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

Unified Diff: src/core/SkMatrix.cpp

Issue 734513004: don't normalize after perspective concat (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkMatrix.cpp
diff --git a/src/core/SkMatrix.cpp b/src/core/SkMatrix.cpp
index db6cc8953cf34d45d253fd5fff627494de8710d4..f770e0d5e5d24c57b975f3c49d5709312615f522 100644
--- a/src/core/SkMatrix.cpp
+++ b/src/core/SkMatrix.cpp
@@ -569,10 +569,12 @@ static inline float rowcol3(const float row[], const float col[]) {
}
static void normalize_perspective(SkScalar mat[9]) {
- if (SkScalarAbs(mat[SkMatrix::kMPersp2]) > 1) {
- for (int i = 0; i < 9; i++)
- mat[i] = SkScalarHalf(mat[i]);
- }
+ // If it was interesting to never store the last element, we could divide all 8 other
+ // elements here by the 9th, making it 1.0...
+ //
+ // When SkScalar was SkFixed, we would sometimes rescale the entire matrix to keep its
+ // component values from getting too large. This is not a concern when using floats/doubles,
+ // so we do nothing now.
}
static bool only_scale_and_translate(unsigned mask) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698