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

Unified Diff: ui/gfx/transform.cc

Issue 1013463003: Update from https://crrev.com/320931 (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 9 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 | « ui/gfx/transform.h ('k') | ui/gfx/transform_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/transform.cc
diff --git a/ui/gfx/transform.cc b/ui/gfx/transform.cc
index c13ae1d65f7565c678a185d43252312edb7ee742..27b5e63991d793eaa0b211fdcf48773c99f4baac 100644
--- a/ui/gfx/transform.cc
+++ b/ui/gfx/transform.cc
@@ -394,6 +394,13 @@ void Transform::FlattenTo2d() {
matrix_.set(2, 3, 0.0);
}
+bool Transform::IsFlat() const {
+ return matrix_.get(2, 0) == 0.0 && matrix_.get(2, 1) == 0.0 &&
+ matrix_.get(0, 2) == 0.0 && matrix_.get(1, 2) == 0.0 &&
+ matrix_.get(2, 2) == 1.0 && matrix_.get(3, 2) == 0.0 &&
+ matrix_.get(2, 3) == 0.0;
+}
+
Vector2dF Transform::To2dTranslation() const {
return gfx::Vector2dF(SkMScalarToFloat(matrix_.get(0, 3)),
SkMScalarToFloat(matrix_.get(1, 3)));
« no previous file with comments | « ui/gfx/transform.h ('k') | ui/gfx/transform_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698