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/test/layer_tree_json_parser.h" | 5 #include "cc/test/layer_tree_json_parser.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/test/values_test_util.h" | 9 #include "base/test/values_test_util.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 double transform[16]; | 145 double transform[16]; |
146 for (int i = 0; i < 16; ++i) | 146 for (int i = 0; i < 16; ++i) |
147 success &= list->GetDouble(i, &transform[i]); | 147 success &= list->GetDouble(i, &transform[i]); |
148 | 148 |
149 gfx::Transform layer_transform; | 149 gfx::Transform layer_transform; |
150 layer_transform.matrix().setColMajord(transform); | 150 layer_transform.matrix().setColMajord(transform); |
151 new_layer->SetTransform(layer_transform); | 151 new_layer->SetTransform(layer_transform); |
152 | 152 |
153 success &= dict->GetList("Children", &list); | 153 success &= dict->GetList("Children", &list); |
154 for (const auto& value : *list) { | 154 for (const auto& value : *list) { |
155 new_layer->AddChild(ParseTreeFromValue(*value, content_client)); | 155 new_layer->AddChild(ParseTreeFromValue(value, content_client)); |
156 } | 156 } |
157 | 157 |
158 if (!success) | 158 if (!success) |
159 return NULL; | 159 return NULL; |
160 | 160 |
161 return new_layer; | 161 return new_layer; |
162 } | 162 } |
163 | 163 |
164 } // namespace | 164 } // namespace |
165 | 165 |
166 scoped_refptr<Layer> ParseTreeFromJson(std::string json, | 166 scoped_refptr<Layer> ParseTreeFromJson(std::string json, |
167 ContentLayerClient* content_client) { | 167 ContentLayerClient* content_client) { |
168 std::unique_ptr<base::Value> val = base::test::ParseJson(json); | 168 std::unique_ptr<base::Value> val = base::test::ParseJson(json); |
169 return ParseTreeFromValue(*val, content_client); | 169 return ParseTreeFromValue(*val, content_client); |
170 } | 170 } |
171 | 171 |
172 } // namespace cc | 172 } // namespace cc |
OLD | NEW |