diff options
author | reed <reed@chromium.org> | 2014-11-18 06:04:37 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-11-18 06:04:37 -0800 |
commit | 9b1dd15d6d90bf623679f4e9b81b29fe9ab82807 (patch) | |
tree | 07382fc4d1f96292f530775d273f328e4aa834b5 /src/core | |
parent | 542ecbb2bd1c8706f280edc3015d67b118d37817 (diff) |
don't normalize after perspective concat
BUG=skia:
Review URL: https://codereview.chromium.org/734513004
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/SkMatrix.cpp | 10 |
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) { |