blob: 2c7a5e4f14244d18726a8817ac8df098005974cd [file] [log] [blame]
rileya@google.com1c6d64b2012-07-27 15:49:05 +00001/*
2 * Copyright 2012 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8#ifndef SkGradientShaderPriv_DEFINED
9#define SkGradientShaderPriv_DEFINED
10
11#include "SkGradientShader.h"
Hal Canary95e3c052017-01-11 12:44:43 -050012
Herb Derby83e939b2017-02-07 14:25:11 -050013#include "SkArenaAlloc.h"
Florin Malitad4e9ec82017-10-25 18:00:26 -040014#include "SkMatrix.h"
Brian Osman6667fb12018-07-03 16:44:02 -040015#include "SkPM4fPriv.h"
Florin Malita4aed1382017-05-25 10:38:07 -040016#include "SkShaderBase.h"
Florin Malita14a8dd72017-11-08 15:46:42 -050017#include "SkTArray.h"
Florin Malita39d71de2017-10-31 11:33:49 -040018#include "SkTemplates.h"
rileya@google.com1c6d64b2012-07-27 15:49:05 +000019
Florin Malitad4e9ec82017-10-25 18:00:26 -040020class SkColorSpace;
Florin Malita39d71de2017-10-31 11:33:49 -040021class SkColorSpaceXformer;
Florin Malitad4e9ec82017-10-25 18:00:26 -040022class SkRasterPipeline;
23class SkReadBuffer;
24class SkWriteBuffer;
rileya@google.com1c6d64b2012-07-27 15:49:05 +000025
Florin Malita4aed1382017-05-25 10:38:07 -040026class SkGradientShaderBase : public SkShaderBase {
rileya@google.com1c6d64b2012-07-27 15:49:05 +000027public:
reed@google.com437d6eb2013-05-23 19:03:05 +000028 struct Descriptor {
29 Descriptor() {
30 sk_bzero(this, sizeof(*this));
31 fTileMode = SkShader::kClamp_TileMode;
32 }
skia.committer@gmail.com3e2345a2013-05-24 07:01:26 +000033
reedaddf2ed2014-08-11 08:28:24 -070034 const SkMatrix* fLocalMatrix;
brianosmane25d71c2016-09-28 11:27:28 -070035 const SkColor4f* fColors;
brianosmanb9c51372016-09-15 11:09:45 -070036 sk_sp<SkColorSpace> fColorSpace;
reed@google.com437d6eb2013-05-23 19:03:05 +000037 const SkScalar* fPos;
38 int fCount;
39 SkShader::TileMode fTileMode;
commit-bot@chromium.org6c5aea22014-04-22 16:25:15 +000040 uint32_t fGradFlags;
reed9fa60da2014-08-21 07:59:51 -070041
42 void flatten(SkWriteBuffer&) const;
43 };
44
45 class DescriptorScope : public Descriptor {
46 public:
47 DescriptorScope() {}
mtklein88fd0fb2014-12-01 06:56:38 -080048
reed9fa60da2014-08-21 07:59:51 -070049 bool unflatten(SkReadBuffer&);
50
51 // fColors and fPos always point into local memory, so they can be safely mutated
52 //
brianosmane25d71c2016-09-28 11:27:28 -070053 SkColor4f* mutableColors() { return const_cast<SkColor4f*>(fColors); }
reed9fa60da2014-08-21 07:59:51 -070054 SkScalar* mutablePos() { return const_cast<SkScalar*>(fPos); }
55
56 private:
Florin Malitaf77db112018-05-10 09:52:27 -040057 SkSTArray<16, SkColor4f, true> fColorStorage;
58 SkSTArray<16, SkScalar , true> fPosStorage;
59 SkMatrix fLocalMatrixStorage;
reed@google.com437d6eb2013-05-23 19:03:05 +000060 };
61
mtkleincc695fe2014-12-10 10:29:19 -080062 SkGradientShaderBase(const Descriptor& desc, const SkMatrix& ptsToUnit);
Brian Salomond3b65972017-03-22 12:05:03 -040063 ~SkGradientShaderBase() override;
rileya@google.com1c6d64b2012-07-27 15:49:05 +000064
mtklein36352bf2015-03-25 18:17:31 -070065 bool isOpaque() const override;
rileya@google.com1c6d64b2012-07-27 15:49:05 +000066
Brian Osman6667fb12018-07-03 16:44:02 -040067 void getGradientTableBitmap(const SkColor4f* colors, SkBitmap*, SkColorType) const;
rileya@google.com1c6d64b2012-07-27 15:49:05 +000068
commit-bot@chromium.org6c5aea22014-04-22 16:25:15 +000069 uint32_t getGradFlags() const { return fGradFlags; }
commit-bot@chromium.org53783b02014-04-17 21:09:49 +000070
rileya@google.com1c6d64b2012-07-27 15:49:05 +000071protected:
fmalitabc590c02016-02-22 09:12:33 -080072 class GradientShaderBase4fContext;
73
commit-bot@chromium.org8b0e8ac2014-01-30 18:58:24 +000074 SkGradientShaderBase(SkReadBuffer& );
mtklein36352bf2015-03-25 18:17:31 -070075 void flatten(SkWriteBuffer&) const override;
rileya@google.com1c6d64b2012-07-27 15:49:05 +000076
Florin Malita5f379a82017-10-18 16:22:35 -040077 void commonAsAGradient(GradientInfo*) const;
skia.committer@gmail.comd3b28e82014-04-22 03:05:17 +000078
mtklein36352bf2015-03-25 18:17:31 -070079 bool onAsLuminanceColor(SkColor*) const override;
reed8367b8c2014-08-22 08:30:20 -070080
Brian Osman6667fb12018-07-03 16:44:02 -040081 void initLinearBitmap(const SkColor4f* colors, SkBitmap* bitmap, SkColorType colorType) const;
brianosmand4546092016-09-22 12:31:58 -070082
Mike Reed1d8c42e2017-08-29 14:58:19 -040083 bool onAppendStages(const StageRec&) const override;
Mike Kleina3771842017-05-04 19:38:48 -040084
Florin Malita50b20842017-07-29 19:08:28 -040085 virtual void appendGradientStages(SkArenaAlloc* alloc, SkRasterPipeline* tPipeline,
86 SkRasterPipeline* postPipeline) const = 0;
Mike Kleina3771842017-05-04 19:38:48 -040087
fmalita088e21b2016-10-05 09:28:42 -070088 template <typename T, typename... Args>
Herb Derby83e939b2017-02-07 14:25:11 -050089 static Context* CheckedMakeContext(SkArenaAlloc* alloc, Args&&... args) {
90 auto* ctx = alloc->make<T>(std::forward<Args>(args)...);
fmalita088e21b2016-10-05 09:28:42 -070091 if (!ctx->isValid()) {
fmalita088e21b2016-10-05 09:28:42 -070092 return nullptr;
93 }
94 return ctx;
95 }
96
Florin Malita39d71de2017-10-31 11:33:49 -040097 struct AutoXformColors {
98 AutoXformColors(const SkGradientShaderBase&, SkColorSpaceXformer*);
99
100 SkAutoSTMalloc<8, SkColor> fColors;
101 };
102
Mike Kleina3771842017-05-04 19:38:48 -0400103 const SkMatrix fPtsToUnit;
104 TileMode fTileMode;
Mike Kleina3771842017-05-04 19:38:48 -0400105 uint8_t fGradFlags;
Mike Kleina3771842017-05-04 19:38:48 -0400106
reedf3182eb2015-11-17 08:12:19 -0800107public:
Florin Malitaed6ae562017-10-28 11:06:48 -0400108 SkScalar getPos(int i) const {
109 SkASSERT(i < fColorCount);
110 return fOrigPos ? fOrigPos[i] : SkIntToScalar(i) / (fColorCount - 1);
111 }
112
Florin Malita39d71de2017-10-31 11:33:49 -0400113 SkColor getLegacyColor(int i) const {
114 SkASSERT(i < fColorCount);
Brian Osman6667fb12018-07-03 16:44:02 -0400115 return Sk4f_toL32(swizzle_rb(Sk4f::Load(fOrigColors4f[i].vec())));
Florin Malita39d71de2017-10-31 11:33:49 -0400116 }
117
brianosmanb9c51372016-09-15 11:09:45 -0700118 SkColor4f* fOrigColors4f; // original colors, as linear floats
119 SkScalar* fOrigPos; // original positions
120 int fColorCount;
Florin Malita39d71de2017-10-31 11:33:49 -0400121 sk_sp<SkColorSpace> fColorSpace; // color space of gradient stops
reedf3182eb2015-11-17 08:12:19 -0800122
123 bool colorsAreOpaque() const { return fColorsAreOpaque; }
124
fmenozzicd9a1d02016-08-15 07:03:47 -0700125 TileMode getTileMode() const { return fTileMode; }
fmenozzicd9a1d02016-08-15 07:03:47 -0700126
reedf3182eb2015-11-17 08:12:19 -0800127private:
Florin Malita89ab2402017-11-01 10:14:57 -0400128 // Reserve inline space for up to 4 stops.
129 static constexpr size_t kInlineStopCount = 4;
130 static constexpr size_t kInlineStorageSize = (sizeof(SkColor4f) + sizeof(SkScalar))
131 * kInlineStopCount;
132 SkAutoSTMalloc<kInlineStorageSize, uint8_t> fStorage;
133
134 bool fColorsAreOpaque;
rileya@google.com1c6d64b2012-07-27 15:49:05 +0000135
Florin Malita4aed1382017-05-25 10:38:07 -0400136 typedef SkShaderBase INHERITED;
rileya@google.com1c6d64b2012-07-27 15:49:05 +0000137};
138
139///////////////////////////////////////////////////////////////////////////////
140
Brian Osman6667fb12018-07-03 16:44:02 -0400141struct SkColor4fXformer {
142 SkColor4fXformer(const SkColor4f* colors, int colorCount, SkColorSpace* src, SkColorSpace* dst);
143
144 const SkColor4f* fColors;
145 SkSTArray<4, SkColor4f, true> fStorage;
146};
147
148///////////////////////////////////////////////////////////////////////////////
149
bsalomon@google.comcf8fb1f2012-08-02 14:03:32 +0000150#if SK_SUPPORT_GPU
151
Brian Salomon4cbb6e62017-10-25 15:12:19 -0400152#include "GrColorSpaceInfo.h"
bsalomon@google.com77af6802013-10-02 13:04:56 +0000153#include "GrCoordTransform.h"
bsalomon6251d172014-10-15 10:50:36 -0700154#include "GrFragmentProcessor.h"
egdaniel64c47282015-11-13 06:54:19 -0800155#include "glsl/GrGLSLFragmentProcessor.h"
egdaniel018fb622015-10-28 07:26:40 -0700156#include "glsl/GrGLSLProgramDataManager.h"
bsalomon@google.comcf8fb1f2012-08-02 14:03:32 +0000157
egdaniel605dd0f2014-11-12 08:35:25 -0800158class GrInvariantOutput;
Robert Phillips057ad702018-08-03 12:47:23 -0400159class GrTextureStripAtlas;
rileya@google.com1c6d64b2012-07-27 15:49:05 +0000160
161/*
bsalomon@google.comd8b5fac2012-11-01 17:02:46 +0000162 * The interpretation of the texture matrix depends on the sample mode. The
rileya@google.com1c6d64b2012-07-27 15:49:05 +0000163 * texture matrix is applied both when the texture coordinates are explicit
164 * and when vertex positions are used as texture coordinates. In the latter
rmistry@google.comfbfcd562012-08-23 18:09:54 +0000165 * case the texture matrix is applied to the pre-view-matrix position
rileya@google.com1c6d64b2012-07-27 15:49:05 +0000166 * values.
167 *
168 * Normal SampleMode
169 * The post-matrix texture coordinates are in normalize space with (0,0) at
170 * the top-left and (1,1) at the bottom right.
171 * RadialGradient
172 * The matrix specifies the radial gradient parameters.
173 * (0,0) in the post-matrix space is center of the radial gradient.
174 * Radial2Gradient
175 * Matrix transforms to space where first circle is centered at the
rmistry@google.comfbfcd562012-08-23 18:09:54 +0000176 * origin. The second circle will be centered (x, 0) where x may be
177 * 0 and is provided by setRadial2Params. The post-matrix space is
rileya@google.com1c6d64b2012-07-27 15:49:05 +0000178 * normalized such that 1 is the second radius - first radius.
179 * SweepGradient
180 * The angle from the origin of texture coordinates in post-matrix space
181 * determines the gradient value.
182 */
183
184// Base class for Gr gradient effects
joshualittb0a8a372014-09-23 09:50:21 -0700185class GrGradientEffect : public GrFragmentProcessor {
rileya@google.com1c6d64b2012-07-27 15:49:05 +0000186public:
brianosman9557c272016-09-15 06:59:15 -0700187 struct CreateArgs {
188 CreateArgs(GrContext* context,
189 const SkGradientShaderBase* shader,
190 const SkMatrix* matrix,
brianosmanb9c51372016-09-15 11:09:45 -0700191 SkShader::TileMode tileMode,
Brian Osman6667fb12018-07-03 16:44:02 -0400192 const GrColorSpaceInfo* dstColorSpaceInfo)
Brian Salomon2bbdcc42017-09-07 12:36:34 -0400193 : fContext(context)
194 , fShader(shader)
195 , fMatrix(matrix)
Brian Osman6667fb12018-07-03 16:44:02 -0400196 , fDstColorSpaceInfo(dstColorSpaceInfo) {
Brian Salomon2bbdcc42017-09-07 12:36:34 -0400197 switch (tileMode) {
198 case SkShader::kClamp_TileMode:
199 fWrapMode = GrSamplerState::WrapMode::kClamp;
200 break;
201 case SkShader::kRepeat_TileMode:
202 fWrapMode = GrSamplerState::WrapMode::kRepeat;
203 break;
204 case SkShader::kMirror_TileMode:
205 fWrapMode = GrSamplerState::WrapMode::kMirrorRepeat;
206 break;
Mike Reeddfc0e912018-02-16 12:40:18 -0500207 case SkShader::kDecal_TileMode:
208 // TODO: actually support decal
209 fWrapMode = GrSamplerState::WrapMode::kClamp;
210 break;
Brian Salomon2bbdcc42017-09-07 12:36:34 -0400211 }
212 }
213
214 CreateArgs(GrContext* context,
215 const SkGradientShaderBase* shader,
216 const SkMatrix* matrix,
217 GrSamplerState::WrapMode wrapMode,
Brian Osman6667fb12018-07-03 16:44:02 -0400218 const GrColorSpaceInfo* dstColorSpaceInfo)
Brian Salomon2bbdcc42017-09-07 12:36:34 -0400219 : fContext(context)
220 , fShader(shader)
221 , fMatrix(matrix)
222 , fWrapMode(wrapMode)
Brian Osman6667fb12018-07-03 16:44:02 -0400223 , fDstColorSpaceInfo(dstColorSpaceInfo) {}
brianosman9557c272016-09-15 06:59:15 -0700224
225 GrContext* fContext;
226 const SkGradientShaderBase* fShader;
227 const SkMatrix* fMatrix;
Brian Salomon2bbdcc42017-09-07 12:36:34 -0400228 GrSamplerState::WrapMode fWrapMode;
Brian Osman6667fb12018-07-03 16:44:02 -0400229 const GrColorSpaceInfo* fDstColorSpaceInfo;
brianosman9557c272016-09-15 06:59:15 -0700230 };
231
fmenozzi55d318d2016-08-09 08:05:57 -0700232 class GLSLProcessor;
rileya@google.com1c6d64b2012-07-27 15:49:05 +0000233
Florin Malita14a8dd72017-11-08 15:46:42 -0500234 // Controls the implementation strategy for this effect.
235 // NB: all entries need to be reflected in the key.
236 enum class InterpolationStrategy : uint8_t {
237 kSingle, // interpolation in a single domain [0,1]
238 kThreshold, // interpolation in two domains [0,T) [T,1], with normal clamping
239 kThresholdClamp0, // same as kThreshold, but clamped only on the left edge
240 kThresholdClamp1, // same as kThreshold, but clamped only on the right edge
241 kTexture, // texture-based fallback
fmenozzicd9a1d02016-08-15 07:03:47 -0700242 };
243
bsalomon@google.com82d12232013-09-09 15:36:26 +0000244 enum PremulType {
245 kBeforeInterp_PremulType,
246 kAfterInterp_PremulType,
247 };
248
bsalomon@google.comd4726202012-08-03 14:34:46 +0000249protected:
Ethan Nicholasabff9562017-10-09 10:54:08 -0400250 GrGradientEffect(ClassID classID, const CreateArgs&, bool isOpaque);
Brian Salomonf8480b92017-07-27 15:45:59 -0400251 explicit GrGradientEffect(const GrGradientEffect&); // facilitates clone() implementations
Brian Salomon587e08f2017-01-27 10:59:27 -0500252
Yuqian Li915817b2017-12-14 13:45:08 -0500253 void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
Florin Malitae657dc82017-11-03 08:46:18 -0400254
Brian Osman6667fb12018-07-03 16:44:02 -0400255 // Helper function used by derived class factories to handle modulation by input alpha.
Brian Osman5911a7c2017-10-25 12:52:31 -0400256 static std::unique_ptr<GrFragmentProcessor> AdjustFP(
257 std::unique_ptr<GrGradientEffect> gradientFP, const CreateArgs& args) {
258 if (!gradientFP->isValid()) {
259 return nullptr;
260 }
Brian Osman6667fb12018-07-03 16:44:02 -0400261 return GrFragmentProcessor::MulChildByInputAlpha(std::move(gradientFP));
Brian Osman5911a7c2017-10-25 12:52:31 -0400262 }
263
264#if GR_TEST_UTILS
Brian Osmane75c19f2016-10-10 11:26:43 -0400265 /** Helper struct that stores (and populates) parameters to construct a random gradient.
Brian Osmana2196532016-10-17 12:48:13 -0400266 If fUseColors4f is true, then the SkColor4f factory should be called, with fColors4f and
267 fColorSpace. Otherwise, the SkColor factory should be called, with fColors. fColorCount
268 will be the number of color stops in either case, and fColors and fStops can be passed to
269 the gradient factory. (The constructor may decide not to use stops, in which case fStops
270 will be nullptr). */
Brian Osman3f748602016-10-03 18:29:03 -0400271 struct RandomGradientParams {
Yuqian Li9df39b42017-12-21 15:14:01 -0500272 static constexpr int kMaxRandomGradientColors = 5;
Brian Osmane75c19f2016-10-10 11:26:43 -0400273
Brian Osman3f748602016-10-03 18:29:03 -0400274 RandomGradientParams(SkRandom* r);
275
Brian Osmana2196532016-10-17 12:48:13 -0400276 bool fUseColors4f;
Brian Osman3f748602016-10-03 18:29:03 -0400277 SkColor fColors[kMaxRandomGradientColors];
Brian Osmana2196532016-10-17 12:48:13 -0400278 SkColor4f fColors4f[kMaxRandomGradientColors];
279 sk_sp<SkColorSpace> fColorSpace;
Brian Osman3f748602016-10-03 18:29:03 -0400280 SkScalar fStopStorage[kMaxRandomGradientColors];
281 SkShader::TileMode fTileMode;
282 int fColorCount;
283 SkScalar* fStops;
284 };
Hal Canary6f6961e2017-01-31 13:50:44 -0500285 #endif
bsalomon@google.comd4726202012-08-03 14:34:46 +0000286
mtklein36352bf2015-03-25 18:17:31 -0700287 bool onIsEqual(const GrFragmentProcessor&) const override;
bsalomon@google.com68b58c92013-01-17 16:50:08 +0000288
commit-bot@chromium.org5fd7d5c2013-10-04 01:20:09 +0000289 const GrCoordTransform& getCoordTransform() const { return fCoordTransform; }
290
Brian Salomon6af27012017-06-09 08:21:42 -0400291 /** Checks whether the constructor failed to fully initialize the processor. */
Brian Salomon06e547c2017-06-09 16:11:32 -0400292 bool isValid() const {
Florin Malita14a8dd72017-11-08 15:46:42 -0500293 return fStrategy != InterpolationStrategy::kTexture || fTextureSampler.isInitialized();
Brian Salomon06e547c2017-06-09 16:11:32 -0400294 }
Brian Salomon6af27012017-06-09 08:21:42 -0400295
bsalomon@google.comd4726202012-08-03 14:34:46 +0000296private:
Brian Osman6667fb12018-07-03 16:44:02 -0400297 void addInterval(const SkGradientShaderBase&, const SkColor4f* colors,
298 size_t idx0, size_t idx1);
Florin Malita14a8dd72017-11-08 15:46:42 -0500299
Brian Salomonf7dcd762018-07-30 14:48:15 -0400300 const TextureSampler& onTextureSampler(int i) const override { return fTextureSampler; }
301
Brian Salomon587e08f2017-01-27 10:59:27 -0500302 static OptimizationFlags OptFlags(bool isOpaque);
303
Florin Malita14a8dd72017-11-08 15:46:42 -0500304 // Interpolation intervals, encoded as 4f tuples of (scale, bias)
305 // such that color(t) = t * scale + bias.
306 SkSTArray<4, GrColor4f, true> fIntervals;
brianosmanb9c51372016-09-15 11:09:45 -0700307
Brian Salomon2bbdcc42017-09-07 12:36:34 -0400308 GrSamplerState::WrapMode fWrapMode;
fmenozzicd9a1d02016-08-15 07:03:47 -0700309
bsalomon@google.com77af6802013-10-02 13:04:56 +0000310 GrCoordTransform fCoordTransform;
Brian Salomon0bbecb22016-11-17 11:38:22 -0500311 TextureSampler fTextureSampler;
bsalomon@google.com371e1052013-01-11 21:08:55 +0000312 bool fIsOpaque;
Florin Malita14a8dd72017-11-08 15:46:42 -0500313
314 InterpolationStrategy fStrategy;
315 SkScalar fThreshold; // used for InterpolationStrategy::kThreshold
316 PremulType fPremulType; // This is already baked into the table for texture
317 // gradients, and only changes behavior for gradients
318 // that don't use a texture.
Yuqian Li9df39b42017-12-21 15:14:01 -0500319
joshualittb0a8a372014-09-23 09:50:21 -0700320 typedef GrFragmentProcessor INHERITED;
rileya@google.com1c6d64b2012-07-27 15:49:05 +0000321
322};
323
324///////////////////////////////////////////////////////////////////////////////
325
fmenozzicd9a1d02016-08-15 07:03:47 -0700326// Base class for GL gradient effects
fmenozzi55d318d2016-08-09 08:05:57 -0700327class GrGradientEffect::GLSLProcessor : public GrGLSLFragmentProcessor {
rileya@google.com1c6d64b2012-07-27 15:49:05 +0000328public:
Florin Malitae657dc82017-11-03 08:46:18 -0400329 static uint32_t GenBaseGradientKey(const GrProcessor&);
rileya@google.comb3e50f22012-08-20 17:43:08 +0000330
bsalomon@google.comf78df332012-10-29 12:43:38 +0000331protected:
Florin Malitae657dc82017-11-03 08:46:18 -0400332 void onSetData(const GrGLSLProgramDataManager&, const GrFragmentProcessor&) override;
bsalomon63e99f72014-07-21 08:03:14 -0700333
334 // Emits the uniform used as the y-coord to texture samples in derived classes. Subclasses
335 // should call this method from their emitCode().
egdaniel7ea439b2015-12-03 09:20:44 -0800336 void emitUniforms(GrGLSLUniformHandler*, const GrGradientEffect&);
bsalomon63e99f72014-07-21 08:03:14 -0700337
fmenozzicd9a1d02016-08-15 07:03:47 -0700338 // Emit code that gets a fragment's color from an expression for t; has branches for
339 // several control flows inside -- 2-color gradients, 3-color symmetric gradients, 4+
340 // color gradients that use the traditional texture lookup, as well as several varieties
341 // of hard stop gradients
cdalton85285412016-02-18 12:37:07 -0800342 void emitColor(GrGLSLFPFragmentBuilder* fragBuilder,
egdaniel7ea439b2015-12-03 09:20:44 -0800343 GrGLSLUniformHandler* uniformHandler,
Brian Salomon1edc5b92016-11-29 13:43:46 -0500344 const GrShaderCaps* shaderCaps,
joshualitt60030bc2014-11-25 14:21:55 -0800345 const GrGradientEffect&,
bsalomon63e99f72014-07-21 08:03:14 -0700346 const char* gradientTValue,
bsalomon63e99f72014-07-21 08:03:14 -0700347 const char* outputColor,
348 const char* inputColor,
bsalomonb58a2b42016-09-26 06:55:02 -0700349 const TextureSamplers&);
bsalomon63e99f72014-07-21 08:03:14 -0700350
351private:
Florin Malitab81a8b92017-08-08 12:14:17 -0400352 void emitAnalyticalColor(GrGLSLFPFragmentBuilder* fragBuilder,
353 GrGLSLUniformHandler* uniformHandler,
354 const GrShaderCaps* shaderCaps,
355 const GrGradientEffect&,
356 const char* gradientTValue,
357 const char* outputColor,
358 const char* inputColor);
359
Florin Malita14a8dd72017-11-08 15:46:42 -0500360 GrGLSLProgramDataManager::UniformHandle fIntervalsUni;
361 GrGLSLProgramDataManager::UniformHandle fThresholdUni;
rileya@google.comb3e50f22012-08-20 17:43:08 +0000362
egdaniel64c47282015-11-13 06:54:19 -0800363 typedef GrGLSLFragmentProcessor INHERITED;
rileya@google.com1c6d64b2012-07-27 15:49:05 +0000364};
365
366#endif
367
bsalomon@google.comcf8fb1f2012-08-02 14:03:32 +0000368#endif