| Index: src/effects/SkGpuBlurUtils.cpp
|
| diff --git a/src/effects/SkGpuBlurUtils.cpp b/src/effects/SkGpuBlurUtils.cpp
|
| index 832e48a4e0247d98b614a2495d7338da668463d3..77e225888c91f519c6d2eee8fa4ae285f5550af2 100644
|
| --- a/src/effects/SkGpuBlurUtils.cpp
|
| +++ b/src/effects/SkGpuBlurUtils.cpp
|
| @@ -45,7 +45,6 @@
|
|
|
| static void convolve_gaussian_1d(GrContext* context,
|
| GrRenderTarget* rt,
|
| - const GrClip& clip,
|
| const SkRect& srcRect,
|
| const SkRect& dstRect,
|
| GrTexture* texture,
|
| @@ -58,12 +57,11 @@
|
| SkAutoTUnref<GrFragmentProcessor> conv(GrConvolutionEffect::CreateGaussian(
|
| texture, direction, radius, sigma, useBounds, bounds));
|
| paint.addColorProcessor(conv);
|
| - context->drawNonAARectToRect(rt, clip, paint, SkMatrix::I(), dstRect, srcRect);
|
| + context->drawNonAARectToRect(rt, paint, SkMatrix::I(), dstRect, srcRect);
|
| }
|
|
|
| static void convolve_gaussian_2d(GrContext* context,
|
| GrRenderTarget* rt,
|
| - const GrClip& clip,
|
| const SkRect& srcRect,
|
| const SkRect& dstRect,
|
| GrTexture* texture,
|
| @@ -81,12 +79,11 @@
|
| useBounds ? GrTextureDomain::kClamp_Mode : GrTextureDomain::kIgnore_Mode,
|
| true, sigmaX, sigmaY));
|
| paint.addColorProcessor(conv);
|
| - context->drawNonAARectToRect(rt, clip, paint, SkMatrix::I(), dstRect, srcRect);
|
| + context->drawNonAARectToRect(rt, paint, SkMatrix::I(), dstRect, srcRect);
|
| }
|
|
|
| static void convolve_gaussian(GrContext* context,
|
| GrRenderTarget* rt,
|
| - const GrClip& clip,
|
| const SkRect& srcRect,
|
| const SkRect& dstRect,
|
| GrTexture* texture,
|
| @@ -96,7 +93,7 @@
|
| bool cropToSrcRect) {
|
| float bounds[2] = { 0.0f, 1.0f };
|
| if (!cropToSrcRect) {
|
| - convolve_gaussian_1d(context, rt, clip, srcRect, dstRect, texture,
|
| + convolve_gaussian_1d(context, rt, srcRect, dstRect, texture,
|
| direction, radius, sigma, false, bounds);
|
| return;
|
| }
|
| @@ -128,15 +125,15 @@
|
| }
|
| if (radius >= size * SK_ScalarHalf) {
|
| // Blur radius covers srcRect; use bounds over entire draw
|
| - convolve_gaussian_1d(context, rt, clip, srcRect, dstRect, texture,
|
| + convolve_gaussian_1d(context, rt, srcRect, dstRect, texture,
|
| direction, radius, sigma, true, bounds);
|
| } else {
|
| // Draw upper and lower margins with bounds; middle without.
|
| - convolve_gaussian_1d(context, rt, clip, lowerSrcRect, lowerDstRect, texture,
|
| + convolve_gaussian_1d(context, rt, lowerSrcRect, lowerDstRect, texture,
|
| direction, radius, sigma, true, bounds);
|
| - convolve_gaussian_1d(context, rt, clip, upperSrcRect, upperDstRect, texture,
|
| + convolve_gaussian_1d(context, rt, upperSrcRect, upperDstRect, texture,
|
| direction, radius, sigma, true, bounds);
|
| - convolve_gaussian_1d(context, rt, clip, middleSrcRect, middleDstRect, texture,
|
| + convolve_gaussian_1d(context, rt, middleSrcRect, middleDstRect, texture,
|
| direction, radius, sigma, false, bounds);
|
| }
|
| }
|
| @@ -163,8 +160,7 @@
|
| scale_rect(&srcRect, static_cast<float>(scaleFactorX),
|
| static_cast<float>(scaleFactorY));
|
|
|
| - // setup new clip
|
| - GrClip clip(SkRect::MakeWH(srcRect.width(), srcRect.height()));
|
| + GrContext::AutoClip acs(context, SkRect::MakeWH(srcRect.width(), srcRect.height()));
|
|
|
| SkASSERT(kBGRA_8888_GrPixelConfig == srcTexture->config() ||
|
| kRGBA_8888_GrPixelConfig == srcTexture->config() ||
|
| @@ -217,8 +213,8 @@
|
| }
|
| scale_rect(&dstRect, i < scaleFactorX ? 0.5f : 1.0f,
|
| i < scaleFactorY ? 0.5f : 1.0f);
|
| - context->drawNonAARectToRect(dstTexture->asRenderTarget(), clip, paint, SkMatrix::I(),
|
| - dstRect, srcRect);
|
| + context->drawNonAARectToRect(dstTexture->asRenderTarget(), paint, SkMatrix::I(), dstRect,
|
| + srcRect);
|
| srcRect = dstRect;
|
| srcTexture = dstTexture;
|
| SkTSwap(dstTexture, tempTexture);
|
| @@ -233,8 +229,8 @@
|
| // We shouldn't be scaling because this is a small size blur
|
| SkASSERT((scaleFactorX == scaleFactorY) == 1);
|
| SkRect dstRect = SkRect::MakeWH(srcRect.width(), srcRect.height());
|
| - convolve_gaussian_2d(context, dstTexture->asRenderTarget(), clip, srcRect, dstRect,
|
| - srcTexture, radiusX, radiusY, sigmaX, sigmaY, cropToRect, srcIRect);
|
| + convolve_gaussian_2d(context, dstTexture->asRenderTarget(), srcRect, dstRect, srcTexture,
|
| + radiusX, radiusY, sigmaX, sigmaY, cropToRect, srcIRect);
|
| srcTexture = dstTexture;
|
| srcRect = dstRect;
|
| SkTSwap(dstTexture, tempTexture);
|
| @@ -249,9 +245,8 @@
|
| context->clear(&clearRect, 0x0, false, srcTexture->asRenderTarget());
|
| }
|
| SkRect dstRect = SkRect::MakeWH(srcRect.width(), srcRect.height());
|
| - convolve_gaussian(context, dstTexture->asRenderTarget(), clip, srcRect, dstRect,
|
| - srcTexture, Gr1DKernelEffect::kX_Direction, radiusX, sigmaX,
|
| - cropToRect);
|
| + convolve_gaussian(context, dstTexture->asRenderTarget(), srcRect, dstRect, srcTexture,
|
| + Gr1DKernelEffect::kX_Direction, radiusX, sigmaX, cropToRect);
|
| srcTexture = dstTexture;
|
| srcRect = dstRect;
|
| SkTSwap(dstTexture, tempTexture);
|
| @@ -267,9 +262,8 @@
|
| }
|
|
|
| SkRect dstRect = SkRect::MakeWH(srcRect.width(), srcRect.height());
|
| - convolve_gaussian(context, dstTexture->asRenderTarget(), clip, srcRect,
|
| - dstRect, srcTexture, Gr1DKernelEffect::kY_Direction, radiusY, sigmaY,
|
| - cropToRect);
|
| + convolve_gaussian(context, dstTexture->asRenderTarget(), srcRect, dstRect, srcTexture,
|
| + Gr1DKernelEffect::kY_Direction, radiusY, sigmaY, cropToRect);
|
| srcTexture = dstTexture;
|
| srcRect = dstRect;
|
| SkTSwap(dstTexture, tempTexture);
|
| @@ -295,8 +289,8 @@
|
|
|
| SkRect dstRect(srcRect);
|
| scale_rect(&dstRect, (float) scaleFactorX, (float) scaleFactorY);
|
| - context->drawNonAARectToRect(dstTexture->asRenderTarget(), clip, paint,
|
| - SkMatrix::I(), dstRect, srcRect);
|
| + context->drawNonAARectToRect(dstTexture->asRenderTarget(), paint, SkMatrix::I(), dstRect,
|
| + srcRect);
|
| srcRect = dstRect;
|
| srcTexture = dstTexture;
|
| SkTSwap(dstTexture, tempTexture);
|
|
|