Index: gm/resizeimagefilter.cpp |
diff --git a/gm/resizeimagefilter.cpp b/gm/resizeimagefilter.cpp |
index 2edb802838e6fb2a30f37e5c0eb725db017c3ddf..14f76b56cfaf4b1b59a83a1bf30030c93021b9cc 100644 |
--- a/gm/resizeimagefilter.cpp |
+++ b/gm/resizeimagefilter.cpp |
@@ -32,8 +32,8 @@ |
SkRect dstRect; |
canvas->getTotalMatrix().mapRect(&dstRect, rect); |
canvas->save(); |
- SkScalar deviceScaleX = deviceSize.width() / dstRect.width(); |
- SkScalar deviceScaleY = deviceSize.height() / dstRect.height(); |
+ SkScalar deviceScaleX = SkScalarDiv(deviceSize.width(), dstRect.width()); |
+ SkScalar deviceScaleY = SkScalarDiv(deviceSize.height(), dstRect.height()); |
canvas->translate(rect.x(), rect.y()); |
canvas->scale(deviceScaleX, deviceScaleY); |
canvas->translate(-rect.x(), -rect.y()); |
@@ -96,7 +96,7 @@ |
SkPaint paint; |
paint.setColor(0xFF00FF00); |
SkRect ovalRect = SkRect::MakeWH(16, 16); |
- ovalRect.inset(SkIntToScalar(2)/3, SkIntToScalar(2)/3); |
+ ovalRect.inset(SkScalarDiv(2.0f, 3.0f), SkScalarDiv(2.0f, 3.0f)); |
bitmapCanvas.drawOval(ovalRect, paint); |
} |
SkRect inRect = SkRect::MakeXYWH(-4, -4, 20, 20); |