| 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 if (layer_tree_host()) { | 57 if (layer_tree_host()) { |
| 58 if (texture_id_) | 58 if (texture_id_) |
| 59 layer_tree_host()->AcquireLayerTextures(); | 59 layer_tree_host()->AcquireLayerTextures(); |
| 60 if (rate_limit_context_ && client_) | 60 if (rate_limit_context_ && client_) |
| 61 layer_tree_host()->StopRateLimiter(client_->Context3d()); | 61 layer_tree_host()->StopRateLimiter(client_->Context3d()); |
| 62 } | 62 } |
| 63 if (own_mailbox_) | 63 if (own_mailbox_) |
| 64 texture_mailbox_.RunReleaseCallback(texture_mailbox_.sync_point()); | 64 texture_mailbox_.RunReleaseCallback(texture_mailbox_.sync_point()); |
| 65 } | 65 } |
| 66 | 66 |
| 67 void TextureLayer::ClearClient() { |
| 68 client_ = NULL; |
| 69 SetTextureId(0); |
| 70 } |
| 71 |
| 67 scoped_ptr<LayerImpl> TextureLayer::CreateLayerImpl(LayerTreeImpl* tree_impl) { | 72 scoped_ptr<LayerImpl> TextureLayer::CreateLayerImpl(LayerTreeImpl* tree_impl) { |
| 68 return TextureLayerImpl::Create(tree_impl, id(), uses_mailbox_). | 73 return TextureLayerImpl::Create(tree_impl, id(), uses_mailbox_). |
| 69 PassAs<LayerImpl>(); | 74 PassAs<LayerImpl>(); |
| 70 } | 75 } |
| 71 | 76 |
| 72 void TextureLayer::SetFlipped(bool flipped) { | 77 void TextureLayer::SetFlipped(bool flipped) { |
| 73 flipped_ = flipped; | 78 flipped_ = flipped; |
| 74 SetNeedsCommit(); | 79 SetNeedsCommit(); |
| 75 } | 80 } |
| 76 | 81 |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 // triple-buffered. Single-buffered layers already prevent draws, so | 200 // triple-buffered. Single-buffered layers already prevent draws, so |
| 196 // can block too for simplicity. | 201 // can block too for simplicity. |
| 197 return DrawsContent(); | 202 return DrawsContent(); |
| 198 } | 203 } |
| 199 | 204 |
| 200 bool TextureLayer::CanClipSelf() const { | 205 bool TextureLayer::CanClipSelf() const { |
| 201 return true; | 206 return true; |
| 202 } | 207 } |
| 203 | 208 |
| 204 } // namespace cc | 209 } // namespace cc |
| OLD | NEW |