| 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 "cc/layer_impl.h" | 5 #include "cc/layer_impl.h" |
| 6 | 6 |
| 7 #include "base/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
| 8 #include "base/stringprintf.h" | 8 #include "base/stringprintf.h" |
| 9 #include "base/values.h" | 9 #include "base/values.h" |
| 10 #include "cc/animation_registrar.h" | 10 #include "cc/animation_registrar.h" |
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 return InputHandlerClient::ScrollOnMainThread; | 238 return InputHandlerClient::ScrollOnMainThread; |
| 239 } | 239 } |
| 240 | 240 |
| 241 if (!screenSpaceTransform().IsInvertible()) { | 241 if (!screenSpaceTransform().IsInvertible()) { |
| 242 TRACE_EVENT0("cc", "LayerImpl::tryScroll: Ignored nonInvertibleTransform
"); | 242 TRACE_EVENT0("cc", "LayerImpl::tryScroll: Ignored nonInvertibleTransform
"); |
| 243 return InputHandlerClient::ScrollIgnored; | 243 return InputHandlerClient::ScrollIgnored; |
| 244 } | 244 } |
| 245 | 245 |
| 246 if (!nonFastScrollableRegion().IsEmpty()) { | 246 if (!nonFastScrollableRegion().IsEmpty()) { |
| 247 bool clipped = false; | 247 bool clipped = false; |
| 248 gfx::PointF hitTestPointInContentSpace = MathUtil::projectPoint(MathUtil
::inverse(screenSpaceTransform()), screenSpacePoint, clipped); | 248 gfx::Transform inverseScreenSpaceTransform(gfx::Transform::kSkipInitiali
zation); |
| 249 if (!screenSpaceTransform().GetInverse(&inverseScreenSpaceTransform)) { |
| 250 // TODO(shawnsingh): We shouldn't be applying a projection if screen
space |
| 251 // transform is uninvertible here. Perhaps we should be returning |
| 252 // ScrollOnMainThread in this case? |
| 253 } |
| 254 |
| 255 gfx::PointF hitTestPointInContentSpace = MathUtil::projectPoint(inverseS
creenSpaceTransform, screenSpacePoint, clipped); |
| 249 gfx::PointF hitTestPointInLayerSpace = gfx::ScalePoint(hitTestPointInCon
tentSpace, 1 / contentsScaleX(), 1 / contentsScaleY()); | 256 gfx::PointF hitTestPointInLayerSpace = gfx::ScalePoint(hitTestPointInCon
tentSpace, 1 / contentsScaleX(), 1 / contentsScaleY()); |
| 250 if (!clipped && nonFastScrollableRegion().Contains(gfx::ToRoundedPoint(h
itTestPointInLayerSpace))) { | 257 if (!clipped && nonFastScrollableRegion().Contains(gfx::ToRoundedPoint(h
itTestPointInLayerSpace))) { |
| 251 TRACE_EVENT0("cc", "LayerImpl::tryScroll: Failed nonFastScrollableRe
gion"); | 258 TRACE_EVENT0("cc", "LayerImpl::tryScroll: Failed nonFastScrollableRe
gion"); |
| 252 return InputHandlerClient::ScrollOnMainThread; | 259 return InputHandlerClient::ScrollOnMainThread; |
| 253 } | 260 } |
| 254 } | 261 } |
| 255 | 262 |
| 256 if (type == InputHandlerClient::Wheel && haveWheelEventHandlers()) { | 263 if (type == InputHandlerClient::Wheel && haveWheelEventHandlers()) { |
| 257 TRACE_EVENT0("cc", "LayerImpl::tryScroll: Failed wheelEventHandlers"); | 264 TRACE_EVENT0("cc", "LayerImpl::tryScroll: Failed wheelEventHandlers"); |
| 258 return InputHandlerClient::ScrollOnMainThread; | 265 return InputHandlerClient::ScrollOnMainThread; |
| (...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 822 if (m_layerTreeImpl->settings().useLinearFadeScrollbarAnimator) | 829 if (m_layerTreeImpl->settings().useLinearFadeScrollbarAnimator) |
| 823 m_scrollbarAnimationController = createScrollbarAnimationControllerW
ithFade(this); | 830 m_scrollbarAnimationController = createScrollbarAnimationControllerW
ithFade(this); |
| 824 else | 831 else |
| 825 m_scrollbarAnimationController = ScrollbarAnimationController::creat
e(this); | 832 m_scrollbarAnimationController = ScrollbarAnimationController::creat
e(this); |
| 826 } | 833 } |
| 827 m_scrollbarAnimationController->setVerticalScrollbarLayer(scrollbarLayer); | 834 m_scrollbarAnimationController->setVerticalScrollbarLayer(scrollbarLayer); |
| 828 m_scrollbarAnimationController->updateScrollOffset(this); | 835 m_scrollbarAnimationController->updateScrollOffset(this); |
| 829 } | 836 } |
| 830 | 837 |
| 831 } // namespace cc | 838 } // namespace cc |
| OLD | NEW |