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

Unified Diff: ui/gfx/transform.cc

Issue 11316043: Implement unit tests and temporary MathUtil wrappers for transform functionality (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Addressed reviewer feedback 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
Index: ui/gfx/transform.cc
diff --git a/ui/gfx/transform.cc b/ui/gfx/transform.cc
index e1d77c343f9181d9a5ed4010ced36cfcd065d0e1..0e0bea8086b3a8034eb5de7f2811421467996037 100644
--- a/ui/gfx/transform.cc
+++ b/ui/gfx/transform.cc
@@ -116,6 +116,9 @@ void Transform::SetSkewY(double angle) {
}
void Transform::SetPerspectiveDepth(double depth) {
+ if (depth == 0)
+ return;
+
SkMatrix44 m;
MSET(m, 3, 2, -1.0 / depth);
matrix_ = m;
@@ -184,6 +187,9 @@ void Transform::ConcatSkewY(double angle_y) {
}
void Transform::ConcatPerspectiveDepth(double depth) {
+ if (depth == 0)
+ return;
+
SkMatrix44 m;
MSET(m, 3, 2, -1.0 / depth);
matrix_.postConcat(m);
@@ -252,6 +258,9 @@ void Transform::PreconcatSkewY(double angle_y) {
}
void Transform::PreconcatPerspectiveDepth(double depth) {
+ if (depth == 0)
+ return;
+
SkMatrix44 m;
MSET(m, 3, 2, -1.0 / depth);
matrix_.preConcat(m);

Powered by Google App Engine
This is Rietveld 408576698