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

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

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/display_compositor.h ('k') | services/ui/surfaces/display_compositor_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/surfaces/display_compositor.cc
diff --git a/services/ui/surfaces/display_compositor.cc b/services/ui/surfaces/display_compositor.cc
index 1bc067e798a7e860bbf75d53d8680194eef85798..5847814353dbaa96ce04fef3c85c3374f584409b 100644
--- a/services/ui/surfaces/display_compositor.cc
+++ b/services/ui/surfaces/display_compositor.cc
@@ -4,14 +4,38 @@
#include "services/ui/surfaces/display_compositor.h"
-namespace ui {
+#include "services/ui/surfaces/display_compositor_client.h"
-DisplayCompositor::DisplayCompositor() : next_client_id_(1u) {}
+namespace ui {
-DisplayCompositor::~DisplayCompositor() {}
+DisplayCompositor::DisplayCompositor(DisplayCompositorClient* client)
+ : client_(client), next_client_id_(1u) {
+ manager_.AddObserver(this);
+}
uint32_t DisplayCompositor::GenerateNextClientId() {
return next_client_id_++;
}
+void DisplayCompositor::ReturnSurfaceReference(
+ const cc::SurfaceSequence& sequence) {
+ std::vector<uint32_t> sequences;
+ sequences.push_back(sequence.sequence);
+ manager_.DidSatisfySequences(sequence.frame_sink_id, &sequences);
+}
+
+DisplayCompositor::~DisplayCompositor() {
+ manager_.RemoveObserver(this);
+}
+
+void DisplayCompositor::OnSurfaceCreated(const cc::SurfaceId& surface_id,
+ const gfx::Size& frame_size,
+ float device_scale_factor) {
+ if (client_)
+ client_->OnSurfaceCreated(surface_id, frame_size, device_scale_factor);
+}
+
+void DisplayCompositor::OnSurfaceDamaged(const cc::SurfaceId& surface_id,
+ bool* changed) {}
+
} // namespace ui
« no previous file with comments | « services/ui/surfaces/display_compositor.h ('k') | services/ui/surfaces/display_compositor_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698