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

Unified Diff: gm/shaderbounds.cpp

Issue 1138263002: Revert of stop calling SkScalarDiv (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 7 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 | « gm/resizeimagefilter.cpp ('k') | gm/stringart.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/shaderbounds.cpp
diff --git a/gm/shaderbounds.cpp b/gm/shaderbounds.cpp
index 4363d4eee3861fe2f5e8f25cde52d6e441fe4193..e86ab054310262b814901328b59f58536f9283e2 100644
--- a/gm/shaderbounds.cpp
+++ b/gm/shaderbounds.cpp
@@ -80,9 +80,10 @@
if (background) {
scale = 0.6f;
}
- SkScalar shaderWidth = width / scale;
- SkScalar shaderHeight = height / scale;
- SkMatrix shaderScale = SkMatrix::MakeScale(scale);
+ SkScalar shaderWidth = SkScalarDiv(SkIntToScalar(width), scale);
+ SkScalar shaderHeight = SkScalarDiv(SkIntToScalar(height), scale);
+ SkMatrix shaderScale;
+ shaderScale.setScale(scale, scale);
SkShader* shader = fShaderMaker(shaderWidth, shaderHeight, background, shaderScale);
return shader;
}
« no previous file with comments | « gm/resizeimagefilter.cpp ('k') | gm/stringart.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698