| 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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 | 148 |
| 149 AppendDebugBorderQuad(quad_sink, shared_quad_state, append_quads_data); | 149 AppendDebugBorderQuad(quad_sink, shared_quad_state, append_quads_data); |
| 150 | 150 |
| 151 SkColor bg_color = blend_background_color_ ? | 151 SkColor bg_color = blend_background_color_ ? |
| 152 background_color() : SK_ColorTRANSPARENT; | 152 background_color() : SK_ColorTRANSPARENT; |
| 153 bool opaque = contents_opaque() || (SkColorGetA(bg_color) == 0xFF); | 153 bool opaque = contents_opaque() || (SkColorGetA(bg_color) == 0xFF); |
| 154 | 154 |
| 155 gfx::Rect quad_rect(content_bounds()); | 155 gfx::Rect quad_rect(content_bounds()); |
| 156 gfx::Rect opaque_rect = opaque ? quad_rect : gfx::Rect(); | 156 gfx::Rect opaque_rect = opaque ? quad_rect : gfx::Rect(); |
| 157 gfx::Rect visible_quad_rect = quad_sink->UnoccludedContentRect( | 157 gfx::Rect visible_quad_rect = quad_sink->UnoccludedContentRect( |
| 158 quad_rect, draw_properties().target_space_transform); | 158 this, quad_rect, draw_properties().target_space_transform); |
| 159 if (visible_quad_rect.IsEmpty()) | 159 if (visible_quad_rect.IsEmpty()) |
| 160 return; | 160 return; |
| 161 | 161 |
| 162 scoped_ptr<TextureDrawQuad> quad = TextureDrawQuad::Create(); | 162 scoped_ptr<TextureDrawQuad> quad = TextureDrawQuad::Create(); |
| 163 ResourceProvider::ResourceId id = | 163 ResourceProvider::ResourceId id = |
| 164 valid_texture_copy_ ? texture_copy_->id() : external_texture_resource_; | 164 valid_texture_copy_ ? texture_copy_->id() : external_texture_resource_; |
| 165 quad->SetNew(shared_quad_state, | 165 quad->SetNew(shared_quad_state, |
| 166 quad_rect, | 166 quad_rect, |
| 167 opaque_rect, | 167 opaque_rect, |
| 168 visible_quad_rect, | 168 visible_quad_rect, |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 } else if (external_texture_resource_) { | 243 } else if (external_texture_resource_) { |
| 244 DCHECK(!own_mailbox_); | 244 DCHECK(!own_mailbox_); |
| 245 ResourceProvider* resource_provider = | 245 ResourceProvider* resource_provider = |
| 246 layer_tree_impl()->resource_provider(); | 246 layer_tree_impl()->resource_provider(); |
| 247 resource_provider->DeleteResource(external_texture_resource_); | 247 resource_provider->DeleteResource(external_texture_resource_); |
| 248 external_texture_resource_ = 0; | 248 external_texture_resource_ = 0; |
| 249 } | 249 } |
| 250 } | 250 } |
| 251 | 251 |
| 252 } // namespace cc | 252 } // namespace cc |
| OLD | NEW |