2 * Copyright 2016 Google Inc.
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
8 #ifndef Sk4fLinearGradient_DEFINED
9 #define Sk4fLinearGradient_DEFINED
11 #include "src/shaders/gradients/Sk4fGradientBase.h"
12 #include "src/shaders/gradients/SkLinearGradient.h"
14 class SkLinearGradient::
15 LinearGradient4fContext final : public GradientShaderBase4fContext {
17 LinearGradient4fContext(const SkLinearGradient&, const ContextRec&);
19 void shadeSpan(int x, int y, SkPMColor dst[], int count) override;
22 using INHERITED = GradientShaderBase4fContext;
24 template<ApplyPremul, SkTileMode>
25 class LinearIntervalProcessor;
27 template <ApplyPremul premul>
28 void shadePremulSpan(int x, int y, SkPMColor dst[], int count,
29 float bias0, float bias1) const;
31 template <ApplyPremul premul, SkTileMode tileMode>
32 void shadeSpanInternal(int x, int y, SkPMColor dst[], int count,
33 float bias0, float bias1) const;
35 const Sk4fGradientInterval* findInterval(SkScalar fx) const;
37 mutable const Sk4fGradientInterval* fCachedInterval;
40 #endif // Sk4fLinearGradient_DEFINED