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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 layer_impl->SetVertexOpacity(vertex_opacity_); | 42 layer_impl->SetVertexOpacity(vertex_opacity_); |
43 } | 43 } |
44 | 44 |
45 void UIResourceLayerImpl::SetUIResourceId(UIResourceId uid) { | 45 void UIResourceLayerImpl::SetUIResourceId(UIResourceId uid) { |
46 if (uid == ui_resource_id_) | 46 if (uid == ui_resource_id_) |
47 return; | 47 return; |
48 ui_resource_id_ = uid; | 48 ui_resource_id_ = uid; |
49 NoteLayerPropertyChanged(); | 49 NoteLayerPropertyChanged(); |
50 } | 50 } |
51 | 51 |
52 void UIResourceLayerImpl::SetImageBounds(gfx::Size image_bounds) { | 52 void UIResourceLayerImpl::SetImageBounds(const gfx::Size& image_bounds) { |
53 // This check imposes an ordering on the call sequence. An UIResource must | 53 // This check imposes an ordering on the call sequence. An UIResource must |
54 // exist before SetImageBounds can be called. | 54 // exist before SetImageBounds can be called. |
55 DCHECK(ui_resource_id_); | 55 DCHECK(ui_resource_id_); |
56 | 56 |
57 if (image_bounds_ == image_bounds) | 57 if (image_bounds_ == image_bounds) |
58 return; | 58 return; |
59 | 59 |
60 image_bounds_ = image_bounds; | 60 image_bounds_ = image_bounds; |
61 | 61 |
62 NoteLayerPropertyChanged(); | 62 NoteLayerPropertyChanged(); |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 list->AppendDouble(vertex_opacity_[3]); | 148 list->AppendDouble(vertex_opacity_[3]); |
149 result->Set("VertexOpacity", list); | 149 result->Set("VertexOpacity", list); |
150 | 150 |
151 result->Set("UVTopLeft", MathUtil::AsValue(uv_top_left_).release()); | 151 result->Set("UVTopLeft", MathUtil::AsValue(uv_top_left_).release()); |
152 result->Set("UVBottomRight", MathUtil::AsValue(uv_bottom_right_).release()); | 152 result->Set("UVBottomRight", MathUtil::AsValue(uv_bottom_right_).release()); |
153 | 153 |
154 return result; | 154 return result; |
155 } | 155 } |
156 | 156 |
157 } // namespace cc | 157 } // namespace cc |
OLD | NEW |