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

Unified Diff: blimp/client/feature/compositor/blimp_compositor_manager.h

Issue 2266863003: blimp: Move BlimpCompositor to use delegated rendering. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: make gn happy 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/feature/compositor/blimp_compositor_manager.h
diff --git a/blimp/client/feature/compositor/blimp_compositor_manager.h b/blimp/client/feature/compositor/blimp_compositor_manager.h
index 2054a9eec32c7b7c2b03744cecc2ebf7656cfe07..ec1623ddfb70fb36c428b6d3a0932d91074dbe1e 100644
--- a/blimp/client/feature/compositor/blimp_compositor_manager.h
+++ b/blimp/client/feature/compositor/blimp_compositor_manager.h
@@ -10,18 +10,17 @@
#include "base/macros.h"
#include "blimp/client/core/compositor/blob_image_serialization_processor.h"
#include "blimp/client/feature/compositor/blimp_compositor.h"
-#include "blimp/client/feature/compositor/blimp_gpu_memory_buffer_manager.h"
#include "blimp/client/feature/render_widget_feature.h"
+#include "cc/layers/layer.h"
#include "cc/trees/layer_tree_settings.h"
+namespace cc {
+class SurfaceManager;
+} // namespace cc
+
namespace blimp {
namespace client {
-
-class BlimpCompositorManagerClient {
- public:
- virtual void OnSwapBuffersCompleted() = 0;
- virtual void DidCommitAndDrawFrame() = 0;
-};
+class BlimpGpuMemoryBufferManager;
// The BlimpCompositorManager manages multiple BlimpCompositor instances, each
// mapped to a render widget on the engine. The compositor corresponding to
@@ -33,18 +32,22 @@ class BlimpCompositorManager
: public RenderWidgetFeature::RenderWidgetFeatureDelegate,
public BlimpCompositorClient {
public:
- explicit BlimpCompositorManager(RenderWidgetFeature* render_widget_feature,
- BlimpCompositorManagerClient* client);
- ~BlimpCompositorManager() override;
+ using SurfaceIdAllocationCallback = base::Callback<uint32_t()>;
- void SetVisible(bool visible);
+ explicit BlimpCompositorManager(
+ RenderWidgetFeature* render_widget_feature,
+ cc::SurfaceManager* surface_manager,
+ BlimpGpuMemoryBufferManager* gpu_memory_buffer_manager,
+ SurfaceIdAllocationCallback callback);
- void SetAcceleratedWidget(gfx::AcceleratedWidget widget);
+ ~BlimpCompositorManager() override;
- void ReleaseAcceleratedWidget();
+ void SetVisible(bool visible);
bool OnTouchEvent(const ui::MotionEvent& motion_event);
+ scoped_refptr<cc::Layer> layer() const { return layer_; }
+
protected:
// Populates the cc::LayerTreeSettings used by the cc::LayerTreeHost of the
// BlimpCompositors created by this manager. Can be overridden to provide
@@ -54,6 +57,8 @@ class BlimpCompositorManager
// virtual for testing.
virtual std::unique_ptr<BlimpCompositor> CreateBlimpCompositor(
int render_widget_id,
+ cc::SurfaceManager* surface_manager,
+ uint32_t surface_client_id,
BlimpCompositorClient* client);
// Returns the compositor for the |render_widget_id|. Will return nullptr if
@@ -71,8 +76,6 @@ class BlimpCompositorManager
std::unique_ptr<cc::proto::CompositorMessage> message) override;
// BlimpCompositorClient implementation.
- void DidCompleteSwapBuffers() override;
- void DidCommitAndDrawFrame() override;
cc::LayerTreeSettings* GetLayerTreeSettings() override;
scoped_refptr<base::SingleThreadTaskRunner>
GetCompositorTaskRunner() override;
@@ -86,13 +89,20 @@ class BlimpCompositorManager
int render_widget_id,
const cc::proto::CompositorMessage& message) override;
- bool visible_;
+ // The bridge to the network layer that does the proto/RenderWidget id work.
+ // BlimpCompositorManager does not own this and it is expected to outlive this
+ // BlimpCompositorManager instance.
+ RenderWidgetFeature* render_widget_feature_;
- gfx::AcceleratedWidget window_;
+ cc::SurfaceManager* surface_manager_;
+ BlimpGpuMemoryBufferManager* gpu_memory_buffer_manager_;
+ SurfaceIdAllocationCallback surface_id_allocation_callback_;
+ bool visible_;
std::unique_ptr<cc::LayerTreeSettings> settings_;
- std::unique_ptr<BlimpGpuMemoryBufferManager> gpu_memory_buffer_manager_;
+ // The layer which holds the content from the active compositor.
+ scoped_refptr<cc::Layer> layer_;
// A map of render_widget_ids to the BlimpCompositor instance.
typedef std::map<int, std::unique_ptr<BlimpCompositor>> CompositorMap;
@@ -107,12 +117,6 @@ class BlimpCompositorManager
// be shared by all compositor instances.
std::unique_ptr<base::Thread> compositor_thread_;
- // The bridge to the network layer that does the proto/RenderWidget id work.
- // BlimpCompositorManager does not own this and it is expected to outlive this
- // BlimpCompositorManager instance.
- RenderWidgetFeature* render_widget_feature_;
- BlimpCompositorManagerClient* client_;
-
DISALLOW_COPY_AND_ASSIGN(BlimpCompositorManager);
};
« no previous file with comments | « blimp/client/feature/compositor/blimp_compositor.cc ('k') | blimp/client/feature/compositor/blimp_compositor_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698