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

Side by Side Diff: cc/layer_impl.cc

Issue 11644008: Migrate from MathUtil::inverse() to gfx::Transform::GetInverse() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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
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 "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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698