| 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 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 Region TextureLayerImpl::VisibleContentOpaqueRegion() const { | 202 Region TextureLayerImpl::VisibleContentOpaqueRegion() const { |
| 203 if (contents_opaque()) | 203 if (contents_opaque()) |
| 204 return visible_content_rect(); | 204 return visible_content_rect(); |
| 205 | 205 |
| 206 if (blend_background_color_ && (SkColorGetA(background_color()) == 0xFF)) | 206 if (blend_background_color_ && (SkColorGetA(background_color()) == 0xFF)) |
| 207 return visible_content_rect(); | 207 return visible_content_rect(); |
| 208 | 208 |
| 209 return Region(); | 209 return Region(); |
| 210 } | 210 } |
| 211 | 211 |
| 212 void TextureLayerImpl::DidLoseOutputSurface() { | 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 texture_copy_.reset(); | 218 texture_copy_.reset(); |
| 219 texture_id_ = 0; | 219 texture_id_ = 0; |
| 220 external_texture_resource_ = 0; | 220 external_texture_resource_ = 0; |
| 221 valid_texture_copy_ = false; | 221 valid_texture_copy_ = false; |
| 222 } | 222 } |
| (...skipping 14 matching lines...) Expand all Loading... |
| 237 } else if (external_texture_resource_) { | 237 } else if (external_texture_resource_) { |
| 238 DCHECK(!own_mailbox_); | 238 DCHECK(!own_mailbox_); |
| 239 ResourceProvider* resource_provider = | 239 ResourceProvider* resource_provider = |
| 240 layer_tree_impl()->resource_provider(); | 240 layer_tree_impl()->resource_provider(); |
| 241 resource_provider->DeleteResource(external_texture_resource_); | 241 resource_provider->DeleteResource(external_texture_resource_); |
| 242 external_texture_resource_ = 0; | 242 external_texture_resource_ = 0; |
| 243 } | 243 } |
| 244 } | 244 } |
| 245 | 245 |
| 246 } // namespace cc | 246 } // namespace cc |
| OLD | NEW |