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/location.h" | 8 #include "base/location.h" |
9 #include "base/message_loop/message_loop_proxy.h" | 9 #include "base/message_loop/message_loop_proxy.h" |
10 #include "cc/layers/texture_layer_client.h" | 10 #include "cc/layers/texture_layer_client.h" |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 needs_set_mailbox_ = true; | 172 needs_set_mailbox_ = true; |
173 Layer::SetLayerTreeHost(host); | 173 Layer::SetLayerTreeHost(host); |
174 } | 174 } |
175 | 175 |
176 bool TextureLayer::DrawsContent() const { | 176 bool TextureLayer::DrawsContent() const { |
177 return (client_ || texture_id_ || holder_ref_) && Layer::DrawsContent(); | 177 return (client_ || texture_id_ || holder_ref_) && Layer::DrawsContent(); |
178 } | 178 } |
179 | 179 |
180 bool TextureLayer::Update(ResourceUpdateQueue* queue, | 180 bool TextureLayer::Update(ResourceUpdateQueue* queue, |
181 const OcclusionTracker* occlusion) { | 181 const OcclusionTracker* occlusion) { |
182 bool updated = false; | 182 bool updated = Layer::Update(queue, occlusion); |
183 if (client_) { | 183 if (client_) { |
184 if (uses_mailbox_) { | 184 if (uses_mailbox_) { |
185 TextureMailbox mailbox; | 185 TextureMailbox mailbox; |
186 if (client_->PrepareTextureMailbox( | 186 if (client_->PrepareTextureMailbox( |
187 &mailbox, layer_tree_host()->UsingSharedMemoryResources())) { | 187 &mailbox, layer_tree_host()->UsingSharedMemoryResources())) { |
188 SetTextureMailbox(mailbox); | 188 SetTextureMailbox(mailbox); |
189 updated = true; | 189 updated = true; |
190 } | 190 } |
191 } else { | 191 } else { |
192 DCHECK(client_->Context3d()); | 192 DCHECK(client_->Context3d()); |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
313 } | 313 } |
314 | 314 |
315 void TextureLayer::MailboxHolder::ReturnAndReleaseOnImplThread( | 315 void TextureLayer::MailboxHolder::ReturnAndReleaseOnImplThread( |
316 unsigned sync_point, bool is_lost) { | 316 unsigned sync_point, bool is_lost) { |
317 message_loop_->PostTask(FROM_HERE, base::Bind( | 317 message_loop_->PostTask(FROM_HERE, base::Bind( |
318 &MailboxHolder::ReturnAndReleaseOnMainThread, | 318 &MailboxHolder::ReturnAndReleaseOnMainThread, |
319 this, sync_point, is_lost)); | 319 this, sync_point, is_lost)); |
320 } | 320 } |
321 | 321 |
322 } // namespace cc | 322 } // namespace cc |
OLD | NEW |