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

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

Issue 1646603004: Move scroll event handlers from layer to layer tree view. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master_cc_listeners
Patch Set: Rebase Created 4 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/layer_impl.cc ('k') | cc/proto/layer_tree_host.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/thread_task_runner_handle.h" 9 #include "base/thread_task_runner_handle.h"
10 #include "cc/animation/animation_host.h" 10 #include "cc/animation/animation_host.h"
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 EXPECT_EQ(src->clip_tree_index_, dest->clip_tree_index_); 127 EXPECT_EQ(src->clip_tree_index_, dest->clip_tree_index_);
128 EXPECT_EQ(src->offset_to_transform_parent_, 128 EXPECT_EQ(src->offset_to_transform_parent_,
129 dest->offset_to_transform_parent_); 129 dest->offset_to_transform_parent_);
130 EXPECT_EQ(src->double_sided_, dest->double_sided_); 130 EXPECT_EQ(src->double_sided_, dest->double_sided_);
131 EXPECT_EQ(src->draws_content_, dest->draws_content_); 131 EXPECT_EQ(src->draws_content_, dest->draws_content_);
132 EXPECT_EQ(src->hide_layer_and_subtree_, dest->hide_layer_and_subtree_); 132 EXPECT_EQ(src->hide_layer_and_subtree_, dest->hide_layer_and_subtree_);
133 EXPECT_EQ(src->has_render_surface_, dest->has_render_surface_); 133 EXPECT_EQ(src->has_render_surface_, dest->has_render_surface_);
134 EXPECT_EQ(src->masks_to_bounds_, dest->masks_to_bounds_); 134 EXPECT_EQ(src->masks_to_bounds_, dest->masks_to_bounds_);
135 EXPECT_EQ(src->main_thread_scrolling_reasons_, 135 EXPECT_EQ(src->main_thread_scrolling_reasons_,
136 dest->main_thread_scrolling_reasons_); 136 dest->main_thread_scrolling_reasons_);
137 EXPECT_EQ(src->have_scroll_event_handlers_,
138 dest->have_scroll_event_handlers_);
139 EXPECT_EQ(src->non_fast_scrollable_region_, 137 EXPECT_EQ(src->non_fast_scrollable_region_,
140 dest->non_fast_scrollable_region_); 138 dest->non_fast_scrollable_region_);
141 EXPECT_EQ(src->touch_event_handler_region_, 139 EXPECT_EQ(src->touch_event_handler_region_,
142 dest->touch_event_handler_region_); 140 dest->touch_event_handler_region_);
143 EXPECT_EQ(src->contents_opaque_, dest->contents_opaque_); 141 EXPECT_EQ(src->contents_opaque_, dest->contents_opaque_);
144 EXPECT_EQ(src->opacity_, dest->opacity_); 142 EXPECT_EQ(src->opacity_, dest->opacity_);
145 EXPECT_EQ(src->blend_mode_, dest->blend_mode_); 143 EXPECT_EQ(src->blend_mode_, dest->blend_mode_);
146 EXPECT_EQ(src->is_root_for_isolated_group_, 144 EXPECT_EQ(src->is_root_for_isolated_group_,
147 dest->is_root_for_isolated_group_); 145 dest->is_root_for_isolated_group_);
148 EXPECT_EQ(src->position_, dest->position_); 146 EXPECT_EQ(src->position_, dest->position_);
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 layer->effect_tree_index_ = -1; 240 layer->effect_tree_index_ = -1;
243 layer->clip_tree_index_ = 71; 241 layer->clip_tree_index_ = 71;
244 layer->offset_to_transform_parent_ = gfx::Vector2dF(3.14f, 1.618f); 242 layer->offset_to_transform_parent_ = gfx::Vector2dF(3.14f, 1.618f);
245 layer->double_sided_ = true; 243 layer->double_sided_ = true;
246 layer->draws_content_ = true; 244 layer->draws_content_ = true;
247 layer->hide_layer_and_subtree_ = false; 245 layer->hide_layer_and_subtree_ = false;
248 layer->has_render_surface_ = false; 246 layer->has_render_surface_ = false;
249 layer->masks_to_bounds_ = true; 247 layer->masks_to_bounds_ = true;
250 layer->main_thread_scrolling_reasons_ = 248 layer->main_thread_scrolling_reasons_ =
251 MainThreadScrollingReason::kNotScrollingOnMain; 249 MainThreadScrollingReason::kNotScrollingOnMain;
252 layer->have_scroll_event_handlers_ = false;
253 layer->non_fast_scrollable_region_ = Region(gfx::Rect(5, 1, 14, 3)); 250 layer->non_fast_scrollable_region_ = Region(gfx::Rect(5, 1, 14, 3));
254 layer->touch_event_handler_region_ = Region(gfx::Rect(3, 14, 1, 5)); 251 layer->touch_event_handler_region_ = Region(gfx::Rect(3, 14, 1, 5));
255 layer->contents_opaque_ = true; 252 layer->contents_opaque_ = true;
256 layer->opacity_ = 1.f; 253 layer->opacity_ = 1.f;
257 layer->blend_mode_ = SkXfermode::kSrcOver_Mode; 254 layer->blend_mode_ = SkXfermode::kSrcOver_Mode;
258 layer->is_root_for_isolated_group_ = true; 255 layer->is_root_for_isolated_group_ = true;
259 layer->position_ = gfx::PointF(3.14f, 6.28f); 256 layer->position_ = gfx::PointF(3.14f, 6.28f);
260 layer->is_container_for_fixed_position_layers_ = true; 257 layer->is_container_for_fixed_position_layers_ = true;
261 LayerPositionConstraint pos_con; 258 LayerPositionConstraint pos_con;
262 pos_con.set_is_fixed_to_bottom_edge(true); 259 pos_con.set_is_fixed_to_bottom_edge(true);
(...skipping 28 matching lines...) Expand all
291 layer->effect_tree_index_ = 17; 288 layer->effect_tree_index_ = 17;
292 layer->clip_tree_index_ = 71; 289 layer->clip_tree_index_ = 71;
293 layer->offset_to_transform_parent_ = gfx::Vector2dF(3.14f, 1.618f); 290 layer->offset_to_transform_parent_ = gfx::Vector2dF(3.14f, 1.618f);
294 layer->double_sided_ = !layer->double_sided_; 291 layer->double_sided_ = !layer->double_sided_;
295 layer->draws_content_ = !layer->draws_content_; 292 layer->draws_content_ = !layer->draws_content_;
296 layer->hide_layer_and_subtree_ = !layer->hide_layer_and_subtree_; 293 layer->hide_layer_and_subtree_ = !layer->hide_layer_and_subtree_;
297 layer->has_render_surface_ = !layer->has_render_surface_; 294 layer->has_render_surface_ = !layer->has_render_surface_;
298 layer->masks_to_bounds_ = !layer->masks_to_bounds_; 295 layer->masks_to_bounds_ = !layer->masks_to_bounds_;
299 layer->main_thread_scrolling_reasons_ = 296 layer->main_thread_scrolling_reasons_ =
300 MainThreadScrollingReason::kHasBackgroundAttachmentFixedObjects; 297 MainThreadScrollingReason::kHasBackgroundAttachmentFixedObjects;
301 layer->have_scroll_event_handlers_ = !layer->have_scroll_event_handlers_;
302 layer->non_fast_scrollable_region_ = Region(gfx::Rect(5, 1, 14, 3)); 298 layer->non_fast_scrollable_region_ = Region(gfx::Rect(5, 1, 14, 3));
303 layer->touch_event_handler_region_ = Region(gfx::Rect(3, 14, 1, 5)); 299 layer->touch_event_handler_region_ = Region(gfx::Rect(3, 14, 1, 5));
304 layer->contents_opaque_ = !layer->contents_opaque_; 300 layer->contents_opaque_ = !layer->contents_opaque_;
305 layer->opacity_ = 3.14f; 301 layer->opacity_ = 3.14f;
306 layer->blend_mode_ = SkXfermode::kSrcIn_Mode; 302 layer->blend_mode_ = SkXfermode::kSrcIn_Mode;
307 layer->is_root_for_isolated_group_ = !layer->is_root_for_isolated_group_; 303 layer->is_root_for_isolated_group_ = !layer->is_root_for_isolated_group_;
308 layer->position_ = gfx::PointF(3.14f, 6.28f); 304 layer->position_ = gfx::PointF(3.14f, 6.28f);
309 layer->is_container_for_fixed_position_layers_ = 305 layer->is_container_for_fixed_position_layers_ =
310 !layer->is_container_for_fixed_position_layers_; 306 !layer->is_container_for_fixed_position_layers_;
311 LayerPositionConstraint pos_con; 307 LayerPositionConstraint pos_con;
(...skipping 647 matching lines...) Expand 10 before | Expand all | Expand 10 after
959 // We can use any layer pointer here since we aren't syncing for real. 955 // We can use any layer pointer here since we aren't syncing for real.
960 EXPECT_SET_NEEDS_COMMIT(1, 956 EXPECT_SET_NEEDS_COMMIT(1,
961 test_layer->SetScrollClipLayerId(test_layer->id())); 957 test_layer->SetScrollClipLayerId(test_layer->id()));
962 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetUserScrollable(true, false)); 958 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetUserScrollable(true, false));
963 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetScrollOffset( 959 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetScrollOffset(
964 gfx::ScrollOffset(10, 10))); 960 gfx::ScrollOffset(10, 10)));
965 EXPECT_SET_NEEDS_COMMIT(1, test_layer->AddMainThreadScrollingReasons( 961 EXPECT_SET_NEEDS_COMMIT(1, test_layer->AddMainThreadScrollingReasons(
966 MainThreadScrollingReason::kEventHandlers)); 962 MainThreadScrollingReason::kEventHandlers));
967 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetNonFastScrollableRegion( 963 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetNonFastScrollableRegion(
968 Region(gfx::Rect(1, 1, 2, 2)))); 964 Region(gfx::Rect(1, 1, 2, 2))));
969 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetHaveScrollEventHandlers(true));
970 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetTransform( 965 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetTransform(
971 gfx::Transform(0.0, 0.0, 0.0, 0.0, 0.0, 0.0))); 966 gfx::Transform(0.0, 0.0, 0.0, 0.0, 0.0, 0.0)));
972 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetDoubleSided(false)); 967 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetDoubleSided(false));
973 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetTouchEventHandlerRegion( 968 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetTouchEventHandlerRegion(
974 gfx::Rect(10, 10))); 969 gfx::Rect(10, 10)));
975 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetForceRenderSurface(true)); 970 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetForceRenderSurface(true));
976 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetHideLayerAndSubtree(true)); 971 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetHideLayerAndSubtree(true));
977 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetElementId(2)); 972 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetElementId(2));
978 EXPECT_SET_NEEDS_COMMIT( 973 EXPECT_SET_NEEDS_COMMIT(
979 1, test_layer->SetMutableProperties(MutableProperty::kTransform)); 974 1, test_layer->SetMutableProperties(MutableProperty::kTransform));
(...skipping 1143 matching lines...) Expand 10 before | Expand all | Expand 10 after
2123 EXPECT_EQ(MutableProperty::kNone, impl_layer->mutable_properties()); 2118 EXPECT_EQ(MutableProperty::kNone, impl_layer->mutable_properties());
2124 2119
2125 test_layer->PushPropertiesTo(impl_layer.get()); 2120 test_layer->PushPropertiesTo(impl_layer.get());
2126 2121
2127 EXPECT_EQ(2lu, impl_layer->element_id()); 2122 EXPECT_EQ(2lu, impl_layer->element_id());
2128 EXPECT_EQ(MutableProperty::kTransform, impl_layer->mutable_properties()); 2123 EXPECT_EQ(MutableProperty::kTransform, impl_layer->mutable_properties());
2129 } 2124 }
2130 2125
2131 } // namespace 2126 } // namespace
2132 } // namespace cc 2127 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/layer_impl.cc ('k') | cc/proto/layer_tree_host.proto » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698