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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 // | 118 // |
119 // For now, we can safely indicate a layer is scrollable by giving it a | 119 // For now, we can safely indicate a layer is scrollable by giving it a |
120 // pointer to itself, something not normally allowed in a working tree. | 120 // pointer to itself, something not normally allowed in a working tree. |
121 // | 121 // |
122 // https://code.google.com/p/chromium/issues/detail?id=330622 | 122 // https://code.google.com/p/chromium/issues/detail?id=330622 |
123 // | 123 // |
124 if (dict->GetBoolean("Scrollable", &scrollable)) | 124 if (dict->GetBoolean("Scrollable", &scrollable)) |
125 new_layer->SetScrollClipLayerId(scrollable ? new_layer->id() | 125 new_layer->SetScrollClipLayerId(scrollable ? new_layer->id() |
126 : Layer::INVALID_ID); | 126 : Layer::INVALID_ID); |
127 | 127 |
128 bool scroll_handler; | |
129 if (dict->GetBoolean("ScrollHandler", &scroll_handler)) | |
130 new_layer->SetHaveScrollEventHandlers(scroll_handler); | |
131 | |
132 bool is_3d_sorted; | 128 bool is_3d_sorted; |
133 if (dict->GetBoolean("Is3DSorted", &is_3d_sorted)) { | 129 if (dict->GetBoolean("Is3DSorted", &is_3d_sorted)) { |
134 // A non-zero context ID will put the layer into a 3D sorting context | 130 // A non-zero context ID will put the layer into a 3D sorting context |
135 new_layer->Set3dSortingContextId(is_3d_sorted ? 1 : 0); | 131 new_layer->Set3dSortingContextId(is_3d_sorted ? 1 : 0); |
136 } | 132 } |
137 | 133 |
138 if (dict->HasKey("TouchRegion")) { | 134 if (dict->HasKey("TouchRegion")) { |
139 success &= dict->GetList("TouchRegion", &list); | 135 success &= dict->GetList("TouchRegion", &list); |
140 Region touch_region; | 136 Region touch_region; |
141 for (size_t i = 0; i < list->GetSize(); ) { | 137 for (size_t i = 0; i < list->GetSize(); ) { |
(...skipping 30 matching lines...) Expand all Loading... |
172 | 168 |
173 } // namespace | 169 } // namespace |
174 | 170 |
175 scoped_refptr<Layer> ParseTreeFromJson(std::string json, | 171 scoped_refptr<Layer> ParseTreeFromJson(std::string json, |
176 ContentLayerClient* content_client) { | 172 ContentLayerClient* content_client) { |
177 scoped_ptr<base::Value> val = base::test::ParseJson(json); | 173 scoped_ptr<base::Value> val = base::test::ParseJson(json); |
178 return ParseTreeFromValue(val.get(), content_client); | 174 return ParseTreeFromValue(val.get(), content_client); |
179 } | 175 } |
180 | 176 |
181 } // namespace cc | 177 } // namespace cc |
OLD | NEW |