rileya@google.com | 1c6d64b | 2012-07-27 15:49:05 +0000 | [diff] [blame] | 1 | /* |
| 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 | |
reed | a6cac4c | 2014-08-21 10:50:25 -0700 | [diff] [blame] | 11 | #include "SkGradientBitmapCache.h" |
rileya@google.com | 1c6d64b | 2012-07-27 15:49:05 +0000 | [diff] [blame] | 12 | #include "SkGradientShader.h" |
Hal Canary | 95e3c05 | 2017-01-11 12:44:43 -0500 | [diff] [blame] | 13 | |
Herb Derby | 83e939b | 2017-02-07 14:25:11 -0500 | [diff] [blame] | 14 | #include "SkArenaAlloc.h" |
Hal Canary | 95e3c05 | 2017-01-11 12:44:43 -0500 | [diff] [blame] | 15 | #include "SkAutoMalloc.h" |
rileya@google.com | 1c6d64b | 2012-07-27 15:49:05 +0000 | [diff] [blame] | 16 | #include "SkClampRange.h" |
| 17 | #include "SkColorPriv.h" |
brianosman | b9c5137 | 2016-09-15 11:09:45 -0700 | [diff] [blame] | 18 | #include "SkColorSpace.h" |
Kevin Lubick | c456b73 | 2017-01-11 17:21:57 +0000 | [diff] [blame] | 19 | #include "SkOnce.h" |
Mike Klein | a377184 | 2017-05-04 19:38:48 -0400 | [diff] [blame] | 20 | #include "SkPM4fPriv.h" |
| 21 | #include "SkRasterPipeline.h" |
Hal Canary | 95e3c05 | 2017-01-11 12:44:43 -0500 | [diff] [blame] | 22 | #include "SkReadBuffer.h" |
Florin Malita | 4aed138 | 2017-05-25 10:38:07 -0400 | [diff] [blame] | 23 | #include "SkShaderBase.h" |
Hal Canary | 95e3c05 | 2017-01-11 12:44:43 -0500 | [diff] [blame] | 24 | #include "SkUtils.h" |
| 25 | #include "SkWriteBuffer.h" |
rileya@google.com | 1c6d64b | 2012-07-27 15:49:05 +0000 | [diff] [blame] | 26 | |
humper@google.com | 05af1af | 2013-01-07 16:47:43 +0000 | [diff] [blame] | 27 | static inline void sk_memset32_dither(uint32_t dst[], uint32_t v0, uint32_t v1, |
rileya@google.com | 1c6d64b | 2012-07-27 15:49:05 +0000 | [diff] [blame] | 28 | int count) { |
| 29 | if (count > 0) { |
| 30 | if (v0 == v1) { |
| 31 | sk_memset32(dst, v0, count); |
| 32 | } else { |
| 33 | int pairs = count >> 1; |
| 34 | for (int i = 0; i < pairs; i++) { |
| 35 | *dst++ = v0; |
| 36 | *dst++ = v1; |
| 37 | } |
| 38 | if (count & 1) { |
| 39 | *dst = v0; |
| 40 | } |
| 41 | } |
| 42 | } |
| 43 | } |
| 44 | |
| 45 | // Clamp |
| 46 | |
humper@google.com | 05af1af | 2013-01-07 16:47:43 +0000 | [diff] [blame] | 47 | static inline SkFixed clamp_tileproc(SkFixed x) { |
rileya@google.com | 1c6d64b | 2012-07-27 15:49:05 +0000 | [diff] [blame] | 48 | return SkClampMax(x, 0xFFFF); |
| 49 | } |
| 50 | |
| 51 | // Repeat |
| 52 | |
humper@google.com | 05af1af | 2013-01-07 16:47:43 +0000 | [diff] [blame] | 53 | static inline SkFixed repeat_tileproc(SkFixed x) { |
rileya@google.com | 1c6d64b | 2012-07-27 15:49:05 +0000 | [diff] [blame] | 54 | return x & 0xFFFF; |
| 55 | } |
| 56 | |
| 57 | // Mirror |
| 58 | |
rileya@google.com | 1c6d64b | 2012-07-27 15:49:05 +0000 | [diff] [blame] | 59 | static inline SkFixed mirror_tileproc(SkFixed x) { |
caryclark | 3127c99 | 2015-12-09 12:02:30 -0800 | [diff] [blame] | 60 | int s = SkLeftShift(x, 15) >> 31; |
rileya@google.com | 1c6d64b | 2012-07-27 15:49:05 +0000 | [diff] [blame] | 61 | return (x ^ s) & 0xFFFF; |
| 62 | } |
| 63 | |
rileya@google.com | 1c6d64b | 2012-07-27 15:49:05 +0000 | [diff] [blame] | 64 | /////////////////////////////////////////////////////////////////////////////// |
| 65 | |
| 66 | typedef SkFixed (*TileProc)(SkFixed); |
| 67 | |
| 68 | /////////////////////////////////////////////////////////////////////////////// |
| 69 | |
| 70 | static const TileProc gTileProcs[] = { |
| 71 | clamp_tileproc, |
| 72 | repeat_tileproc, |
| 73 | mirror_tileproc |
| 74 | }; |
| 75 | |
| 76 | /////////////////////////////////////////////////////////////////////////////// |
| 77 | |
Florin Malita | 4aed138 | 2017-05-25 10:38:07 -0400 | [diff] [blame] | 78 | class SkGradientShaderBase : public SkShaderBase { |
rileya@google.com | 1c6d64b | 2012-07-27 15:49:05 +0000 | [diff] [blame] | 79 | public: |
reed@google.com | 437d6eb | 2013-05-23 19:03:05 +0000 | [diff] [blame] | 80 | struct Descriptor { |
| 81 | Descriptor() { |
| 82 | sk_bzero(this, sizeof(*this)); |
| 83 | fTileMode = SkShader::kClamp_TileMode; |
| 84 | } |
skia.committer@gmail.com | 3e2345a | 2013-05-24 07:01:26 +0000 | [diff] [blame] | 85 | |
reed | addf2ed | 2014-08-11 08:28:24 -0700 | [diff] [blame] | 86 | const SkMatrix* fLocalMatrix; |
brianosman | e25d71c | 2016-09-28 11:27:28 -0700 | [diff] [blame] | 87 | const SkColor4f* fColors; |
brianosman | b9c5137 | 2016-09-15 11:09:45 -0700 | [diff] [blame] | 88 | sk_sp<SkColorSpace> fColorSpace; |
reed@google.com | 437d6eb | 2013-05-23 19:03:05 +0000 | [diff] [blame] | 89 | const SkScalar* fPos; |
| 90 | int fCount; |
| 91 | SkShader::TileMode fTileMode; |
commit-bot@chromium.org | 6c5aea2 | 2014-04-22 16:25:15 +0000 | [diff] [blame] | 92 | uint32_t fGradFlags; |
reed | 9fa60da | 2014-08-21 07:59:51 -0700 | [diff] [blame] | 93 | |
| 94 | void flatten(SkWriteBuffer&) const; |
| 95 | }; |
| 96 | |
| 97 | class DescriptorScope : public Descriptor { |
| 98 | public: |
| 99 | DescriptorScope() {} |
mtklein | 88fd0fb | 2014-12-01 06:56:38 -0800 | [diff] [blame] | 100 | |
reed | 9fa60da | 2014-08-21 07:59:51 -0700 | [diff] [blame] | 101 | bool unflatten(SkReadBuffer&); |
| 102 | |
| 103 | // fColors and fPos always point into local memory, so they can be safely mutated |
| 104 | // |
brianosman | e25d71c | 2016-09-28 11:27:28 -0700 | [diff] [blame] | 105 | SkColor4f* mutableColors() { return const_cast<SkColor4f*>(fColors); } |
reed | 9fa60da | 2014-08-21 07:59:51 -0700 | [diff] [blame] | 106 | SkScalar* mutablePos() { return const_cast<SkScalar*>(fPos); } |
| 107 | |
| 108 | private: |
| 109 | enum { |
| 110 | kStorageCount = 16 |
| 111 | }; |
brianosman | e25d71c | 2016-09-28 11:27:28 -0700 | [diff] [blame] | 112 | SkColor4f fColorStorage[kStorageCount]; |
reed | 9fa60da | 2014-08-21 07:59:51 -0700 | [diff] [blame] | 113 | SkScalar fPosStorage[kStorageCount]; |
| 114 | SkMatrix fLocalMatrixStorage; |
| 115 | SkAutoMalloc fDynamicStorage; |
reed@google.com | 437d6eb | 2013-05-23 19:03:05 +0000 | [diff] [blame] | 116 | }; |
| 117 | |
mtklein | cc695fe | 2014-12-10 10:29:19 -0800 | [diff] [blame] | 118 | SkGradientShaderBase(const Descriptor& desc, const SkMatrix& ptsToUnit); |
Brian Salomon | d3b6597 | 2017-03-22 12:05:03 -0400 | [diff] [blame] | 119 | ~SkGradientShaderBase() override; |
rileya@google.com | 1c6d64b | 2012-07-27 15:49:05 +0000 | [diff] [blame] | 120 | |
brianosman | 93110a8 | 2016-09-15 08:40:21 -0700 | [diff] [blame] | 121 | // The cache is initialized on-demand when getCache32 is called. |
commit-bot@chromium.org | 87fcd95 | 2014-04-23 19:10:51 +0000 | [diff] [blame] | 122 | class GradientShaderCache : public SkRefCnt { |
| 123 | public: |
fmalita | 37d8688 | 2015-10-09 10:22:46 -0700 | [diff] [blame] | 124 | GradientShaderCache(U8CPU alpha, bool dither, const SkGradientShaderBase& shader); |
commit-bot@chromium.org | 87fcd95 | 2014-04-23 19:10:51 +0000 | [diff] [blame] | 125 | ~GradientShaderCache(); |
| 126 | |
commit-bot@chromium.org | 87fcd95 | 2014-04-23 19:10:51 +0000 | [diff] [blame] | 127 | const SkPMColor* getCache32(); |
| 128 | |
Mike Reed | 6b3155c | 2017-04-03 14:41:44 -0400 | [diff] [blame] | 129 | SkPixelRef* getCache32PixelRef() const { return fCache32PixelRef.get(); } |
commit-bot@chromium.org | 87fcd95 | 2014-04-23 19:10:51 +0000 | [diff] [blame] | 130 | |
| 131 | unsigned getAlpha() const { return fCacheAlpha; } |
fmalita | 37d8688 | 2015-10-09 10:22:46 -0700 | [diff] [blame] | 132 | bool getDither() const { return fCacheDither; } |
commit-bot@chromium.org | 87fcd95 | 2014-04-23 19:10:51 +0000 | [diff] [blame] | 133 | |
| 134 | private: |
brianosman | 93110a8 | 2016-09-15 08:40:21 -0700 | [diff] [blame] | 135 | // Working pointer. If it's nullptr, we need to recompute the cache values. |
commit-bot@chromium.org | 87fcd95 | 2014-04-23 19:10:51 +0000 | [diff] [blame] | 136 | SkPMColor* fCache32; |
| 137 | |
Mike Reed | 6b3155c | 2017-04-03 14:41:44 -0400 | [diff] [blame] | 138 | sk_sp<SkPixelRef> fCache32PixelRef; |
commit-bot@chromium.org | 87fcd95 | 2014-04-23 19:10:51 +0000 | [diff] [blame] | 139 | const unsigned fCacheAlpha; // The alpha value we used when we computed the cache. |
| 140 | // Larger than 8bits so we can store uninitialized |
| 141 | // value. |
fmalita | 37d8688 | 2015-10-09 10:22:46 -0700 | [diff] [blame] | 142 | const bool fCacheDither; // The dither flag used when we computed the cache. |
commit-bot@chromium.org | 87fcd95 | 2014-04-23 19:10:51 +0000 | [diff] [blame] | 143 | |
| 144 | const SkGradientShaderBase& fShader; |
| 145 | |
brianosman | 93110a8 | 2016-09-15 08:40:21 -0700 | [diff] [blame] | 146 | // Make sure we only initialize the cache once. |
| 147 | SkOnce fCache32InitOnce; |
commit-bot@chromium.org | 87fcd95 | 2014-04-23 19:10:51 +0000 | [diff] [blame] | 148 | |
commit-bot@chromium.org | 87fcd95 | 2014-04-23 19:10:51 +0000 | [diff] [blame] | 149 | static void initCache32(GradientShaderCache* cache); |
| 150 | |
commit-bot@chromium.org | 87fcd95 | 2014-04-23 19:10:51 +0000 | [diff] [blame] | 151 | static void Build32bitCache(SkPMColor[], SkColor c0, SkColor c1, int count, |
fmalita | 37d8688 | 2015-10-09 10:22:46 -0700 | [diff] [blame] | 152 | U8CPU alpha, uint32_t gradFlags, bool dither); |
commit-bot@chromium.org | 87fcd95 | 2014-04-23 19:10:51 +0000 | [diff] [blame] | 153 | }; |
| 154 | |
Florin Malita | 4aed138 | 2017-05-25 10:38:07 -0400 | [diff] [blame] | 155 | class GradientShaderBaseContext : public Context { |
commit-bot@chromium.org | 87fcd95 | 2014-04-23 19:10:51 +0000 | [diff] [blame] | 156 | public: |
commit-bot@chromium.org | e901b6d | 2014-05-01 19:31:31 +0000 | [diff] [blame] | 157 | GradientShaderBaseContext(const SkGradientShaderBase& shader, const ContextRec&); |
commit-bot@chromium.org | 87fcd95 | 2014-04-23 19:10:51 +0000 | [diff] [blame] | 158 | |
mtklein | 36352bf | 2015-03-25 18:17:31 -0700 | [diff] [blame] | 159 | uint32_t getFlags() const override { return fFlags; } |
commit-bot@chromium.org | 87fcd95 | 2014-04-23 19:10:51 +0000 | [diff] [blame] | 160 | |
fmalita | 088e21b | 2016-10-05 09:28:42 -0700 | [diff] [blame] | 161 | bool isValid() const; |
| 162 | |
commit-bot@chromium.org | 87fcd95 | 2014-04-23 19:10:51 +0000 | [diff] [blame] | 163 | protected: |
| 164 | SkMatrix fDstToIndex; |
| 165 | SkMatrix::MapXYProc fDstToIndexProc; |
| 166 | uint8_t fDstToIndexClass; |
| 167 | uint8_t fFlags; |
fmalita | 37d8688 | 2015-10-09 10:22:46 -0700 | [diff] [blame] | 168 | bool fDither; |
commit-bot@chromium.org | 87fcd95 | 2014-04-23 19:10:51 +0000 | [diff] [blame] | 169 | |
Hal Canary | 67b39de | 2016-11-07 11:47:44 -0500 | [diff] [blame] | 170 | sk_sp<GradientShaderCache> fCache; |
commit-bot@chromium.org | 87fcd95 | 2014-04-23 19:10:51 +0000 | [diff] [blame] | 171 | |
| 172 | private: |
Florin Malita | 4aed138 | 2017-05-25 10:38:07 -0400 | [diff] [blame] | 173 | typedef Context INHERITED; |
commit-bot@chromium.org | 87fcd95 | 2014-04-23 19:10:51 +0000 | [diff] [blame] | 174 | }; |
| 175 | |
mtklein | 36352bf | 2015-03-25 18:17:31 -0700 | [diff] [blame] | 176 | bool isOpaque() const override; |
rileya@google.com | 1c6d64b | 2012-07-27 15:49:05 +0000 | [diff] [blame] | 177 | |
brianosman | d454609 | 2016-09-22 12:31:58 -0700 | [diff] [blame] | 178 | enum class GradientBitmapType : uint8_t { |
| 179 | kLegacy, |
| 180 | kSRGB, |
| 181 | kHalfFloat, |
| 182 | }; |
| 183 | |
| 184 | void getGradientTableBitmap(SkBitmap*, GradientBitmapType bitmapType) const; |
rileya@google.com | 1c6d64b | 2012-07-27 15:49:05 +0000 | [diff] [blame] | 185 | |
| 186 | enum { |
| 187 | /// Seems like enough for visual accuracy. TODO: if pos[] deserves |
| 188 | /// it, use a larger cache. |
rileya@google.com | 1c6d64b | 2012-07-27 15:49:05 +0000 | [diff] [blame] | 189 | kCache32Bits = 8, |
reed@google.com | 6004029 | 2013-02-04 18:21:23 +0000 | [diff] [blame] | 190 | kCache32Count = (1 << kCache32Bits), |
rileya@google.com | 1c6d64b | 2012-07-27 15:49:05 +0000 | [diff] [blame] | 191 | kCache32Shift = 16 - kCache32Bits, |
| 192 | kSqrt32Shift = 8 - kCache32Bits, |
| 193 | |
| 194 | /// This value is used to *read* the dither cache; it may be 0 |
| 195 | /// if dithering is disabled. |
rileya@google.com | 1c6d64b | 2012-07-27 15:49:05 +0000 | [diff] [blame] | 196 | kDitherStride32 = kCache32Count, |
rileya@google.com | 1c6d64b | 2012-07-27 15:49:05 +0000 | [diff] [blame] | 197 | }; |
| 198 | |
commit-bot@chromium.org | 6c5aea2 | 2014-04-22 16:25:15 +0000 | [diff] [blame] | 199 | uint32_t getGradFlags() const { return fGradFlags; } |
commit-bot@chromium.org | 53783b0 | 2014-04-17 21:09:49 +0000 | [diff] [blame] | 200 | |
Florin Malita | 0e36b3f | 2017-06-05 23:33:45 -0400 | [diff] [blame] | 201 | SkColor4f getXformedColor(size_t index, SkColorSpace*) const; |
| 202 | |
rileya@google.com | 1c6d64b | 2012-07-27 15:49:05 +0000 | [diff] [blame] | 203 | protected: |
Mike Klein | a377184 | 2017-05-04 19:38:48 -0400 | [diff] [blame] | 204 | struct Rec { |
| 205 | SkFixed fPos; // 0...1 |
| 206 | uint32_t fScale; // (1 << 24) / range |
| 207 | }; |
| 208 | |
fmalita | bc590c0 | 2016-02-22 09:12:33 -0800 | [diff] [blame] | 209 | class GradientShaderBase4fContext; |
| 210 | |
commit-bot@chromium.org | 8b0e8ac | 2014-01-30 18:58:24 +0000 | [diff] [blame] | 211 | SkGradientShaderBase(SkReadBuffer& ); |
mtklein | 36352bf | 2015-03-25 18:17:31 -0700 | [diff] [blame] | 212 | void flatten(SkWriteBuffer&) const override; |
commit-bot@chromium.org | 0f10f7b | 2014-03-13 18:02:17 +0000 | [diff] [blame] | 213 | SK_TO_STRING_OVERRIDE() |
rileya@google.com | 1c6d64b | 2012-07-27 15:49:05 +0000 | [diff] [blame] | 214 | |
commit-bot@chromium.org | 44d83c1 | 2014-04-21 13:10:25 +0000 | [diff] [blame] | 215 | void commonAsAGradient(GradientInfo*, bool flipGrad = false) const; |
skia.committer@gmail.com | d3b28e8 | 2014-04-22 03:05:17 +0000 | [diff] [blame] | 216 | |
mtklein | 36352bf | 2015-03-25 18:17:31 -0700 | [diff] [blame] | 217 | bool onAsLuminanceColor(SkColor*) const override; |
reed | 8367b8c | 2014-08-22 08:30:20 -0700 | [diff] [blame] | 218 | |
brianosman | d454609 | 2016-09-22 12:31:58 -0700 | [diff] [blame] | 219 | void initLinearBitmap(SkBitmap* bitmap) const; |
| 220 | |
commit-bot@chromium.org | 44d83c1 | 2014-04-21 13:10:25 +0000 | [diff] [blame] | 221 | /* |
| 222 | * Takes in pointers to gradient color and Rec info as colorSrc and recSrc respectively. |
| 223 | * Count is the number of colors in the gradient |
| 224 | * It will then flip all the color and rec information and return in their respective Dst |
| 225 | * pointers. It is assumed that space has already been allocated for the Dst pointers. |
| 226 | * The rec src and dst are only assumed to be valid if count > 2 |
| 227 | */ |
| 228 | static void FlipGradientColors(SkColor* colorDst, Rec* recDst, |
| 229 | SkColor* colorSrc, Rec* recSrc, |
| 230 | int count); |
| 231 | |
Mike Klein | a377184 | 2017-05-04 19:38:48 -0400 | [diff] [blame] | 232 | bool onAppendStages(SkRasterPipeline* pipeline, SkColorSpace* dstCS, SkArenaAlloc* alloc, |
| 233 | const SkMatrix& ctm, const SkPaint& paint, |
| 234 | const SkMatrix* localM) const override; |
| 235 | |
Florin Malita | 50b2084 | 2017-07-29 19:08:28 -0400 | [diff] [blame] | 236 | virtual void appendGradientStages(SkArenaAlloc* alloc, SkRasterPipeline* tPipeline, |
| 237 | SkRasterPipeline* postPipeline) const = 0; |
Mike Klein | a377184 | 2017-05-04 19:38:48 -0400 | [diff] [blame] | 238 | |
fmalita | 088e21b | 2016-10-05 09:28:42 -0700 | [diff] [blame] | 239 | template <typename T, typename... Args> |
Herb Derby | 83e939b | 2017-02-07 14:25:11 -0500 | [diff] [blame] | 240 | static Context* CheckedMakeContext(SkArenaAlloc* alloc, Args&&... args) { |
| 241 | auto* ctx = alloc->make<T>(std::forward<Args>(args)...); |
fmalita | 088e21b | 2016-10-05 09:28:42 -0700 | [diff] [blame] | 242 | if (!ctx->isValid()) { |
fmalita | 088e21b | 2016-10-05 09:28:42 -0700 | [diff] [blame] | 243 | return nullptr; |
| 244 | } |
| 245 | return ctx; |
| 246 | } |
| 247 | |
Mike Klein | a377184 | 2017-05-04 19:38:48 -0400 | [diff] [blame] | 248 | const SkMatrix fPtsToUnit; |
| 249 | TileMode fTileMode; |
| 250 | TileProc fTileProc; |
| 251 | uint8_t fGradFlags; |
| 252 | Rec* fRecs; |
| 253 | |
rileya@google.com | 1c6d64b | 2012-07-27 15:49:05 +0000 | [diff] [blame] | 254 | private: |
| 255 | enum { |
| 256 | kColorStorageCount = 4, // more than this many colors, and we'll use sk_malloc for the space |
| 257 | |
brianosman | b9c5137 | 2016-09-15 11:09:45 -0700 | [diff] [blame] | 258 | kStorageSize = kColorStorageCount * |
| 259 | (sizeof(SkColor) + sizeof(SkScalar) + sizeof(Rec) + sizeof(SkColor4f)) |
rileya@google.com | 1c6d64b | 2012-07-27 15:49:05 +0000 | [diff] [blame] | 260 | }; |
brianosman | b9c5137 | 2016-09-15 11:09:45 -0700 | [diff] [blame] | 261 | SkColor fStorage[(kStorageSize + 3) >> 2]; |
reed | f3182eb | 2015-11-17 08:12:19 -0800 | [diff] [blame] | 262 | public: |
brianosman | b9c5137 | 2016-09-15 11:09:45 -0700 | [diff] [blame] | 263 | SkColor* fOrigColors; // original colors, before modulation by paint in context. |
| 264 | SkColor4f* fOrigColors4f; // original colors, as linear floats |
| 265 | SkScalar* fOrigPos; // original positions |
| 266 | int fColorCount; |
| 267 | sk_sp<SkColorSpace> fColorSpace; // color space of gradient stops |
reed | f3182eb | 2015-11-17 08:12:19 -0800 | [diff] [blame] | 268 | |
| 269 | bool colorsAreOpaque() const { return fColorsAreOpaque; } |
| 270 | |
fmenozzi | cd9a1d0 | 2016-08-15 07:03:47 -0700 | [diff] [blame] | 271 | TileMode getTileMode() const { return fTileMode; } |
| 272 | Rec* getRecs() const { return fRecs; } |
| 273 | |
reed | f3182eb | 2015-11-17 08:12:19 -0800 | [diff] [blame] | 274 | private: |
brianosman | b9c5137 | 2016-09-15 11:09:45 -0700 | [diff] [blame] | 275 | bool fColorsAreOpaque; |
rileya@google.com | 1c6d64b | 2012-07-27 15:49:05 +0000 | [diff] [blame] | 276 | |
Hal Canary | 67b39de | 2016-11-07 11:47:44 -0500 | [diff] [blame] | 277 | sk_sp<GradientShaderCache> refCache(U8CPU alpha, bool dither) const; |
| 278 | mutable SkMutex fCacheMutex; |
| 279 | mutable sk_sp<GradientShaderCache> fCache; |
rileya@google.com | 1c6d64b | 2012-07-27 15:49:05 +0000 | [diff] [blame] | 280 | |
rileya@google.com | 1c6d64b | 2012-07-27 15:49:05 +0000 | [diff] [blame] | 281 | void initCommon(); |
| 282 | |
Florin Malita | 4aed138 | 2017-05-25 10:38:07 -0400 | [diff] [blame] | 283 | typedef SkShaderBase INHERITED; |
rileya@google.com | 1c6d64b | 2012-07-27 15:49:05 +0000 | [diff] [blame] | 284 | }; |
| 285 | |
Mike Klein | a377184 | 2017-05-04 19:38:48 -0400 | [diff] [blame] | 286 | |
reed@google.com | 55853db | 2013-02-01 19:34:59 +0000 | [diff] [blame] | 287 | static inline int init_dither_toggle(int x, int y) { |
reed@google.com | 6004029 | 2013-02-04 18:21:23 +0000 | [diff] [blame] | 288 | x &= 1; |
| 289 | y = (y & 1) << 1; |
| 290 | return (x | y) * SkGradientShaderBase::kDitherStride32; |
reed@google.com | 55853db | 2013-02-01 19:34:59 +0000 | [diff] [blame] | 291 | } |
| 292 | |
| 293 | static inline int next_dither_toggle(int toggle) { |
| 294 | return toggle ^ SkGradientShaderBase::kDitherStride32; |
| 295 | } |
| 296 | |
rileya@google.com | 1c6d64b | 2012-07-27 15:49:05 +0000 | [diff] [blame] | 297 | /////////////////////////////////////////////////////////////////////////////// |
| 298 | |
bsalomon@google.com | cf8fb1f | 2012-08-02 14:03:32 +0000 | [diff] [blame] | 299 | #if SK_SUPPORT_GPU |
| 300 | |
brianosman | b9c5137 | 2016-09-15 11:09:45 -0700 | [diff] [blame] | 301 | #include "GrColorSpaceXform.h" |
bsalomon@google.com | 77af680 | 2013-10-02 13:04:56 +0000 | [diff] [blame] | 302 | #include "GrCoordTransform.h" |
bsalomon | 6251d17 | 2014-10-15 10:50:36 -0700 | [diff] [blame] | 303 | #include "GrFragmentProcessor.h" |
Brian Osman | c624d9d | 2017-03-08 11:42:02 -0500 | [diff] [blame] | 304 | #include "glsl/GrGLSLColorSpaceXformHelper.h" |
egdaniel | 64c4728 | 2015-11-13 06:54:19 -0800 | [diff] [blame] | 305 | #include "glsl/GrGLSLFragmentProcessor.h" |
egdaniel | 018fb62 | 2015-10-28 07:26:40 -0700 | [diff] [blame] | 306 | #include "glsl/GrGLSLProgramDataManager.h" |
bsalomon@google.com | cf8fb1f | 2012-08-02 14:03:32 +0000 | [diff] [blame] | 307 | |
egdaniel | 605dd0f | 2014-11-12 08:35:25 -0800 | [diff] [blame] | 308 | class GrInvariantOutput; |
rileya@google.com | 1c6d64b | 2012-07-27 15:49:05 +0000 | [diff] [blame] | 309 | |
| 310 | /* |
bsalomon@google.com | d8b5fac | 2012-11-01 17:02:46 +0000 | [diff] [blame] | 311 | * The interpretation of the texture matrix depends on the sample mode. The |
rileya@google.com | 1c6d64b | 2012-07-27 15:49:05 +0000 | [diff] [blame] | 312 | * texture matrix is applied both when the texture coordinates are explicit |
| 313 | * and when vertex positions are used as texture coordinates. In the latter |
rmistry@google.com | fbfcd56 | 2012-08-23 18:09:54 +0000 | [diff] [blame] | 314 | * case the texture matrix is applied to the pre-view-matrix position |
rileya@google.com | 1c6d64b | 2012-07-27 15:49:05 +0000 | [diff] [blame] | 315 | * values. |
| 316 | * |
| 317 | * Normal SampleMode |
| 318 | * The post-matrix texture coordinates are in normalize space with (0,0) at |
| 319 | * the top-left and (1,1) at the bottom right. |
| 320 | * RadialGradient |
| 321 | * The matrix specifies the radial gradient parameters. |
| 322 | * (0,0) in the post-matrix space is center of the radial gradient. |
| 323 | * Radial2Gradient |
| 324 | * Matrix transforms to space where first circle is centered at the |
rmistry@google.com | fbfcd56 | 2012-08-23 18:09:54 +0000 | [diff] [blame] | 325 | * origin. The second circle will be centered (x, 0) where x may be |
| 326 | * 0 and is provided by setRadial2Params. The post-matrix space is |
rileya@google.com | 1c6d64b | 2012-07-27 15:49:05 +0000 | [diff] [blame] | 327 | * normalized such that 1 is the second radius - first radius. |
| 328 | * SweepGradient |
| 329 | * The angle from the origin of texture coordinates in post-matrix space |
| 330 | * determines the gradient value. |
| 331 | */ |
| 332 | |
rileya@google.com | b3e50f2 | 2012-08-20 17:43:08 +0000 | [diff] [blame] | 333 | class GrTextureStripAtlas; |
| 334 | |
rileya@google.com | 1c6d64b | 2012-07-27 15:49:05 +0000 | [diff] [blame] | 335 | // Base class for Gr gradient effects |
joshualitt | b0a8a37 | 2014-09-23 09:50:21 -0700 | [diff] [blame] | 336 | class GrGradientEffect : public GrFragmentProcessor { |
rileya@google.com | 1c6d64b | 2012-07-27 15:49:05 +0000 | [diff] [blame] | 337 | public: |
brianosman | 9557c27 | 2016-09-15 06:59:15 -0700 | [diff] [blame] | 338 | struct CreateArgs { |
| 339 | CreateArgs(GrContext* context, |
| 340 | const SkGradientShaderBase* shader, |
| 341 | const SkMatrix* matrix, |
brianosman | b9c5137 | 2016-09-15 11:09:45 -0700 | [diff] [blame] | 342 | SkShader::TileMode tileMode, |
| 343 | sk_sp<GrColorSpaceXform> colorSpaceXform, |
| 344 | bool gammaCorrect) |
brianosman | 9557c27 | 2016-09-15 06:59:15 -0700 | [diff] [blame] | 345 | : fContext(context) |
| 346 | , fShader(shader) |
| 347 | , fMatrix(matrix) |
brianosman | b9c5137 | 2016-09-15 11:09:45 -0700 | [diff] [blame] | 348 | , fTileMode(tileMode) |
| 349 | , fColorSpaceXform(std::move(colorSpaceXform)) |
| 350 | , fGammaCorrect(gammaCorrect) {} |
brianosman | 9557c27 | 2016-09-15 06:59:15 -0700 | [diff] [blame] | 351 | |
| 352 | GrContext* fContext; |
| 353 | const SkGradientShaderBase* fShader; |
| 354 | const SkMatrix* fMatrix; |
| 355 | SkShader::TileMode fTileMode; |
brianosman | b9c5137 | 2016-09-15 11:09:45 -0700 | [diff] [blame] | 356 | sk_sp<GrColorSpaceXform> fColorSpaceXform; |
| 357 | bool fGammaCorrect; |
brianosman | 9557c27 | 2016-09-15 06:59:15 -0700 | [diff] [blame] | 358 | }; |
| 359 | |
fmenozzi | 55d318d | 2016-08-09 08:05:57 -0700 | [diff] [blame] | 360 | class GLSLProcessor; |
rileya@google.com | 1c6d64b | 2012-07-27 15:49:05 +0000 | [diff] [blame] | 361 | |
Brian Salomon | d3b6597 | 2017-03-22 12:05:03 -0400 | [diff] [blame] | 362 | ~GrGradientEffect() override; |
rileya@google.com | 1c6d64b | 2012-07-27 15:49:05 +0000 | [diff] [blame] | 363 | |
rileya@google.com | b3e50f2 | 2012-08-20 17:43:08 +0000 | [diff] [blame] | 364 | bool useAtlas() const { return SkToBool(-1 != fRow); } |
fmenozzi | cd9a1d0 | 2016-08-15 07:03:47 -0700 | [diff] [blame] | 365 | SkScalar getYCoord() const { return fYCoord; } |
rileya@google.com | b3e50f2 | 2012-08-20 17:43:08 +0000 | [diff] [blame] | 366 | |
fmenozzi | cd9a1d0 | 2016-08-15 07:03:47 -0700 | [diff] [blame] | 367 | enum ColorType { |
| 368 | kTwo_ColorType, |
| 369 | kThree_ColorType, // Symmetric three color |
| 370 | kTexture_ColorType, |
Brian Salomon | 466ad99 | 2016-10-13 16:08:36 -0400 | [diff] [blame] | 371 | kSingleHardStop_ColorType, // 0, t, t, 1 |
fmenozzi | cd9a1d0 | 2016-08-15 07:03:47 -0700 | [diff] [blame] | 372 | kHardStopLeftEdged_ColorType, // 0, 0, 1 |
| 373 | kHardStopRightEdged_ColorType, // 0, 1, 1 |
fmenozzi | cd9a1d0 | 2016-08-15 07:03:47 -0700 | [diff] [blame] | 374 | }; |
| 375 | |
| 376 | ColorType getColorType() const { return fColorType; } |
| 377 | |
| 378 | // Determines the type of gradient, one of: |
| 379 | // - Two-color |
| 380 | // - Symmetric three-color |
| 381 | // - Texture |
| 382 | // - Centered hard stop |
| 383 | // - Left-edged hard stop |
| 384 | // - Right-edged hard stop |
| 385 | ColorType determineColorType(const SkGradientShaderBase& shader); |
bsalomon@google.com | 82d1223 | 2013-09-09 15:36:26 +0000 | [diff] [blame] | 386 | |
| 387 | enum PremulType { |
| 388 | kBeforeInterp_PremulType, |
| 389 | kAfterInterp_PremulType, |
| 390 | }; |
| 391 | |
| 392 | PremulType getPremulType() const { return fPremulType; } |
| 393 | |
| 394 | const SkColor* getColors(int pos) const { |
fmenozzi | cd9a1d0 | 2016-08-15 07:03:47 -0700 | [diff] [blame] | 395 | SkASSERT(fColorType != kTexture_ColorType); |
| 396 | SkASSERT(pos < fColors.count()); |
bsalomon@google.com | 82d1223 | 2013-09-09 15:36:26 +0000 | [diff] [blame] | 397 | return &fColors[pos]; |
| 398 | } |
bsalomon@google.com | 371e105 | 2013-01-11 21:08:55 +0000 | [diff] [blame] | 399 | |
brianosman | b9c5137 | 2016-09-15 11:09:45 -0700 | [diff] [blame] | 400 | const SkColor4f* getColors4f(int pos) const { |
| 401 | SkASSERT(fColorType != kTexture_ColorType); |
| 402 | SkASSERT(pos < fColors4f.count()); |
| 403 | return &fColors4f[pos]; |
| 404 | } |
| 405 | |
bsalomon@google.com | d472620 | 2012-08-03 14:34:46 +0000 | [diff] [blame] | 406 | protected: |
Brian Salomon | 587e08f | 2017-01-27 10:59:27 -0500 | [diff] [blame] | 407 | GrGradientEffect(const CreateArgs&, bool isOpaque); |
Brian Salomon | f8480b9 | 2017-07-27 15:45:59 -0400 | [diff] [blame] | 408 | explicit GrGradientEffect(const GrGradientEffect&); // facilitates clone() implementations |
Brian Salomon | 587e08f | 2017-01-27 10:59:27 -0500 | [diff] [blame] | 409 | |
Hal Canary | 6f6961e | 2017-01-31 13:50:44 -0500 | [diff] [blame] | 410 | #if GR_TEST_UTILS |
Brian Osman | e75c19f | 2016-10-10 11:26:43 -0400 | [diff] [blame] | 411 | /** Helper struct that stores (and populates) parameters to construct a random gradient. |
Brian Osman | a219653 | 2016-10-17 12:48:13 -0400 | [diff] [blame] | 412 | If fUseColors4f is true, then the SkColor4f factory should be called, with fColors4f and |
| 413 | fColorSpace. Otherwise, the SkColor factory should be called, with fColors. fColorCount |
| 414 | will be the number of color stops in either case, and fColors and fStops can be passed to |
| 415 | the gradient factory. (The constructor may decide not to use stops, in which case fStops |
| 416 | will be nullptr). */ |
Brian Osman | 3f74860 | 2016-10-03 18:29:03 -0400 | [diff] [blame] | 417 | struct RandomGradientParams { |
Brian Salomon | 5d4cd9e | 2017-02-09 11:16:46 -0500 | [diff] [blame] | 418 | static const int kMaxRandomGradientColors = 5; |
Brian Osman | e75c19f | 2016-10-10 11:26:43 -0400 | [diff] [blame] | 419 | |
Brian Osman | 3f74860 | 2016-10-03 18:29:03 -0400 | [diff] [blame] | 420 | RandomGradientParams(SkRandom* r); |
| 421 | |
Brian Osman | a219653 | 2016-10-17 12:48:13 -0400 | [diff] [blame] | 422 | bool fUseColors4f; |
Brian Osman | 3f74860 | 2016-10-03 18:29:03 -0400 | [diff] [blame] | 423 | SkColor fColors[kMaxRandomGradientColors]; |
Brian Osman | a219653 | 2016-10-17 12:48:13 -0400 | [diff] [blame] | 424 | SkColor4f fColors4f[kMaxRandomGradientColors]; |
| 425 | sk_sp<SkColorSpace> fColorSpace; |
Brian Osman | 3f74860 | 2016-10-03 18:29:03 -0400 | [diff] [blame] | 426 | SkScalar fStopStorage[kMaxRandomGradientColors]; |
| 427 | SkShader::TileMode fTileMode; |
| 428 | int fColorCount; |
| 429 | SkScalar* fStops; |
| 430 | }; |
Hal Canary | 6f6961e | 2017-01-31 13:50:44 -0500 | [diff] [blame] | 431 | #endif |
bsalomon@google.com | d472620 | 2012-08-03 14:34:46 +0000 | [diff] [blame] | 432 | |
mtklein | 36352bf | 2015-03-25 18:17:31 -0700 | [diff] [blame] | 433 | bool onIsEqual(const GrFragmentProcessor&) const override; |
bsalomon@google.com | 68b58c9 | 2013-01-17 16:50:08 +0000 | [diff] [blame] | 434 | |
commit-bot@chromium.org | 5fd7d5c | 2013-10-04 01:20:09 +0000 | [diff] [blame] | 435 | const GrCoordTransform& getCoordTransform() const { return fCoordTransform; } |
| 436 | |
Brian Salomon | 6af2701 | 2017-06-09 08:21:42 -0400 | [diff] [blame] | 437 | /** Checks whether the constructor failed to fully initialize the processor. */ |
Brian Salomon | 06e547c | 2017-06-09 16:11:32 -0400 | [diff] [blame] | 438 | bool isValid() const { |
| 439 | return fColorType != kTexture_ColorType || fTextureSampler.isInitialized(); |
| 440 | } |
Brian Salomon | 6af2701 | 2017-06-09 08:21:42 -0400 | [diff] [blame] | 441 | |
bsalomon@google.com | d472620 | 2012-08-03 14:34:46 +0000 | [diff] [blame] | 442 | private: |
Brian Salomon | 587e08f | 2017-01-27 10:59:27 -0500 | [diff] [blame] | 443 | static OptimizationFlags OptFlags(bool isOpaque); |
| 444 | |
brianosman | b9c5137 | 2016-09-15 11:09:45 -0700 | [diff] [blame] | 445 | // If we're in legacy mode, then fColors will be populated. If we're gamma-correct, then |
| 446 | // fColors4f and fColorSpaceXform will be populated. |
| 447 | SkTDArray<SkColor> fColors; |
| 448 | |
| 449 | SkTDArray<SkColor4f> fColors4f; |
| 450 | sk_sp<GrColorSpaceXform> fColorSpaceXform; |
| 451 | |
| 452 | SkTDArray<SkScalar> fPositions; |
| 453 | SkShader::TileMode fTileMode; |
fmenozzi | cd9a1d0 | 2016-08-15 07:03:47 -0700 | [diff] [blame] | 454 | |
bsalomon@google.com | 77af680 | 2013-10-02 13:04:56 +0000 | [diff] [blame] | 455 | GrCoordTransform fCoordTransform; |
Brian Salomon | 0bbecb2 | 2016-11-17 11:38:22 -0500 | [diff] [blame] | 456 | TextureSampler fTextureSampler; |
bsalomon@google.com | 8171288 | 2012-11-01 17:12:34 +0000 | [diff] [blame] | 457 | SkScalar fYCoord; |
rileya@google.com | b3e50f2 | 2012-08-20 17:43:08 +0000 | [diff] [blame] | 458 | GrTextureStripAtlas* fAtlas; |
| 459 | int fRow; |
bsalomon@google.com | 371e105 | 2013-01-11 21:08:55 +0000 | [diff] [blame] | 460 | bool fIsOpaque; |
fmenozzi | cd9a1d0 | 2016-08-15 07:03:47 -0700 | [diff] [blame] | 461 | ColorType fColorType; |
| 462 | PremulType fPremulType; // This is already baked into the table for texture gradients, and |
| 463 | // only changes behavior for gradients that don't use a texture. |
joshualitt | b0a8a37 | 2014-09-23 09:50:21 -0700 | [diff] [blame] | 464 | typedef GrFragmentProcessor INHERITED; |
rileya@google.com | 1c6d64b | 2012-07-27 15:49:05 +0000 | [diff] [blame] | 465 | |
| 466 | }; |
| 467 | |
| 468 | /////////////////////////////////////////////////////////////////////////////// |
| 469 | |
fmenozzi | cd9a1d0 | 2016-08-15 07:03:47 -0700 | [diff] [blame] | 470 | // Base class for GL gradient effects |
fmenozzi | 55d318d | 2016-08-09 08:05:57 -0700 | [diff] [blame] | 471 | class GrGradientEffect::GLSLProcessor : public GrGLSLFragmentProcessor { |
rileya@google.com | 1c6d64b | 2012-07-27 15:49:05 +0000 | [diff] [blame] | 472 | public: |
fmenozzi | cd9a1d0 | 2016-08-15 07:03:47 -0700 | [diff] [blame] | 473 | GLSLProcessor() { |
| 474 | fCachedYCoord = SK_ScalarMax; |
| 475 | } |
rileya@google.com | 1c6d64b | 2012-07-27 15:49:05 +0000 | [diff] [blame] | 476 | |
wangyix | b1daa86 | 2015-08-18 11:29:31 -0700 | [diff] [blame] | 477 | protected: |
Brian Salomon | ab015ef | 2017-04-04 10:15:51 -0400 | [diff] [blame] | 478 | void onSetData(const GrGLSLProgramDataManager&, const GrFragmentProcessor&) override; |
rileya@google.com | b3e50f2 | 2012-08-20 17:43:08 +0000 | [diff] [blame] | 479 | |
bsalomon@google.com | f78df33 | 2012-10-29 12:43:38 +0000 | [diff] [blame] | 480 | protected: |
bsalomon | 63e99f7 | 2014-07-21 08:03:14 -0700 | [diff] [blame] | 481 | /** |
| 482 | * Subclasses must call this. It will return a key for the part of the shader code controlled |
| 483 | * by the base class. The subclasses must stick it in their key and then pass it to the below |
| 484 | * emit* functions from their emitCode function. |
| 485 | */ |
joshualitt | b0a8a37 | 2014-09-23 09:50:21 -0700 | [diff] [blame] | 486 | static uint32_t GenBaseGradientKey(const GrProcessor&); |
bsalomon | 63e99f7 | 2014-07-21 08:03:14 -0700 | [diff] [blame] | 487 | |
| 488 | // Emits the uniform used as the y-coord to texture samples in derived classes. Subclasses |
| 489 | // should call this method from their emitCode(). |
egdaniel | 7ea439b | 2015-12-03 09:20:44 -0800 | [diff] [blame] | 490 | void emitUniforms(GrGLSLUniformHandler*, const GrGradientEffect&); |
bsalomon | 63e99f7 | 2014-07-21 08:03:14 -0700 | [diff] [blame] | 491 | |
fmenozzi | cd9a1d0 | 2016-08-15 07:03:47 -0700 | [diff] [blame] | 492 | // Emit code that gets a fragment's color from an expression for t; has branches for |
| 493 | // several control flows inside -- 2-color gradients, 3-color symmetric gradients, 4+ |
| 494 | // color gradients that use the traditional texture lookup, as well as several varieties |
| 495 | // of hard stop gradients |
cdalton | 8528541 | 2016-02-18 12:37:07 -0800 | [diff] [blame] | 496 | void emitColor(GrGLSLFPFragmentBuilder* fragBuilder, |
egdaniel | 7ea439b | 2015-12-03 09:20:44 -0800 | [diff] [blame] | 497 | GrGLSLUniformHandler* uniformHandler, |
Brian Salomon | 1edc5b9 | 2016-11-29 13:43:46 -0500 | [diff] [blame] | 498 | const GrShaderCaps* shaderCaps, |
joshualitt | 60030bc | 2014-11-25 14:21:55 -0800 | [diff] [blame] | 499 | const GrGradientEffect&, |
bsalomon | 63e99f7 | 2014-07-21 08:03:14 -0700 | [diff] [blame] | 500 | const char* gradientTValue, |
bsalomon | 63e99f7 | 2014-07-21 08:03:14 -0700 | [diff] [blame] | 501 | const char* outputColor, |
| 502 | const char* inputColor, |
bsalomon | b58a2b4 | 2016-09-26 06:55:02 -0700 | [diff] [blame] | 503 | const TextureSamplers&); |
bsalomon | 63e99f7 | 2014-07-21 08:03:14 -0700 | [diff] [blame] | 504 | |
| 505 | private: |
Florin Malita | b81a8b9 | 2017-08-08 12:14:17 -0400 | [diff] [blame^] | 506 | void emitAnalyticalColor(GrGLSLFPFragmentBuilder* fragBuilder, |
| 507 | GrGLSLUniformHandler* uniformHandler, |
| 508 | const GrShaderCaps* shaderCaps, |
| 509 | const GrGradientEffect&, |
| 510 | const char* gradientTValue, |
| 511 | const char* outputColor, |
| 512 | const char* inputColor); |
| 513 | |
bsalomon@google.com | d8b5fac | 2012-11-01 17:02:46 +0000 | [diff] [blame] | 514 | enum { |
fmenozzi | 64e8e5d | 2016-07-19 10:45:57 -0700 | [diff] [blame] | 515 | // First bit for premul before/after interp |
fmenozzi | cd9a1d0 | 2016-08-15 07:03:47 -0700 | [diff] [blame] | 516 | kPremulBeforeInterpKey = 1, |
bsalomon@google.com | 82d1223 | 2013-09-09 15:36:26 +0000 | [diff] [blame] | 517 | |
fmenozzi | cd9a1d0 | 2016-08-15 07:03:47 -0700 | [diff] [blame] | 518 | // Next three bits for 2/3 color type or different special |
| 519 | // hard stop cases (neither means using texture atlas) |
| 520 | kTwoColorKey = 2, |
| 521 | kThreeColorKey = 4, |
Brian Salomon | f8480b9 | 2017-07-27 15:45:59 -0400 | [diff] [blame] | 522 | |
fmenozzi | cd9a1d0 | 2016-08-15 07:03:47 -0700 | [diff] [blame] | 523 | kHardStopCenteredKey = 6, |
| 524 | kHardStopZeroZeroOneKey = 8, |
| 525 | kHardStopZeroOneOneKey = 10, |
| 526 | |
| 527 | // Next two bits for tile mode |
| 528 | kClampTileMode = 16, |
| 529 | kRepeatTileMode = 32, |
| 530 | kMirrorTileMode = 48, |
| 531 | |
| 532 | // Lower six bits for premul, 2/3 color type, and tile mode |
| 533 | kReservedBits = 6, |
bsalomon@google.com | d8b5fac | 2012-11-01 17:02:46 +0000 | [diff] [blame] | 534 | }; |
| 535 | |
bsalomon@google.com | 8171288 | 2012-11-01 17:12:34 +0000 | [diff] [blame] | 536 | SkScalar fCachedYCoord; |
fmenozzi | cd9a1d0 | 2016-08-15 07:03:47 -0700 | [diff] [blame] | 537 | GrGLSLProgramDataManager::UniformHandle fColorsUni; |
Brian Salomon | 466ad99 | 2016-10-13 16:08:36 -0400 | [diff] [blame] | 538 | GrGLSLProgramDataManager::UniformHandle fHardStopT; |
egdaniel | 018fb62 | 2015-10-28 07:26:40 -0700 | [diff] [blame] | 539 | GrGLSLProgramDataManager::UniformHandle fFSYUni; |
Brian Osman | c624d9d | 2017-03-08 11:42:02 -0500 | [diff] [blame] | 540 | GrGLSLColorSpaceXformHelper fColorSpaceHelper; |
rileya@google.com | b3e50f2 | 2012-08-20 17:43:08 +0000 | [diff] [blame] | 541 | |
egdaniel | 64c4728 | 2015-11-13 06:54:19 -0800 | [diff] [blame] | 542 | typedef GrGLSLFragmentProcessor INHERITED; |
rileya@google.com | 1c6d64b | 2012-07-27 15:49:05 +0000 | [diff] [blame] | 543 | }; |
| 544 | |
| 545 | #endif |
| 546 | |
bsalomon@google.com | cf8fb1f | 2012-08-02 14:03:32 +0000 | [diff] [blame] | 547 | #endif |