diff options
author | 2015-10-15 08:01:48 -0700 | |
---|---|---|
committer | 2015-10-15 08:01:49 -0700 | |
commit | 2e1e51f04985f7c258b96f0decc190456f5dd74d (patch) | |
tree | a7c76384e447455ba8fb95575a41696fa5777bcf /src/gpu/GrBlurUtils.cpp | |
parent | 860e8a67190e024b7375e52e270e6bd0a17af86e (diff) |
GrDrawContext now holds GrRenderTarget pointer
Review URL: https://codereview.chromium.org/1404823005
Diffstat (limited to 'src/gpu/GrBlurUtils.cpp')
-rw-r--r-- | src/gpu/GrBlurUtils.cpp | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/src/gpu/GrBlurUtils.cpp b/src/gpu/GrBlurUtils.cpp index a396c3340d..5d691fb137 100644 --- a/src/gpu/GrBlurUtils.cpp +++ b/src/gpu/GrBlurUtils.cpp @@ -26,7 +26,6 @@ static bool clip_bounds_quick_reject(const SkIRect& clipBounds, const SkIRect& r // is already burnt into the mask this boils down to a rect draw. // Return true if the mask was successfully drawn. static bool draw_mask(GrDrawContext* drawContext, - GrRenderTarget* rt, const GrClip& clip, const SkMatrix& viewMatrix, const SkRect& maskRect, @@ -43,13 +42,12 @@ static bool draw_mask(GrDrawContext* drawContext, if (!viewMatrix.invert(&inverse)) { return false; } - drawContext->drawNonAARectWithLocalMatrix(rt, clip, *grp, SkMatrix::I(), maskRect, inverse); + drawContext->drawNonAARectWithLocalMatrix(clip, *grp, SkMatrix::I(), maskRect, inverse); return true; } static bool draw_with_mask_filter(GrDrawContext* drawContext, GrTextureProvider* textureProvider, - GrRenderTarget* rt, const GrClip& clipData, const SkMatrix& viewMatrix, const SkPath& devPath, @@ -91,7 +89,7 @@ static bool draw_with_mask_filter(GrDrawContext* drawContext, SkRect maskRect = SkRect::Make(dstM.fBounds); - return draw_mask(drawContext, rt, clipData, viewMatrix, maskRect, grp, texture); + return draw_mask(drawContext, clipData, viewMatrix, maskRect, grp, texture); } // Create a mask of 'devPath' and place the result in 'mask'. @@ -126,12 +124,12 @@ static GrTexture* create_mask_GPU(GrContext* context, SkRect clipRect = SkRect::MakeWH(maskRect->width(), maskRect->height()); - SkAutoTUnref<GrDrawContext> drawContext(context->drawContext()); + SkAutoTUnref<GrDrawContext> drawContext(context->drawContext(mask->asRenderTarget())); if (!drawContext) { return nullptr; } - drawContext->clear(mask->asRenderTarget(), nullptr, 0x0, true); + drawContext->clear(nullptr, 0x0, true); GrPaint tempPaint; tempPaint.setAntiAlias(doAA); @@ -144,7 +142,7 @@ static GrTexture* create_mask_GPU(GrContext* context, // the origin using tempPaint. SkMatrix translate; translate.setTranslate(-maskRect->fLeft, -maskRect->fTop); - drawContext->drawPath(mask->asRenderTarget(), clip, tempPaint, translate, devPath, strokeInfo); + drawContext->drawPath(clip, tempPaint, translate, devPath, strokeInfo); return mask; } @@ -247,7 +245,6 @@ void GrBlurUtils::drawPathWithMaskFilter(GrContext* context, if (paint.getMaskFilter()->directFilterMaskGPU(context->textureProvider(), drawContext, - renderTarget, &grPaint, clip, viewMatrix, @@ -272,7 +269,6 @@ void GrBlurUtils::drawPathWithMaskFilter(GrContext* context, // filterMaskGPU gives us ownership of a ref to the result SkAutoTUnref<GrTexture> atu(filtered); if (draw_mask(drawContext, - renderTarget, clip, viewMatrix, maskRect, @@ -289,12 +285,12 @@ void GrBlurUtils::drawPathWithMaskFilter(GrContext* context, // GPU path fails SkPaint::Style style = strokeInfo.isHairlineStyle() ? SkPaint::kStroke_Style : SkPaint::kFill_Style; - draw_with_mask_filter(drawContext, context->textureProvider(), renderTarget, + draw_with_mask_filter(drawContext, context->textureProvider(), clip, viewMatrix, *devPathPtr, paint.getMaskFilter(), clipBounds, &grPaint, style); return; } - drawContext->drawPath(renderTarget, clip, grPaint, viewMatrix, *pathPtr, strokeInfo); + drawContext->drawPath(clip, grPaint, viewMatrix, *pathPtr, strokeInfo); } |