| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/ui_resource_layer_impl.h" | 5 #include "cc/layers/ui_resource_layer_impl.h" |
| 6 | 6 |
| 7 #include "base/strings/stringprintf.h" | 7 #include "base/strings/stringprintf.h" |
| 8 #include "base/values.h" | 8 #include "base/values.h" |
| 9 #include "cc/base/math_util.h" | 9 #include "cc/base/math_util.h" |
| 10 #include "cc/layers/quad_sink.h" | 10 #include "cc/layers/quad_sink.h" |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 static const bool premultiplied_alpha = true; | 111 static const bool premultiplied_alpha = true; |
| 112 | 112 |
| 113 DCHECK(!bounds().IsEmpty()); | 113 DCHECK(!bounds().IsEmpty()); |
| 114 | 114 |
| 115 bool opaque = layer_tree_impl()->IsUIResourceOpaque(ui_resource_id_) || | 115 bool opaque = layer_tree_impl()->IsUIResourceOpaque(ui_resource_id_) || |
| 116 contents_opaque(); | 116 contents_opaque(); |
| 117 | 117 |
| 118 gfx::Rect quad_rect(bounds()); | 118 gfx::Rect quad_rect(bounds()); |
| 119 gfx::Rect opaque_rect(opaque ? quad_rect : gfx::Rect()); | 119 gfx::Rect opaque_rect(opaque ? quad_rect : gfx::Rect()); |
| 120 gfx::Rect visible_quad_rect = quad_sink->UnoccludedContentRect( | 120 gfx::Rect visible_quad_rect = quad_sink->UnoccludedContentRect( |
| 121 quad_rect, draw_properties().target_space_transform); | 121 this, quad_rect, draw_properties().target_space_transform); |
| 122 if (visible_quad_rect.IsEmpty()) | 122 if (visible_quad_rect.IsEmpty()) |
| 123 return; | 123 return; |
| 124 | 124 |
| 125 scoped_ptr<TextureDrawQuad> quad = TextureDrawQuad::Create(); | 125 scoped_ptr<TextureDrawQuad> quad = TextureDrawQuad::Create(); |
| 126 quad->SetNew(shared_quad_state, | 126 quad->SetNew(shared_quad_state, |
| 127 quad_rect, | 127 quad_rect, |
| 128 opaque_rect, | 128 opaque_rect, |
| 129 visible_quad_rect, | 129 visible_quad_rect, |
| 130 resource, | 130 resource, |
| 131 premultiplied_alpha, | 131 premultiplied_alpha, |
| (...skipping 21 matching lines...) Expand all Loading... |
| 153 list->AppendDouble(vertex_opacity_[3]); | 153 list->AppendDouble(vertex_opacity_[3]); |
| 154 result->Set("VertexOpacity", list); | 154 result->Set("VertexOpacity", list); |
| 155 | 155 |
| 156 result->Set("UVTopLeft", MathUtil::AsValue(uv_top_left_).release()); | 156 result->Set("UVTopLeft", MathUtil::AsValue(uv_top_left_).release()); |
| 157 result->Set("UVBottomRight", MathUtil::AsValue(uv_bottom_right_).release()); | 157 result->Set("UVBottomRight", MathUtil::AsValue(uv_bottom_right_).release()); |
| 158 | 158 |
| 159 return result; | 159 return result; |
| 160 } | 160 } |
| 161 | 161 |
| 162 } // namespace cc | 162 } // namespace cc |
| OLD | NEW |