| Index: cc/layers/layer.cc
|
| diff --git a/cc/layers/layer.cc b/cc/layers/layer.cc
|
| index 2519daa55636f354fdef38a564a7d21d0b868dcf..7b4bc7ce3923c243be49774edb44c6fb494087a3 100644
|
| --- a/cc/layers/layer.cc
|
| +++ b/cc/layers/layer.cc
|
| @@ -70,7 +70,6 @@ Layer::Layer(const LayerSettings& settings)
|
| main_thread_scrolling_reasons_(
|
| MainThreadScrollingReason::kNotScrollingOnMain),
|
| should_flatten_transform_from_property_tree_(false),
|
| - have_wheel_event_handlers_(false),
|
| have_scroll_event_handlers_(false),
|
| user_scrollable_horizontal_(true),
|
| user_scrollable_vertical_(true),
|
| @@ -88,6 +87,8 @@ Layer::Layer(const LayerSettings& settings)
|
| transform_is_invertible_(true),
|
| has_render_surface_(false),
|
| scroll_blocks_on_(SCROLL_BLOCKS_ON_NONE),
|
| + touch_event_properties_(EventListenerProperties::kNone),
|
| + wheel_event_properties_(EventListenerProperties::kNone),
|
| background_color_(0),
|
| opacity_(1.f),
|
| blend_mode_(SkXfermode::kSrcOver_Mode),
|
| @@ -968,12 +969,21 @@ void Layer::ClearMainThreadScrollingReasons() {
|
| SetNeedsCommit();
|
| }
|
|
|
| -void Layer::SetHaveWheelEventHandlers(bool have_wheel_event_handlers) {
|
| +void Layer::SetTouchEventProperties(uint32_t touch_event_properties) {
|
| DCHECK(IsPropertyChangeAllowed());
|
| - if (have_wheel_event_handlers_ == have_wheel_event_handlers)
|
| + if (touch_event_properties_ == touch_event_properties)
|
| return;
|
|
|
| - have_wheel_event_handlers_ = have_wheel_event_handlers;
|
| + touch_event_properties_ = touch_event_properties;
|
| + SetNeedsCommit();
|
| +}
|
| +
|
| +void Layer::SetWheelEventProperties(uint32_t wheel_event_properties) {
|
| + DCHECK(IsPropertyChangeAllowed());
|
| + if (wheel_event_properties_ == wheel_event_properties)
|
| + return;
|
| +
|
| + wheel_event_properties_ = wheel_event_properties;
|
| SetNeedsCommit();
|
| }
|
|
|
| @@ -1210,7 +1220,8 @@ void Layer::PushPropertiesTo(LayerImpl* layer) {
|
| layer->SetBackgroundFilters(background_filters());
|
| layer->SetMasksToBounds(masks_to_bounds_);
|
| layer->set_main_thread_scrolling_reasons(main_thread_scrolling_reasons_);
|
| - layer->SetHaveWheelEventHandlers(have_wheel_event_handlers_);
|
| + layer->SetTouchEventProperties(touch_event_properties_);
|
| + layer->SetWheelEventProperties(wheel_event_properties_);
|
| layer->SetHaveScrollEventHandlers(have_scroll_event_handlers_);
|
| layer->SetNonFastScrollableRegion(non_fast_scrollable_region_);
|
| layer->SetTouchEventHandlerRegion(touch_event_handler_region_);
|
| @@ -1481,7 +1492,10 @@ void Layer::LayerSpecificPropertiesToProto(proto::LayerProperties* proto) {
|
|
|
| base->set_masks_to_bounds(masks_to_bounds_);
|
| base->set_main_thread_scrolling_reasons(main_thread_scrolling_reasons_);
|
| - base->set_have_wheel_event_handlers(have_wheel_event_handlers_);
|
| + base->set_touch_event_properties(
|
| + static_cast<int32_t>(touch_event_properties_));
|
| + base->set_wheel_event_properties(
|
| + static_cast<int32_t>(wheel_event_properties_));
|
| base->set_have_scroll_event_handlers(have_scroll_event_handlers_);
|
| RegionToProto(non_fast_scrollable_region_,
|
| base->mutable_non_fast_scrollable_region());
|
| @@ -1567,7 +1581,8 @@ void Layer::FromLayerSpecificPropertiesProto(
|
| has_render_surface_ = base.has_render_surface();
|
| masks_to_bounds_ = base.masks_to_bounds();
|
| main_thread_scrolling_reasons_ = base.main_thread_scrolling_reasons();
|
| - have_wheel_event_handlers_ = base.have_wheel_event_handlers();
|
| + touch_event_properties_ = base.touch_event_properties();
|
| + wheel_event_properties_ = base.wheel_event_properties();
|
| have_scroll_event_handlers_ = base.have_scroll_event_handlers();
|
| non_fast_scrollable_region_ =
|
| RegionFromProto(base.non_fast_scrollable_region());
|
|
|