aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar reed <reed@chromium.org>2014-11-18 06:04:37 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2014-11-18 06:04:37 -0800
commit9b1dd15d6d90bf623679f4e9b81b29fe9ab82807 (patch)
tree07382fc4d1f96292f530775d273f328e4aa834b5 /src
parent542ecbb2bd1c8706f280edc3015d67b118d37817 (diff)
don't normalize after perspective concat
Diffstat (limited to 'src')
-rw-r--r--src/core/SkMatrix.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/core/SkMatrix.cpp b/src/core/SkMatrix.cpp
index db6cc8953c..f770e0d5e5 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) {