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 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
260 TextureMailboxHolder* holder = holder_ref_->holder(); | 260 TextureMailboxHolder* holder = holder_ref_->holder(); |
261 texture_mailbox = holder->mailbox(); | 261 texture_mailbox = holder->mailbox(); |
262 release_callback_impl = holder->GetCallbackForImplThread(); | 262 release_callback_impl = holder->GetCallbackForImplThread(); |
263 } | 263 } |
264 texture_layer->SetTextureMailbox(texture_mailbox, | 264 texture_layer->SetTextureMailbox(texture_mailbox, |
265 release_callback_impl.Pass()); | 265 release_callback_impl.Pass()); |
266 needs_set_mailbox_ = false; | 266 needs_set_mailbox_ = false; |
267 } | 267 } |
268 } | 268 } |
269 | 269 |
270 SimpleEnclosedRegion TextureLayer::VisibleContentOpaqueRegion() const { | |
271 if (contents_opaque()) | |
272 return SimpleEnclosedRegion(visible_content_rect()); | |
273 | |
274 if (blend_background_color_ && (SkColorGetA(background_color()) == 0xFF)) | |
275 return SimpleEnclosedRegion(visible_content_rect()); | |
276 | |
277 return SimpleEnclosedRegion(); | |
278 } | |
279 | |
280 TextureLayer::TextureMailboxHolder::MainThreadReference::MainThreadReference( | 270 TextureLayer::TextureMailboxHolder::MainThreadReference::MainThreadReference( |
281 TextureMailboxHolder* holder) | 271 TextureMailboxHolder* holder) |
282 : holder_(holder) { | 272 : holder_(holder) { |
283 holder_->InternalAddRef(); | 273 holder_->InternalAddRef(); |
284 } | 274 } |
285 | 275 |
286 TextureLayer::TextureMailboxHolder::MainThreadReference:: | 276 TextureLayer::TextureMailboxHolder::MainThreadReference:: |
287 ~MainThreadReference() { | 277 ~MainThreadReference() { |
288 holder_->InternalRelease(); | 278 holder_->InternalRelease(); |
289 } | 279 } |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
343 void TextureLayer::TextureMailboxHolder::ReturnAndReleaseOnImplThread( | 333 void TextureLayer::TextureMailboxHolder::ReturnAndReleaseOnImplThread( |
344 uint32 sync_point, | 334 uint32 sync_point, |
345 bool is_lost, | 335 bool is_lost, |
346 BlockingTaskRunner* main_thread_task_runner) { | 336 BlockingTaskRunner* main_thread_task_runner) { |
347 Return(sync_point, is_lost); | 337 Return(sync_point, is_lost); |
348 main_thread_task_runner->PostTask( | 338 main_thread_task_runner->PostTask( |
349 FROM_HERE, base::Bind(&TextureMailboxHolder::InternalRelease, this)); | 339 FROM_HERE, base::Bind(&TextureMailboxHolder::InternalRelease, this)); |
350 } | 340 } |
351 | 341 |
352 } // namespace cc | 342 } // namespace cc |
OLD | NEW |