From 8e1c4e672553ecae2745168514240705f3516773 Mon Sep 17 00:00:00 2001 From: Robert Phillips Date: Sun, 19 Feb 2017 12:27:01 -0500 Subject: Remove asTextureRef from SkSpecialImage & update effects accordingly (take 2) This CL also renames SkSpecialImage::asTextureProxy to asTextureProxyRef This is a reland of: https://skia-review.googlesource.com/c/7995/ (Remove asTextureRef from SkSpecialImage & update effects accordingly) It should be good to land since https://skia-review.googlesource.com/c/8701/ (Replace SkSpecialImage::makeTightSubset with asImage (take 2)) fixes the Chrome-side issue Change-Id: I3d88b2b3d23fd69f3fb914a69dacca96cbc038a4 Reviewed-on: https://skia-review.googlesource.com/8450 Commit-Queue: Robert Phillips Reviewed-by: Brian Salomon --- src/effects/GrAlphaThresholdFragmentProcessor.h | 33 ++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) (limited to 'src/effects/GrAlphaThresholdFragmentProcessor.h') diff --git a/src/effects/GrAlphaThresholdFragmentProcessor.h b/src/effects/GrAlphaThresholdFragmentProcessor.h index fe97c7d96c..2dd18e807a 100644 --- a/src/effects/GrAlphaThresholdFragmentProcessor.h +++ b/src/effects/GrAlphaThresholdFragmentProcessor.h @@ -25,7 +25,30 @@ public: GrTexture* maskTexture, float innerThreshold, float outerThreshold, - const SkIRect& bounds); + const SkIRect& bounds) { + return sk_sp(new GrAlphaThresholdFragmentProcessor( + texture, + std::move(colorSpaceXform), + maskTexture, + innerThreshold, outerThreshold, + bounds)); + } + + static sk_sp Make(GrContext* context, + sk_sp proxy, + sk_sp colorSpaceXform, + GrTexture* maskTexture, + float innerThreshold, + float outerThreshold, + const SkIRect& bounds) { + return sk_sp(new GrAlphaThresholdFragmentProcessor( + context, + std::move(proxy), + std::move(colorSpaceXform), + maskTexture, + innerThreshold, outerThreshold, + bounds)); + } const char* name() const override { return "Alpha Threshold"; } @@ -44,6 +67,14 @@ private: float outerThreshold, const SkIRect& bounds); + GrAlphaThresholdFragmentProcessor(GrContext*, + sk_sp proxy, + sk_sp colorSpaceXform, + GrTexture* maskTexture, + float innerThreshold, + float outerThreshold, + const SkIRect& bounds); + GrGLSLFragmentProcessor* onCreateGLSLInstance() const override; void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override; -- cgit v1.2.3