Chromium Code Reviews| 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/debug_border_draw_quad.h" | 10 #include "cc/debug_border_draw_quad.h" |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 229 return InputHandlerClient::ScrollOnMainThread; | 229 return InputHandlerClient::ScrollOnMainThread; |
| 230 } | 230 } |
| 231 | 231 |
| 232 if (!screenSpaceTransform().IsInvertible()) { | 232 if (!screenSpaceTransform().IsInvertible()) { |
| 233 TRACE_EVENT0("cc", "LayerImpl::tryScroll: Ignored nonInvertibleTransform "); | 233 TRACE_EVENT0("cc", "LayerImpl::tryScroll: Ignored nonInvertibleTransform "); |
| 234 return InputHandlerClient::ScrollIgnored; | 234 return InputHandlerClient::ScrollIgnored; |
| 235 } | 235 } |
| 236 | 236 |
| 237 if (!nonFastScrollableRegion().IsEmpty()) { | 237 if (!nonFastScrollableRegion().IsEmpty()) { |
| 238 bool clipped = false; | 238 bool clipped = false; |
| 239 gfx::PointF hitTestPointInContentSpace = MathUtil::projectPoint(MathUtil ::inverse(screenSpaceTransform()), screenSpacePoint, clipped); | 239 gfx::Transform inverseScreenSpaceTransform(gfx::Transform::kSkipInitiali zation); |
| 240 screenSpaceTransform().GetInverse(&inverseScreenSpaceTransform); | |
|
danakj
2012/12/19 05:23:06
If GetInverse() returns false, seems like we shoul
| |
| 241 gfx::PointF hitTestPointInContentSpace = MathUtil::projectPoint(inverseS creenSpaceTransform, screenSpacePoint, clipped); | |
| 240 gfx::PointF hitTestPointInLayerSpace = gfx::ScalePoint(hitTestPointInCon tentSpace, 1 / contentsScaleX(), 1 / contentsScaleY()); | 242 gfx::PointF hitTestPointInLayerSpace = gfx::ScalePoint(hitTestPointInCon tentSpace, 1 / contentsScaleX(), 1 / contentsScaleY()); |
| 241 if (!clipped && nonFastScrollableRegion().Contains(gfx::ToRoundedPoint(h itTestPointInLayerSpace))) { | 243 if (!clipped && nonFastScrollableRegion().Contains(gfx::ToRoundedPoint(h itTestPointInLayerSpace))) { |
| 242 TRACE_EVENT0("cc", "LayerImpl::tryScroll: Failed nonFastScrollableRe gion"); | 244 TRACE_EVENT0("cc", "LayerImpl::tryScroll: Failed nonFastScrollableRe gion"); |
| 243 return InputHandlerClient::ScrollOnMainThread; | 245 return InputHandlerClient::ScrollOnMainThread; |
| 244 } | 246 } |
| 245 } | 247 } |
| 246 | 248 |
| 247 if (type == InputHandlerClient::Wheel && haveWheelEventHandlers()) { | 249 if (type == InputHandlerClient::Wheel && haveWheelEventHandlers()) { |
| 248 TRACE_EVENT0("cc", "LayerImpl::tryScroll: Failed wheelEventHandlers"); | 250 TRACE_EVENT0("cc", "LayerImpl::tryScroll: Failed wheelEventHandlers"); |
| 249 return InputHandlerClient::ScrollOnMainThread; | 251 return InputHandlerClient::ScrollOnMainThread; |
| (...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 782 | 784 |
| 783 void LayerImpl::setVerticalScrollbarLayer(ScrollbarLayerImpl* scrollbarLayer) | 785 void LayerImpl::setVerticalScrollbarLayer(ScrollbarLayerImpl* scrollbarLayer) |
| 784 { | 786 { |
| 785 if (!m_scrollbarAnimationController) | 787 if (!m_scrollbarAnimationController) |
| 786 m_scrollbarAnimationController = ScrollbarAnimationController::create(th is); | 788 m_scrollbarAnimationController = ScrollbarAnimationController::create(th is); |
| 787 m_scrollbarAnimationController->setVerticalScrollbarLayer(scrollbarLayer); | 789 m_scrollbarAnimationController->setVerticalScrollbarLayer(scrollbarLayer); |
| 788 m_scrollbarAnimationController->updateScrollOffset(this); | 790 m_scrollbarAnimationController->updateScrollOffset(this); |
| 789 } | 791 } |
| 790 | 792 |
| 791 } // namespace cc | 793 } // namespace cc |
| OLD | NEW |