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

Side by Side Diff: cc/layers/layer_unittest.cc

Issue 2194833002: Overscroll and Elasticity for views::ScrollView Base URL: https://chromium.googlesource.com/chromium/src.git@20160728-MacViews-RouteThroughInputHandler
Patch Set: Restore functionality and fix bugs \o/ Created 4 years, 1 month 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/layer_impl.cc ('k') | cc/proto/begin_main_frame_and_commit_state.proto » ('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 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 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/layers/layer.h" 5 #include "cc/layers/layer.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/threading/thread_task_runner_handle.h" 9 #include "base/threading/thread_task_runner_handle.h"
10 #include "cc/animation/animation_host.h" 10 #include "cc/animation/animation_host.h"
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 dest->inputs_.sorting_context_id); 187 dest->inputs_.sorting_context_id);
188 EXPECT_EQ(src->num_descendants_that_draw_content_, 188 EXPECT_EQ(src->num_descendants_that_draw_content_,
189 dest->num_descendants_that_draw_content_); 189 dest->num_descendants_that_draw_content_);
190 EXPECT_EQ(src->inputs_.scroll_clip_layer_id, 190 EXPECT_EQ(src->inputs_.scroll_clip_layer_id,
191 dest->inputs_.scroll_clip_layer_id); 191 dest->inputs_.scroll_clip_layer_id);
192 EXPECT_EQ(src->inputs_.user_scrollable_horizontal, 192 EXPECT_EQ(src->inputs_.user_scrollable_horizontal,
193 dest->inputs_.user_scrollable_horizontal); 193 dest->inputs_.user_scrollable_horizontal);
194 EXPECT_EQ(src->inputs_.user_scrollable_vertical, 194 EXPECT_EQ(src->inputs_.user_scrollable_vertical,
195 dest->inputs_.user_scrollable_vertical); 195 dest->inputs_.user_scrollable_vertical);
196 EXPECT_EQ(src->inputs_.scroll_offset, dest->inputs_.scroll_offset); 196 EXPECT_EQ(src->inputs_.scroll_offset, dest->inputs_.scroll_offset);
197 EXPECT_EQ(src->inputs_.overscroll, dest->inputs_.overscroll);
197 EXPECT_EQ(update_rect, dest->inputs_.update_rect); 198 EXPECT_EQ(update_rect, dest->inputs_.update_rect);
198 199
199 if (src->inputs_.scroll_parent) { 200 if (src->inputs_.scroll_parent) {
200 ASSERT_TRUE(dest->inputs_.scroll_parent); 201 ASSERT_TRUE(dest->inputs_.scroll_parent);
201 EXPECT_EQ(src->inputs_.scroll_parent->id(), 202 EXPECT_EQ(src->inputs_.scroll_parent->id(),
202 dest->inputs_.scroll_parent->id()); 203 dest->inputs_.scroll_parent->id());
203 } else { 204 } else {
204 EXPECT_FALSE(dest->inputs_.scroll_parent); 205 EXPECT_FALSE(dest->inputs_.scroll_parent);
205 } 206 }
206 if (src->scroll_children_) { 207 if (src->scroll_children_) {
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 layer->inputs_.use_parent_backface_visibility = true; 294 layer->inputs_.use_parent_backface_visibility = true;
294 gfx::Transform transform; 295 gfx::Transform transform;
295 transform.Rotate(90); 296 transform.Rotate(90);
296 layer->inputs_.transform = transform; 297 layer->inputs_.transform = transform;
297 layer->inputs_.sorting_context_id = 0; 298 layer->inputs_.sorting_context_id = 0;
298 layer->num_descendants_that_draw_content_ = 5; 299 layer->num_descendants_that_draw_content_ = 5;
299 layer->inputs_.scroll_clip_layer_id = Layer::INVALID_ID; 300 layer->inputs_.scroll_clip_layer_id = Layer::INVALID_ID;
300 layer->inputs_.user_scrollable_horizontal = false; 301 layer->inputs_.user_scrollable_horizontal = false;
301 layer->inputs_.user_scrollable_vertical = true; 302 layer->inputs_.user_scrollable_vertical = true;
302 layer->inputs_.scroll_offset = gfx::ScrollOffset(3, 14); 303 layer->inputs_.scroll_offset = gfx::ScrollOffset(3, 14);
304 layer->inputs_.overscroll = gfx::ScrollOffset(-10, -5);
303 layer->inputs_.update_rect = gfx::Rect(14, 15); 305 layer->inputs_.update_rect = gfx::Rect(14, 15);
304 306
305 VerifyBaseLayerPropertiesSerializationAndDeserialization(layer.get()); 307 VerifyBaseLayerPropertiesSerializationAndDeserialization(layer.get());
306 } 308 }
307 309
308 void RunAllMembersChangedTest() { 310 void RunAllMembersChangedTest() {
309 scoped_refptr<Layer> layer = Layer::Create(); 311 scoped_refptr<Layer> layer = Layer::Create();
310 layer->inputs_.transform_origin = gfx::Point3F(3.0f, 1.0f, 4.0f); 312 layer->inputs_.transform_origin = gfx::Point3F(3.0f, 1.0f, 4.0f);
311 layer->inputs_.background_color = SK_ColorRED; 313 layer->inputs_.background_color = SK_ColorRED;
312 layer->inputs_.bounds = gfx::Size(3, 14); 314 layer->inputs_.bounds = gfx::Size(3, 14);
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
346 transform.Rotate(90); 348 transform.Rotate(90);
347 layer->inputs_.transform = transform; 349 layer->inputs_.transform = transform;
348 layer->inputs_.sorting_context_id = 42; 350 layer->inputs_.sorting_context_id = 42;
349 layer->num_descendants_that_draw_content_ = 5; 351 layer->num_descendants_that_draw_content_ = 5;
350 layer->inputs_.scroll_clip_layer_id = 17; 352 layer->inputs_.scroll_clip_layer_id = 17;
351 layer->inputs_.user_scrollable_horizontal = 353 layer->inputs_.user_scrollable_horizontal =
352 !layer->inputs_.user_scrollable_horizontal; 354 !layer->inputs_.user_scrollable_horizontal;
353 layer->inputs_.user_scrollable_vertical = 355 layer->inputs_.user_scrollable_vertical =
354 !layer->inputs_.user_scrollable_vertical; 356 !layer->inputs_.user_scrollable_vertical;
355 layer->inputs_.scroll_offset = gfx::ScrollOffset(3, 14); 357 layer->inputs_.scroll_offset = gfx::ScrollOffset(3, 14);
358 layer->inputs_.overscroll = gfx::ScrollOffset(-10, -5);
356 layer->inputs_.update_rect = gfx::Rect(14, 15); 359 layer->inputs_.update_rect = gfx::Rect(14, 15);
357 360
358 VerifyBaseLayerPropertiesSerializationAndDeserialization(layer.get()); 361 VerifyBaseLayerPropertiesSerializationAndDeserialization(layer.get());
359 } 362 }
360 363
361 void VerifySolidColorScrollbarLayerAfterSerializationAndDeserialization( 364 void VerifySolidColorScrollbarLayerAfterSerializationAndDeserialization(
362 scoped_refptr<SolidColorScrollbarLayer> source_scrollbar) { 365 scoped_refptr<SolidColorScrollbarLayer> source_scrollbar) {
363 proto::LayerNode serialized_scrollbar_node; 366 proto::LayerNode serialized_scrollbar_node;
364 source_scrollbar->ToLayerNodeProto(&serialized_scrollbar_node); 367 source_scrollbar->ToLayerNodeProto(&serialized_scrollbar_node);
365 368
(...skipping 2108 matching lines...) Expand 10 before | Expand all | Expand 10 after
2474 EXPECT_EQ(MutableProperty::kNone, impl_layer->mutable_properties()); 2477 EXPECT_EQ(MutableProperty::kNone, impl_layer->mutable_properties());
2475 2478
2476 test_layer->PushPropertiesTo(impl_layer.get()); 2479 test_layer->PushPropertiesTo(impl_layer.get());
2477 2480
2478 EXPECT_EQ(ElementId(2, 0), impl_layer->element_id()); 2481 EXPECT_EQ(ElementId(2, 0), impl_layer->element_id());
2479 EXPECT_EQ(MutableProperty::kTransform, impl_layer->mutable_properties()); 2482 EXPECT_EQ(MutableProperty::kTransform, impl_layer->mutable_properties());
2480 } 2483 }
2481 2484
2482 } // namespace 2485 } // namespace
2483 } // namespace cc 2486 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/layer_impl.cc ('k') | cc/proto/begin_main_frame_and_commit_state.proto » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698