| 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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 | 151 |
| 152 AppendDebugBorderQuad( | 152 AppendDebugBorderQuad( |
| 153 render_pass, content_bounds(), shared_quad_state, append_quads_data); | 153 render_pass, content_bounds(), shared_quad_state, append_quads_data); |
| 154 | 154 |
| 155 SkColor bg_color = blend_background_color_ ? | 155 SkColor bg_color = blend_background_color_ ? |
| 156 background_color() : SK_ColorTRANSPARENT; | 156 background_color() : SK_ColorTRANSPARENT; |
| 157 bool opaque = contents_opaque() || (SkColorGetA(bg_color) == 0xFF); | 157 bool opaque = contents_opaque() || (SkColorGetA(bg_color) == 0xFF); |
| 158 | 158 |
| 159 gfx::Rect quad_rect(content_bounds()); | 159 gfx::Rect quad_rect(content_bounds()); |
| 160 gfx::Rect opaque_rect = opaque ? quad_rect : gfx::Rect(); | 160 gfx::Rect opaque_rect = opaque ? quad_rect : gfx::Rect(); |
| 161 gfx::Rect visible_quad_rect = occlusion_tracker.UnoccludedContentRect( | 161 gfx::Rect visible_quad_rect = |
| 162 quad_rect, draw_properties().target_space_transform); | 162 occlusion_tracker.GetCurrentOcclusionForLayer( |
| 163 draw_properties().target_space_transform) |
| 164 .GetUnoccludedContentRect(quad_rect); |
| 163 if (visible_quad_rect.IsEmpty()) | 165 if (visible_quad_rect.IsEmpty()) |
| 164 return; | 166 return; |
| 165 | 167 |
| 166 TextureDrawQuad* quad = | 168 TextureDrawQuad* quad = |
| 167 render_pass->CreateAndAppendDrawQuad<TextureDrawQuad>(); | 169 render_pass->CreateAndAppendDrawQuad<TextureDrawQuad>(); |
| 168 ResourceProvider::ResourceId id = | 170 ResourceProvider::ResourceId id = |
| 169 valid_texture_copy_ ? texture_copy_->id() : external_texture_resource_; | 171 valid_texture_copy_ ? texture_copy_->id() : external_texture_resource_; |
| 170 quad->SetNew(shared_quad_state, | 172 quad->SetNew(shared_quad_state, |
| 171 quad_rect, | 173 quad_rect, |
| 172 opaque_rect, | 174 opaque_rect, |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 } else if (external_texture_resource_) { | 252 } else if (external_texture_resource_) { |
| 251 DCHECK(!own_mailbox_); | 253 DCHECK(!own_mailbox_); |
| 252 ResourceProvider* resource_provider = | 254 ResourceProvider* resource_provider = |
| 253 layer_tree_impl()->resource_provider(); | 255 layer_tree_impl()->resource_provider(); |
| 254 resource_provider->DeleteResource(external_texture_resource_); | 256 resource_provider->DeleteResource(external_texture_resource_); |
| 255 external_texture_resource_ = 0; | 257 external_texture_resource_ = 0; |
| 256 } | 258 } |
| 257 } | 259 } |
| 258 | 260 |
| 259 } // namespace cc | 261 } // namespace cc |
| OLD | NEW |