From 9b1dd15d6d90bf623679f4e9b81b29fe9ab82807 Mon Sep 17 00:00:00 2001 From: reed Date: Tue, 18 Nov 2014 06:04:37 -0800 Subject: don't normalize after perspective concat BUG=skia: Review URL: https://codereview.chromium.org/734513004 --- src/core/SkMatrix.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/core') 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) { -- cgit v1.2.3