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

Side by Side 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "services/ui/surfaces/display_compositor.h" 5 #include "services/ui/surfaces/display_compositor.h"
6 6
7 #include "services/ui/surfaces/display_compositor_client.h"
8
7 namespace ui { 9 namespace ui {
8 10
9 DisplayCompositor::DisplayCompositor() : next_client_id_(1u) {} 11 DisplayCompositor::DisplayCompositor(DisplayCompositorClient* client)
10 12 : client_(client), next_client_id_(1u) {
11 DisplayCompositor::~DisplayCompositor() {} 13 manager_.AddObserver(this);
14 }
12 15
13 uint32_t DisplayCompositor::GenerateNextClientId() { 16 uint32_t DisplayCompositor::GenerateNextClientId() {
14 return next_client_id_++; 17 return next_client_id_++;
15 } 18 }
16 19
20 void DisplayCompositor::ReturnSurfaceReference(
21 const cc::SurfaceSequence& sequence) {
22 std::vector<uint32_t> sequences;
23 sequences.push_back(sequence.sequence);
24 manager_.DidSatisfySequences(sequence.frame_sink_id, &sequences);
25 }
26
27 DisplayCompositor::~DisplayCompositor() {
28 manager_.RemoveObserver(this);
29 }
30
31 void DisplayCompositor::OnSurfaceCreated(const cc::SurfaceId& surface_id,
32 const gfx::Size& frame_size,
33 float device_scale_factor) {
34 if (client_)
35 client_->OnSurfaceCreated(surface_id, frame_size, device_scale_factor);
36 }
37
38 void DisplayCompositor::OnSurfaceDamaged(const cc::SurfaceId& surface_id,
39 bool* changed) {}
40
17 } // namespace ui 41 } // namespace ui
OLDNEW
« 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