OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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/delegated_renderer_layer.h" | 5 #include "cc/layers/delegated_renderer_layer.h" |
6 | 6 |
7 #include "cc/layers/delegated_renderer_layer_impl.h" | 7 #include "cc/layers/delegated_renderer_layer_impl.h" |
8 #include "cc/output/delegated_frame_data.h" | 8 #include "cc/output/delegated_frame_data.h" |
9 #include "cc/quads/render_pass_draw_quad.h" | 9 #include "cc/quads/render_pass_draw_quad.h" |
10 #include "cc/trees/layer_tree_host.h" | 10 #include "cc/trees/layer_tree_host.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 weak_ptrs_(this) { | 26 weak_ptrs_(this) { |
27 frame_provider_->AddObserver(this); | 27 frame_provider_->AddObserver(this); |
28 } | 28 } |
29 | 29 |
30 DelegatedRendererLayer::~DelegatedRendererLayer() { | 30 DelegatedRendererLayer::~DelegatedRendererLayer() { |
31 frame_provider_->RemoveObserver(this); | 31 frame_provider_->RemoveObserver(this); |
32 } | 32 } |
33 | 33 |
34 scoped_ptr<LayerImpl> DelegatedRendererLayer::CreateLayerImpl( | 34 scoped_ptr<LayerImpl> DelegatedRendererLayer::CreateLayerImpl( |
35 LayerTreeImpl* tree_impl) { | 35 LayerTreeImpl* tree_impl) { |
36 return DelegatedRendererLayerImpl::Create( | 36 return DelegatedRendererLayerImpl::Create(tree_impl, layer_id_); |
37 tree_impl, layer_id_).PassAs<LayerImpl>(); | |
38 } | 37 } |
39 | 38 |
40 void DelegatedRendererLayer::SetLayerTreeHost(LayerTreeHost* host) { | 39 void DelegatedRendererLayer::SetLayerTreeHost(LayerTreeHost* host) { |
41 if (layer_tree_host() == host) { | 40 if (layer_tree_host() == host) { |
42 Layer::SetLayerTreeHost(host); | 41 Layer::SetLayerTreeHost(host); |
43 return; | 42 return; |
44 } | 43 } |
45 | 44 |
46 if (!host) { | 45 if (!host) { |
47 // The active frame needs to be removed from the active tree and resources | 46 // The active frame needs to be removed from the active tree and resources |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 | 93 |
95 SetNeedsPushProperties(); | 94 SetNeedsPushProperties(); |
96 return true; | 95 return true; |
97 } | 96 } |
98 | 97 |
99 bool DelegatedRendererLayer::HasDelegatedContent() const { | 98 bool DelegatedRendererLayer::HasDelegatedContent() const { |
100 return true; | 99 return true; |
101 } | 100 } |
102 | 101 |
103 } // namespace cc | 102 } // namespace cc |
OLD | NEW |