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

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

Issue 1680613002: Adding momentum/overscroll to views:: ScrollViews Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Tableview layout. aaaand I think we are done Created 4 years, 4 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/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 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 dest->inputs_.sorting_context_id); 203 dest->inputs_.sorting_context_id);
204 EXPECT_EQ(src->num_descendants_that_draw_content_, 204 EXPECT_EQ(src->num_descendants_that_draw_content_,
205 dest->num_descendants_that_draw_content_); 205 dest->num_descendants_that_draw_content_);
206 EXPECT_EQ(src->inputs_.scroll_clip_layer_id, 206 EXPECT_EQ(src->inputs_.scroll_clip_layer_id,
207 dest->inputs_.scroll_clip_layer_id); 207 dest->inputs_.scroll_clip_layer_id);
208 EXPECT_EQ(src->inputs_.user_scrollable_horizontal, 208 EXPECT_EQ(src->inputs_.user_scrollable_horizontal,
209 dest->inputs_.user_scrollable_horizontal); 209 dest->inputs_.user_scrollable_horizontal);
210 EXPECT_EQ(src->inputs_.user_scrollable_vertical, 210 EXPECT_EQ(src->inputs_.user_scrollable_vertical,
211 dest->inputs_.user_scrollable_vertical); 211 dest->inputs_.user_scrollable_vertical);
212 EXPECT_EQ(src->inputs_.scroll_offset, dest->inputs_.scroll_offset); 212 EXPECT_EQ(src->inputs_.scroll_offset, dest->inputs_.scroll_offset);
213 EXPECT_EQ(src->inputs_.overscroll, dest->inputs_.overscroll);
213 EXPECT_EQ(update_rect, dest->inputs_.update_rect); 214 EXPECT_EQ(update_rect, dest->inputs_.update_rect);
214 215
215 if (src->inputs_.scroll_parent) { 216 if (src->inputs_.scroll_parent) {
216 ASSERT_TRUE(dest->inputs_.scroll_parent); 217 ASSERT_TRUE(dest->inputs_.scroll_parent);
217 EXPECT_EQ(src->inputs_.scroll_parent->id(), 218 EXPECT_EQ(src->inputs_.scroll_parent->id(),
218 dest->inputs_.scroll_parent->id()); 219 dest->inputs_.scroll_parent->id());
219 } else { 220 } else {
220 EXPECT_FALSE(dest->inputs_.scroll_parent); 221 EXPECT_FALSE(dest->inputs_.scroll_parent);
221 } 222 }
222 if (src->scroll_children_) { 223 if (src->scroll_children_) {
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 layer->inputs_.use_parent_backface_visibility = true; 309 layer->inputs_.use_parent_backface_visibility = true;
309 gfx::Transform transform; 310 gfx::Transform transform;
310 transform.Rotate(90); 311 transform.Rotate(90);
311 layer->inputs_.transform = transform; 312 layer->inputs_.transform = transform;
312 layer->inputs_.sorting_context_id = 0; 313 layer->inputs_.sorting_context_id = 0;
313 layer->num_descendants_that_draw_content_ = 5; 314 layer->num_descendants_that_draw_content_ = 5;
314 layer->inputs_.scroll_clip_layer_id = Layer::INVALID_ID; 315 layer->inputs_.scroll_clip_layer_id = Layer::INVALID_ID;
315 layer->inputs_.user_scrollable_horizontal = false; 316 layer->inputs_.user_scrollable_horizontal = false;
316 layer->inputs_.user_scrollable_vertical = true; 317 layer->inputs_.user_scrollable_vertical = true;
317 layer->inputs_.scroll_offset = gfx::ScrollOffset(3, 14); 318 layer->inputs_.scroll_offset = gfx::ScrollOffset(3, 14);
319 layer->inputs_.overscroll = gfx::ScrollOffset(-10, -5);
318 layer->inputs_.update_rect = gfx::Rect(14, 15); 320 layer->inputs_.update_rect = gfx::Rect(14, 15);
319 321
320 VerifyBaseLayerPropertiesSerializationAndDeserialization(layer.get()); 322 VerifyBaseLayerPropertiesSerializationAndDeserialization(layer.get());
321 } 323 }
322 324
323 void RunAllMembersChangedTest() { 325 void RunAllMembersChangedTest() {
324 scoped_refptr<Layer> layer = Layer::Create(); 326 scoped_refptr<Layer> layer = Layer::Create();
325 layer->inputs_.transform_origin = gfx::Point3F(3.0f, 1.0f, 4.0f); 327 layer->inputs_.transform_origin = gfx::Point3F(3.0f, 1.0f, 4.0f);
326 layer->inputs_.background_color = SK_ColorRED; 328 layer->inputs_.background_color = SK_ColorRED;
327 layer->inputs_.bounds = gfx::Size(3, 14); 329 layer->inputs_.bounds = gfx::Size(3, 14);
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 transform.Rotate(90); 362 transform.Rotate(90);
361 layer->inputs_.transform = transform; 363 layer->inputs_.transform = transform;
362 layer->inputs_.sorting_context_id = 42; 364 layer->inputs_.sorting_context_id = 42;
363 layer->num_descendants_that_draw_content_ = 5; 365 layer->num_descendants_that_draw_content_ = 5;
364 layer->inputs_.scroll_clip_layer_id = 17; 366 layer->inputs_.scroll_clip_layer_id = 17;
365 layer->inputs_.user_scrollable_horizontal = 367 layer->inputs_.user_scrollable_horizontal =
366 !layer->inputs_.user_scrollable_horizontal; 368 !layer->inputs_.user_scrollable_horizontal;
367 layer->inputs_.user_scrollable_vertical = 369 layer->inputs_.user_scrollable_vertical =
368 !layer->inputs_.user_scrollable_vertical; 370 !layer->inputs_.user_scrollable_vertical;
369 layer->inputs_.scroll_offset = gfx::ScrollOffset(3, 14); 371 layer->inputs_.scroll_offset = gfx::ScrollOffset(3, 14);
372 layer->inputs_.overscroll = gfx::ScrollOffset(-10, -5);
370 layer->inputs_.update_rect = gfx::Rect(14, 15); 373 layer->inputs_.update_rect = gfx::Rect(14, 15);
371 374
372 VerifyBaseLayerPropertiesSerializationAndDeserialization(layer.get()); 375 VerifyBaseLayerPropertiesSerializationAndDeserialization(layer.get());
373 } 376 }
374 377
375 void VerifySolidColorScrollbarLayerAfterSerializationAndDeserialization( 378 void VerifySolidColorScrollbarLayerAfterSerializationAndDeserialization(
376 scoped_refptr<SolidColorScrollbarLayer> source_scrollbar) { 379 scoped_refptr<SolidColorScrollbarLayer> source_scrollbar) {
377 proto::LayerProperties serialized_scrollbar; 380 proto::LayerProperties serialized_scrollbar;
378 source_scrollbar->LayerSpecificPropertiesToProto(&serialized_scrollbar); 381 source_scrollbar->LayerSpecificPropertiesToProto(&serialized_scrollbar);
379 382
(...skipping 2151 matching lines...) Expand 10 before | Expand all | Expand 10 after
2531 EXPECT_EQ(MutableProperty::kNone, impl_layer->mutable_properties()); 2534 EXPECT_EQ(MutableProperty::kNone, impl_layer->mutable_properties());
2532 2535
2533 test_layer->PushPropertiesTo(impl_layer.get()); 2536 test_layer->PushPropertiesTo(impl_layer.get());
2534 2537
2535 EXPECT_EQ(ElementId(2, 0), impl_layer->element_id()); 2538 EXPECT_EQ(ElementId(2, 0), impl_layer->element_id());
2536 EXPECT_EQ(MutableProperty::kTransform, impl_layer->mutable_properties()); 2539 EXPECT_EQ(MutableProperty::kTransform, impl_layer->mutable_properties());
2537 } 2540 }
2538 2541
2539 } // namespace 2542 } // namespace
2540 } // namespace cc 2543 } // 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