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 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
269 release_callback = holder->GetCallbackForImplThread(); | 269 release_callback = holder->GetCallbackForImplThread(); |
270 } | 270 } |
271 texture_layer->SetTextureMailbox(texture_mailbox, release_callback.Pass()); | 271 texture_layer->SetTextureMailbox(texture_mailbox, release_callback.Pass()); |
272 needs_set_mailbox_ = false; | 272 needs_set_mailbox_ = false; |
273 } else { | 273 } else { |
274 texture_layer->SetTextureId(texture_id_); | 274 texture_layer->SetTextureId(texture_id_); |
275 content_committed_ = DrawsContent(); | 275 content_committed_ = DrawsContent(); |
276 } | 276 } |
277 } | 277 } |
278 | 278 |
279 void TextureLayer::OnOutputSurfaceCreated() { | |
280 if (uses_mailbox_) { | |
danakj
2014/02/11 19:58:59
If we release the mailbox here, we should be calli
boliu
2014/02/11 21:44:07
That's already handled on the impl side (DeferredI
boliu
2014/02/12 01:48:57
Actually I'm not clear what your concern is about
danakj
2014/02/12 15:40:01
I did mean content, the impl side texture. But the
boliu
2014/02/12 17:45:27
Good suggestion. Caught an edge case that I haven'
| |
281 holder_ref_.reset(); | |
boliu
2014/02/07 04:29:55
So for mailboxes the contract is maintained implic
danakj
2014/02/11 19:58:59
It'd be nice to just mark the layer as "bad" until
boliu
2014/02/11 21:44:07
Could I do this in a follow up? :p
Or do you thin
boliu
2014/02/12 01:48:57
This should just work right now?
Without a valid
danakj
2014/02/12 15:40:01
Oh, we'll draw a frame without the layer there, wh
| |
282 } | |
283 } | |
284 | |
279 Region TextureLayer::VisibleContentOpaqueRegion() const { | 285 Region TextureLayer::VisibleContentOpaqueRegion() const { |
280 if (contents_opaque()) | 286 if (contents_opaque()) |
281 return visible_content_rect(); | 287 return visible_content_rect(); |
282 | 288 |
283 if (blend_background_color_ && (SkColorGetA(background_color()) == 0xFF)) | 289 if (blend_background_color_ && (SkColorGetA(background_color()) == 0xFF)) |
284 return visible_content_rect(); | 290 return visible_content_rect(); |
285 | 291 |
286 return Region(); | 292 return Region(); |
287 } | 293 } |
288 | 294 |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
351 | 357 |
352 void TextureLayer::TextureMailboxHolder::ReturnAndReleaseOnImplThread( | 358 void TextureLayer::TextureMailboxHolder::ReturnAndReleaseOnImplThread( |
353 uint32 sync_point, | 359 uint32 sync_point, |
354 bool is_lost) { | 360 bool is_lost) { |
355 Return(sync_point, is_lost); | 361 Return(sync_point, is_lost); |
356 message_loop_->PostTask( | 362 message_loop_->PostTask( |
357 FROM_HERE, base::Bind(&TextureMailboxHolder::InternalRelease, this)); | 363 FROM_HERE, base::Bind(&TextureMailboxHolder::InternalRelease, this)); |
358 } | 364 } |
359 | 365 |
360 } // namespace cc | 366 } // namespace cc |
OLD | NEW |