| 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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 gfx::Rect visible_quad_rect = | 160 gfx::Rect visible_quad_rect = |
| 161 draw_properties().occlusion_in_content_space.GetUnoccludedContentRect( | 161 draw_properties().occlusion_in_content_space.GetUnoccludedContentRect( |
| 162 quad_rect); | 162 quad_rect); |
| 163 if (visible_quad_rect.IsEmpty()) | 163 if (visible_quad_rect.IsEmpty()) |
| 164 return; | 164 return; |
| 165 | 165 |
| 166 TextureDrawQuad* quad = | 166 TextureDrawQuad* quad = |
| 167 render_pass->CreateAndAppendDrawQuad<TextureDrawQuad>(); | 167 render_pass->CreateAndAppendDrawQuad<TextureDrawQuad>(); |
| 168 ResourceProvider::ResourceId id = | 168 ResourceProvider::ResourceId id = |
| 169 valid_texture_copy_ ? texture_copy_->id() : external_texture_resource_; | 169 valid_texture_copy_ ? texture_copy_->id() : external_texture_resource_; |
| 170 // TODO(danakj): crbug.com/455931 | |
| 171 layer_tree_impl()->resource_provider()->ValidateResource(id); | |
| 172 quad->SetNew(shared_quad_state, | 170 quad->SetNew(shared_quad_state, |
| 173 quad_rect, | 171 quad_rect, |
| 174 opaque_rect, | 172 opaque_rect, |
| 175 visible_quad_rect, | 173 visible_quad_rect, |
| 176 id, | 174 id, |
| 177 premultiplied_alpha_, | 175 premultiplied_alpha_, |
| 178 uv_top_left_, | 176 uv_top_left_, |
| 179 uv_bottom_right_, | 177 uv_bottom_right_, |
| 180 bg_color, | 178 bg_color, |
| 181 vertex_opacity_, | 179 vertex_opacity_, |
| 182 flipped_, | 180 flipped_, |
| 183 nearest_neighbor_); | 181 nearest_neighbor_); |
| 182 ValidateQuadResources(quad); |
| 184 } | 183 } |
| 185 | 184 |
| 186 SimpleEnclosedRegion TextureLayerImpl::VisibleContentOpaqueRegion() const { | 185 SimpleEnclosedRegion TextureLayerImpl::VisibleContentOpaqueRegion() const { |
| 187 if (contents_opaque()) | 186 if (contents_opaque()) |
| 188 return SimpleEnclosedRegion(visible_content_rect()); | 187 return SimpleEnclosedRegion(visible_content_rect()); |
| 189 | 188 |
| 190 if (blend_background_color_ && (SkColorGetA(background_color()) == 0xFF)) | 189 if (blend_background_color_ && (SkColorGetA(background_color()) == 0xFF)) |
| 191 return SimpleEnclosedRegion(visible_content_rect()); | 190 return SimpleEnclosedRegion(visible_content_rect()); |
| 192 | 191 |
| 193 return SimpleEnclosedRegion(); | 192 return SimpleEnclosedRegion(); |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 } else if (external_texture_resource_) { | 257 } else if (external_texture_resource_) { |
| 259 DCHECK(!own_mailbox_); | 258 DCHECK(!own_mailbox_); |
| 260 ResourceProvider* resource_provider = | 259 ResourceProvider* resource_provider = |
| 261 layer_tree_impl()->resource_provider(); | 260 layer_tree_impl()->resource_provider(); |
| 262 resource_provider->DeleteResource(external_texture_resource_); | 261 resource_provider->DeleteResource(external_texture_resource_); |
| 263 external_texture_resource_ = 0; | 262 external_texture_resource_ = 0; |
| 264 } | 263 } |
| 265 } | 264 } |
| 266 | 265 |
| 267 } // namespace cc | 266 } // namespace cc |
| OLD | NEW |