Index: blimp/client/support/compositor/display_compositor.h |
diff --git a/blimp/client/app/compositor/browser_compositor.h b/blimp/client/support/compositor/display_compositor.h |
similarity index 70% |
copy from blimp/client/app/compositor/browser_compositor.h |
copy to blimp/client/support/compositor/display_compositor.h |
index cb0828f477ff98058f4c6f82beacf80c02edf28b..a78b2492e52c909b24c3c538ff0bed482fbdcbb9 100644 |
--- a/blimp/client/app/compositor/browser_compositor.h |
+++ b/blimp/client/support/compositor/display_compositor.h |
@@ -2,20 +2,19 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-#ifndef BLIMP_CLIENT_APP_COMPOSITOR_BROWSER_COMPOSITOR_H_ |
-#define BLIMP_CLIENT_APP_COMPOSITOR_BROWSER_COMPOSITOR_H_ |
+#ifndef BLIMP_CLIENT_SUPPORT_COMPOSITOR_DISPLAY_COMPOSITOR_H_ |
+#define BLIMP_CLIENT_SUPPORT_COMPOSITOR_DISPLAY_COMPOSITOR_H_ |
-#include "base/macros.h" |
#include "base/callback.h" |
+#include "base/macros.h" |
#include "base/memory/weak_ptr.h" |
+#include "cc/layers/layer.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 "ui/gfx/native_widget_types.h" |
namespace cc { |
class Display; |
-class Layer; |
class LayerTreeHost; |
class SurfaceIdAllocator; |
class SurfaceManager; |
@@ -26,12 +25,12 @@ namespace client { |
class CompositorDependencies; |
// The parent compositor that embeds the content from the BlimpCompositor for |
-// the current page. |
-class BrowserCompositor : public cc::LayerTreeHostClient, |
+// the current page and draws it to a display. |
+class DisplayCompositor : public cc::LayerTreeHostClient, |
Khushal
2016/09/13 04:47:24
I'd suggest naming this as Parent/Root compositor
David Trainor- moved to gerrit
2016/09/13 06:18:05
Sigh but sadly this is a compositor for the displa
|
public cc::LayerTreeHostSingleThreadClient { |
public: |
- explicit BrowserCompositor(CompositorDependencies* compositor_dependencies); |
- ~BrowserCompositor() override; |
+ explicit DisplayCompositor(CompositorDependencies* compositor_dependencies); |
+ ~DisplayCompositor() override; |
// Sets the layer with the content from the renderer compositor. |
void SetContentLayer(scoped_refptr<cc::Layer> content_layer); |
@@ -39,18 +38,14 @@ class BrowserCompositor : public cc::LayerTreeHostClient, |
// 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. |
- void SetAcceleratedWidget(gfx::AcceleratedWidget widget); |
+ protected: |
+ void SetContextProvider(scoped_refptr<cc::ContextProvider> context_provider); |
- // A callback to get notifed when the compositor performs a successful swap. |
- void set_did_complete_swap_buffers_callback(base::Closure callback) { |
- did_complete_swap_buffers_ = callback; |
+ scoped_refptr<cc::Layer> root_layer() { return root_layer_; } |
+ CompositorDependencies* compositor_dependencies() { |
+ return compositor_dependencies_; |
} |
- private: |
// LayerTreeHostClient implementation. |
void WillBeginMainFrame() override {} |
void DidBeginMainFrame() override {} |
@@ -68,19 +63,21 @@ class BrowserCompositor : public cc::LayerTreeHostClient, |
void WillCommit() override {} |
void DidCommit() override {} |
void DidCommitAndDrawFrame() override {} |
- void DidCompleteSwapBuffers() override; |
+ void DidCompleteSwapBuffers() override {} |
void DidCompletePageScaleAnimation() override {} |
// LayerTreeHostSingleThreadClient implementation. |
void DidPostSwapBuffers() override {} |
void DidAbortSwapBuffers() override {} |
+ private: |
void HandlePendingOutputSurfaceRequest(); |
CompositorDependencies* compositor_dependencies_; |
+ scoped_refptr<cc::ContextProvider> context_provider_; |
+ |
std::unique_ptr<cc::SurfaceIdAllocator> surface_id_allocator_; |
- gfx::AcceleratedWidget widget_; |
bool output_surface_request_pending_; |
std::unique_ptr<cc::Display> display_; |
@@ -91,10 +88,10 @@ class BrowserCompositor : public cc::LayerTreeHostClient, |
base::Closure did_complete_swap_buffers_; |
- DISALLOW_COPY_AND_ASSIGN(BrowserCompositor); |
+ DISALLOW_COPY_AND_ASSIGN(DisplayCompositor); |
}; |
} // namespace client |
} // namespace blimp |
-#endif // BLIMP_CLIENT_APP_COMPOSITOR_BROWSER_COMPOSITOR_H_ |
+#endif // BLIMP_CLIENT_SUPPORT_COMPOSITOR_DISPLAY_COMPOSITOR_H_ |