Index: src/core/SkPictureShader.cpp |
diff --git a/src/core/SkPictureShader.cpp b/src/core/SkPictureShader.cpp |
index 8f6d43f862992eccd5cb4e37ccbb27d36d4cab6d..f1addadd20012745373b76ce91b3bf3bcab98e99 100644 |
--- a/src/core/SkPictureShader.cpp |
+++ b/src/core/SkPictureShader.cpp |
@@ -197,14 +197,18 @@ SkShader* SkPictureShader::refBitmapShader(const SkMatrix& viewMatrix, const SkM |
} |
#endif |
- SkISize tileSize = scaledSize.toRound(); |
+#ifdef SK_SUPPORT_LEGACY_PICTURESHADER_ROUNDING |
+ const SkISize tileSize = scaledSize.toRound(); |
+#else |
+ const SkISize tileSize = scaledSize.toCeil(); |
+#endif |
if (tileSize.isEmpty()) { |
return SkShader::CreateEmptyShader(); |
} |
// The actual scale, compensating for rounding & clamping. |
- SkSize tileScale = SkSize::Make(SkIntToScalar(tileSize.width()) / fTile.width(), |
- SkIntToScalar(tileSize.height()) / fTile.height()); |
+ const SkSize tileScale = SkSize::Make(SkIntToScalar(tileSize.width()) / fTile.width(), |
+ SkIntToScalar(tileSize.height()) / fTile.height()); |
SkAutoTUnref<SkShader> tileShader; |
BitmapShaderKey key(fPicture->uniqueID(), |