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

Side by Side Diff: cc/layers/texture_layer_impl.cc

Issue 16888015: Reland r206537 - cc: Don't return mailboxes if the TextureLayer is removed from the tree. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nits 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « cc/layers/texture_layer.cc ('k') | cc/layers/texture_layer_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 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_impl.h" 5 #include "cc/layers/texture_layer_impl.h"
6 6
7 #include "base/strings/stringprintf.h" 7 #include "base/strings/stringprintf.h"
8 #include "cc/layers/quad_sink.h" 8 #include "cc/layers/quad_sink.h"
9 #include "cc/output/renderer.h" 9 #include "cc/output/renderer.h"
10 #include "cc/quads/texture_draw_quad.h" 10 #include "cc/quads/texture_draw_quad.h"
(...skipping 16 matching lines...) Expand all
27 vertex_opacity_[0] = 1.0f; 27 vertex_opacity_[0] = 1.0f;
28 vertex_opacity_[1] = 1.0f; 28 vertex_opacity_[1] = 1.0f;
29 vertex_opacity_[2] = 1.0f; 29 vertex_opacity_[2] = 1.0f;
30 vertex_opacity_[3] = 1.0f; 30 vertex_opacity_[3] = 1.0f;
31 } 31 }
32 32
33 TextureLayerImpl::~TextureLayerImpl() { FreeTextureMailbox(); } 33 TextureLayerImpl::~TextureLayerImpl() { FreeTextureMailbox(); }
34 34
35 void TextureLayerImpl::SetTextureMailbox(const TextureMailbox& mailbox) { 35 void TextureLayerImpl::SetTextureMailbox(const TextureMailbox& mailbox) {
36 DCHECK(uses_mailbox_); 36 DCHECK(uses_mailbox_);
37 if (own_mailbox_)
38 DCHECK(!mailbox.IsValid() || !mailbox.Equals(texture_mailbox_));
39 FreeTextureMailbox(); 37 FreeTextureMailbox();
40 texture_mailbox_ = mailbox; 38 texture_mailbox_ = mailbox;
41 own_mailbox_ = true; 39 own_mailbox_ = true;
42 } 40 }
43 41
44 scoped_ptr<LayerImpl> TextureLayerImpl::CreateLayerImpl( 42 scoped_ptr<LayerImpl> TextureLayerImpl::CreateLayerImpl(
45 LayerTreeImpl* tree_impl) { 43 LayerTreeImpl* tree_impl) {
46 return TextureLayerImpl::Create(tree_impl, id(), uses_mailbox_). 44 return TextureLayerImpl::Create(tree_impl, id(), uses_mailbox_).
47 PassAs<LayerImpl>(); 45 PassAs<LayerImpl>();
48 } 46 }
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 } else if (external_texture_resource_) { 161 } else if (external_texture_resource_) {
164 DCHECK(!own_mailbox_); 162 DCHECK(!own_mailbox_);
165 ResourceProvider* resource_provider = 163 ResourceProvider* resource_provider =
166 layer_tree_impl()->resource_provider(); 164 layer_tree_impl()->resource_provider();
167 resource_provider->DeleteResource(external_texture_resource_); 165 resource_provider->DeleteResource(external_texture_resource_);
168 external_texture_resource_ = 0; 166 external_texture_resource_ = 0;
169 } 167 }
170 } 168 }
171 169
172 } // namespace cc 170 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/texture_layer.cc ('k') | cc/layers/texture_layer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698