summaryrefslogtreecommitdiffstats
path: root/mojo/cc
diff options
context:
space:
mode:
authorjamesr <jamesr@chromium.org>2014-09-11 22:49:13 -0700
committerCommit bot <commit-bot@chromium.org>2014-09-12 05:51:10 +0000
commit2abb46fdc18d2110b443a9e570ea393e3b0a42c5 (patch)
treee53147118cc91471f189c516751b23a08507f099 /mojo/cc
parent8176b73b02e137a3c06afb7382a0a277338cc5ea (diff)
downloadchromium_src-2abb46fdc18d2110b443a9e570ea393e3b0a42c5.zip
chromium_src-2abb46fdc18d2110b443a9e570ea393e3b0a42c5.tar.gz
chromium_src-2abb46fdc18d2110b443a9e570ea393e3b0a42c5.tar.bz2
Compositor bindings for mojo html_viewer
This binds mojo's html_viewer to a compositor implementation that uses surfaces to present. It reuses the bindings for the WebLayer* types in cc/blink and adds a new implementation of blink::WebLayerTreeView that shares some things with content/renderer/gpu/render_widget_compositor.cc but is distinct enough to be its own class. Whenever the compositor resizes (and thus needs a new surface id) it passes the surface id to the view manager client lib. This also adds mojo bindings for a few new quad types that are used on the web. We don't yet have support for video quad types, but we don't have the media system hooked up to html_viewer yet either so these will not be generated. Review URL: https://codereview.chromium.org/558343004 Cr-Commit-Position: refs/heads/master@{#294546}
Diffstat (limited to 'mojo/cc')
-rw-r--r--mojo/cc/output_surface_mojo.cc5
-rw-r--r--mojo/cc/output_surface_mojo.h15
2 files changed, 18 insertions, 2 deletions
diff --git a/mojo/cc/output_surface_mojo.cc b/mojo/cc/output_surface_mojo.cc
index 05c6a84..37a4eb0 100644
--- a/mojo/cc/output_surface_mojo.cc
+++ b/mojo/cc/output_surface_mojo.cc
@@ -12,13 +12,17 @@
namespace mojo {
OutputSurfaceMojo::OutputSurfaceMojo(
+ OutputSurfaceMojoClient* client,
const scoped_refptr<cc::ContextProvider>& context_provider,
SurfacePtr surface,
uint32_t id_namespace)
: cc::OutputSurface(context_provider),
+ output_surface_mojo_client_(client),
surface_(surface.Pass()),
id_allocator_(id_namespace) {
surface_.set_client(this);
+ capabilities_.delegated_rendering = true;
+ capabilities_.max_frames_pending = 1;
}
OutputSurfaceMojo::~OutputSurfaceMojo() {
@@ -37,6 +41,7 @@ void OutputSurfaceMojo::SwapBuffers(cc::CompositorFrame* frame) {
surface_id_ = id_allocator_.GenerateId();
surface_->CreateSurface(SurfaceId::From(surface_id_),
Size::From(frame_size));
+ output_surface_mojo_client_->DidCreateSurface(surface_id_);
surface_size_ = frame_size;
}
diff --git a/mojo/cc/output_surface_mojo.h b/mojo/cc/output_surface_mojo.h
index fbde931..f5b98ae 100644
--- a/mojo/cc/output_surface_mojo.h
+++ b/mojo/cc/output_surface_mojo.h
@@ -12,12 +12,19 @@
namespace mojo {
+class OutputSurfaceMojoClient {
+ public:
+ virtual ~OutputSurfaceMojoClient() {}
+
+ virtual void DidCreateSurface(cc::SurfaceId id) = 0;
+};
+
class OutputSurfaceMojo : public cc::OutputSurface, public SurfaceClient {
public:
- OutputSurfaceMojo(const scoped_refptr<cc::ContextProvider>& context_provider,
+ OutputSurfaceMojo(OutputSurfaceMojoClient* client,
+ const scoped_refptr<cc::ContextProvider>& context_provider,
SurfacePtr surface,
uint32_t id_namespace);
- virtual ~OutputSurfaceMojo();
// SurfaceClient implementation.
virtual void ReturnResources(Array<ReturnedResourcePtr> resources) OVERRIDE;
@@ -25,7 +32,11 @@ class OutputSurfaceMojo : public cc::OutputSurface, public SurfaceClient {
// cc::OutputSurface implementation.
virtual void SwapBuffers(cc::CompositorFrame* frame) OVERRIDE;
+ protected:
+ virtual ~OutputSurfaceMojo();
+
private:
+ OutputSurfaceMojoClient* output_surface_mojo_client_;
SurfacePtr surface_;
cc::SurfaceIdAllocator id_allocator_;
cc::SurfaceId surface_id_;