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

Unified Diff: cc/layer_tree_host.cc

Issue 11644008: Migrate from MathUtil::inverse() to gfx::Transform::GetInverse() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Partially addressed uninvertible cases 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 side-by-side diff with in-line comments
Download patch
Index: cc/layer_tree_host.cc
diff --git a/cc/layer_tree_host.cc b/cc/layer_tree_host.cc
index 91276deb8ad5bcb005ec733ce1713e3e0f543d63..059741eb31dbea716be01a0af06a729a8cd27e02 100644
--- a/cc/layer_tree_host.cc
+++ b/cc/layer_tree_host.cc
@@ -796,7 +796,13 @@ gfx::PointF LayerTreeHost::adjustEventPointForPinchZoom(const gfx::PointF& zoome
// Scale to screen space before applying implTransform inverse.
gfx::PointF zoomedScreenspacePoint = gfx::ScalePoint(zoomedViewportPoint, deviceScaleFactor());
- gfx::Transform inverseImplTransform = MathUtil::inverse(m_implTransform);
+
+ // Note carefully, this remains an identity matrix if m_implTransform is uninvertible.
+ // TODO: see if there is something more reasonable we can do if m_implTransform really is uninvertible.
+ // or perhaps we can just DCHECK that m_implTransform should be invertible?
+ gfx::Transform inverseImplTransform(gfx::Transform::kSkipInitialization);
+ if (!m_implTransform.GetInverse(&inverseImplTransform))
+ inverseImplTransform.MakeIdentity();
bool wasClipped = false;
gfx::PointF unzoomedScreenspacePoint = MathUtil::projectPoint(inverseImplTransform, zoomedScreenspacePoint, wasClipped);
« cc/direct_renderer.cc ('K') | « cc/layer_impl.cc ('k') | cc/layer_tree_host_common.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698