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

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

Issue 124063003: [NOT FOR COMMIT] Hacks to get hardware canvas (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: only cc changes left Created 6 years, 11 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 | « no previous file | cc/test/fake_layer_tree_host_impl_client.h » ('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 <vector> 7 #include <vector>
8 8
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "cc/layers/quad_sink.h" 10 #include "cc/layers/quad_sink.h"
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 208
209 return Region(); 209 return Region();
210 } 210 }
211 211
212 void TextureLayerImpl::ReleaseResources() { 212 void TextureLayerImpl::ReleaseResources() {
213 if (external_texture_resource_ && !uses_mailbox_) { 213 if (external_texture_resource_ && !uses_mailbox_) {
214 ResourceProvider* resource_provider = 214 ResourceProvider* resource_provider =
215 layer_tree_impl()->resource_provider(); 215 layer_tree_impl()->resource_provider();
216 resource_provider->DeleteResource(external_texture_resource_); 216 resource_provider->DeleteResource(external_texture_resource_);
217 } 217 }
218 FreeTextureMailbox();
218 texture_copy_.reset(); 219 texture_copy_.reset();
219 texture_id_ = 0; 220 texture_id_ = 0;
220 external_texture_resource_ = 0; 221 external_texture_resource_ = 0;
221 valid_texture_copy_ = false; 222 valid_texture_copy_ = false;
222 } 223 }
223 224
224 const char* TextureLayerImpl::LayerTypeAsString() const { 225 const char* TextureLayerImpl::LayerTypeAsString() const {
225 return "cc::TextureLayerImpl"; 226 return "cc::TextureLayerImpl";
226 } 227 }
227 228
228 void TextureLayerImpl::FreeTextureMailbox() { 229 void TextureLayerImpl::FreeTextureMailbox() {
229 if (!uses_mailbox_) 230 if (!uses_mailbox_)
230 return; 231 return;
231 if (own_mailbox_) { 232 if (own_mailbox_) {
232 DCHECK(!external_texture_resource_); 233 DCHECK(!external_texture_resource_);
233 if (release_callback_) 234 if (release_callback_)
234 release_callback_->Run(texture_mailbox_.sync_point(), false); 235 release_callback_->Run(texture_mailbox_.sync_point(), false);
235 texture_mailbox_ = TextureMailbox(); 236 texture_mailbox_ = TextureMailbox();
236 release_callback_.reset(); 237 release_callback_.reset();
237 } else if (external_texture_resource_) { 238 } else if (external_texture_resource_) {
238 DCHECK(!own_mailbox_); 239 DCHECK(!own_mailbox_);
239 ResourceProvider* resource_provider = 240 ResourceProvider* resource_provider =
240 layer_tree_impl()->resource_provider(); 241 layer_tree_impl()->resource_provider();
241 resource_provider->DeleteResource(external_texture_resource_); 242 resource_provider->DeleteResource(external_texture_resource_);
242 external_texture_resource_ = 0; 243 external_texture_resource_ = 0;
243 } 244 }
244 } 245 }
245 246
246 } // namespace cc 247 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/test/fake_layer_tree_host_impl_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698