aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrTextureToYUVPlanes.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/GrTextureToYUVPlanes.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/GrTextureToYUVPlanes.cpp')
-rw-r--r--src/gpu/GrTextureToYUVPlanes.cpp17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/gpu/GrTextureToYUVPlanes.cpp b/src/gpu/GrTextureToYUVPlanes.cpp
index 7d01626162..0a0edee4df 100644
--- a/src/gpu/GrTextureToYUVPlanes.cpp
+++ b/src/gpu/GrTextureToYUVPlanes.cpp
@@ -19,7 +19,7 @@ namespace {
SkYUVColorSpace colorSpace);
};
-static bool convert_proxy(GrContext* context, sk_sp<GrTextureProxy> src,
+static bool convert_proxy(sk_sp<GrTextureProxy> src,
GrRenderTargetContext* dst, int dstW, int dstH,
SkYUVColorSpace colorSpace, MakeFPProc proc) {
@@ -32,7 +32,10 @@ static bool convert_proxy(GrContext* context, sk_sp<GrTextureProxy> src,
filter = GrSamplerParams::kBilerp_FilterMode;
}
- sk_sp<GrFragmentProcessor> fp(GrSimpleTextureEffect::Make(context, std::move(src), nullptr,
+ GrResourceProvider* resourceProvider = dst->resourceProvider();
+
+ sk_sp<GrFragmentProcessor> fp(GrSimpleTextureEffect::Make(resourceProvider, std::move(src),
+ nullptr,
SkMatrix::MakeScale(xScale, yScale),
filter));
if (!fp) {
@@ -121,32 +124,32 @@ bool GrTextureToYUVPlanes(GrContext* context, sk_sp<GrTextureProxy> proxy,
// Do all the draws before any readback.
if (yuvRenderTargetContext) {
- if (!convert_proxy(context, std::move(proxy), yuvRenderTargetContext.get(),
+ if (!convert_proxy(std::move(proxy), yuvRenderTargetContext.get(),
sizes[0].fWidth, sizes[0].fHeight,
colorSpace, GrYUVEffect::MakeRGBToYUV)) {
return false;
}
} else {
SkASSERT(yRenderTargetContext);
- if (!convert_proxy(context, proxy, yRenderTargetContext.get(),
+ if (!convert_proxy(proxy, yRenderTargetContext.get(),
sizes[0].fWidth, sizes[0].fHeight,
colorSpace, GrYUVEffect::MakeRGBToY)) {
return false;
}
if (uvRenderTargetContext) {
- if (!convert_proxy(context, std::move(proxy), uvRenderTargetContext.get(),
+ if (!convert_proxy(std::move(proxy), uvRenderTargetContext.get(),
sizes[1].fWidth, sizes[1].fHeight,
colorSpace, GrYUVEffect::MakeRGBToUV)) {
return false;
}
} else {
SkASSERT(uRenderTargetContext && vRenderTargetContext);
- if (!convert_proxy(context, proxy, uRenderTargetContext.get(),
+ if (!convert_proxy(proxy, uRenderTargetContext.get(),
sizes[1].fWidth, sizes[1].fHeight,
colorSpace, GrYUVEffect::MakeRGBToU)) {
return false;
}
- if (!convert_proxy(context, std::move(proxy), vRenderTargetContext.get(),
+ if (!convert_proxy(std::move(proxy), vRenderTargetContext.get(),
sizes[2].fWidth, sizes[2].fHeight,
colorSpace, GrYUVEffect::MakeRGBToV)) {
return false;