From 296b1ccf9b8e9c8b945645efcbaa9c71c7135f58 Mon Sep 17 00:00:00 2001 From: Robert Phillips Date: Wed, 15 Mar 2017 10:42:12 -0400 Subject: Retract GrContext from src/gpu/effects Change-Id: Iceb7263098286bafb2605ef17d1fe6bb25d71e97 Reviewed-on: https://skia-review.googlesource.com/9693 Commit-Queue: Robert Phillips Reviewed-by: Brian Salomon --- gm/etc1.cpp | 2 +- gm/texdata.cpp | 2 +- gm/texturedomaineffect.cpp | 2 +- gm/windowrectangles.cpp | 6 +++--- gm/yuvtorgbeffect.cpp | 7 ++++--- 5 files changed, 10 insertions(+), 9 deletions(-) (limited to 'gm') diff --git a/gm/etc1.cpp b/gm/etc1.cpp index a005c8fce3..2bb93d0aa4 100644 --- a/gm/etc1.cpp +++ b/gm/etc1.cpp @@ -88,7 +88,7 @@ protected: const SkMatrix trans = SkMatrix::MakeTrans(-kPad, -kPad); - sk_sp fp = GrSimpleTextureEffect::Make(context, + sk_sp fp = GrSimpleTextureEffect::Make(context->resourceProvider(), std::move(proxy), nullptr, trans); diff --git a/gm/texdata.cpp b/gm/texdata.cpp index 24153f8cf6..7bb7173f13 100644 --- a/gm/texdata.cpp +++ b/gm/texdata.cpp @@ -117,7 +117,7 @@ DEF_SIMPLE_GM_BG(texdata, canvas, 2 * S, 2 * S, SK_ColorBLACK) { } else { vm.reset(); } - paint.addColorTextureProcessor(context, tContext->asTextureProxyRef(), + paint.addColorTextureProcessor(context->resourceProvider(), tContext->asTextureProxyRef(), nullptr, vm); renderTargetContext->drawRect(clip, GrPaint(paint), GrAA::kNo, vm, diff --git a/gm/texturedomaineffect.cpp b/gm/texturedomaineffect.cpp index 7cb3bce61a..88bcc57c9a 100644 --- a/gm/texturedomaineffect.cpp +++ b/gm/texturedomaineffect.cpp @@ -123,7 +123,7 @@ protected: grPaint.setXPFactory(GrPorterDuffXPFactory::Get(SkBlendMode::kSrc)); sk_sp fp( GrTextureDomainEffect::Make( - context, proxy, + context->resourceProvider(), proxy, nullptr, textureMatrices[tm], GrTextureDomain::MakeTexelDomainForMode(texelDomains[d], mode), mode, GrSamplerParams::kNone_FilterMode)); diff --git a/gm/windowrectangles.cpp b/gm/windowrectangles.cpp index 202836f18a..d0bae11a21 100644 --- a/gm/windowrectangles.cpp +++ b/gm/windowrectangles.cpp @@ -149,9 +149,9 @@ private: */ class AlphaOnlyClip final : public MaskOnlyClipBase { public: - AlphaOnlyClip(GrContext* context, sk_sp mask, int x, int y) { + AlphaOnlyClip(GrResourceProvider* resourceProvider, sk_sp mask, int x, int y) { int w = mask->width(), h = mask->height(); - fFP = GrDeviceSpaceTextureDecalFragmentProcessor::Make(context, std::move(mask), + fFP = GrDeviceSpaceTextureDecalFragmentProcessor::Make(resourceProvider, std::move(mask), SkIRect::MakeWH(w, h), {x, y}); } private: @@ -225,7 +225,7 @@ void WindowRectanglesMaskGM::visualizeAlphaMask(GrContext* ctx, GrRenderTargetCo // Now visualize the alpha mask by drawing a rect over the area where it is defined. The regions // inside window rectangles or outside the scissor should still have the initial checkerboard // intact. (This verifies we didn't spend any time modifying those pixels in the mask.) - AlphaOnlyClip clip(ctx, maskRTC->asTextureProxyRef(), x, y); + AlphaOnlyClip clip(ctx->resourceProvider(), maskRTC->asTextureProxyRef(), x, y); rtc->drawRect(clip, std::move(paint), GrAA::kYes, SkMatrix::I(), SkRect::Make(SkIRect::MakeXYWH(x, y, maskRTC->width(), maskRTC->height()))); } diff --git a/gm/yuvtorgbeffect.cpp b/gm/yuvtorgbeffect.cpp index 376621d92a..fda0565559 100644 --- a/gm/yuvtorgbeffect.cpp +++ b/gm/yuvtorgbeffect.cpp @@ -119,7 +119,7 @@ protected: for (int i = 0; i < 6; ++i) { sk_sp fp( - GrYUVEffect::MakeYUVToRGB(context, + GrYUVEffect::MakeYUVToRGB(context->resourceProvider(), proxy[indices[i][0]], proxy[indices[i][1]], proxy[indices[i][2]], @@ -250,8 +250,9 @@ protected: GrPaint grPaint; grPaint.setXPFactory(GrPorterDuffXPFactory::Get(SkBlendMode::kSrc)); sk_sp fp( - GrYUVEffect::MakeYUVToRGB(context, proxy[0], proxy[1], proxy[2], - sizes, static_cast(space), true)); + GrYUVEffect::MakeYUVToRGB(context->resourceProvider(), + proxy[0], proxy[1], proxy[2], sizes, + static_cast(space), true)); if (fp) { SkMatrix viewMatrix; viewMatrix.setTranslate(x, y); -- cgit v1.2.3