diff options
author | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-01-10 19:28:01 +0000 |
---|---|---|
committer | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-01-10 19:28:01 +0000 |
commit | b435bd7d497c6743ae495e11b6828eae30521366 (patch) | |
tree | 6b51d297fe4a9c4898c518b2adbf39bdc51fa49d | |
parent | e354397dd9ac2f0d011fcdcdbae242bb0cfd0fa9 (diff) |
use SkIntToScalar
git-svn-id: http://skia.googlecode.com/svn/trunk@3003 2bbb7eff-a529-9590-31e7-b0007b416f81
-rw-r--r-- | gm/strokefill.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/gm/strokefill.cpp b/gm/strokefill.cpp index 274c4cdf83..193e850580 100644 --- a/gm/strokefill.cpp +++ b/gm/strokefill.cpp @@ -26,7 +26,7 @@ static void test_rev(SkCanvas* canvas, const SkPath& path) { SkPath rev; rev.reverseAddPath(path); canvas->save(); - canvas->translate(150, 0); + canvas->translate(SkIntToScalar(150), 0); test_path(canvas, rev); canvas->restore(); } @@ -86,35 +86,35 @@ protected: SkTypeface* hira = SkTypeface::CreateFromName("Hiragino Maru Gothic Pro", SkTypeface::kNormal); paint.setTypeface(hira); - SkScalar x = 180; - SkScalar y = 88; + SkScalar x = SkIntToScalar(180); + SkScalar y = SkIntToScalar(88); canvas->drawText(text, len, x, y, paint); paint.setFakeBoldText(true); - canvas->drawText(text, len, x, y + 100, paint); + canvas->drawText(text, len, x, y + SkIntToScalar(100), paint); paint.setStyle(SkPaint::kStrokeAndFill_Style); - paint.setStrokeWidth(5); + paint.setStrokeWidth(SkIntToScalar(5)); SkPath path; path.setFillType(SkPath::kWinding_FillType); - path.addCircle(x, y + 200, 50, SkPath::kCW_Direction); - path.addCircle(x, y + 200, 40, SkPath::kCCW_Direction); + path.addCircle(x, y + SkIntToScalar(200), SkIntToScalar(50), SkPath::kCW_Direction); + path.addCircle(x, y + SkIntToScalar(200), SkIntToScalar(40), SkPath::kCCW_Direction); canvas->drawPath(path, paint); SkPath path2; path2.setFillType(SkPath::kWinding_FillType); - path2.addCircle(x + 120, y + 200, 50, SkPath::kCCW_Direction); - path2.addCircle(x + 120, y + 200, 40, SkPath::kCW_Direction); + path2.addCircle(x + SkIntToScalar(120), y + SkIntToScalar(200), SkIntToScalar(50), SkPath::kCCW_Direction); + path2.addCircle(x + SkIntToScalar(120), y + SkIntToScalar(200), SkIntToScalar(40), SkPath::kCW_Direction); canvas->drawPath(path2, paint); path2.reset(); - path2.addCircle(x + 240, y + 200, 50, SkPath::kCCW_Direction); + path2.addCircle(x + SkIntToScalar(240), y + SkIntToScalar(200), SkIntToScalar(50), SkPath::kCCW_Direction); canvas->drawPath(path2, paint); SkASSERT(path2.cheapIsDirection(SkPath::kCCW_Direction)); path2.reset(); SkASSERT(!path2.cheapComputeDirection(NULL)); - path2.addCircle(x + 360, y + 200, 50, SkPath::kCW_Direction); + path2.addCircle(x + SkIntToScalar(360), y + SkIntToScalar(200), SkIntToScalar(50), SkPath::kCW_Direction); SkASSERT(path2.cheapIsDirection(SkPath::kCW_Direction)); canvas->drawPath(path2, paint); } |