| OLD | NEW |
| 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 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 dict->SetString("surface_id", primary_surface_info_.id().ToString()); | 242 dict->SetString("surface_id", primary_surface_info_.id().ToString()); |
| 247 dict->SetString("fallback_surface_id", | 243 dict->SetString("fallback_surface_id", |
| 248 fallback_surface_info_.id().ToString()); | 244 fallback_surface_info_.id().ToString()); |
| 249 } | 245 } |
| 250 | 246 |
| 251 const char* SurfaceLayerImpl::LayerTypeAsString() const { | 247 const char* SurfaceLayerImpl::LayerTypeAsString() const { |
| 252 return "cc::SurfaceLayerImpl"; | 248 return "cc::SurfaceLayerImpl"; |
| 253 } | 249 } |
| 254 | 250 |
| 255 } // namespace cc | 251 } // namespace cc |
| OLD | NEW |