| 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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 // the parent pointer to this function and traversing the same number of | 110 // the parent pointer to this function and traversing the same number of |
| 111 // ancestors to determine the pointer to the clip layer. The LayerTreesMatch() | 111 // ancestors to determine the pointer to the clip layer. The LayerTreesMatch() |
| 112 // function should then check that both original and reconstructed layers | 112 // function should then check that both original and reconstructed layers |
| 113 // have the same positioning with respect to their clip layers. | 113 // have the same positioning with respect to their clip layers. |
| 114 // | 114 // |
| 115 // For now, we can safely indicate a layer is scrollable by giving it a | 115 // For now, we can safely indicate a layer is scrollable by giving it a |
| 116 // pointer to itself, something not normally allowed in a working tree. | 116 // pointer to itself, something not normally allowed in a working tree. |
| 117 // | 117 // |
| 118 // https://code.google.com/p/chromium/issues/detail?id=330622 | 118 // https://code.google.com/p/chromium/issues/detail?id=330622 |
| 119 // | 119 // |
| 120 if (dict->GetBoolean("Scrollable", &scrollable)) | 120 if (dict->GetBoolean("Scrollable", &scrollable)) { |
| 121 new_layer->SetScrollClipLayerId(scrollable ? new_layer->id() | 121 new_layer->SetScrollClipAndCanOverscroll( |
| 122 : Layer::INVALID_ID); | 122 scrollable ? new_layer->id() : Layer::INVALID_ID, false); |
| 123 } |
| 123 | 124 |
| 124 bool is_3d_sorted; | 125 bool is_3d_sorted; |
| 125 if (dict->GetBoolean("Is3DSorted", &is_3d_sorted)) { | 126 if (dict->GetBoolean("Is3DSorted", &is_3d_sorted)) { |
| 126 // A non-zero context ID will put the layer into a 3D sorting context | 127 // A non-zero context ID will put the layer into a 3D sorting context |
| 127 new_layer->Set3dSortingContextId(is_3d_sorted ? 1 : 0); | 128 new_layer->Set3dSortingContextId(is_3d_sorted ? 1 : 0); |
| 128 } | 129 } |
| 129 | 130 |
| 130 if (dict->HasKey("TouchRegion")) { | 131 if (dict->HasKey("TouchRegion")) { |
| 131 success &= dict->GetList("TouchRegion", &list); | 132 success &= dict->GetList("TouchRegion", &list); |
| 132 Region touch_region; | 133 Region touch_region; |
| (...skipping 30 matching lines...) Expand all Loading... |
| 163 | 164 |
| 164 } // namespace | 165 } // namespace |
| 165 | 166 |
| 166 scoped_refptr<Layer> ParseTreeFromJson(std::string json, | 167 scoped_refptr<Layer> ParseTreeFromJson(std::string json, |
| 167 ContentLayerClient* content_client) { | 168 ContentLayerClient* content_client) { |
| 168 std::unique_ptr<base::Value> val = base::test::ParseJson(json); | 169 std::unique_ptr<base::Value> val = base::test::ParseJson(json); |
| 169 return ParseTreeFromValue(*val, content_client); | 170 return ParseTreeFromValue(*val, content_client); |
| 170 } | 171 } |
| 171 | 172 |
| 172 } // namespace cc | 173 } // namespace cc |
| OLD | NEW |