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

Unified Diff: src/core/SkPictureShader.cpp

Issue 1135053002: stop calling SkScalarDiv (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix xpsdevice 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 | « src/core/SkPathMeasure.cpp ('k') | src/core/SkRRect.cpp » ('j') | 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 2c835ed93ecbb5122a89e726d5623da43bfa92f6..c1c47550586cb1005290a98a1c0e8f74b4eab7e6 100644
--- a/src/core/SkPictureShader.cpp
+++ b/src/core/SkPictureShader.cpp
@@ -168,7 +168,7 @@ SkShader* SkPictureShader::refBitmapShader(const SkMatrix& matrix, const SkMatri
static const SkScalar kMaxTileArea = 2048 * 2048;
SkScalar tileArea = SkScalarMul(scaledSize.width(), scaledSize.height());
if (tileArea > kMaxTileArea) {
- SkScalar clampScale = SkScalarSqrt(SkScalarDiv(kMaxTileArea, tileArea));
+ SkScalar clampScale = SkScalarSqrt(kMaxTileArea / tileArea);
scaledSize.set(SkScalarMul(scaledSize.width(), clampScale),
SkScalarMul(scaledSize.height(), clampScale));
}
@@ -176,8 +176,7 @@ SkShader* SkPictureShader::refBitmapShader(const SkMatrix& matrix, const SkMatri
// 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 = SkScalarDiv(maxTextureSize,
- SkMax32(scaledSize.width(), scaledSize.height()));
+ SkScalar downScale = maxTextureSize / SkMax32(scaledSize.width(), scaledSize.height());
scaledSize.set(SkScalarFloorToScalar(SkScalarMul(scaledSize.width(), downScale)),
SkScalarFloorToScalar(SkScalarMul(scaledSize.height(), downScale)));
}
« no previous file with comments | « src/core/SkPathMeasure.cpp ('k') | src/core/SkRRect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698