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 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 return (client_ || texture_id_ || holder_ref_) && | 165 return (client_ || texture_id_ || holder_ref_) && |
166 !context_lost_ && Layer::DrawsContent(); | 166 !context_lost_ && Layer::DrawsContent(); |
167 } | 167 } |
168 | 168 |
169 bool TextureLayer::Update(ResourceUpdateQueue* queue, | 169 bool TextureLayer::Update(ResourceUpdateQueue* queue, |
170 const OcclusionTracker* occlusion) { | 170 const OcclusionTracker* occlusion) { |
171 bool updated = false; | 171 bool updated = false; |
172 if (client_) { | 172 if (client_) { |
173 if (uses_mailbox_) { | 173 if (uses_mailbox_) { |
174 TextureMailbox mailbox; | 174 TextureMailbox mailbox; |
175 if (client_->PrepareTextureMailbox(&mailbox)) { | 175 if (client_->PrepareTextureMailbox( |
| 176 &mailbox, layer_tree_host()->UsingSharedMemoryResources())) { |
176 SetTextureMailbox(mailbox); | 177 SetTextureMailbox(mailbox); |
177 updated = true; | 178 updated = true; |
178 } | 179 } |
179 } else { | 180 } else { |
180 DCHECK(client_->Context3d()); | 181 DCHECK(client_->Context3d()); |
181 texture_id_ = client_->PrepareTexture(queue); | 182 texture_id_ = client_->PrepareTexture(queue); |
182 context_lost_ = client_->Context3d() && | 183 context_lost_ = client_->Context3d() && |
183 client_->Context3d()->getGraphicsResetStatusARB() != GL_NO_ERROR; | 184 client_->Context3d()->getGraphicsResetStatusARB() != GL_NO_ERROR; |
184 updated = true; | 185 updated = true; |
185 } | 186 } |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 } | 292 } |
292 | 293 |
293 void TextureLayer::MailboxHolder::ReturnAndReleaseOnImplThread( | 294 void TextureLayer::MailboxHolder::ReturnAndReleaseOnImplThread( |
294 unsigned sync_point, bool is_lost) { | 295 unsigned sync_point, bool is_lost) { |
295 message_loop_->PostTask(FROM_HERE, base::Bind( | 296 message_loop_->PostTask(FROM_HERE, base::Bind( |
296 &MailboxHolder::ReturnAndReleaseOnMainThread, | 297 &MailboxHolder::ReturnAndReleaseOnMainThread, |
297 this, sync_point, is_lost)); | 298 this, sync_point, is_lost)); |
298 } | 299 } |
299 | 300 |
300 } // namespace cc | 301 } // namespace cc |
OLD | NEW |