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

Unified Diff: cc/base/math_util.cc

Issue 1135813005: Add detection for rotation and flip overlay transforms (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix mojo surfaces unit test, chase flipped rename to TextureQuadState Created 5 years, 7 months 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 | « cc/base/math_util.h ('k') | cc/output/gl_renderer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/base/math_util.cc
diff --git a/cc/base/math_util.cc b/cc/base/math_util.cc
index e2fd565eb9774943c0c75c64ada9906fc1804ebb..969e52a6ed787019ed2eda24248c75995a8cd12b 100644
--- a/cc/base/math_util.cc
+++ b/cc/base/math_util.cc
@@ -15,6 +15,7 @@
#include "ui/gfx/geometry/rect_conversions.h"
#include "ui/gfx/geometry/rect_f.h"
#include "ui/gfx/geometry/vector2d_f.h"
+#include "ui/gfx/geometry/vector3d_f.h"
#include "ui/gfx/transform.h"
namespace cc {
@@ -867,4 +868,16 @@ float MathUtil::AsFloatSafely(float value) {
return std::min(value, std::numeric_limits<float>::max());
}
+gfx::Vector3dF MathUtil::GetXAxis(const gfx::Transform& transform) {
+ return gfx::Vector3dF(transform.matrix().getFloat(0, 0),
+ transform.matrix().getFloat(1, 0),
+ transform.matrix().getFloat(2, 0));
+}
+
+gfx::Vector3dF MathUtil::GetYAxis(const gfx::Transform& transform) {
+ return gfx::Vector3dF(transform.matrix().getFloat(0, 1),
+ transform.matrix().getFloat(1, 1),
+ transform.matrix().getFloat(2, 1));
+}
+
} // namespace cc
« no previous file with comments | « cc/base/math_util.h ('k') | cc/output/gl_renderer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698