Fix warnings-as-errors on Mac10.6 and Win. Unreviewed.
authorsenorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>
Thu, 21 Feb 2013 17:10:44 +0000 (17:10 +0000)
committersenorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>
Thu, 21 Feb 2013 17:10:44 +0000 (17:10 +0000)
git-svn-id: http://skia.googlecode.com/svn/trunk@7811 2bbb7eff-a529-9590-31e7-b0007b416f81

src/effects/SkRectShaderImageFilter.cpp
tests/ShaderImageFilterTest.cpp

index b6c78efd0f142c31b2d7490ca2e49ad651cb319a..eb5af2097c8684bd298829f8719534db558b6abe 100644 (file)
@@ -47,7 +47,8 @@ bool SkRectShaderImageFilter::onFilterImage(Proxy* proxy,
                                         const SkMatrix& matrix,
                                         SkBitmap* result,
                                         SkIPoint* loc) {
-    SkAutoTUnref<SkDevice> device(proxy->createDevice(fRegion.width(), fRegion.height()));
+    SkAutoTUnref<SkDevice> device(proxy->createDevice(SkScalarCeilToInt(fRegion.width()),
+                                                      SkScalarCeilToInt(fRegion.height())));
     SkCanvas canvas(device.get());
     SkPaint paint;
     paint.setShader(fShader);
index 934e8c23e6afe377b978e955896794248b068268..78aa796caae324461fcbd9b31f1f64c6dc4f96c3 100644 (file)
 #include "SkGradientShader.h"
 
 static void test_asShaderMode(skiatest::Reporter* reporter) {
-    SkRect r = SkRect::MakeWH(10, 10); // Make small 10x10 gradient
+    int w = 10, h = 10;
+    SkRect r = SkRect::MakeWH(SkIntToScalar(w), SkIntToScalar(h)); // Make small 10x10 gradient
 
     SkBitmap filterResult, shaderResult;
 
-    filterResult.setConfig(SkBitmap::kARGB_8888_Config, r.width(), r.height());
+    filterResult.setConfig(SkBitmap::kARGB_8888_Config, w, h);
     filterResult.allocPixels();
     SkCanvas canvasFilter(filterResult);
     canvasFilter.clear(0x00000000);
 
-    shaderResult.setConfig(SkBitmap::kARGB_8888_Config, r.width(), r.height());
+    shaderResult.setConfig(SkBitmap::kARGB_8888_Config, w, h);
     shaderResult.allocPixels();
     SkCanvas canvasShader(shaderResult);
     canvasShader.clear(0x00000000);