Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(698)

Side by Side Diff: cc/layer_impl.cc

Issue 11377006: LayerImpl::tryScroll must convert its content-space point to layer space before comparing to the no… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ToRoundedPoint Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | cc/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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::ToRoundedPoint(h itTestPointInLayerSpace))) {
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
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
OLDNEW
« no previous file with comments | « no previous file | cc/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698