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.h" | 5 #include "cc/layers/ui_resource_layer.h" |
6 | 6 |
7 #include "cc/layers/ui_resource_layer_impl.h" | 7 #include "cc/layers/ui_resource_layer_impl.h" |
8 #include "cc/resources/prioritized_resource.h" | 8 #include "cc/resources/prioritized_resource.h" |
9 #include "cc/resources/resource_update.h" | 9 #include "cc/resources/resource_update.h" |
10 #include "cc/resources/resource_update_queue.h" | 10 #include "cc/resources/resource_update_queue.h" |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 vertex_opacity_[3] = 1.0f; | 65 vertex_opacity_[3] = 1.0f; |
66 } | 66 } |
67 | 67 |
68 UIResourceLayer::~UIResourceLayer() {} | 68 UIResourceLayer::~UIResourceLayer() {} |
69 | 69 |
70 scoped_ptr<LayerImpl> UIResourceLayer::CreateLayerImpl( | 70 scoped_ptr<LayerImpl> UIResourceLayer::CreateLayerImpl( |
71 LayerTreeImpl* tree_impl) { | 71 LayerTreeImpl* tree_impl) { |
72 return UIResourceLayerImpl::Create(tree_impl, id()).PassAs<LayerImpl>(); | 72 return UIResourceLayerImpl::Create(tree_impl, id()).PassAs<LayerImpl>(); |
73 } | 73 } |
74 | 74 |
75 void UIResourceLayer::SetUV(gfx::PointF top_left, gfx::PointF bottom_right) { | 75 void UIResourceLayer::SetUV(const gfx::PointF& top_left, |
| 76 const gfx::PointF& bottom_right) { |
76 if (uv_top_left_ == top_left && uv_bottom_right_ == bottom_right) | 77 if (uv_top_left_ == top_left && uv_bottom_right_ == bottom_right) |
77 return; | 78 return; |
78 uv_top_left_ = top_left; | 79 uv_top_left_ = top_left; |
79 uv_bottom_right_ = bottom_right; | 80 uv_bottom_right_ = bottom_right; |
80 SetNeedsCommit(); | 81 SetNeedsCommit(); |
81 } | 82 } |
82 | 83 |
83 void UIResourceLayer::SetVertexOpacity(float bottom_left, | 84 void UIResourceLayer::SetVertexOpacity(float bottom_left, |
84 float top_left, | 85 float top_left, |
85 float top_right, | 86 float top_right, |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 gfx::Size image_size = | 157 gfx::Size image_size = |
157 layer_tree_host()->GetUIResourceSize(ui_resource_holder_->id()); | 158 layer_tree_host()->GetUIResourceSize(ui_resource_holder_->id()); |
158 layer_impl->SetUIResourceId(ui_resource_holder_->id()); | 159 layer_impl->SetUIResourceId(ui_resource_holder_->id()); |
159 layer_impl->SetImageBounds(image_size); | 160 layer_impl->SetImageBounds(image_size); |
160 layer_impl->SetUV(uv_top_left_, uv_bottom_right_); | 161 layer_impl->SetUV(uv_top_left_, uv_bottom_right_); |
161 layer_impl->SetVertexOpacity(vertex_opacity_); | 162 layer_impl->SetVertexOpacity(vertex_opacity_); |
162 } | 163 } |
163 } | 164 } |
164 | 165 |
165 } // namespace cc | 166 } // namespace cc |
OLD | NEW |