Chromium Code Reviews| Index: cc/trees/layer_tree_host_impl.cc |
| diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc |
| index ec89ddcfd734a055a9cdc9fa4dd9bc60bc870f99..d6e35a2dda279d5b00f1eca514ad7a40799bf4bd 100644 |
| --- a/cc/trees/layer_tree_host_impl.cc |
| +++ b/cc/trees/layer_tree_host_impl.cc |
| @@ -2491,6 +2491,9 @@ bool LayerTreeHostImpl::HandleMouseOverScrollbar(LayerImpl* layer_impl, |
| } |
| void LayerTreeHostImpl::PinchGestureBegin() { |
| + if (!InnerViewportScrollLayer()) |
|
wjmaclean
2014/02/18 21:16:59
Do we really need early outs in PinchGestureBegin(
bokan
2014/02/18 22:12:11
I think it's safer/cleaner not to have any side ef
|
| + return; |
| + |
| pinch_gesture_active_ = true; |
| previous_pinch_anchor_ = gfx::Point(); |
| client_->RenewTreePriority(); |
| @@ -2508,9 +2511,10 @@ void LayerTreeHostImpl::PinchGestureBegin() { |
| void LayerTreeHostImpl::PinchGestureUpdate(float magnify_delta, |
| gfx::Point anchor) { |
| - TRACE_EVENT0("cc", "LayerTreeHostImpl::PinchGestureUpdate"); |
| + if (!InnerViewportScrollLayer()) |
| + return; |
| - DCHECK(InnerViewportScrollLayer()); |
| + TRACE_EVENT0("cc", "LayerTreeHostImpl::PinchGestureUpdate"); |
| // Keep the center-of-pinch anchor specified by (x, y) in a stable |
| // position over the course of the magnify. |
| @@ -2551,6 +2555,9 @@ void LayerTreeHostImpl::PinchGestureUpdate(float magnify_delta, |
| } |
| void LayerTreeHostImpl::PinchGestureEnd() { |
| + if (!InnerViewportScrollLayer()) |
| + return; |
| + |
| pinch_gesture_active_ = false; |
| if (pinch_gesture_end_should_clear_scrolling_layer_) { |
| pinch_gesture_end_should_clear_scrolling_layer_ = false; |