From f469fc0e0f04197f19c94c26801ba6888c6329dc Mon Sep 17 00:00:00 2001 From: ericrk Date: Wed, 14 Oct 2015 17:33:29 -0700 Subject: [PATCH] Fix floating point data loss in SkPictureShader SkPictureShader had an invalid use of SkMax32 on two SkScalars which ended up converting the result to an integer which caused us to lose necessary floating point data. BUG=473166 Review URL: https://codereview.chromium.org/1401743004 --- src/core/SkPictureShader.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/SkPictureShader.cpp b/src/core/SkPictureShader.cpp index 4539dda224..92e6157343 100644 --- a/src/core/SkPictureShader.cpp +++ b/src/core/SkPictureShader.cpp @@ -190,7 +190,7 @@ SkShader* SkPictureShader::refBitmapShader(const SkMatrix& viewMatrix, const SkM // Scale down the tile size if larger than maxTextureSize for GPU Path or it should fail on create texture if (maxTextureSize) { if (scaledSize.width() > maxTextureSize || scaledSize.height() > maxTextureSize) { - SkScalar downScale = maxTextureSize / SkMax32(scaledSize.width(), scaledSize.height()); + SkScalar downScale = maxTextureSize / SkMaxScalar(scaledSize.width(), scaledSize.height()); scaledSize.set(SkScalarFloorToScalar(SkScalarMul(scaledSize.width(), downScale)), SkScalarFloorToScalar(SkScalarMul(scaledSize.height(), downScale))); }