| OLD | NEW |
| 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 "config.h" | 5 #include "config.h" |
| 6 | 6 |
| 7 #include "cc/layer_impl.h" | 7 #include "cc/layer_impl.h" |
| 8 | 8 |
| 9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
| 10 #include "base/stringprintf.h" | 10 #include "base/stringprintf.h" |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 return unscrolled; | 191 return unscrolled; |
| 192 | 192 |
| 193 m_scrollDelta = newDelta; | 193 m_scrollDelta = newDelta; |
| 194 if (m_scrollbarAnimationController) | 194 if (m_scrollbarAnimationController) |
| 195 m_scrollbarAnimationController->updateScrollOffset(this); | 195 m_scrollbarAnimationController->updateScrollOffset(this); |
| 196 noteLayerPropertyChangedForSubtree(); | 196 noteLayerPropertyChangedForSubtree(); |
| 197 | 197 |
| 198 return unscrolled; | 198 return unscrolled; |
| 199 } | 199 } |
| 200 | 200 |
| 201 InputHandlerClient::ScrollStatus LayerImpl::tryScroll(const gfx::Point& screenSp
acePoint, InputHandlerClient::ScrollInputType type) const | 201 InputHandlerClient::ScrollStatus LayerImpl::tryScroll(const gfx::PointF& screenS
pacePoint, InputHandlerClient::ScrollInputType type) const |
| 202 { | 202 { |
| 203 if (shouldScrollOnMainThread()) { | 203 if (shouldScrollOnMainThread()) { |
| 204 TRACE_EVENT0("cc", "LayerImpl::tryScroll: Failed shouldScrollOnMainThrea
d"); | 204 TRACE_EVENT0("cc", "LayerImpl::tryScroll: Failed shouldScrollOnMainThrea
d"); |
| 205 return InputHandlerClient::ScrollOnMainThread; | 205 return InputHandlerClient::ScrollOnMainThread; |
| 206 } | 206 } |
| 207 | 207 |
| 208 if (!screenSpaceTransform().isInvertible()) { | 208 if (!screenSpaceTransform().isInvertible()) { |
| 209 TRACE_EVENT0("cc", "LayerImpl::tryScroll: Ignored nonInvertibleTransform
"); | 209 TRACE_EVENT0("cc", "LayerImpl::tryScroll: Ignored nonInvertibleTransform
"); |
| 210 return InputHandlerClient::ScrollIgnored; | 210 return InputHandlerClient::ScrollIgnored; |
| 211 } | 211 } |
| 212 | 212 |
| 213 if (!nonFastScrollableRegion().IsEmpty()) { | 213 if (!nonFastScrollableRegion().IsEmpty()) { |
| 214 bool clipped = false; | 214 bool clipped = false; |
| 215 gfx::PointF hitTestPointInLocalSpace = MathUtil::projectPoint(screenSpac
eTransform().inverse(), gfx::PointF(screenSpacePoint), clipped); | 215 gfx::PointF hitTestPointInLocalSpace = MathUtil::projectPoint(screenSpac
eTransform().inverse(), screenSpacePoint, clipped); |
| 216 if (!clipped && nonFastScrollableRegion().Contains(gfx::ToFlooredPoint(h
itTestPointInLocalSpace))) { | 216 if (!clipped && nonFastScrollableRegion().Contains(gfx::ToFlooredPoint(h
itTestPointInLocalSpace))) { |
| 217 TRACE_EVENT0("cc", "LayerImpl::tryScroll: Failed nonFastScrollableRe
gion"); | 217 TRACE_EVENT0("cc", "LayerImpl::tryScroll: Failed nonFastScrollableRe
gion"); |
| 218 return InputHandlerClient::ScrollOnMainThread; | 218 return InputHandlerClient::ScrollOnMainThread; |
| 219 } | 219 } |
| 220 } | 220 } |
| 221 | 221 |
| 222 if (type == InputHandlerClient::Wheel && haveWheelEventHandlers()) { | 222 if (type == InputHandlerClient::Wheel && haveWheelEventHandlers()) { |
| 223 TRACE_EVENT0("cc", "LayerImpl::tryScroll: Failed wheelEventHandlers"); | 223 TRACE_EVENT0("cc", "LayerImpl::tryScroll: Failed wheelEventHandlers"); |
| 224 return InputHandlerClient::ScrollOnMainThread; | 224 return InputHandlerClient::ScrollOnMainThread; |
| 225 } | 225 } |
| (...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 699 | 699 |
| 700 void LayerImpl::setVerticalScrollbarLayer(ScrollbarLayerImpl* scrollbarLayer) | 700 void LayerImpl::setVerticalScrollbarLayer(ScrollbarLayerImpl* scrollbarLayer) |
| 701 { | 701 { |
| 702 if (!m_scrollbarAnimationController) | 702 if (!m_scrollbarAnimationController) |
| 703 m_scrollbarAnimationController = ScrollbarAnimationController::create(th
is); | 703 m_scrollbarAnimationController = ScrollbarAnimationController::create(th
is); |
| 704 m_scrollbarAnimationController->setVerticalScrollbarLayer(scrollbarLayer); | 704 m_scrollbarAnimationController->setVerticalScrollbarLayer(scrollbarLayer); |
| 705 m_scrollbarAnimationController->updateScrollOffset(this); | 705 m_scrollbarAnimationController->updateScrollOffset(this); |
| 706 } | 706 } |
| 707 | 707 |
| 708 } | 708 } |
| OLD | NEW |