aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/effects/GrAlphaThresholdFragmentProcessor.h
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2017-02-19 12:27:01 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-02-20 19:21:53 +0000
commit8e1c4e672553ecae2745168514240705f3516773 (patch)
treee6a30fef483a4701d7e4203129805880d79f4242 /src/effects/GrAlphaThresholdFragmentProcessor.h
parenta3091099fa19da32e60433c0da835e9de3dd8ee9 (diff)
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 <robertphillips@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/effects/GrAlphaThresholdFragmentProcessor.h')
-rw-r--r--src/effects/GrAlphaThresholdFragmentProcessor.h33
1 files changed, 32 insertions, 1 deletions
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<GrFragmentProcessor>(new GrAlphaThresholdFragmentProcessor(
+ texture,
+ std::move(colorSpaceXform),
+ maskTexture,
+ innerThreshold, outerThreshold,
+ bounds));
+ }
+
+ static sk_sp<GrFragmentProcessor> Make(GrContext* context,
+ sk_sp<GrTextureProxy> proxy,
+ sk_sp<GrColorSpaceXform> colorSpaceXform,
+ GrTexture* maskTexture,
+ float innerThreshold,
+ float outerThreshold,
+ const SkIRect& bounds) {
+ return sk_sp<GrFragmentProcessor>(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<GrTextureProxy> proxy,
+ sk_sp<GrColorSpaceXform> colorSpaceXform,
+ GrTexture* maskTexture,
+ float innerThreshold,
+ float outerThreshold,
+ const SkIRect& bounds);
+
GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;