The units used to setup XPS should be SkScalars.
http://codereview.appspot.com/5509050/
git-svn-id: http://skia.googlecode.com/svn/trunk@2968 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/gm/gmmain.cpp b/gm/gmmain.cpp
index 0c41418..0af2933 100644
--- a/gm/gmmain.cpp
+++ b/gm/gmmain.cpp
@@ -324,13 +324,11 @@
SkSize trimSize = SkSize::Make(SkIntToScalar(size.width()),
SkIntToScalar(size.height()));
- static const double inchesPerMeter = 10000.0 / 254.0;
- static const double upm = 72 * inchesPerMeter;
- SkVector unitsPerMeter = SkPoint::Make(SkDoubleToScalar(upm),
- SkDoubleToScalar(upm));
- static const double ppm = 200 * inchesPerMeter;
- SkVector pixelsPerMeter = SkPoint::Make(SkDoubleToScalar(ppm),
- SkDoubleToScalar(ppm));
+ static const SkScalar inchesPerMeter = SkScalarDiv(10000, 254);
+ static const SkScalar upm = 72 * inchesPerMeter;
+ SkVector unitsPerMeter = SkPoint::Make(upm, upm);
+ static const SkScalar ppm = 200 * inchesPerMeter;
+ SkVector pixelsPerMeter = SkPoint::Make(ppm, ppm);
SkXPSDevice* dev = new SkXPSDevice();
SkAutoUnref aur(dev);