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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 | 123 |
124 bool wheel_handler; | 124 bool wheel_handler; |
125 if (dict->GetBoolean("WheelHandler", &wheel_handler)) | 125 if (dict->GetBoolean("WheelHandler", &wheel_handler)) |
126 new_layer->SetHaveWheelEventHandlers(wheel_handler); | 126 new_layer->SetHaveWheelEventHandlers(wheel_handler); |
127 | 127 |
128 bool scroll_handler; | 128 bool scroll_handler; |
129 if (dict->GetBoolean("ScrollHandler", &scroll_handler)) | 129 if (dict->GetBoolean("ScrollHandler", &scroll_handler)) |
130 new_layer->SetHaveScrollEventHandlers(scroll_handler); | 130 new_layer->SetHaveScrollEventHandlers(scroll_handler); |
131 | 131 |
132 bool is_3d_sorted; | 132 bool is_3d_sorted; |
133 if (dict->GetBoolean("Is3DSorted", &is_3d_sorted)) | 133 if (dict->GetBoolean("Is3DSorted", &is_3d_sorted)) { |
134 new_layer->SetIs3dSorted(is_3d_sorted); | 134 // A non-zero context ID will put the layer into a 3D sorting context |
| 135 new_layer->Set3dSortingContextId(is_3d_sorted ? 1 : 0); |
| 136 } |
135 | 137 |
136 if (dict->HasKey("TouchRegion")) { | 138 if (dict->HasKey("TouchRegion")) { |
137 success &= dict->GetList("TouchRegion", &list); | 139 success &= dict->GetList("TouchRegion", &list); |
138 Region touch_region; | 140 Region touch_region; |
139 for (size_t i = 0; i < list->GetSize(); ) { | 141 for (size_t i = 0; i < list->GetSize(); ) { |
140 int rect_x, rect_y, rect_width, rect_height; | 142 int rect_x, rect_y, rect_width, rect_height; |
141 success &= list->GetInteger(i++, &rect_x); | 143 success &= list->GetInteger(i++, &rect_x); |
142 success &= list->GetInteger(i++, &rect_y); | 144 success &= list->GetInteger(i++, &rect_y); |
143 success &= list->GetInteger(i++, &rect_width); | 145 success &= list->GetInteger(i++, &rect_width); |
144 success &= list->GetInteger(i++, &rect_height); | 146 success &= list->GetInteger(i++, &rect_height); |
(...skipping 25 matching lines...) Expand all Loading... |
170 | 172 |
171 } // namespace | 173 } // namespace |
172 | 174 |
173 scoped_refptr<Layer> ParseTreeFromJson(std::string json, | 175 scoped_refptr<Layer> ParseTreeFromJson(std::string json, |
174 ContentLayerClient* content_client) { | 176 ContentLayerClient* content_client) { |
175 scoped_ptr<base::Value> val = base::test::ParseJson(json); | 177 scoped_ptr<base::Value> val = base::test::ParseJson(json); |
176 return ParseTreeFromValue(val.get(), content_client); | 178 return ParseTreeFromValue(val.get(), content_client); |
177 } | 179 } |
178 | 180 |
179 } // namespace cc | 181 } // namespace cc |
OLD | NEW |