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

Unified Diff: ui/base/events/event.cc

Issue 11418040: gfx::Transform API clean-up (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/base/animation/tween.cc ('k') | ui/compositor/debug_utils.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/events/event.cc
diff --git a/ui/base/events/event.cc b/ui/base/events/event.cc
index b3d2a2274c9e45b225942d884ba6565401786f76..53cae8f630fd07c700da1441a079f0bdfe282177 100644
--- a/ui/base/events/event.cc
+++ b/ui/base/events/event.cc
@@ -13,10 +13,10 @@
#include "ui/base/events/event_utils.h"
#include "ui/base/keycodes/keyboard_code_conversion.h"
-#include "ui/gfx/interpolated_transform.h"
#include "ui/gfx/point3_f.h"
#include "ui/gfx/point_conversions.h"
#include "ui/gfx/transform.h"
+#include "ui/gfx/transform_util.h"
#if defined(USE_X11)
#include "ui/base/keycodes/keyboard_code_conversion_x.h"
@@ -340,12 +340,13 @@ void TouchEvent::CalibrateLocation(const gfx::Size& from, const gfx::Size& to) {
void TouchEvent::UpdateForRootTransform(const gfx::Transform& root_transform) {
LocatedEvent::UpdateForRootTransform(root_transform);
- gfx::Point3F scale;
- InterpolatedTransform::FactorTRS(root_transform, NULL, NULL, &scale);
- if (scale.x())
- radius_x_ /= scale.x();
- if (scale.y())
- radius_y_ /= scale.y();
+ gfx::DecomposedTransform decomp;
+ bool success = gfx::DecomposeTransform(&decomp, root_transform);
+ DCHECK(success);
+ if (decomp.scale[0])
+ radius_x_ /= decomp.scale[0];
+ if (decomp.scale[1])
+ radius_y_ /= decomp.scale[1];
}
////////////////////////////////////////////////////////////////////////////////
« no previous file with comments | « ui/base/animation/tween.cc ('k') | ui/compositor/debug_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698