aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm
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 /gm
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 'gm')
-rw-r--r--gm/etc1.cpp2
-rw-r--r--gm/texdata.cpp2
-rw-r--r--gm/texturedomaineffect.cpp2
-rw-r--r--gm/windowrectangles.cpp6
-rw-r--r--gm/yuvtorgbeffect.cpp7
5 files changed, 10 insertions, 9 deletions
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<GrFragmentProcessor> fp = GrSimpleTextureEffect::Make(context,
+ sk_sp<GrFragmentProcessor> 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<GrFragmentProcessor> 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<GrTextureProxy> mask, int x, int y) {
+ AlphaOnlyClip(GrResourceProvider* resourceProvider, sk_sp<GrTextureProxy> 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<GrFragmentProcessor> 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<GrFragmentProcessor> fp(
- GrYUVEffect::MakeYUVToRGB(context, proxy[0], proxy[1], proxy[2],
- sizes, static_cast<SkYUVColorSpace>(space), true));
+ GrYUVEffect::MakeYUVToRGB(context->resourceProvider(),
+ proxy[0], proxy[1], proxy[2], sizes,
+ static_cast<SkYUVColorSpace>(space), true));
if (fp) {
SkMatrix viewMatrix;
viewMatrix.setTranslate(x, y);