diff options
author | 2017-08-28 12:50:26 -0400 | |
---|---|---|
committer | 2017-08-29 17:10:36 +0000 | |
commit | aa0ce825b877871f73532beb6fde6bf2f80e99dd (patch) | |
tree | 6cc4c265c8ccb84e1408b5b9cfe6068e9abc6fec /src/shaders/gradients/Sk4fLinearGradient.h | |
parent | 9d7e57d509149dd2fcb3ba73ea8f4cdce11f84bd (diff) |
Use the 4f impl for legacy/8888 linear gradients
This is a partial revert of https://skia-review.googlesource.com/c/20280,
adding back L32 support for 4f gradients and switching off the legacy
impl.
If it sticks, we should be able to completely delete the legacy gradient
code.
Change-Id: Iaa6d722ea4dfd8e4d959bb76eca815a30ca7098f
Reviewed-on: https://skia-review.googlesource.com/31425
Reviewed-by: Herb Derby <herb@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
Diffstat (limited to 'src/shaders/gradients/Sk4fLinearGradient.h')
-rw-r--r-- | src/shaders/gradients/Sk4fLinearGradient.h | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/shaders/gradients/Sk4fLinearGradient.h b/src/shaders/gradients/Sk4fLinearGradient.h index 11606e1c80..27c14e0637 100644 --- a/src/shaders/gradients/Sk4fLinearGradient.h +++ b/src/shaders/gradients/Sk4fLinearGradient.h @@ -16,19 +16,20 @@ LinearGradient4fContext final : public GradientShaderBase4fContext { public: LinearGradient4fContext(const SkLinearGradient&, const ContextRec&); + void shadeSpan(int x, int y, SkPMColor dst[], int count) override; void shadeSpan4f(int x, int y, SkPM4f dst[], int count) override; private: using INHERITED = GradientShaderBase4fContext; - template<ApplyPremul, TileMode> + template<typename dstType, ApplyPremul, TileMode> class LinearIntervalProcessor; - template <ApplyPremul premul> - void shadePremulSpan(int x, int y, SkPM4f[], int count) const; + template <typename dstType, ApplyPremul premul> + void shadePremulSpan(int x, int y, dstType dst[], int count, float bias0, float bias1) const; - template <ApplyPremul premul, SkShader::TileMode tileMode> - void shadeSpanInternal(int x, int y, SkPM4f[], int count) const; + template <typename dstType, ApplyPremul premul, SkShader::TileMode tileMode> + void shadeSpanInternal(int x, int y, dstType dst[], int count, float bias0, float bias1) const; const Sk4fGradientInterval* findInterval(SkScalar fx) const; |