Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(124)

Unified Diff: src/core/SkPictureShader.cpp

Issue 1749763002: Use enclosing int rect for picture shader tiles (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: indentation Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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(),
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698