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

Side by Side Diff: cc/layers/surface_layer_impl.cc

Issue 2905533002: cc : Store surface layer ids on LayerTreeHost and push them at commit (Closed)
Patch Set: comments Created 3 years, 7 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "cc/layers/surface_layer_impl.h" 5 #include "cc/layers/surface_layer_impl.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include "base/trace_event/trace_event_argument.h" 9 #include "base/trace_event/trace_event_argument.h"
10 #include "cc/debug/debug_colors.h" 10 #include "cc/debug/debug_colors.h"
11 #include "cc/layers/append_quads_data.h" 11 #include "cc/layers/append_quads_data.h"
12 #include "cc/quads/solid_color_draw_quad.h" 12 #include "cc/quads/solid_color_draw_quad.h"
13 #include "cc/quads/surface_draw_quad.h" 13 #include "cc/quads/surface_draw_quad.h"
14 #include "cc/trees/layer_tree_impl.h" 14 #include "cc/trees/layer_tree_impl.h"
15 #include "cc/trees/occlusion.h" 15 #include "cc/trees/occlusion.h"
16 16
17 namespace cc { 17 namespace cc {
18 18
19 SurfaceLayerImpl::SurfaceLayerImpl(LayerTreeImpl* tree_impl, int id) 19 SurfaceLayerImpl::SurfaceLayerImpl(LayerTreeImpl* tree_impl, int id)
20 : LayerImpl(tree_impl, id) { 20 : LayerImpl(tree_impl, id) {}
21 layer_tree_impl()->AddSurfaceLayer(this);
22 }
23 21
24 SurfaceLayerImpl::~SurfaceLayerImpl() { 22 SurfaceLayerImpl::~SurfaceLayerImpl() {}
25 layer_tree_impl()->RemoveSurfaceLayer(this);
26 }
27 23
28 std::unique_ptr<LayerImpl> SurfaceLayerImpl::CreateLayerImpl( 24 std::unique_ptr<LayerImpl> SurfaceLayerImpl::CreateLayerImpl(
29 LayerTreeImpl* tree_impl) { 25 LayerTreeImpl* tree_impl) {
30 return SurfaceLayerImpl::Create(tree_impl, id()); 26 return SurfaceLayerImpl::Create(tree_impl, id());
31 } 27 }
32 28
33 void SurfaceLayerImpl::SetPrimarySurfaceInfo(const SurfaceInfo& surface_info) { 29 void SurfaceLayerImpl::SetPrimarySurfaceInfo(const SurfaceInfo& surface_info) {
34 if (primary_surface_info_ == surface_info) 30 if (primary_surface_info_ == surface_info)
35 return; 31 return;
36 32
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 dict->SetString("surface_id", primary_surface_info_.id().ToString()); 241 dict->SetString("surface_id", primary_surface_info_.id().ToString());
246 dict->SetString("fallback_surface_id", 242 dict->SetString("fallback_surface_id",
247 fallback_surface_info_.id().ToString()); 243 fallback_surface_info_.id().ToString());
248 } 244 }
249 245
250 const char* SurfaceLayerImpl::LayerTypeAsString() const { 246 const char* SurfaceLayerImpl::LayerTypeAsString() const {
251 return "cc::SurfaceLayerImpl"; 247 return "cc::SurfaceLayerImpl";
252 } 248 }
253 249
254 } // namespace cc 250 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698