| Index: src/gpu/GrBlurUtils.cpp
|
| diff --git a/src/gpu/GrBlurUtils.cpp b/src/gpu/GrBlurUtils.cpp
|
| index 58d12af1788e63f204bea8f8add07b9e3d3955ef..ca83c582c35487cc43a6616a771f11684a7954e6 100644
|
| --- a/src/gpu/GrBlurUtils.cpp
|
| +++ b/src/gpu/GrBlurUtils.cpp
|
| @@ -13,6 +13,7 @@
|
| #include "effects/GrSimpleTextureEffect.h"
|
| #include "GrStyle.h"
|
| #include "GrTexture.h"
|
| +#include "GrTextureProxy.h"
|
| #include "GrTextureProvider.h"
|
| #include "SkDraw.h"
|
| #include "SkGrPriv.h"
|
| @@ -32,7 +33,7 @@ static bool draw_mask(GrRenderTargetContext* renderTargetContext,
|
| const SkMatrix& viewMatrix,
|
| const SkIRect& maskRect,
|
| GrPaint* grp,
|
| - GrTexture* mask) {
|
| + GrTextureProxy* mask) {
|
| SkMatrix matrix;
|
| matrix.setTranslate(-SkIntToScalar(maskRect.fLeft), -SkIntToScalar(maskRect.fTop));
|
| matrix.postIDiv(mask->width(), mask->height());
|
| @@ -88,16 +89,17 @@ static bool sw_draw_with_mask_filter(GrRenderTargetContext* renderTargetContext,
|
| texture->writePixels(0, 0, desc.fWidth, desc.fHeight, desc.fConfig,
|
| dstM.fImage, dstM.fRowBytes);
|
|
|
| - return draw_mask(renderTargetContext, clipData, viewMatrix, dstM.fBounds, grp, texture.get());
|
| + sk_sp<GrTextureProxy> proxy(GrTextureProxy::Make(texture));
|
| + return draw_mask(renderTargetContext, clipData, viewMatrix, dstM.fBounds, grp, proxy.get());
|
| }
|
|
|
| // Create a mask of 'devPath' and place the result in 'mask'.
|
| -static sk_sp<GrTexture> create_mask_GPU(GrContext* context,
|
| - const SkIRect& maskRect,
|
| - const SkPath& devPath,
|
| - SkStrokeRec::InitStyle fillOrHairline,
|
| - bool doAA,
|
| - int sampleCnt) {
|
| +static sk_sp<GrTextureProxy> create_mask_GPU(GrContext* context,
|
| + const SkIRect& maskRect,
|
| + const SkPath& devPath,
|
| + SkStrokeRec::InitStyle fillOrHairline,
|
| + bool doAA,
|
| + int sampleCnt) {
|
| if (!doAA) {
|
| // Don't need MSAA if mask isn't AA
|
| sampleCnt = 0;
|
| @@ -125,7 +127,7 @@ static sk_sp<GrTexture> create_mask_GPU(GrContext* context,
|
| SkMatrix translate;
|
| translate.setTranslate(-SkIntToScalar(maskRect.fLeft), -SkIntToScalar(maskRect.fTop));
|
| renderTargetContext->drawPath(clip, tempPaint, translate, devPath, GrStyle(fillOrHairline));
|
| - return renderTargetContext->asTexture();;
|
| + return sk_ref_sp(renderTargetContext->asDeferredTexture());
|
| }
|
|
|
| static void draw_path_with_mask_filter(GrContext* context,
|
| @@ -204,18 +206,18 @@ static void draw_path_with_mask_filter(GrContext* context,
|
| return;
|
| }
|
|
|
| - sk_sp<GrTexture> mask(create_mask_GPU(context,
|
| - finalIRect,
|
| - *path,
|
| - fillOrHairline,
|
| - paint->isAntiAlias(),
|
| - renderTargetContext->numColorSamples()));
|
| + sk_sp<GrTextureProxy> mask(create_mask_GPU(context,
|
| + finalIRect,
|
| + *path,
|
| + fillOrHairline,
|
| + paint->isAntiAlias(),
|
| + renderTargetContext->numColorSamples()));
|
| if (mask) {
|
| - GrTexture* filtered;
|
| + GrTextureProxy* filtered;
|
|
|
| if (maskFilter->filterMaskGPU(mask.get(), viewMatrix, finalIRect, &filtered)) {
|
| // filterMaskGPU gives us ownership of a ref to the result
|
| - sk_sp<GrTexture> atu(filtered);
|
| + sk_sp<GrTextureProxy> atu(filtered);
|
| if (draw_mask(renderTargetContext, clip, viewMatrix, finalIRect, paint, filtered)) {
|
| // This path is completely drawn
|
| return;
|
|
|