Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3757)

Unified Diff: blimp/client/app/compositor/browser_compositor.h

Issue 2274323002: Expose Blimp dependencies to the embedder (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@khushal_baseline_1
Patch Set: Addressed Khushal's initial comments Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 707d062ba575d8051b2a3400e7b5de8ab90d2612..ae0ee3b70a56f1e1dbf97802b9f8e8cdf07ef1d5 100644
--- a/blimp/client/app/compositor/browser_compositor.h
+++ b/blimp/client/app/compositor/browser_compositor.h
@@ -7,6 +7,7 @@
#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"
@@ -22,20 +23,14 @@ class SurfaceManager;
namespace blimp {
namespace client {
-class BlimpGpuMemoryBufferManager;
+class CompositorDependencies;
// The parent compositor that embeds the content from the BlimpCompositor for
// the current page.
class BrowserCompositor : public cc::LayerTreeHostClient,
public cc::LayerTreeHostSingleThreadClient {
public:
- // TODO(dtrainor): Move these to the CompositorDeps and share them with the
- // BlimpCompositor.
- static cc::SurfaceManager* GetSurfaceManager();
- static BlimpGpuMemoryBufferManager* GetGpuMemoryBufferManager();
- static uint32_t AllocateSurfaceClientId();
-
- BrowserCompositor();
+ explicit BrowserCompositor(CompositorDependencies* compositor_dependencies);
~BrowserCompositor() override;
// Sets the layer with the content from the renderer compositor.
@@ -50,6 +45,11 @@ class BrowserCompositor : public cc::LayerTreeHostClient,
// used to draw to the screen.
void SetAcceleratedWidget(gfx::AcceleratedWidget widget);
+ // Called when the a ContextProvider has been created by the
+ // CompositorDependencies class. If |host_| is waiting on an OutputSurface
+ // this will build one for it.
+ void OnContextProviderCreated(scoped_refptr<cc::ContextProvider> 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;
@@ -80,7 +80,7 @@ class BrowserCompositor : public cc::LayerTreeHostClient,
void DidPostSwapBuffers() override {}
void DidAbortSwapBuffers() override {}
- void HandlePendingOutputSurfaceRequest();
+ CompositorDependencies* compositor_dependencies_;
std::unique_ptr<cc::SurfaceIdAllocator> surface_id_allocator_;
gfx::AcceleratedWidget widget_;
@@ -94,6 +94,8 @@ class BrowserCompositor : public cc::LayerTreeHostClient,
base::Closure did_complete_swap_buffers_;
+ base::WeakPtrFactory<BrowserCompositor> weak_ptr_factory_;
+
DISALLOW_COPY_AND_ASSIGN(BrowserCompositor);
};

Powered by Google App Engine
This is Rietveld 408576698