aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/pdf/SkPDFShader.cpp
diff options
context:
space:
mode:
authorGravatar Mike Reed <reed@google.com>2017-02-13 20:44:33 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-02-14 14:43:47 +0000
commit8be952ad8c9deefe19cff36f9ad217563400f817 (patch)
tree3879f25fb86ed01ffd3817b510bd8a63423f9e8d /src/pdf/SkPDFShader.cpp
parent351549febad86d785aab6c985c9489d55a0bd2a4 (diff)
SkScalarMul is deprecated
BUG=skia: Change-Id: I88ecfe9d4c72506f6b1a0e0dfadd2a5c171a6cb6 Reviewed-on: https://skia-review.googlesource.com/8353 Commit-Queue: Ben Wagner <bungeman@google.com> Reviewed-by: Ben Wagner <bungeman@google.com>
Diffstat (limited to 'src/pdf/SkPDFShader.cpp')
-rw-r--r--src/pdf/SkPDFShader.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/pdf/SkPDFShader.cpp b/src/pdf/SkPDFShader.cpp
index 0d5439e7e8..3754df8e21 100644
--- a/src/pdf/SkPDFShader.cpp
+++ b/src/pdf/SkPDFShader.cpp
@@ -403,8 +403,7 @@ static void twoPointConicalCode(const SkShader::GradientInfo& info,
SkScalar dy = info.fPoint[1].fY - info.fPoint[0].fY;
SkScalar r0 = info.fRadius[0];
SkScalar dr = info.fRadius[1] - info.fRadius[0];
- SkScalar a = SkScalarMul(dx, dx) + SkScalarMul(dy, dy) -
- SkScalarMul(dr, dr);
+ SkScalar a = dx * dx + dy * dy - dr * dr;
// First compute t, if the pixel falls outside the cone, then we'll end
// with 'false' on the stack, otherwise we'll push 'true' with t below it
@@ -422,12 +421,12 @@ static void twoPointConicalCode(const SkShader::GradientInfo& info,
function->writeText(" mul exch ");
SkPDFUtils::AppendScalar(dx, function);
function->writeText(" mul add ");
- SkPDFUtils::AppendScalar(SkScalarMul(r0, dr), function);
+ SkPDFUtils::AppendScalar(r0 * dr, function);
function->writeText(" add -2 mul dup dup mul\n");
// c = x^2 + y^2 + radius0^2
function->writeText("4 2 roll dup mul exch dup mul add ");
- SkPDFUtils::AppendScalar(SkScalarMul(r0, r0), function);
+ SkPDFUtils::AppendScalar(r0 * r0, function);
function->writeText(" sub dup 4 1 roll\n");
// Contents of the stack at this point: c, b, b^2, c
@@ -453,7 +452,7 @@ static void twoPointConicalCode(const SkShader::GradientInfo& info,
// root t for which radius(t) > 0
// compute the discriminant (b^2 - 4ac)
- SkPDFUtils::AppendScalar(SkScalarMul(SkIntToScalar(4), a), function);
+ SkPDFUtils::AppendScalar(a * 4, function);
function->writeText(" mul sub dup\n");
// if d >= 0, proceed