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

Unified Diff: services/ui/surfaces/display_compositor.h

Issue 2654693003: Decouple GpuCompositorFrameSink from DisplayCompositor (Closed)
Patch Set: Refactor code Created 3 years, 11 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
« no previous file with comments | « services/ui/surfaces/BUILD.gn ('k') | services/ui/surfaces/display_compositor.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/surfaces/display_compositor.h
diff --git a/services/ui/surfaces/display_compositor.h b/services/ui/surfaces/display_compositor.h
index 8616b1e40d08a057c4ac83a0752826fd064ea342..938cfb0ac706461af83b548eb06f982703aca11a 100644
--- a/services/ui/surfaces/display_compositor.h
+++ b/services/ui/surfaces/display_compositor.h
@@ -19,6 +19,7 @@
#include "cc/surfaces/surface_id.h"
#include "cc/surfaces/surface_manager.h"
#include "cc/surfaces/surface_observer.h"
+#include "components/display_compositor/gpu_compositor_frame_sink_delegate.h"
#include "gpu/command_buffer/client/gpu_memory_buffer_manager.h"
#include "gpu/ipc/common/surface_handle.h"
#include "gpu/ipc/in_process_command_buffer.h"
@@ -36,17 +37,21 @@ class SurfaceManager;
class SyntheticBeginFrameSource;
}
-namespace ui {
-
+namespace display_compositor {
class GpuCompositorFrameSink;
+}
+
+namespace ui {
// The DisplayCompositor object is an object global to the Window Server app
// that holds the SurfaceServer and allocates new Surfaces namespaces.
// This object lives on the main thread of the Window Server.
// TODO(rjkroege, fsamuel): This object will need to change to support multiple
// displays.
-class DisplayCompositor : public cc::SurfaceObserver,
- public cc::mojom::DisplayCompositor {
+class DisplayCompositor
+ : public cc::SurfaceObserver,
+ public display_compositor::GpuCompositorFrameSinkDelegate,
+ public cc::mojom::DisplayCompositor {
public:
DisplayCompositor(
scoped_refptr<gpu::InProcessCommandBuffer::Service> gpu_service,
@@ -58,24 +63,11 @@ class DisplayCompositor : public cc::SurfaceObserver,
cc::SurfaceManager* manager() { return &manager_; }
- // Adds surface references. For each reference added, this will remove the
- // temporary reference to the child surface if one exists.
- void AddSurfaceReferences(
- const std::vector<cc::SurfaceReference>& references);
-
- // Removes surface references.
- void RemoveSurfaceReferences(
- const std::vector<cc::SurfaceReference>& references);
-
- // We must avoid destroying a GpuCompositorFrameSink until both the display
- // compositor host and the client drop their connection to avoid getting into
- // a state where surfaces references are inconsistent.
- void OnCompositorFrameSinkClientConnectionLost(
- const cc::FrameSinkId& frame_sink_id,
- bool destroy_compositor_frame_sink);
- void OnCompositorFrameSinkPrivateConnectionLost(
- const cc::FrameSinkId& frame_sink_id,
- bool destroy_compositor_frame_sink);
+ // display_compositor::GpuCompositorFrameSinkDelegate implementation.
+ void OnClientConnectionLost(const cc::FrameSinkId& frame_sink_id,
+ bool destroy_compositor_frame_sink) override;
+ void OnPrivateConnectionLost(const cc::FrameSinkId& frame_sink_id,
+ bool destroy_compositor_frame_sink) override;
// cc::mojom::DisplayCompositor implementation:
void CreateDisplayCompositorFrameSink(
@@ -128,9 +120,10 @@ class DisplayCompositor : public cc::SurfaceObserver,
std::unique_ptr<gpu::GpuMemoryBufferManager> gpu_memory_buffer_manager_;
gpu::ImageFactory* image_factory_;
- std::unordered_map<cc::FrameSinkId,
- std::unique_ptr<GpuCompositorFrameSink>,
- cc::FrameSinkIdHash>
+ std::unordered_map<
+ cc::FrameSinkId,
+ std::unique_ptr<display_compositor::GpuCompositorFrameSink>,
+ cc::FrameSinkIdHash>
compositor_frame_sinks_;
scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
« no previous file with comments | « services/ui/surfaces/BUILD.gn ('k') | services/ui/surfaces/display_compositor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698