diff options
author | tomhudson@google.com <tomhudson@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-04-10 17:42:21 +0000 |
---|---|---|
committer | tomhudson@google.com <tomhudson@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-04-10 17:42:21 +0000 |
commit | 75589257c6ac7fc55a66502b74b8bc09c0212fea (patch) | |
tree | 24d452385ad37eba7f91a17aec9b5a7851007229 /gm | |
parent | 56dd630c41d662bcf2a3f08100f2c6accda05ba9 (diff) |
Fix miscellaneous compiler warnings from Visual Studio 2010.
Changes serialization path for MorphologyImageFilter, handling of Windows
HRESULTS; otherwise just tweaks tests.
git-svn-id: http://skia.googlecode.com/svn/trunk@3642 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'gm')
-rw-r--r-- | gm/bitmapcopy.cpp | 12 | ||||
-rw-r--r-- | gm/colormatrix.cpp | 3 | ||||
-rw-r--r-- | gm/imageblur.cpp | 5 | ||||
-rw-r--r-- | gm/verttext2.cpp | 3 |
4 files changed, 15 insertions, 8 deletions
diff --git a/gm/bitmapcopy.cpp b/gm/bitmapcopy.cpp index 249ec436b0..edf6445911 100644 --- a/gm/bitmapcopy.cpp +++ b/gm/bitmapcopy.cpp @@ -30,13 +30,17 @@ SkBitmap::Config gConfigs[] = { static void draw_checks(SkCanvas* canvas, int width, int height) { SkPaint paint; paint.setColor(SK_ColorRED); - canvas->drawRectCoords(0, 0, width / 2, height / 2, paint); + canvas->drawRectCoords(SkIntToScalar(0), SkIntToScalar(0), + SkIntToScalar(width / 2), SkIntToScalar(height / 2), paint); paint.setColor(SK_ColorGREEN); - canvas->drawRectCoords(width / 2, 0, width, height / 2, paint); + canvas->drawRectCoords(SkIntToScalar(width / 2), SkIntToScalar(0), + SkIntToScalar(width), SkIntToScalar(height / 2), paint); paint.setColor(SK_ColorBLUE); - canvas->drawRectCoords(0, height / 2, width / 2, height, paint); + canvas->drawRectCoords(SkIntToScalar(0), SkIntToScalar(height / 2), + SkIntToScalar(width / 2), SkIntToScalar(height), paint); paint.setColor(SK_ColorYELLOW); - canvas->drawRectCoords(width / 2, height / 2, width, height, paint); + canvas->drawRectCoords(SkIntToScalar(width / 2), SkIntToScalar(height / 2), + SkIntToScalar(width), SkIntToScalar(height), paint); } class BitmapCopyGM : public GM { diff --git a/gm/colormatrix.cpp b/gm/colormatrix.cpp index 3cc9c028dc..cc5cfbc22a 100644 --- a/gm/colormatrix.cpp +++ b/gm/colormatrix.cpp @@ -61,7 +61,8 @@ protected: for (int x = 0; x < width; ++x) { SkPaint paint; paint.setColor(SkColorSetARGB(255, x * 255 / width, y * 255 / height, 0)); - canvas.drawRect(SkRect::MakeXYWH(x, y, 1, 1), paint); + canvas.drawRect(SkRect::MakeXYWH(SkIntToScalar(x), + SkIntToScalar(y), SK_Scalar1, SK_Scalar1), paint); } } return bm; diff --git a/gm/imageblur.cpp b/gm/imageblur.cpp index 841441e68d..c8dd5d760c 100644 --- a/gm/imageblur.cpp +++ b/gm/imageblur.cpp @@ -39,8 +39,9 @@ protected: int x = rand() % WIDTH; int y = rand() % HEIGHT; paint.setColor(rand() % 0x1000000 | 0xFF000000); - paint.setTextSize(rand() % 300); - canvas->drawText(str, strlen(str), x, y, paint); + paint.setTextSize(SkIntToScalar(rand() % 300)); + canvas->drawText(str, strlen(str), SkIntToScalar(x), + SkIntToScalar(y), paint); } canvas->restore(); } diff --git a/gm/verttext2.cpp b/gm/verttext2.cpp index 3bfb471187..9ffefec247 100644 --- a/gm/verttext2.cpp +++ b/gm/verttext2.cpp @@ -73,7 +73,8 @@ protected: paint.setTextSize(textHeight); canvas->drawText(string.c_str(), string.size(), y, - alignment == SkPaint::kLeft_Align ? 10 : 240, paint); + SkIntToScalar(alignment == SkPaint::kLeft_Align ? 10 : 240), + paint); y += textHeight; } |