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

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

Issue 2414683003: Mus+Ash: propagate Surface ID to parents (Closed)
Patch Set: Don't follow null surface_info Created 4 years, 2 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 a59fe9ee158053525f96db1094d87327d8dcf893..2498bac10c0091d389213ee3d34eeb4da6e8319b 100644
--- a/services/ui/surfaces/display_compositor.h
+++ b/services/ui/surfaces/display_compositor.h
@@ -10,6 +10,7 @@
#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "cc/surfaces/surface_manager.h"
+#include "cc/surfaces/surface_observer.h"
namespace cc {
class SurfaceHittest;
@@ -18,26 +19,36 @@ class SurfaceManager;
namespace ui {
+class DisplayCompositorClient;
+
// 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 base::RefCounted<DisplayCompositor> {
+class DisplayCompositor : public cc::SurfaceObserver,
+ public base::RefCounted<DisplayCompositor> {
public:
- DisplayCompositor();
+ explicit DisplayCompositor(DisplayCompositorClient* client);
uint32_t GenerateNextClientId();
+ void ReturnSurfaceReference(const cc::SurfaceSequence& sequence);
+
cc::SurfaceManager* manager() { return &manager_; }
private:
friend class base::RefCounted<DisplayCompositor>;
- ~DisplayCompositor();
+ virtual ~DisplayCompositor();
+
+ // cc::SurfaceObserver implementation.
+ void OnSurfaceCreated(const cc::SurfaceId& surface_id,
+ const gfx::Size& frame_size,
+ float device_scale_factor) override;
+ void OnSurfaceDamaged(const cc::SurfaceId& surface_id,
+ bool* changed) override;
- // A Surface ID is an unsigned 64-bit int where the high 32-bits are generated
- // by the Surfaces service, and the low 32-bits are generated by the process
- // that requested the Surface.
+ DisplayCompositorClient* const client_;
uint32_t next_client_id_;
cc::SurfaceManager manager_;
« 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