From fdaf2b9f8b812b5ca594fd5cdc66c0218ebd8b60 Mon Sep 17 00:00:00 2001 From: "senorblanco@chromium.org" Date: Thu, 21 Jul 2011 22:16:05 +0000 Subject: [PATCH] Revert r1937 while I try to figure out the GM failures. (Unreviewed; build fix). git-svn-id: http://skia.googlecode.com/svn/trunk@1938 2bbb7eff-a529-9590-31e7-b0007b416f81 --- gpu/src/GrContext.cpp | 1 - src/gpu/SkGpuDevice.cpp | 22 ++++++++++------------ 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/gpu/src/GrContext.cpp b/gpu/src/GrContext.cpp index b829323b2e..ef5ad1157d 100644 --- a/gpu/src/GrContext.cpp +++ b/gpu/src/GrContext.cpp @@ -1736,6 +1736,5 @@ void GrContext::convolve(GrTexture* texture, fGpu->setSamplerState(0, sampler); fGpu->setViewMatrix(GrMatrix::I()); fGpu->setTexture(0, texture); - fGpu->setBlendFunc(kOne_BlendCoeff, kZero_BlendCoeff); fGpu->drawSimpleRect(rect, NULL, 1 << 0); } diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp index e54e0de494..c4e0ebecd1 100644 --- a/src/gpu/SkGpuDevice.cpp +++ b/src/gpu/SkGpuDevice.cpp @@ -913,7 +913,9 @@ static bool drawWithGPUMaskFilter(GrContext* context, const SkPath& path, GrClip oldClip = context->getClip(); context->setRenderTarget(dstTexture->asRenderTarget()); context->setClip(srcRect); + // FIXME: could just clear bounds context->clear(NULL, 0); + GrMatrix transM; GrPaint tempPaint; tempPaint.reset(); @@ -957,6 +959,9 @@ static bool drawWithGPUMaskFilter(GrContext* context, const SkPath& path, context->setRenderTarget(dstTexture->asRenderTarget()); SkRect dstRect(srcRect); scaleRect(&dstRect, 0.5f); + // Clear out 1 pixel border for linear filtering. + // FIXME: for now, clear everything + context->clear(NULL, 0); paint.setTexture(0, srcTexture); context->drawRectToRect(paint, dstRect, srcRect); srcRect = dstRect; @@ -967,23 +972,13 @@ static bool drawWithGPUMaskFilter(GrContext* context, const SkPath& path, float* kernel = kernelStorage.get(); buildKernel(sigma, kernel, kernelWidth); - // Clear out a halfWidth to the right of the srcRect to prevent the - // X convolution from reading garbage. - SkIRect clearRect = SkIRect::MakeXYWH( - srcRect.fRight, srcRect.fTop, halfWidth, srcRect.height()); - context->clear(&clearRect, 0x0); - context->setRenderTarget(dstTexture->asRenderTarget()); + context->clear(NULL, 0); context->convolveInX(srcTexture, srcRect, kernel, kernelWidth); SkTSwap(srcTexture, dstTexture); - // Clear out a halfWidth below the srcRect to prevent the Y - // convolution from reading garbage. - clearRect = SkIRect::MakeXYWH( - srcRect.fLeft, srcRect.fBottom, srcRect.width(), halfWidth); - context->clear(&clearRect, 0x0); - context->setRenderTarget(dstTexture->asRenderTarget()); + context->clear(NULL, 0); context->convolveInY(srcTexture, srcRect, kernel, kernelWidth); SkTSwap(srcTexture, dstTexture); @@ -993,6 +988,9 @@ static bool drawWithGPUMaskFilter(GrContext* context, const SkPath& path, sampleM.setIDiv(srcTexture->width(), srcTexture->height()); paint.getTextureSampler(0)->setMatrix(sampleM); context->setRenderTarget(dstTexture->asRenderTarget()); + // Clear out 2 pixel border for bicubic filtering. + // FIXME: for now, clear everything + context->clear(NULL, 0); paint.setTexture(0, srcTexture); SkRect dstRect(srcRect); scaleRect(&dstRect, scaleFactor);