| 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 "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/callback_helpers.h" | 8 #include "base/callback_helpers.h" |
| 9 #include "base/location.h" | 9 #include "base/location.h" |
| 10 #include "base/synchronization/lock.h" | 10 #include "base/synchronization/lock.h" |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 SetNextCommitWaitsForActivation(); | 210 SetNextCommitWaitsForActivation(); |
| 211 } | 211 } |
| 212 Layer::SetLayerTreeHost(host); | 212 Layer::SetLayerTreeHost(host); |
| 213 } | 213 } |
| 214 | 214 |
| 215 bool TextureLayer::DrawsContent() const { | 215 bool TextureLayer::DrawsContent() const { |
| 216 return (client_ || texture_id_ || holder_ref_) && Layer::DrawsContent(); | 216 return (client_ || texture_id_ || holder_ref_) && Layer::DrawsContent(); |
| 217 } | 217 } |
| 218 | 218 |
| 219 bool TextureLayer::Update(ResourceUpdateQueue* queue, | 219 bool TextureLayer::Update(ResourceUpdateQueue* queue, |
| 220 const OcclusionTracker* occlusion) { | 220 const OcclusionTracker<Layer>* occlusion) { |
| 221 bool updated = Layer::Update(queue, occlusion); | 221 bool updated = Layer::Update(queue, occlusion); |
| 222 if (client_) { | 222 if (client_) { |
| 223 if (uses_mailbox_) { | 223 if (uses_mailbox_) { |
| 224 TextureMailbox mailbox; | 224 TextureMailbox mailbox; |
| 225 scoped_ptr<SingleReleaseCallback> release_callback; | 225 scoped_ptr<SingleReleaseCallback> release_callback; |
| 226 if (client_->PrepareTextureMailbox( | 226 if (client_->PrepareTextureMailbox( |
| 227 &mailbox, | 227 &mailbox, |
| 228 &release_callback, | 228 &release_callback, |
| 229 layer_tree_host()->UsingSharedMemoryResources())) { | 229 layer_tree_host()->UsingSharedMemoryResources())) { |
| 230 // Already within a commit, no need to do another one immediately. | 230 // Already within a commit, no need to do another one immediately. |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 351 | 351 |
| 352 void TextureLayer::TextureMailboxHolder::ReturnAndReleaseOnImplThread( | 352 void TextureLayer::TextureMailboxHolder::ReturnAndReleaseOnImplThread( |
| 353 uint32 sync_point, | 353 uint32 sync_point, |
| 354 bool is_lost) { | 354 bool is_lost) { |
| 355 Return(sync_point, is_lost); | 355 Return(sync_point, is_lost); |
| 356 message_loop_->PostTask( | 356 message_loop_->PostTask( |
| 357 FROM_HERE, base::Bind(&TextureMailboxHolder::InternalRelease, this)); | 357 FROM_HERE, base::Bind(&TextureMailboxHolder::InternalRelease, this)); |
| 358 } | 358 } |
| 359 | 359 |
| 360 } // namespace cc | 360 } // namespace cc |
| OLD | NEW |