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/quads/texture_draw_quad.h" | 10 #include "cc/quads/texture_draw_quad.h" |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 resource, premultiplied_alpha, uv_top_left_, uv_bottom_right_, | 133 resource, premultiplied_alpha, uv_top_left_, uv_bottom_right_, |
134 SK_ColorTRANSPARENT, vertex_opacity_, flipped, nearest_neighbor, | 134 SK_ColorTRANSPARENT, vertex_opacity_, flipped, nearest_neighbor, |
135 false); | 135 false); |
136 ValidateQuadResources(quad); | 136 ValidateQuadResources(quad); |
137 } | 137 } |
138 | 138 |
139 const char* UIResourceLayerImpl::LayerTypeAsString() const { | 139 const char* UIResourceLayerImpl::LayerTypeAsString() const { |
140 return "cc::UIResourceLayerImpl"; | 140 return "cc::UIResourceLayerImpl"; |
141 } | 141 } |
142 | 142 |
143 base::DictionaryValue* UIResourceLayerImpl::LayerTreeAsJson() const { | 143 std::unique_ptr<base::DictionaryValue> UIResourceLayerImpl::LayerTreeAsJson() |
144 base::DictionaryValue* result = LayerImpl::LayerTreeAsJson(); | 144 const { |
| 145 std::unique_ptr<base::DictionaryValue> result = LayerImpl::LayerTreeAsJson(); |
145 | 146 |
146 result->Set("ImageBounds", MathUtil::AsValue(image_bounds_).release()); | 147 result->Set("ImageBounds", MathUtil::AsValue(image_bounds_).release()); |
147 | 148 |
148 base::ListValue* list = new base::ListValue; | 149 base::ListValue* list = new base::ListValue; |
149 list->AppendDouble(vertex_opacity_[0]); | 150 list->AppendDouble(vertex_opacity_[0]); |
150 list->AppendDouble(vertex_opacity_[1]); | 151 list->AppendDouble(vertex_opacity_[1]); |
151 list->AppendDouble(vertex_opacity_[2]); | 152 list->AppendDouble(vertex_opacity_[2]); |
152 list->AppendDouble(vertex_opacity_[3]); | 153 list->AppendDouble(vertex_opacity_[3]); |
153 result->Set("VertexOpacity", list); | 154 result->Set("VertexOpacity", list); |
154 | 155 |
155 result->Set("UVTopLeft", MathUtil::AsValue(uv_top_left_).release()); | 156 result->Set("UVTopLeft", MathUtil::AsValue(uv_top_left_).release()); |
156 result->Set("UVBottomRight", MathUtil::AsValue(uv_bottom_right_).release()); | 157 result->Set("UVBottomRight", MathUtil::AsValue(uv_bottom_right_).release()); |
157 | 158 |
158 return result; | 159 return result; |
159 } | 160 } |
160 | 161 |
161 } // namespace cc | 162 } // namespace cc |
OLD | NEW |