OLD | NEW |
1 // Copyright 2010 The Chromium Authors. All rights reserved. | 1 // Copyright 2010 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/texture_layer.h" | 5 #include "cc/layers/texture_layer.h" |
6 | 6 |
7 #include "cc/base/thread.h" | 7 #include "cc/base/thread.h" |
8 #include "cc/layers/texture_layer_client.h" | 8 #include "cc/layers/texture_layer_client.h" |
9 #include "cc/layers/texture_layer_impl.h" | 9 #include "cc/layers/texture_layer_impl.h" |
10 #include "cc/trees/layer_tree_host.h" | 10 #include "cc/trees/layer_tree_host.h" |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 layer_tree_host()->AcquireLayerTextures(); | 148 layer_tree_host()->AcquireLayerTextures(); |
149 Layer::SetLayerTreeHost(host); | 149 Layer::SetLayerTreeHost(host); |
150 } | 150 } |
151 | 151 |
152 bool TextureLayer::DrawsContent() const { | 152 bool TextureLayer::DrawsContent() const { |
153 return (client_ || texture_id_ || !texture_mailbox_.IsEmpty()) && | 153 return (client_ || texture_id_ || !texture_mailbox_.IsEmpty()) && |
154 !context_lost_ && Layer::DrawsContent(); | 154 !context_lost_ && Layer::DrawsContent(); |
155 } | 155 } |
156 | 156 |
157 void TextureLayer::Update(ResourceUpdateQueue* queue, | 157 void TextureLayer::Update(ResourceUpdateQueue* queue, |
158 const OcclusionTracker* occlusion, | 158 const OcclusionTracker* occlusion) { |
159 RenderingStats* stats) { | |
160 if (client_) { | 159 if (client_) { |
161 texture_id_ = client_->PrepareTexture(queue); | 160 texture_id_ = client_->PrepareTexture(queue); |
162 context_lost_ = | 161 context_lost_ = |
163 client_->Context3d()->getGraphicsResetStatusARB() != GL_NO_ERROR; | 162 client_->Context3d()->getGraphicsResetStatusARB() != GL_NO_ERROR; |
164 } | 163 } |
165 | 164 |
166 needs_display_ = false; | 165 needs_display_ = false; |
167 } | 166 } |
168 | 167 |
169 void TextureLayer::PushPropertiesTo(LayerImpl* layer) { | 168 void TextureLayer::PushPropertiesTo(LayerImpl* layer) { |
(...skipping 25 matching lines...) Expand all Loading... |
195 // triple-buffered. Single-buffered layers already prevent draws, so | 194 // triple-buffered. Single-buffered layers already prevent draws, so |
196 // can block too for simplicity. | 195 // can block too for simplicity. |
197 return DrawsContent(); | 196 return DrawsContent(); |
198 } | 197 } |
199 | 198 |
200 bool TextureLayer::CanClipSelf() const { | 199 bool TextureLayer::CanClipSelf() const { |
201 return true; | 200 return true; |
202 } | 201 } |
203 | 202 |
204 } // namespace cc | 203 } // namespace cc |
OLD | NEW |