Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6660)

Unified Diff: cc/layers/texture_layer_impl.cc

Issue 15001027: [Aura] Added Support for rendering software compositor frames as cc::TextureLayers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed SharedMemory::DuplicateHandle. Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: cc/layers/texture_layer_impl.cc
diff --git a/cc/layers/texture_layer_impl.cc b/cc/layers/texture_layer_impl.cc
index 44062975bf8949c2899f854e2f7c92eb5c473c9e..e4d252ab550c30f1cfb98d8da611426ed5b49990 100644
--- a/cc/layers/texture_layer_impl.cc
+++ b/cc/layers/texture_layer_impl.cc
@@ -16,13 +16,13 @@ TextureLayerImpl::TextureLayerImpl(LayerTreeImpl* tree_impl,
int id,
bool uses_mailbox)
: LayerImpl(tree_impl, id),
+ uses_mailbox_(uses_mailbox),
texture_id_(0),
external_texture_resource_(0),
premultiplied_alpha_(true),
flipped_(true),
uv_top_left_(0.f, 0.f),
uv_bottom_right_(1.f, 1.f),
- uses_mailbox_(uses_mailbox),
own_mailbox_(false) {
vertex_opacity_[0] = 1.0f;
vertex_opacity_[1] = 1.0f;
@@ -34,7 +34,9 @@ TextureLayerImpl::~TextureLayerImpl() { FreeTextureMailbox(); }
void TextureLayerImpl::SetTextureMailbox(const TextureMailbox& mailbox) {
DCHECK(uses_mailbox_);
- DCHECK(mailbox.IsEmpty() || !mailbox.Equals(texture_mailbox_));
+ DCHECK(!mailbox.IsValid() ||
+ mailbox.IsSharedMemory() ||
+ !mailbox.ContainsMailbox(texture_mailbox_.name()));
FreeTextureMailbox();
texture_mailbox_ = mailbox;
own_mailbox_ = true;
@@ -146,7 +148,7 @@ void TextureLayerImpl::DidBecomeActive() {
return;
DCHECK(!external_texture_resource_);
ResourceProvider* resource_provider = layer_tree_impl()->resource_provider();
- if (!texture_mailbox_.IsEmpty()) {
+ if (texture_mailbox_.IsValid()) {
external_texture_resource_ =
resource_provider->CreateResourceFromTextureMailbox(texture_mailbox_);
}

Powered by Google App Engine
This is Rietveld 408576698