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

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: Created 7 years, 7 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 17f6c480a39afcbce87816f66005f4d78919f0e6..6f9c311040ead1c5c2db8409d610b49462e1b7a6 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;
@@ -30,11 +30,13 @@ TextureLayerImpl::TextureLayerImpl(LayerTreeImpl* tree_impl,
vertex_opacity_[3] = 1.0f;
}
-TextureLayerImpl::~TextureLayerImpl() { FreeTextureMailbox(); }
+TextureLayerImpl::~TextureLayerImpl() {
+ FreeTextureMailbox();
+}
void TextureLayerImpl::SetTextureMailbox(const TextureMailbox& mailbox) {
DCHECK(uses_mailbox_);
- DCHECK(mailbox.IsEmpty() || !mailbox.Equals(texture_mailbox_));
+ DCHECK(!mailbox.IsValid() || !mailbox.Equals(texture_mailbox_));
FreeTextureMailbox();
texture_mailbox_ = mailbox;
own_mailbox_ = true;
@@ -140,7 +142,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