aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/effects
diff options
context:
space:
mode:
authorGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-12-17 19:22:07 +0000
committerGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-12-17 19:22:07 +0000
commite1ca705cac4b946993f6cbf798e2a0ba27e739f3 (patch)
tree9757af858cadeea671264651780935b00d8c0252 /src/effects
parent3fb15f4d21292a319dc6522bfc99c89a7a5eac68 (diff)
deprecate SkScalarRound (and its ilk), use SkScalarRound[ToInt,ToScalar]. #define SK_SUPPORT_DEPRECATED_SCALARROUND for legacy clients
BUG= R=robertphillips@google.com Review URL: https://codereview.chromium.org/111353003 git-svn-id: http://skia.googlecode.com/svn/trunk@12719 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/effects')
-rw-r--r--src/effects/SkBlurMask.cpp8
-rw-r--r--src/effects/SkDashPathEffect.cpp2
-rw-r--r--src/effects/SkDiscretePathEffect.cpp4
-rw-r--r--src/effects/SkEmbossMaskFilter.cpp2
4 files changed, 8 insertions, 8 deletions
diff --git a/src/effects/SkBlurMask.cpp b/src/effects/SkBlurMask.cpp
index d2484c84b7..32a3d20d31 100644
--- a/src/effects/SkBlurMask.cpp
+++ b/src/effects/SkBlurMask.cpp
@@ -404,7 +404,7 @@ static int boxBlurInterp(const uint8_t* src, int src_y_stride, uint8_t* dst,
static void get_adjusted_radii(SkScalar passRadius, int *loRadius, int *hiRadius)
{
- *loRadius = *hiRadius = SkScalarCeil(passRadius);
+ *loRadius = *hiRadius = SkScalarCeilToInt(passRadius);
if (SkIntToScalar(*hiRadius) - passRadius > 0.5f) {
*loRadius = *hiRadius - 1;
}
@@ -512,8 +512,8 @@ bool SkBlurMask::BoxBlur(SkMask* dst, const SkMask& src,
// to approximate a Gaussian blur
int passCount = (kHigh_Quality == quality) ? 3 : 1;
- int rx = SkScalarCeil(passRadius);
- int outerWeight = 255 - SkScalarRound((SkIntToScalar(rx) - passRadius) * 255);
+ int rx = SkScalarCeilToInt(passRadius);
+ int outerWeight = 255 - SkScalarRoundToInt((SkIntToScalar(rx) - passRadius) * 255);
SkASSERT(rx >= 0);
SkASSERT((unsigned)outerWeight <= 255);
@@ -865,7 +865,7 @@ bool SkBlurMask::BlurGroundTruth(SkScalar sigma, SkMask* dst, const SkMask& src,
float variance = sigma * sigma;
- int windowSize = SkScalarCeil(sigma*6);
+ int windowSize = SkScalarCeilToInt(sigma*6);
// round window size up to nearest odd number
windowSize |= 1;
diff --git a/src/effects/SkDashPathEffect.cpp b/src/effects/SkDashPathEffect.cpp
index 4099058502..10fee23aff 100644
--- a/src/effects/SkDashPathEffect.cpp
+++ b/src/effects/SkDashPathEffect.cpp
@@ -277,7 +277,7 @@ bool SkDashPathEffect::filterPath(SkPath* dst, const SkPath& src,
scale = SkScalarDiv(length, fIntervalLength);
} else {
SkScalar div = SkScalarDiv(length, fIntervalLength);
- int n = SkScalarFloor(div);
+ int n = SkScalarFloorToInt(div);
scale = SkScalarDiv(length, n * fIntervalLength);
}
}
diff --git a/src/effects/SkDiscretePathEffect.cpp b/src/effects/SkDiscretePathEffect.cpp
index eece2eff86..b7ec1de3e0 100644
--- a/src/effects/SkDiscretePathEffect.cpp
+++ b/src/effects/SkDiscretePathEffect.cpp
@@ -30,7 +30,7 @@ bool SkDiscretePathEffect::filterPath(SkPath* dst, const SkPath& src,
bool doFill = rec->isFillStyle();
SkPathMeasure meas(src, doFill);
- uint32_t seed = SkScalarRound(meas.getLength());
+ uint32_t seed = SkScalarRoundToInt(meas.getLength());
SkLCGRandom rand(seed ^ ((seed << 16) | (seed >> 16)));
SkScalar scale = fPerterb;
SkPoint p;
@@ -42,7 +42,7 @@ bool SkDiscretePathEffect::filterPath(SkPath* dst, const SkPath& src,
if (fSegLength * (2 + doFill) > length) {
meas.getSegment(0, length, dst, true); // to short for us to mangle
} else {
- int n = SkScalarRound(SkScalarDiv(length, fSegLength));
+ int n = SkScalarRoundToInt(length / fSegLength);
SkScalar delta = length / n;
SkScalar distance = 0;
diff --git a/src/effects/SkEmbossMaskFilter.cpp b/src/effects/SkEmbossMaskFilter.cpp
index 905cfab941..1306d6a632 100644
--- a/src/effects/SkEmbossMaskFilter.cpp
+++ b/src/effects/SkEmbossMaskFilter.cpp
@@ -89,7 +89,7 @@ bool SkEmbossMaskFilter::filterMask(SkMask* dst, const SkMask& src,
dst->fFormat = SkMask::k3D_Format;
if (margin) {
- margin->set(SkScalarCeil(3*sigma), SkScalarCeil(3*sigma));
+ margin->set(SkScalarCeilToInt(3*sigma), SkScalarCeilToInt(3*sigma));
}
if (src.fImage == NULL) {