aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkGpuBlurUtils.cpp
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2017-06-15 12:07:18 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-06-15 17:18:19 +0000
commitfbcef6eb8abad142daf45418516550f7635b4a52 (patch)
tree1fb2b2a1df72ba87ec05a91bd1cd271e24b5544e /src/core/SkGpuBlurUtils.cpp
parentbaaf439eb5d08097d794f13800e5bf7ce8885f95 (diff)
Clean up GrResourceProvider usage
The only substantive changes are the removal of GrProxy instantiation in: SkGpuBlurUtils::GaussianBlur GrSimpleTextureEffect::Make* Change-Id: I10970609693bd6ff5b3a3c21b41d82642bb277bc Reviewed-on: https://skia-review.googlesource.com/19965 Reviewed-by: Greg Daniel <egdaniel@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/core/SkGpuBlurUtils.cpp')
-rw-r--r--src/core/SkGpuBlurUtils.cpp23
1 files changed, 4 insertions, 19 deletions
diff --git a/src/core/SkGpuBlurUtils.cpp b/src/core/SkGpuBlurUtils.cpp
index 64bf203fd3..40a6c24706 100644
--- a/src/core/SkGpuBlurUtils.cpp
+++ b/src/core/SkGpuBlurUtils.cpp
@@ -79,10 +79,8 @@ static void convolve_gaussian_1d(GrRenderTargetContext* renderTargetContext,
GrPaint paint;
paint.setGammaCorrect(renderTargetContext->isGammaCorrect());
- GrResourceProvider* resourceProvider = renderTargetContext->resourceProvider();
-
sk_sp<GrFragmentProcessor> conv(GrGaussianConvolutionFragmentProcessor::Make(
- resourceProvider, std::move(proxy), direction, radius, sigma, useBounds, bounds));
+ std::move(proxy), direction, radius, sigma, useBounds, bounds));
paint.addColorFragmentProcessor(std::move(conv));
paint.setPorterDuffXPFactory(SkBlendMode::kSrc);
SkMatrix localMatrix = SkMatrix::MakeTrans(-SkIntToScalar(srcOffset.x()),
@@ -109,10 +107,8 @@ static void convolve_gaussian_2d(GrRenderTargetContext* renderTargetContext,
paint.setGammaCorrect(renderTargetContext->isGammaCorrect());
SkIRect bounds = srcBounds ? *srcBounds : SkIRect::EmptyIRect();
- GrResourceProvider* resourceProvider = renderTargetContext->resourceProvider();
-
sk_sp<GrFragmentProcessor> conv(GrMatrixConvolutionEffect::MakeGaussian(
- resourceProvider, std::move(proxy), bounds, size, 1.0, 0.0, kernelOffset,
+ std::move(proxy), bounds, size, 1.0, 0.0, kernelOffset,
srcBounds ? GrTextureDomain::kDecal_Mode : GrTextureDomain::kIgnore_Mode,
true, sigmaX, sigmaY));
paint.addColorFragmentProcessor(std::move(conv));
@@ -197,16 +193,6 @@ sk_sp<GrRenderTargetContext> GaussianBlur(GrContext* context,
SkBackingFit fit) {
SkASSERT(context);
- {
- // MDB TODO: remove this
- // Chrome is crashing with proxies when they need to be instantiated.
- // Force an instantiation here (where, in olden days, we used to require a GrTexture)
- // to see if the input is already un-instantiable.
- if (!srcProxy->instantiate(context->resourceProvider())) {
- return nullptr;
- }
- }
-
SkIRect clearRect;
int scaleFactorX, radiusX;
int scaleFactorY, radiusY;
@@ -280,7 +266,6 @@ sk_sp<GrRenderTargetContext> GaussianBlur(GrContext* context,
domain.inset((i < scaleFactorX) ? SK_ScalarHalf : 0.0f,
(i < scaleFactorY) ? SK_ScalarHalf : 0.0f);
sk_sp<GrFragmentProcessor> fp(GrTextureDomainEffect::Make(
- context->resourceProvider(),
std::move(srcProxy),
nullptr,
SkMatrix::I(),
@@ -292,7 +277,7 @@ sk_sp<GrRenderTargetContext> GaussianBlur(GrContext* context,
srcOffset.set(0, 0);
} else {
GrSamplerParams params(SkShader::kClamp_TileMode, GrSamplerParams::kBilerp_FilterMode);
- paint.addColorTextureProcessor(context->resourceProvider(), std::move(srcProxy),
+ paint.addColorTextureProcessor(std::move(srcProxy),
nullptr, SkMatrix::I(), params);
}
paint.setPorterDuffXPFactory(SkBlendMode::kSrc);
@@ -379,7 +364,7 @@ sk_sp<GrRenderTargetContext> GaussianBlur(GrContext* context,
return nullptr;
}
- paint.addColorTextureProcessor(context->resourceProvider(), std::move(proxy),
+ paint.addColorTextureProcessor(std::move(proxy),
nullptr, SkMatrix::I(), params);
paint.setPorterDuffXPFactory(SkBlendMode::kSrc);