Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(161)

Side by Side Diff: cc/test/layer_tree_json_parser.cc

Issue 784463002: Add initial CC support for scroll-blocks-on (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: jdduke CR feedback Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/layers/scrollbar_layer_unittest.cc ('k') | cc/trees/layer_tree_host_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 int rect_x, rect_y, rect_width, rect_height; 142 int rect_x, rect_y, rect_width, rect_height;
143 success &= list->GetInteger(i++, &rect_x); 143 success &= list->GetInteger(i++, &rect_x);
144 success &= list->GetInteger(i++, &rect_y); 144 success &= list->GetInteger(i++, &rect_y);
145 success &= list->GetInteger(i++, &rect_width); 145 success &= list->GetInteger(i++, &rect_width);
146 success &= list->GetInteger(i++, &rect_height); 146 success &= list->GetInteger(i++, &rect_height);
147 touch_region.Union(gfx::Rect(rect_x, rect_y, rect_width, rect_height)); 147 touch_region.Union(gfx::Rect(rect_x, rect_y, rect_width, rect_height));
148 } 148 }
149 new_layer->SetTouchEventHandlerRegion(touch_region); 149 new_layer->SetTouchEventHandlerRegion(touch_region);
150 } 150 }
151 151
152 if (dict->HasKey("ScrollBlocksOn")) {
153 success &= dict->GetList("ScrollBlocksOn", &list);
154 ScrollBlocksOn blocks;
155 std::string str;
156 for (size_t i = 0; i < list->GetSize(); i++) {
157 success &= list->GetString(i, &str);
158 if (str == "StartTouch")
159 blocks |= ScrollBlocksOnStartTouch;
160 else if (str == "WheelEvent")
161 blocks |= ScrollBlocksOnWheelEvent;
162 else if (str == "ScrollEvent")
163 blocks |= ScrollBlocksOnScrollEvent;
164 else
165 success = false;
166 }
167 }
168
152 success &= dict->GetList("DrawTransform", &list); 169 success &= dict->GetList("DrawTransform", &list);
153 double transform[16]; 170 double transform[16];
154 for (int i = 0; i < 16; ++i) 171 for (int i = 0; i < 16; ++i)
155 success &= list->GetDouble(i, &transform[i]); 172 success &= list->GetDouble(i, &transform[i]);
156 173
157 gfx::Transform layer_transform; 174 gfx::Transform layer_transform;
158 layer_transform.matrix().setColMajord(transform); 175 layer_transform.matrix().setColMajord(transform);
159 new_layer->SetTransform(layer_transform); 176 new_layer->SetTransform(layer_transform);
160 177
161 success &= dict->GetList("Children", &list); 178 success &= dict->GetList("Children", &list);
(...skipping 10 matching lines...) Expand all
172 189
173 } // namespace 190 } // namespace
174 191
175 scoped_refptr<Layer> ParseTreeFromJson(std::string json, 192 scoped_refptr<Layer> ParseTreeFromJson(std::string json,
176 ContentLayerClient* content_client) { 193 ContentLayerClient* content_client) {
177 scoped_ptr<base::Value> val = base::test::ParseJson(json); 194 scoped_ptr<base::Value> val = base::test::ParseJson(json);
178 return ParseTreeFromValue(val.get(), content_client); 195 return ParseTreeFromValue(val.get(), content_client);
179 } 196 }
180 197
181 } // namespace cc 198 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/scrollbar_layer_unittest.cc ('k') | cc/trees/layer_tree_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698