diff options
author | Mike Reed <reed@google.com> | 2018-01-19 14:03:47 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-01-19 19:39:16 +0000 |
commit | a99b39399522658d7e5ddee97d0e45aa9fceaf89 (patch) | |
tree | 7c4cdcee7ecf4b152933382604793daa94f95b1b /src/core | |
parent | c22e50bd317fe3658445c04e18a6e319d746c510 (diff) |
use GrFPArgs for maskfilters
Bug: skia:
Change-Id: I8516a3b0f6d8301c51f0861c65b9fe8f692fc5e5
Reviewed-on: https://skia-review.googlesource.com/97260
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/SkMaskFilter.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/core/SkMaskFilter.cpp b/src/core/SkMaskFilter.cpp index fb6d47bffe..b8aadec10c 100644 --- a/src/core/SkMaskFilter.cpp +++ b/src/core/SkMaskFilter.cpp @@ -17,6 +17,7 @@ #if SK_SUPPORT_GPU #include "GrTextureProxy.h" +#include "GrFragmentProcessor.h" #endif SkMaskFilter::NinePatch::~NinePatch() { @@ -301,6 +302,24 @@ SkMaskFilter::filterRectsToNine(const SkRect[], int count, const SkMatrix&, } #if SK_SUPPORT_GPU +std::unique_ptr<GrFragmentProcessor> SkMaskFilter::asFragmentProcessor(const GrFPArgs& args) const { + auto fp = this->onAsFragmentProcessor(args); + if (fp) { + SkASSERT(this->hasFragmentProcessor()); + } else { + SkASSERT(!this->hasFragmentProcessor()); + } + return fp; +} +bool SkMaskFilter::hasFragmentProcessor() const { + return this->onHasFragmentProcessor(); +} + +std::unique_ptr<GrFragmentProcessor> SkMaskFilter::onAsFragmentProcessor(const GrFPArgs&) const { + return nullptr; +} +bool SkMaskFilter::onHasFragmentProcessor() const { return false; } + bool SkMaskFilter::canFilterMaskGPU(const SkRRect& devRRect, const SkIRect& clipBounds, const SkMatrix& ctm, |