aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-04-27 15:39:52 +0000
committerGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-04-27 15:39:52 +0000
commit5af56069010b33562d337a4f76543d898ca8d485 (patch)
tree82fb5c35ddcbbb9aeef1b17e505c0dc70bcba768
parentf294b773f0b2b9f05eb45b52dd3cb4d97b96af06 (diff)
convert float to SkScalar changes
http://codereview.appspot.com/6071043/ Submitted on behalf of Guanqun.Lu@gmail.com git-svn-id: http://skia.googlecode.com/svn/trunk@3779 2bbb7eff-a529-9590-31e7-b0007b416f81
-rw-r--r--src/gpu/GrContext.cpp8
-rw-r--r--src/gpu/SkGpuDevice.cpp4
2 files changed, 6 insertions, 6 deletions
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index 38b682aa7f..7ee2b71746 100644
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -240,10 +240,10 @@ void build_kernel(float sigma, float* kernel, int kernelWidth) {
}
void scale_rect(SkRect* rect, float xScale, float yScale) {
- rect->fLeft *= xScale;
- rect->fTop *= yScale;
- rect->fRight *= xScale;
- rect->fBottom *= yScale;
+ rect->fLeft = SkScalarMul(rect->fLeft, SkFloatToScalar(xScale));
+ rect->fTop = SkScalarMul(rect->fTop, SkFloatToScalar(yScale));
+ rect->fRight = SkScalarMul(rect->fRight, SkFloatToScalar(xScale));
+ rect->fBottom = SkScalarMul(rect->fBottom, SkFloatToScalar(yScale));
}
float adjust_sigma(float sigma, int *scaleFactor, int *halfWidth,
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index a7ba61fbd3..411b2c5b8f 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -774,8 +774,8 @@ bool drawWithGPUMaskFilter(GrContext* context, const SkPath& path,
clipRect.set(clip.getBounds());
// Outset srcRect and clipRect by 3 * sigma, to compute affected blur area.
- srcRect.inset(-sigma3, -sigma3);
- clipRect.inset(-sigma3, -sigma3);
+ srcRect.inset(SkFloatToScalar(-sigma3), SkFloatToScalar(-sigma3));
+ clipRect.inset(SkFloatToScalar(-sigma3), SkFloatToScalar(-sigma3));
srcRect.intersect(clipRect);
SkRect finalRect = srcRect;
SkIRect finalIRect;