Minor Windows compiler complaint fixes
authorrobertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Tue, 10 Apr 2012 18:32:35 +0000 (18:32 +0000)
committerrobertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Tue, 10 Apr 2012 18:32:35 +0000 (18:32 +0000)
http://codereview.appspot.com/5988072/

git-svn-id: http://skia.googlecode.com/svn/trunk@3644 2bbb7eff-a529-9590-31e7-b0007b416f81

experimental/SkSetPoly3To3_A.cpp
experimental/SkSetPoly3To3_D.cpp
src/gpu/GrContext.cpp
src/gpu/SkGpuDevice.cpp
src/pdf/SkPDFDevice.cpp

index a0f955c6cbc861a301d235b1d7afd50fc9791c96..bf41713001623b5c7dc23e6ee82d7697652f0de0 100644 (file)
@@ -32,7 +32,7 @@
 #endif
 
 static SkDScalar SkDScalar_setMul(SkScalar a, SkScalar b) {
-    return (SkDScalar)a * b;
+    return (SkDScalar) ((SkDScalar) a * b);
 }
 
 static void computeOuterProduct(SkScalar op[4],
@@ -59,7 +59,7 @@ static SkScalar dot(SkScalar ax, SkScalar ay, SkScalar bx, SkScalar by) {
     return SkDScalar_toScalar(ddot(ax, ay, bx, by));
 }
 
-bool SkSetPoly3To3(SkMatrix* matrix, const SkPoint src[3], const SkPoint dst[3]) {
+bool SkSetPoly3To3_A(SkMatrix* matrix, const SkPoint src[3], const SkPoint dst[3]) {
     const SkPoint& srcAve = src[0];
     const SkPoint& dstAve = dst[0];
     
index 810e6b21d011f3cbfff5afa1af03b08f48a06d71..0225581ed2de890a896fc7f5d19ff9682b623529 100644 (file)
@@ -17,7 +17,7 @@ static SkScalar SkDScalar_toScalar(SkDScalar value) {
 }
 
 static SkDScalar SkDScalar_setMul(SkScalar a, SkScalar b) {
-    return (SkDScalar)a * b;
+    return (SkDScalar) ((SkDScalar) a * b);
 }
 
 static void computeOuterProduct(SkMatrix* matrix,
@@ -48,7 +48,7 @@ static SkScalar dot(SkScalar ax, SkScalar ay, SkScalar bx, SkScalar by) {
                               SkDScalar_setMul(ay, by));
 }
 
-bool SkSetPoly3To3(SkMatrix* matrix, const SkPoint src[3], const SkPoint dst[3]) {
+bool SkSetPoly3To3_D(SkMatrix* matrix, const SkPoint src[3], const SkPoint dst[3]) {
     const SkPoint& srcAve = src[0];
     const SkPoint& dstAve = dst[0];
     
index a87631c96daeeac8e39a88d65189d125ad4647e0..f044909452c9cc2b780ed61aa341fbb26151f370 100644 (file)
@@ -2108,7 +2108,8 @@ GrTexture* GrContext::gaussianBlur(GrTexture* srcTexture,
     SkRect srcRect(rect);
     scale_rect(&srcRect, 1.0f / scaleFactorX, 1.0f / scaleFactorY);
     srcRect.roundOut();
-    scale_rect(&srcRect, scaleFactorX, scaleFactorY);
+    scale_rect(&srcRect, static_cast<float>(scaleFactorX), 
+                         static_cast<float>(scaleFactorY));
     this->setClip(srcRect);
 
     const GrTextureDesc desc = {
index c2e090c3be6017db9dbd5201fc04815bdd54bd11..cf05284740582c527d57183b1f04fb917cc09f30 100644 (file)
@@ -1431,8 +1431,8 @@ static GrTexture* filter_texture(GrContext* context, GrTexture* texture,
 
     const GrTextureDesc desc = {
         kRenderTarget_GrTextureFlagBit,
-        rect.width(),
-        rect.height(),
+        SkScalarCeilToInt(rect.width()),
+        SkScalarCeilToInt(rect.height()),
         kRGBA_8888_PM_GrPixelConfig,
         0 // samples
     };
@@ -1490,7 +1490,7 @@ void SkGpuDevice::drawSprite(const SkDraw& draw, const SkBitmap& bitmap,
     SkImageFilter* filter = paint.getImageFilter();
     if (NULL != filter) {
         GrTexture* filteredTexture = filter_texture(fContext, texture, filter,
-                                                    GrRect::MakeWH(w, h));
+                 GrRect::MakeWH(SkIntToScalar(w), SkIntToScalar(h)));
         if (filteredTexture) {
             grPaint.setTexture(kBitmapTextureIdx, filteredTexture);
             texture = filteredTexture;
@@ -1529,7 +1529,8 @@ void SkGpuDevice::drawDevice(const SkDraw& draw, SkDevice* device,
 
     SkImageFilter* filter = paint.getImageFilter();
     if (NULL != filter) {
-        GrRect rect = GrRect::MakeWH(devTex->width(), devTex->height());
+        GrRect rect = GrRect::MakeWH(SkIntToScalar(devTex->width()), 
+                                     SkIntToScalar(devTex->height()));
         GrTexture* filteredTexture = filter_texture(fContext, devTex, filter,
                                                     rect);
         if (filteredTexture) {
@@ -1591,7 +1592,8 @@ bool SkGpuDevice::filterImage(SkImageFilter* filter, const SkBitmap& src,
     SkAutoCachedTexture act(this, src, sampler, &texture);
 
     result->setConfig(src.config(), src.width(), src.height());
-    GrRect rect = GrRect::MakeWH(src.width(), src.height());
+    GrRect rect = GrRect::MakeWH(SkIntToScalar(src.width()), 
+                                 SkIntToScalar(src.height()));
     GrTexture* resultTexture = filter_texture(fContext, texture, filter, rect);
     if (resultTexture) {
         result->setPixelRef(new SkGrTexturePixelRef(resultTexture))->unref();
index cf23e6dbdf6944a0b3e926101aeca7496b5cfd31..f3aaa5efaedd6b20bcf9309f8f84494f4aa477e8 100644 (file)
@@ -1137,7 +1137,8 @@ SkData* SkPDFDevice::copyContentToData() const {
     // we have to clip to the content area; we've already applied the
     // initial transform, so just clip to the device size.
     if (fPageSize != fContentSize) {
-        SkRect r = SkRect::MakeWH(this->width(), this->height());
+        SkRect r = SkRect::MakeWH(SkIntToScalar(this->width()),
+                                  SkIntToScalar(this->height()));
         emit_clip(NULL, &r, &data);
     }