| 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 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 layer_tree_host()->UsingSharedMemoryResources())) { | 226 layer_tree_host()->UsingSharedMemoryResources())) { |
| 227 // Already within a commit, no need to do another one immediately. | 227 // Already within a commit, no need to do another one immediately. |
| 228 SetTextureMailboxInternal( | 228 SetTextureMailboxInternal( |
| 229 mailbox, | 229 mailbox, |
| 230 release_callback.Pass(), | 230 release_callback.Pass(), |
| 231 false /* requires_commit */); | 231 false /* requires_commit */); |
| 232 updated = true; | 232 updated = true; |
| 233 } | 233 } |
| 234 } else { | 234 } else { |
| 235 texture_id_ = client_->PrepareTexture(); | 235 texture_id_ = client_->PrepareTexture(); |
| 236 DCHECK_EQ(!!texture_id_, !!client_->Context3d()); | |
| 237 if (client_->Context3d() && | |
| 238 client_->Context3d()->getGraphicsResetStatusARB() != GL_NO_ERROR) | |
| 239 texture_id_ = 0; | |
| 240 updated = true; | 236 updated = true; |
| 241 SetNeedsPushProperties(); | 237 SetNeedsPushProperties(); |
| 242 // The texture id needs to be removed from the active tree before the | 238 // The texture id needs to be removed from the active tree before the |
| 243 // commit is called complete. | 239 // commit is called complete. |
| 244 SetNextCommitWaitsForActivation(); | 240 SetNextCommitWaitsForActivation(); |
| 245 } | 241 } |
| 246 } | 242 } |
| 247 | 243 |
| 248 // SetTextureMailbox could be called externally and the same mailbox used for | 244 // SetTextureMailbox could be called externally and the same mailbox used for |
| 249 // different textures. Such callers notify this layer that the texture has | 245 // different textures. Such callers notify this layer that the texture has |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 350 } | 346 } |
| 351 | 347 |
| 352 void TextureLayer::MailboxHolder::ReturnAndReleaseOnImplThread( | 348 void TextureLayer::MailboxHolder::ReturnAndReleaseOnImplThread( |
| 353 unsigned sync_point, bool is_lost) { | 349 unsigned sync_point, bool is_lost) { |
| 354 Return(sync_point, is_lost); | 350 Return(sync_point, is_lost); |
| 355 message_loop_->PostTask(FROM_HERE, | 351 message_loop_->PostTask(FROM_HERE, |
| 356 base::Bind(&MailboxHolder::InternalRelease, this)); | 352 base::Bind(&MailboxHolder::InternalRelease, this)); |
| 357 } | 353 } |
| 358 | 354 |
| 359 } // namespace cc | 355 } // namespace cc |
| OLD | NEW |