diff options
author | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-07-03 12:23:22 +0000 |
---|---|---|
committer | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-07-03 12:23:22 +0000 |
commit | dbc5d28979bef1c92aa79e0dc1b5d27a41de5c9a (patch) | |
tree | a535d088316ed6a131d0ab894a881c1f25a0cec8 /gm | |
parent | 8dbd5725c0a6681425c7a019c58c4cacdad2a238 (diff) |
fix SkFixed build
git-svn-id: http://skia.googlecode.com/svn/trunk@4441 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'gm')
-rw-r--r-- | gm/hittestpath.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/gm/hittestpath.cpp b/gm/hittestpath.cpp index a8566b7a70..06f89e4dd2 100644 --- a/gm/hittestpath.cpp +++ b/gm/hittestpath.cpp @@ -17,9 +17,11 @@ static void test_hittest(SkCanvas* canvas, const SkPath& path, bool hires) { paint.setColor(SK_ColorRED); canvas->drawPath(path, paint); + const SkScalar MARGIN = SkIntToScalar(4); + paint.setColor(0x800000FF); - for (SkScalar y = r.fTop + 0.5 - 4; y < r.fBottom + 4; y += 1) { - for (SkScalar x = r.fLeft + 0.5 - 4; x < r.fRight + 4; x += 1) { + for (SkScalar y = r.fTop + SK_ScalarHalf - MARGIN; y < r.fBottom + MARGIN; y += SK_Scalar1) { + for (SkScalar x = r.fLeft + SK_ScalarHalf - MARGIN; x < r.fRight + MARGIN; x += SK_Scalar1) { if (hires) { if (SkHitTestPathEx(path, x, y)) { canvas->drawPoint(x, y, paint); @@ -55,17 +57,17 @@ protected: } path.setFillType(SkPath::kEvenOdd_FillType); - path.offset(20, 20); + path.offset(SkIntToScalar(20), SkIntToScalar(20)); test_hittest(canvas, path, false); - canvas->translate(200, 0); + canvas->translate(SkIntToScalar(200), 0); test_hittest(canvas, path, true); - canvas->translate(-200, 200); + canvas->translate(-SkIntToScalar(200), SkIntToScalar(200)); path.setFillType(SkPath::kWinding_FillType); test_hittest(canvas, path, false); - canvas->translate(200, 0); + canvas->translate(SkIntToScalar(200), 0); test_hittest(canvas, path, true); } |