diff options
author | Robert Phillips <robertphillips@google.com> | 2017-01-30 08:06:27 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-01-30 13:40:15 +0000 |
commit | 40fd7c94c24bb30d888c3d85a79cbb96c7fbf800 (patch) | |
tree | 075e886c01de864ba982910f1854f47ba1ae95d8 /src/gpu/effects/GrBicubicEffect.h | |
parent | 55b72530fedeb58154635531751a8730982fbf2a (diff) |
Push GrTextureProxy down to more effects
Change-Id: Ie3f32a88f25af082c25bc6daf3fe24e303e80f9e
Reviewed-on: https://skia-review.googlesource.com/7616
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/gpu/effects/GrBicubicEffect.h')
-rw-r--r-- | src/gpu/effects/GrBicubicEffect.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/gpu/effects/GrBicubicEffect.h b/src/gpu/effects/GrBicubicEffect.h index d0f5f41a90..a51aad8cab 100644 --- a/src/gpu/effects/GrBicubicEffect.h +++ b/src/gpu/effects/GrBicubicEffect.h @@ -49,6 +49,30 @@ public: } /** + * Create a Mitchell filter effect with specified texture matrix and x/y tile modes. + */ + static sk_sp<GrFragmentProcessor> Make(GrContext* context, sk_sp<GrTextureProxy> proxy, + sk_sp<GrColorSpaceXform> colorSpaceXform, + const SkMatrix& matrix, + const SkShader::TileMode tileModes[2]) { + return sk_sp<GrFragmentProcessor>(new GrBicubicEffect(context, std::move(proxy), + std::move(colorSpaceXform), + matrix, tileModes)); + } + + /** + * Create a Mitchell filter effect with a texture matrix and a domain. + */ + static sk_sp<GrFragmentProcessor> Make(GrContext* context, sk_sp<GrTextureProxy> proxy, + sk_sp<GrColorSpaceXform> colorSpaceXform, + const SkMatrix& matrix, + const SkRect& domain) { + return sk_sp<GrFragmentProcessor>(new GrBicubicEffect(context, std::move(proxy), + std::move(colorSpaceXform), + matrix, domain)); + } + + /** * Determines whether the bicubic effect should be used based on the transformation from the * local coords to the device. Returns true if the bicubic effect should be used. filterMode * is set to appropriate filtering mode to use regardless of the return result (e.g. when this @@ -64,6 +88,11 @@ private: GrBicubicEffect(GrTexture*, sk_sp<GrColorSpaceXform>, const SkMatrix &matrix, const SkRect& domain); + GrBicubicEffect(GrContext*, sk_sp<GrTextureProxy>, sk_sp<GrColorSpaceXform>, + const SkMatrix &matrix, const SkShader::TileMode tileModes[2]); + GrBicubicEffect(GrContext*, sk_sp<GrTextureProxy>, sk_sp<GrColorSpaceXform>, + const SkMatrix &matrix, const SkRect& domain); + GrGLSLFragmentProcessor* onCreateGLSLInstance() const override; void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override; |