aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrBlurUtils.cpp
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2017-03-15 10:42:12 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-03-15 15:20:40 +0000
commit296b1ccf9b8e9c8b945645efcbaa9c71c7135f58 (patch)
treee8085e48ed8cd2a3b66316e95215f5b06f39bf50 /src/gpu/GrBlurUtils.cpp
parente0d4fbac00f240603e725b50d58d89048fd8b21f (diff)
Retract GrContext from src/gpu/effects
Change-Id: Iceb7263098286bafb2605ef17d1fe6bb25d71e97 Reviewed-on: https://skia-review.googlesource.com/9693 Commit-Queue: Robert Phillips <robertphillips@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/gpu/GrBlurUtils.cpp')
-rw-r--r--src/gpu/GrBlurUtils.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/gpu/GrBlurUtils.cpp b/src/gpu/GrBlurUtils.cpp
index b38b306cf9..9d28b54f54 100644
--- a/src/gpu/GrBlurUtils.cpp
+++ b/src/gpu/GrBlurUtils.cpp
@@ -30,8 +30,7 @@ static bool clip_bounds_quick_reject(const SkIRect& clipBounds, const SkIRect& r
// Draw a mask using the supplied paint. Since the coverage/geometry
// 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(GrContext* context,
- GrRenderTargetContext* renderTargetContext,
+static bool draw_mask(GrRenderTargetContext* renderTargetContext,
const GrClip& clip,
const SkMatrix& viewMatrix,
const SkIRect& maskRect,
@@ -42,10 +41,13 @@ static bool draw_mask(GrContext* context,
return false;
}
+ GrResourceProvider* resourceProvider = renderTargetContext->resourceProvider();
+
SkMatrix matrix = SkMatrix::MakeTrans(-SkIntToScalar(maskRect.fLeft),
-SkIntToScalar(maskRect.fTop));
matrix.preConcat(viewMatrix);
- paint.addCoverageFragmentProcessor(GrSimpleTextureEffect::Make(context, std::move(mask),
+ paint.addCoverageFragmentProcessor(GrSimpleTextureEffect::Make(resourceProvider,
+ std::move(mask),
nullptr, matrix));
renderTargetContext->fillRectWithLocalMatrix(clip, std::move(paint), GrAA::kNo, SkMatrix::I(),
@@ -100,7 +102,7 @@ static bool sw_draw_with_mask_filter(GrContext* context,
return false;
}
- return draw_mask(context, renderTargetContext, clipData, viewMatrix,
+ return draw_mask(renderTargetContext, clipData, viewMatrix,
dstM.fBounds, std::move(paint), sContext->asTextureProxyRef());
}
@@ -231,7 +233,7 @@ static void draw_path_with_mask_filter(GrContext* context,
viewMatrix,
finalIRect);
if (filtered) {
- if (draw_mask(context, renderTargetContext, clip, viewMatrix,
+ if (draw_mask(renderTargetContext, clip, viewMatrix,
finalIRect, std::move(paint), std::move(filtered))) {
// This path is completely drawn
return;