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 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
208 return InputHandlerClient::ScrollOnMainThread; | 208 return InputHandlerClient::ScrollOnMainThread; |
209 } | 209 } |
210 | 210 |
211 if (!screenSpaceTransform().isInvertible()) { | 211 if (!screenSpaceTransform().isInvertible()) { |
212 TRACE_EVENT0("cc", "LayerImpl::tryScroll: Ignored nonInvertibleTransform "); | 212 TRACE_EVENT0("cc", "LayerImpl::tryScroll: Ignored nonInvertibleTransform "); |
213 return InputHandlerClient::ScrollIgnored; | 213 return InputHandlerClient::ScrollIgnored; |
214 } | 214 } |
215 | 215 |
216 if (!nonFastScrollableRegion().IsEmpty()) { | 216 if (!nonFastScrollableRegion().IsEmpty()) { |
217 bool clipped = false; | 217 bool clipped = false; |
218 gfx::PointF hitTestPointInLocalSpace = MathUtil::projectPoint(screenSpac eTransform().inverse(), screenSpacePoint, clipped); | 218 gfx::PointF hitTestPointInContentSpace = MathUtil::projectPoint(screenSp aceTransform().inverse(), screenSpacePoint, clipped); |
219 if (!clipped && nonFastScrollableRegion().Contains(gfx::ToFlooredPoint(h itTestPointInLocalSpace))) { | 219 gfx::PointF hitTestPointInLayerSpace = hitTestPointInContentSpace.Scale( 1 / contentsScaleX(), 1 / contentsScaleY()); |
220 if (!clipped && nonFastScrollableRegion().Contains(gfx::ToFlooredPoint(h itTestPointInLayerSpace))) { | |
enne (OOO)
2012/11/06 23:18:58
Can you convince me about the use of ToFlooredPoin
danakj
2012/11/06 23:21:57
I think I did ToFloored because I wanted no behavi
danakj
2012/11/06 23:22:27
Done.
| |
220 TRACE_EVENT0("cc", "LayerImpl::tryScroll: Failed nonFastScrollableRe gion"); | 221 TRACE_EVENT0("cc", "LayerImpl::tryScroll: Failed nonFastScrollableRe gion"); |
221 return InputHandlerClient::ScrollOnMainThread; | 222 return InputHandlerClient::ScrollOnMainThread; |
222 } | 223 } |
223 } | 224 } |
224 | 225 |
225 if (type == InputHandlerClient::Wheel && haveWheelEventHandlers()) { | 226 if (type == InputHandlerClient::Wheel && haveWheelEventHandlers()) { |
226 TRACE_EVENT0("cc", "LayerImpl::tryScroll: Failed wheelEventHandlers"); | 227 TRACE_EVENT0("cc", "LayerImpl::tryScroll: Failed wheelEventHandlers"); |
227 return InputHandlerClient::ScrollOnMainThread; | 228 return InputHandlerClient::ScrollOnMainThread; |
228 } | 229 } |
229 | 230 |
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
702 | 703 |
703 void LayerImpl::setVerticalScrollbarLayer(ScrollbarLayerImpl* scrollbarLayer) | 704 void LayerImpl::setVerticalScrollbarLayer(ScrollbarLayerImpl* scrollbarLayer) |
704 { | 705 { |
705 if (!m_scrollbarAnimationController) | 706 if (!m_scrollbarAnimationController) |
706 m_scrollbarAnimationController = ScrollbarAnimationController::create(th is); | 707 m_scrollbarAnimationController = ScrollbarAnimationController::create(th is); |
707 m_scrollbarAnimationController->setVerticalScrollbarLayer(scrollbarLayer); | 708 m_scrollbarAnimationController->setVerticalScrollbarLayer(scrollbarLayer); |
708 m_scrollbarAnimationController->updateScrollOffset(this); | 709 m_scrollbarAnimationController->updateScrollOffset(this); |
709 } | 710 } |
710 | 711 |
711 } // namespace cc | 712 } // namespace cc |
OLD | NEW |