Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(217)

Unified Diff: src/effects/gradients/Sk4fLinearGradient.h

Issue 1783823002: Generic 4f gradient T sampler fallback (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: review comments Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/effects/gradients/Sk4fLinearGradient.h
diff --git a/src/effects/gradients/Sk4fLinearGradient.h b/src/effects/gradients/Sk4fLinearGradient.h
index a0a09caf5cde500541ee7c3e9891bf25084b14b8..67449fc7e98849e454e40048b19e4e5a3bc05ddb 100644
--- a/src/effects/gradients/Sk4fLinearGradient.h
+++ b/src/effects/gradients/Sk4fLinearGradient.h
@@ -12,19 +12,19 @@
#include "SkLinearGradient.h"
class SkLinearGradient::
-LinearGradient4fContext : public GradientShaderBase4fContext {
+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;
+protected:
+ void mapTs(int x, int y, SkScalar ts[], int count) const override;
+
private:
using INHERITED = GradientShaderBase4fContext;
- void addMirrorIntervals(const SkLinearGradient&, const Sk4f& componentScale,
- bool dx_is_pos);
-
template<typename DstType, TileMode>
class LinearIntervalProcessor;
@@ -32,13 +32,12 @@ private:
void shadePremulSpan(int x, int y, DstType[], int count) const;
template <typename DstType, bool premul, SkShader::TileMode tileMode>
- void shadePremulTileSpan(int x, int y, DstType[], int count) const;
-
- template <typename DstType, bool premul, SkShader::TileMode tileMode>
void shadeSpanInternal(int x, int y, DstType[], int count) const;
const Interval* findInterval(SkScalar fx) const;
+ bool isFast() const { return fDstToPosClass == kLinear_MatrixClass; }
+
mutable const Interval* fCachedInterval;
};

Powered by Google App Engine
This is Rietveld 408576698