From 8637a365518a82901d313d61eecd83a0c5102fe9 Mon Sep 17 00:00:00 2001 From: "robertphillips@google.com" Date: Tue, 10 Apr 2012 18:32:35 +0000 Subject: Minor Windows compiler complaint fixes http://codereview.appspot.com/5988072/ git-svn-id: http://skia.googlecode.com/svn/trunk@3644 2bbb7eff-a529-9590-31e7-b0007b416f81 --- src/gpu/GrContext.cpp | 3 ++- src/gpu/SkGpuDevice.cpp | 12 +++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) (limited to 'src/gpu') diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp index a87631c96d..f044909452 100644 --- a/src/gpu/GrContext.cpp +++ b/src/gpu/GrContext.cpp @@ -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(scaleFactorX), + static_cast(scaleFactorY)); this->setClip(srcRect); const GrTextureDesc desc = { diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp index c2e090c3be..cf05284740 100644 --- a/src/gpu/SkGpuDevice.cpp +++ b/src/gpu/SkGpuDevice.cpp @@ -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(); -- cgit v1.2.3