| 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 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 SetNeedsCommit(); | 152 SetNeedsCommit(); |
| 153 } | 153 } |
| 154 | 154 |
| 155 void TextureLayer::WillModifyTexture() { | 155 void TextureLayer::WillModifyTexture() { |
| 156 if (layer_tree_host() && (DrawsContent() || content_committed_)) { | 156 if (layer_tree_host() && (DrawsContent() || content_committed_)) { |
| 157 layer_tree_host()->AcquireLayerTextures(); | 157 layer_tree_host()->AcquireLayerTextures(); |
| 158 content_committed_ = false; | 158 content_committed_ = false; |
| 159 } | 159 } |
| 160 } | 160 } |
| 161 | 161 |
| 162 bool TextureLayer::MustUseBitmap() { |
| 163 return layer_tree_host()->UsingSoftwareRenderer(); |
| 164 } |
| 165 |
| 162 void TextureLayer::SetNeedsDisplayRect(const gfx::RectF& dirty_rect) { | 166 void TextureLayer::SetNeedsDisplayRect(const gfx::RectF& dirty_rect) { |
| 163 Layer::SetNeedsDisplayRect(dirty_rect); | 167 Layer::SetNeedsDisplayRect(dirty_rect); |
| 164 | 168 |
| 165 if (rate_limit_context_ && client_ && layer_tree_host() && DrawsContent()) | 169 if (rate_limit_context_ && client_ && layer_tree_host() && DrawsContent()) |
| 166 layer_tree_host()->StartRateLimiter(client_->Context3d()); | 170 layer_tree_host()->StartRateLimiter(client_->Context3d()); |
| 167 } | 171 } |
| 168 | 172 |
| 169 void TextureLayer::SetLayerTreeHost(LayerTreeHost* host) { | 173 void TextureLayer::SetLayerTreeHost(LayerTreeHost* host) { |
| 170 if (texture_id_ && layer_tree_host() && host != layer_tree_host()) | 174 if (texture_id_ && layer_tree_host() && host != layer_tree_host()) |
| 171 layer_tree_host()->AcquireLayerTextures(); | 175 layer_tree_host()->AcquireLayerTextures(); |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 TextureLayer::MailboxHolder::~MailboxHolder() { | 255 TextureLayer::MailboxHolder::~MailboxHolder() { |
| 252 mailbox_.RunReleaseCallback(sync_point_, is_lost_); | 256 mailbox_.RunReleaseCallback(sync_point_, is_lost_); |
| 253 } | 257 } |
| 254 | 258 |
| 255 void TextureLayer::MailboxHolder::Return(unsigned sync_point, bool is_lost) { | 259 void TextureLayer::MailboxHolder::Return(unsigned sync_point, bool is_lost) { |
| 256 sync_point_ = sync_point; | 260 sync_point_ = sync_point; |
| 257 is_lost_ = is_lost; | 261 is_lost_ = is_lost; |
| 258 } | 262 } |
| 259 | 263 |
| 260 } // namespace cc | 264 } // namespace cc |
| OLD | NEW |