Index: blimp/client/app/compositor/browser_compositor.h |
diff --git a/blimp/client/app/compositor/browser_compositor.h b/blimp/client/app/compositor/browser_compositor.h |
index 1a5cdc79b3000646606a30a998a888a7bd8d4fd9..29d8f8bda6ca9f52bbc2f8a89d631e63bd75e08f 100644 |
--- a/blimp/client/app/compositor/browser_compositor.h |
+++ b/blimp/client/app/compositor/browser_compositor.h |
@@ -6,43 +6,26 @@ |
#define BLIMP_CLIENT_APP_COMPOSITOR_BROWSER_COMPOSITOR_H_ |
#include "base/macros.h" |
-#include "base/callback.h" |
-#include "base/memory/weak_ptr.h" |
-#include "cc/trees/layer_tree_host_client.h" |
-#include "cc/trees/layer_tree_host_single_thread_client.h" |
-#include "ui/gfx/geometry/size.h" |
+#include "blimp/client/support/compositor/blimp_embedder_compositor.h" |
#include "ui/gfx/native_widget_types.h" |
-namespace cc { |
-class Display; |
-class Layer; |
-class LayerTreeHostInterface; |
-class SurfaceIdAllocator; |
-class SurfaceManager; |
-} // namespace cc |
- |
namespace blimp { |
namespace client { |
class CompositorDependencies; |
-// The parent compositor that embeds the content from the BlimpCompositor for |
-// the current page. |
-class BrowserCompositor : public cc::LayerTreeHostClient, |
- public cc::LayerTreeHostSingleThreadClient { |
+// A version of a BlimpEmbedderCompositor that supplies a ContextProvider backed |
+// by an AcceleratedWidget. The AcceleratedWidget is a platform specific hook |
+// that the ContextProvider can use to render to the screen. |
+class BrowserCompositor : public BlimpEmbedderCompositor { |
public: |
explicit BrowserCompositor(CompositorDependencies* compositor_dependencies); |
~BrowserCompositor() override; |
- // Sets the layer with the content from the renderer compositor. |
- void SetContentLayer(scoped_refptr<cc::Layer> content_layer); |
- |
- // Sets the size for the display. Should be in physical pixels. |
- void SetSize(const gfx::Size& size_in_px); |
- |
- // Sets the widget that the |cc::Display| draws to. On proving it the widget, |
- // the compositor will become visible and start drawing to the widget. When |
- // the widget goes away, we become invisible and drop all resources being |
- // used to draw to the screen. |
+ // Sets the AcceleratedWidget that will be used to display to. Once provided, |
+ // the compositor will become visible and start drawing to the widget. When |
+ // the widget is taken away by passing gfx::kNullAcceleratedWidget, the |
+ // compositor will become invisible and will drop all resources being used to |
+ // draw to the screen. |
void SetAcceleratedWidget(gfx::AcceleratedWidget widget); |
// A callback to get notifed when the compositor performs a successful swap. |
@@ -50,47 +33,13 @@ class BrowserCompositor : public cc::LayerTreeHostClient, |
did_complete_swap_buffers_ = callback; |
} |
- private: |
- // LayerTreeHostClient implementation. |
- void WillBeginMainFrame() override {} |
- void DidBeginMainFrame() override {} |
- void BeginMainFrame(const cc::BeginFrameArgs& args) override {} |
- void BeginMainFrameNotExpectedSoon() override {} |
- void UpdateLayerTreeHost() override {} |
- void ApplyViewportDeltas(const gfx::Vector2dF& inner_delta, |
- const gfx::Vector2dF& outer_delta, |
- const gfx::Vector2dF& elastic_overscroll_delta, |
- float page_scale, |
- float top_controls_delta) override {} |
- void RequestNewOutputSurface() override; |
- void DidInitializeOutputSurface() override; |
- void DidFailToInitializeOutputSurface() override; |
- void WillCommit() override {} |
- void DidCommit() override {} |
- void DidCommitAndDrawFrame() override {} |
+ protected: |
+ // BlimpEmbedderCompositor implementation. |
void DidCompleteSwapBuffers() override; |
- void DidCompletePageScaleAnimation() override {} |
- |
- // LayerTreeHostSingleThreadClient implementation. |
- void DidPostSwapBuffers() override {} |
- void DidAbortSwapBuffers() override {} |
- |
- void HandlePendingOutputSurfaceRequest(); |
- |
- CompositorDependencies* compositor_dependencies_; |
- |
- std::unique_ptr<cc::SurfaceIdAllocator> surface_id_allocator_; |
- gfx::AcceleratedWidget widget_; |
- bool output_surface_request_pending_; |
- std::unique_ptr<cc::Display> display_; |
- |
- gfx::Size viewport_size_in_px_; |
- |
- std::unique_ptr<cc::LayerTreeHostInterface> host_; |
- scoped_refptr<cc::Layer> root_layer_; |
base::Closure did_complete_swap_buffers_; |
+ private: |
DISALLOW_COPY_AND_ASSIGN(BrowserCompositor); |
}; |