| Index: src/effects/SkGpuBlurUtils.cpp
|
| diff --git a/src/effects/SkGpuBlurUtils.cpp b/src/effects/SkGpuBlurUtils.cpp
|
| index 6133db11d20e41bdf31a06d5d7379c4f44a3e348..9da08e6f71f0f32d84d21aef5d027e4ffa7bdcb4 100644
|
| --- a/src/effects/SkGpuBlurUtils.cpp
|
| +++ b/src/effects/SkGpuBlurUtils.cpp
|
| @@ -28,11 +28,15 @@ static void scale_rect(SkRect* rect, float xScale, float yScale) {
|
| rect->fBottom = SkScalarMul(rect->fBottom, yScale);
|
| }
|
|
|
| -static float adjust_sigma(float sigma, int *scaleFactor, int *radius) {
|
| +static float adjust_sigma(float sigma, int maxTextureSize, int *scaleFactor, int *radius) {
|
| *scaleFactor = 1;
|
| while (sigma > MAX_BLUR_SIGMA) {
|
| *scaleFactor *= 2;
|
| sigma *= 0.5f;
|
| + if (*scaleFactor > maxTextureSize) {
|
| + *scaleFactor = maxTextureSize;
|
| + sigma = MAX_BLUR_SIGMA;
|
| + }
|
| }
|
| *radius = static_cast<int>(ceilf(sigma * 3.0f));
|
| SkASSERT(*radius <= GrConvolutionEffect::kMaxKernelRadius);
|
| @@ -129,8 +133,9 @@ GrTexture* GaussianBlur(GrContext* context,
|
| SkIRect clearRect;
|
| int scaleFactorX, radiusX;
|
| int scaleFactorY, radiusY;
|
| - sigmaX = adjust_sigma(sigmaX, &scaleFactorX, &radiusX);
|
| - sigmaY = adjust_sigma(sigmaY, &scaleFactorY, &radiusY);
|
| + int maxTextureSize = context->getMaxTextureSize();
|
| + sigmaX = adjust_sigma(sigmaX, maxTextureSize, &scaleFactorX, &radiusX);
|
| + sigmaY = adjust_sigma(sigmaY, maxTextureSize, &scaleFactorY, &radiusY);
|
|
|
| SkRect srcRect(rect);
|
| scale_rect(&srcRect, 1.0f / scaleFactorX, 1.0f / scaleFactorY);
|
|
|