| OLD | NEW |
| 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 Loading... |
| 208 return visible_content_rect(); | 208 return visible_content_rect(); |
| 209 | 209 |
| 210 return Region(); | 210 return Region(); |
| 211 } | 211 } |
| 212 | 212 |
| 213 void TextureLayerImpl::ReleaseResources() { | 213 void TextureLayerImpl::ReleaseResources() { |
| 214 if (external_texture_resource_ && !uses_mailbox_) { | 214 if (external_texture_resource_ && !uses_mailbox_) { |
| 215 ResourceProvider* resource_provider = | 215 ResourceProvider* resource_provider = |
| 216 layer_tree_impl()->resource_provider(); | 216 layer_tree_impl()->resource_provider(); |
| 217 resource_provider->DeleteResource(external_texture_resource_); | 217 resource_provider->DeleteResource(external_texture_resource_); |
| 218 } else { |
| 219 FreeTextureMailbox(); |
| 218 } | 220 } |
| 219 texture_copy_.reset(); | 221 texture_copy_.reset(); |
| 220 texture_id_ = 0; | 222 texture_id_ = 0; |
| 221 external_texture_resource_ = 0; | 223 external_texture_resource_ = 0; |
| 222 valid_texture_copy_ = false; | 224 valid_texture_copy_ = false; |
| 223 } | 225 } |
| 224 | 226 |
| 225 void TextureLayerImpl::SetTextureId(unsigned id) { | 227 void TextureLayerImpl::SetTextureId(unsigned id) { |
| 226 texture_id_ = id; | 228 texture_id_ = id; |
| 227 SetNeedsPushProperties(); | 229 SetNeedsPushProperties(); |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 } else if (external_texture_resource_) { | 281 } else if (external_texture_resource_) { |
| 280 DCHECK(!own_mailbox_); | 282 DCHECK(!own_mailbox_); |
| 281 ResourceProvider* resource_provider = | 283 ResourceProvider* resource_provider = |
| 282 layer_tree_impl()->resource_provider(); | 284 layer_tree_impl()->resource_provider(); |
| 283 resource_provider->DeleteResource(external_texture_resource_); | 285 resource_provider->DeleteResource(external_texture_resource_); |
| 284 external_texture_resource_ = 0; | 286 external_texture_resource_ = 0; |
| 285 } | 287 } |
| 286 } | 288 } |
| 287 | 289 |
| 288 } // namespace cc | 290 } // namespace cc |
| OLD | NEW |