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

Unified Diff: ui/compositor/compositor.h

Issue 2563783002: ui + mus: Split ContextFactory into ContextFactory(Client) and ContextFactoryPrivate (Closed)
Patch Set: Restore mash Created 4 years 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
« no previous file with comments | « ui/aura/window_tree_host.cc ('k') | ui/compositor/compositor.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/compositor/compositor.h
diff --git a/ui/compositor/compositor.h b/ui/compositor/compositor.h
index 76f8f38765127232647b1fd02031924eb7782e3b..07472f3f52fac536d52f24226518f3a0ea19c0f2 100644
--- a/ui/compositor/compositor.h
+++ b/ui/compositor/compositor.h
@@ -86,48 +86,18 @@ class COMPOSITOR_EXPORT ContextFactoryObserver {
virtual void OnLostResources() = 0;
};
-// This class abstracts the creation of the 3D context for the compositor. It is
-// a global object.
-class COMPOSITOR_EXPORT ContextFactory {
+// This is privileged interface to the compositor. It is a global object.
+class COMPOSITOR_EXPORT ContextFactoryPrivate {
public:
- virtual ~ContextFactory() {}
-
- // Creates an output surface for the given compositor. The factory may keep
- // per-compositor data (e.g. a shared context), that needs to be cleaned up
- // by calling RemoveCompositor when the compositor gets destroyed.
- virtual void CreateCompositorFrameSink(
- base::WeakPtr<Compositor> compositor) = 0;
-
// Creates a reflector that copies the content of the |mirrored_compositor|
// onto |mirroring_layer|.
virtual std::unique_ptr<Reflector> CreateReflector(
Compositor* mirrored_compositor,
Layer* mirroring_layer) = 0;
+
// Removes the reflector, which stops the mirroring.
virtual void RemoveReflector(Reflector* reflector) = 0;
- // Return a reference to a shared offscreen context provider usable from the
- // main thread.
- virtual scoped_refptr<cc::ContextProvider>
- SharedMainThreadContextProvider() = 0;
-
- // Destroys per-compositor data.
- virtual void RemoveCompositor(Compositor* compositor) = 0;
-
- // When true, the factory uses test contexts that do not do real GL
- // operations.
- virtual bool DoesCreateTestContexts() = 0;
-
- // Returns the OpenGL target to use for image textures.
- virtual uint32_t GetImageTextureTarget(gfx::BufferFormat format,
- gfx::BufferUsage usage) = 0;
-
- // Gets the GPU memory buffer manager.
- virtual gpu::GpuMemoryBufferManager* GetGpuMemoryBufferManager() = 0;
-
- // Gets the task graph runner.
- virtual cc::TaskGraphRunner* GetTaskGraphRunner() = 0;
-
// Allocate a new client ID for the display compositor.
virtual cc::FrameSinkId AllocateFrameSinkId() = 0;
@@ -156,6 +126,41 @@ class COMPOSITOR_EXPORT ContextFactory {
base::TimeDelta interval) = 0;
virtual void SetOutputIsSecure(Compositor* compositor, bool secure) = 0;
+};
+
+// This class abstracts the creation of the 3D context for the compositor. It is
+// a global object.
+class COMPOSITOR_EXPORT ContextFactory {
+ public:
+ virtual ~ContextFactory() {}
+
+ // Creates an output surface for the given compositor. The factory may keep
+ // per-compositor data (e.g. a shared context), that needs to be cleaned up
+ // by calling RemoveCompositor when the compositor gets destroyed.
+ virtual void CreateCompositorFrameSink(
+ base::WeakPtr<Compositor> compositor) = 0;
+
+ // Return a reference to a shared offscreen context provider usable from the
+ // main thread.
+ virtual scoped_refptr<cc::ContextProvider>
+ SharedMainThreadContextProvider() = 0;
+
+ // Destroys per-compositor data.
+ virtual void RemoveCompositor(Compositor* compositor) = 0;
+
+ // When true, the factory uses test contexts that do not do real GL
+ // operations.
+ virtual bool DoesCreateTestContexts() = 0;
+
+ // Returns the OpenGL target to use for image textures.
+ virtual uint32_t GetImageTextureTarget(gfx::BufferFormat format,
+ gfx::BufferUsage usage) = 0;
+
+ // Gets the GPU memory buffer manager.
+ virtual gpu::GpuMemoryBufferManager* GetGpuMemoryBufferManager() = 0;
+
+ // Gets the task graph runner.
+ virtual cc::TaskGraphRunner* GetTaskGraphRunner() = 0;
virtual void AddObserver(ContextFactoryObserver* observer) = 0;
@@ -198,11 +203,16 @@ class COMPOSITOR_EXPORT Compositor
NON_EXPORTED_BASE(public cc::LayerTreeHostSingleThreadClient) {
public:
Compositor(ui::ContextFactory* context_factory,
+ ui::ContextFactoryPrivate* context_factory_private,
scoped_refptr<base::SingleThreadTaskRunner> task_runner);
~Compositor() override;
ui::ContextFactory* context_factory() { return context_factory_; }
+ ui::ContextFactoryPrivate* context_factory_private() {
+ return context_factory_private_;
+ }
+
void AddFrameSink(const cc::FrameSinkId& frame_sink_id);
void RemoveFrameSink(const cc::FrameSinkId& frame_sink_id);
@@ -392,6 +402,7 @@ class COMPOSITOR_EXPORT Compositor
gfx::Size size_;
ui::ContextFactory* context_factory_;
+ ui::ContextFactoryPrivate* context_factory_private_;
// The root of the Layer tree drawn by this compositor.
Layer* root_layer_;
« no previous file with comments | « ui/aura/window_tree_host.cc ('k') | ui/compositor/compositor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698