| 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 "base/test/values_test_util.h" | 7 #include "base/test/values_test_util.h" |
| 8 #include "base/values.h" | 8 #include "base/values.h" |
| 9 #include "cc/layers/content_layer.h" | 9 #include "cc/layers/content_layer.h" |
| 10 #include "cc/layers/layer.h" | 10 #include "cc/layers/layer.h" |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 new_layer->SetTouchEventHandlerRegion(touch_region); | 149 new_layer->SetTouchEventHandlerRegion(touch_region); |
| 150 } | 150 } |
| 151 | 151 |
| 152 if (dict->HasKey("ScrollBlocksOn")) { | 152 if (dict->HasKey("ScrollBlocksOn")) { |
| 153 success &= dict->GetList("ScrollBlocksOn", &list); | 153 success &= dict->GetList("ScrollBlocksOn", &list); |
| 154 ScrollBlocksOn blocks; | 154 ScrollBlocksOn blocks; |
| 155 std::string str; | 155 std::string str; |
| 156 for (size_t i = 0; i < list->GetSize(); i++) { | 156 for (size_t i = 0; i < list->GetSize(); i++) { |
| 157 success &= list->GetString(i, &str); | 157 success &= list->GetString(i, &str); |
| 158 if (str == "StartTouch") | 158 if (str == "StartTouch") |
| 159 blocks |= SCROLL_BLOCKS_ON_START_TOUCH; | 159 blocks |= ScrollBlocksOnStartTouch; |
| 160 else if (str == "WheelEvent") | 160 else if (str == "WheelEvent") |
| 161 blocks |= SCROLL_BLOCKS_ON_WHEEL_EVENT; | 161 blocks |= ScrollBlocksOnWheelEvent; |
| 162 else if (str == "ScrollEvent") | 162 else if (str == "ScrollEvent") |
| 163 blocks |= SCROLL_BLOCKS_ON_SCROLL_EVENT; | 163 blocks |= ScrollBlocksOnScrollEvent; |
| 164 else | 164 else |
| 165 success = false; | 165 success = false; |
| 166 } | 166 } |
| 167 } | 167 } |
| 168 | 168 |
| 169 success &= dict->GetList("DrawTransform", &list); | 169 success &= dict->GetList("DrawTransform", &list); |
| 170 double transform[16]; | 170 double transform[16]; |
| 171 for (int i = 0; i < 16; ++i) | 171 for (int i = 0; i < 16; ++i) |
| 172 success &= list->GetDouble(i, &transform[i]); | 172 success &= list->GetDouble(i, &transform[i]); |
| 173 | 173 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 189 | 189 |
| 190 } // namespace | 190 } // namespace |
| 191 | 191 |
| 192 scoped_refptr<Layer> ParseTreeFromJson(std::string json, | 192 scoped_refptr<Layer> ParseTreeFromJson(std::string json, |
| 193 ContentLayerClient* content_client) { | 193 ContentLayerClient* content_client) { |
| 194 scoped_ptr<base::Value> val = base::test::ParseJson(json); | 194 scoped_ptr<base::Value> val = base::test::ParseJson(json); |
| 195 return ParseTreeFromValue(val.get(), content_client); | 195 return ParseTreeFromValue(val.get(), content_client); |
| 196 } | 196 } |
| 197 | 197 |
| 198 } // namespace cc | 198 } // namespace cc |
| OLD | NEW |