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/output/renderer.h" | 10 #include "cc/output/renderer.h" |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 vertex_opacity_, | 177 vertex_opacity_, |
178 flipped_, | 178 flipped_, |
179 nearest_neighbor_); | 179 nearest_neighbor_); |
180 if (!valid_texture_copy_) { | 180 if (!valid_texture_copy_) { |
181 quad->set_resource_size_in_pixels(texture_mailbox_.size_in_pixels()); | 181 quad->set_resource_size_in_pixels(texture_mailbox_.size_in_pixels()); |
182 quad->set_allow_overlay(texture_mailbox_.allow_overlay()); | 182 quad->set_allow_overlay(texture_mailbox_.allow_overlay()); |
183 } | 183 } |
184 ValidateQuadResources(quad); | 184 ValidateQuadResources(quad); |
185 } | 185 } |
186 | 186 |
187 SimpleEnclosedRegion TextureLayerImpl::VisibleContentOpaqueRegion() const { | 187 SimpleEnclosedRegion TextureLayerImpl::VisibleOpaqueRegion() const { |
188 if (contents_opaque()) | 188 if (contents_opaque()) |
189 return SimpleEnclosedRegion(visible_content_rect()); | 189 return SimpleEnclosedRegion(visible_layer_rect()); |
190 | 190 |
191 if (blend_background_color_ && (SkColorGetA(background_color()) == 0xFF)) | 191 if (blend_background_color_ && (SkColorGetA(background_color()) == 0xFF)) |
192 return SimpleEnclosedRegion(visible_content_rect()); | 192 return SimpleEnclosedRegion(visible_layer_rect()); |
193 | 193 |
194 return SimpleEnclosedRegion(); | 194 return SimpleEnclosedRegion(); |
195 } | 195 } |
196 | 196 |
197 void TextureLayerImpl::ReleaseResources() { | 197 void TextureLayerImpl::ReleaseResources() { |
198 FreeTextureMailbox(); | 198 FreeTextureMailbox(); |
199 texture_copy_ = nullptr; | 199 texture_copy_ = nullptr; |
200 external_texture_resource_ = 0; | 200 external_texture_resource_ = 0; |
201 valid_texture_copy_ = false; | 201 valid_texture_copy_ = false; |
202 } | 202 } |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 } else if (external_texture_resource_) { | 259 } else if (external_texture_resource_) { |
260 DCHECK(!own_mailbox_); | 260 DCHECK(!own_mailbox_); |
261 ResourceProvider* resource_provider = | 261 ResourceProvider* resource_provider = |
262 layer_tree_impl()->resource_provider(); | 262 layer_tree_impl()->resource_provider(); |
263 resource_provider->DeleteResource(external_texture_resource_); | 263 resource_provider->DeleteResource(external_texture_resource_); |
264 external_texture_resource_ = 0; | 264 external_texture_resource_ = 0; |
265 } | 265 } |
266 } | 266 } |
267 | 267 |
268 } // namespace cc | 268 } // namespace cc |
OLD | NEW |