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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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 new_layer->SetRenderingContextId(1); // A non-zero context ID = 3d sorted |
danakj
2014/06/15 18:15:36
can you make this comment a proper sentence (ie s/
troyhildebrandt
2014/06/17 00:29:43
Done.
| |
135 | 135 |
136 if (dict->HasKey("TouchRegion")) { | 136 if (dict->HasKey("TouchRegion")) { |
137 success &= dict->GetList("TouchRegion", &list); | 137 success &= dict->GetList("TouchRegion", &list); |
138 Region touch_region; | 138 Region touch_region; |
139 for (size_t i = 0; i < list->GetSize(); ) { | 139 for (size_t i = 0; i < list->GetSize(); ) { |
140 int rect_x, rect_y, rect_width, rect_height; | 140 int rect_x, rect_y, rect_width, rect_height; |
141 success &= list->GetInteger(i++, &rect_x); | 141 success &= list->GetInteger(i++, &rect_x); |
142 success &= list->GetInteger(i++, &rect_y); | 142 success &= list->GetInteger(i++, &rect_y); |
143 success &= list->GetInteger(i++, &rect_width); | 143 success &= list->GetInteger(i++, &rect_width); |
144 success &= list->GetInteger(i++, &rect_height); | 144 success &= list->GetInteger(i++, &rect_height); |
(...skipping 25 matching lines...) Expand all Loading... | |
170 | 170 |
171 } // namespace | 171 } // namespace |
172 | 172 |
173 scoped_refptr<Layer> ParseTreeFromJson(std::string json, | 173 scoped_refptr<Layer> ParseTreeFromJson(std::string json, |
174 ContentLayerClient* content_client) { | 174 ContentLayerClient* content_client) { |
175 scoped_ptr<base::Value> val = base::test::ParseJson(json); | 175 scoped_ptr<base::Value> val = base::test::ParseJson(json); |
176 return ParseTreeFromValue(val.get(), content_client); | 176 return ParseTreeFromValue(val.get(), content_client); |
177 } | 177 } |
178 | 178 |
179 } // namespace cc | 179 } // namespace cc |
OLD | NEW |