blob: 2c449f63266b33586ef8bff1fbc7588f9b216f16 [file] [log] [blame]
jvanverth@google.comd830d132013-11-11 20:54:09 +00001/*
2 * Copyright 2013 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
jvanverth502286d2015-04-08 12:37:51 -07008#ifndef GrDistanceFieldGeoProc_DEFINED
9#define GrDistanceFieldGeoProc_DEFINED
jvanverth@google.comd830d132013-11-11 20:54:09 +000010
joshualittb0a8a372014-09-23 09:50:21 -070011#include "GrProcessor.h"
joshualitt249af152014-09-15 11:41:13 -070012#include "GrGeometryProcessor.h"
jvanverth@google.comd830d132013-11-11 20:54:09 +000013
jvanverth502286d2015-04-08 12:37:51 -070014class GrGLDistanceFieldA8TextGeoProc;
15class GrGLDistanceFieldPathGeoProc;
16class GrGLDistanceFieldLCDTextGeoProc;
egdaniel605dd0f2014-11-12 08:35:25 -080017class GrInvariantOutput;
jvanverth@google.comd830d132013-11-11 20:54:09 +000018
jvanverth78f07182014-07-30 06:17:59 -070019enum GrDistanceFieldEffectFlags {
brianosmanb461d342016-04-13 13:10:14 -070020 kSimilarity_DistanceFieldEffectFlag = 0x01, // ctm is similarity matrix
21 kScaleOnly_DistanceFieldEffectFlag = 0x02, // ctm has only scale and translate
Brian Salomon5c6ac642017-12-19 11:09:32 -050022 kPerspective_DistanceFieldEffectFlag = 0x04, // ctm has perspective (and positions are x,y,w)
23 kUseLCD_DistanceFieldEffectFlag = 0x08, // use lcd text
24 kBGR_DistanceFieldEffectFlag = 0x10, // lcd display has bgr order
25 kPortrait_DistanceFieldEffectFlag = 0x20, // lcd display is in portrait mode (not used yet)
26 kGammaCorrect_DistanceFieldEffectFlag = 0x40, // assume gamma-correct output (linear blending)
27 kAliased_DistanceFieldEffectFlag = 0x80, // monochrome output
jvanverth6d22eca2014-10-28 11:10:48 -070028
Brian Salomon5c6ac642017-12-19 11:09:32 -050029 kInvalid_DistanceFieldEffectFlag = 0x100, // invalid state (for initialization)
halcanary9d524f22016-03-29 09:03:52 -070030
jvanverth78f07182014-07-30 06:17:59 -070031 kUniformScale_DistanceFieldEffectMask = kSimilarity_DistanceFieldEffectFlag |
jvanverthcf371bb2016-03-10 11:10:43 -080032 kScaleOnly_DistanceFieldEffectFlag,
jvanverth502286d2015-04-08 12:37:51 -070033 // The subset of the flags relevant to GrDistanceFieldA8TextGeoProc
jvanverthcf371bb2016-03-10 11:10:43 -080034 kNonLCD_DistanceFieldEffectMask = kSimilarity_DistanceFieldEffectFlag |
brianosman0586f5c2016-04-12 12:48:21 -070035 kScaleOnly_DistanceFieldEffectFlag |
Brian Salomon5c6ac642017-12-19 11:09:32 -050036 kPerspective_DistanceFieldEffectFlag |
Jim Van Verth90e89b32017-07-06 16:36:55 -040037 kGammaCorrect_DistanceFieldEffectFlag |
38 kAliased_DistanceFieldEffectFlag,
jvanverth502286d2015-04-08 12:37:51 -070039 // The subset of the flags relevant to GrDistanceFieldLCDTextGeoProc
jvanverth78f07182014-07-30 06:17:59 -070040 kLCD_DistanceFieldEffectMask = kSimilarity_DistanceFieldEffectFlag |
jvanverthcf371bb2016-03-10 11:10:43 -080041 kScaleOnly_DistanceFieldEffectFlag |
Brian Salomon5c6ac642017-12-19 11:09:32 -050042 kPerspective_DistanceFieldEffectFlag |
jvanverth78f07182014-07-30 06:17:59 -070043 kUseLCD_DistanceFieldEffectFlag |
brianosman0586f5c2016-04-12 12:48:21 -070044 kBGR_DistanceFieldEffectFlag |
brianosmanb461d342016-04-13 13:10:14 -070045 kGammaCorrect_DistanceFieldEffectFlag,
jvanverth78f07182014-07-30 06:17:59 -070046};
47
jvanverth@google.comd830d132013-11-11 20:54:09 +000048/**
skia.committer@gmail.com11a253b2013-11-12 07:02:05 +000049 * The output color of this effect is a modulation of the input color and a sample from a
jvanverth@google.comd830d132013-11-11 20:54:09 +000050 * distance field texture (using a smoothed step function near 0.5).
Brian Salomon2bbdcc42017-09-07 12:36:34 -040051 * It allows explicit specification of the filtering and wrap modes (GrSamplerState). The input
jvanverth2d2a68c2014-06-10 06:42:56 -070052 * coords are a custom attribute. Gamma correction is handled via a texture LUT.
jvanverth@google.comd830d132013-11-11 20:54:09 +000053 */
jvanverth502286d2015-04-08 12:37:51 -070054class GrDistanceFieldA8TextGeoProc : public GrGeometryProcessor {
jvanverth@google.comd830d132013-11-11 20:54:09 +000055public:
Brian Salomon7eae3e02018-08-07 14:02:38 +000056 static constexpr int kMaxTextures = 4;
57
Brian Salomon5c6ac642017-12-19 11:09:32 -050058 /** The local matrix should be identity if local coords are not required by the GrPipeline. */
jvanverth2d2a68c2014-06-10 06:42:56 -070059#ifdef SK_GAMMA_APPLY_TO_A8
Brian Osman4a3f5c82018-09-18 16:16:38 -040060 static sk_sp<GrGeometryProcessor> Make(const GrShaderCaps& caps,
61 const sk_sp<GrTextureProxy>* proxies,
Jim Van Verthcbeae032018-05-16 14:54:41 -040062 int numActiveProxies,
Brian Salomon2bbdcc42017-09-07 12:36:34 -040063 const GrSamplerState& params, float lum, uint32_t flags,
Brian Salomon5c6ac642017-12-19 11:09:32 -050064 const SkMatrix& localMatrixIfUsesLocalCoords) {
65 return sk_sp<GrGeometryProcessor>(new GrDistanceFieldA8TextGeoProc(
Brian Osman4a3f5c82018-09-18 16:16:38 -040066 caps, proxies, numActiveProxies, params, lum, flags, localMatrixIfUsesLocalCoords));
Robert Phillipsdbc8eeb2017-02-21 10:04:31 -050067 }
jvanverth2d2a68c2014-06-10 06:42:56 -070068#else
Brian Osman4a3f5c82018-09-18 16:16:38 -040069 static sk_sp<GrGeometryProcessor> Make(const GrShaderCaps& caps,
70 const sk_sp<GrTextureProxy>* proxies,
Jim Van Verthcbeae032018-05-16 14:54:41 -040071 int numActiveProxies,
Brian Salomon2bbdcc42017-09-07 12:36:34 -040072 const GrSamplerState& params, uint32_t flags,
Brian Salomon5c6ac642017-12-19 11:09:32 -050073 const SkMatrix& localMatrixIfUsesLocalCoords) {
74 return sk_sp<GrGeometryProcessor>(new GrDistanceFieldA8TextGeoProc(
Brian Osman4a3f5c82018-09-18 16:16:38 -040075 caps, proxies, numActiveProxies, params, flags, localMatrixIfUsesLocalCoords));
Robert Phillipsdbc8eeb2017-02-21 10:04:31 -050076 }
bsalomon55fad7a2014-07-08 07:34:20 -070077#endif
jvanverth@google.comd830d132013-11-11 20:54:09 +000078
Brian Salomond3b65972017-03-22 12:05:03 -040079 ~GrDistanceFieldA8TextGeoProc() override {}
jvanverth@google.comd830d132013-11-11 20:54:09 +000080
bsalomon32d1e952016-09-15 07:29:52 -070081 const char* name() const override { return "DistanceFieldA8Text"; }
jvanverth@google.comd830d132013-11-11 20:54:09 +000082
Brian Salomon92be2f72018-06-19 14:33:47 -040083 const Attribute& inPosition() const { return fInPosition; }
84 const Attribute& inColor() const { return kInColor; }
Brian Osman4a3f5c82018-09-18 16:16:38 -040085 const Attribute& inTextureCoords() const { return fInTextureCoords; }
Brian Salomon5c6ac642017-12-19 11:09:32 -050086 const SkMatrix& localMatrix() const { return fLocalMatrix; }
jvanverth2d2a68c2014-06-10 06:42:56 -070087#ifdef SK_GAMMA_APPLY_TO_A8
jvanverth21deace2015-04-01 12:43:48 -070088 float getDistanceAdjust() const { return fDistanceAdjust; }
jvanverth2d2a68c2014-06-10 06:42:56 -070089#endif
jvanverth78f07182014-07-30 06:17:59 -070090 uint32_t getFlags() const { return fFlags; }
Brian Salomon7eae3e02018-08-07 14:02:38 +000091 const SkISize& atlasSize() const { return fAtlasSize; }
jvanverth@google.comd830d132013-11-11 20:54:09 +000092
Robert Phillips4bc70112018-03-01 10:24:02 -050093 void addNewProxies(const sk_sp<GrTextureProxy>* proxies, int numProxies, const GrSamplerState&);
Jim Van Vertheafa64b2017-09-18 10:05:00 -040094
Brian Salomon94efbf52016-11-29 13:43:05 -050095 void getGLSLProcessorKey(const GrShaderCaps& caps, GrProcessorKeyBuilder* b) const override;
jvanverth@google.comd830d132013-11-11 20:54:09 +000096
Brian Salomon94efbf52016-11-29 13:43:05 -050097 GrGLSLPrimitiveProcessor* createGLSLInstance(const GrShaderCaps&) const override;
jvanverth@google.comd830d132013-11-11 20:54:09 +000098
99private:
Brian Osman4a3f5c82018-09-18 16:16:38 -0400100 GrDistanceFieldA8TextGeoProc(const GrShaderCaps& caps,
101 const sk_sp<GrTextureProxy>* proxies,
Jim Van Verthcbeae032018-05-16 14:54:41 -0400102 int numActiveProxies,
Brian Salomon2bbdcc42017-09-07 12:36:34 -0400103 const GrSamplerState& params,
Robert Phillipsdbc8eeb2017-02-21 10:04:31 -0500104#ifdef SK_GAMMA_APPLY_TO_A8
105 float distanceAdjust,
106#endif
Brian Salomon5c6ac642017-12-19 11:09:32 -0500107 uint32_t flags, const SkMatrix& localMatrix);
Robert Phillipsdbc8eeb2017-02-21 10:04:31 -0500108
Brian Salomon92be2f72018-06-19 14:33:47 -0400109 const Attribute& onVertexAttribute(int i) const override {
Brian Osman4a3f5c82018-09-18 16:16:38 -0400110 return IthAttribute(i, fInPosition, kInColor, fInTextureCoords);
Brian Salomon92be2f72018-06-19 14:33:47 -0400111 }
112
Brian Salomonf7dcd762018-07-30 14:48:15 -0400113 const TextureSampler& onTextureSampler(int i) const override { return fTextureSamplers[i]; }
114
Jim Van Vertha950b632017-09-12 11:54:11 -0400115 TextureSampler fTextureSamplers[kMaxTextures];
Brian Salomon7eae3e02018-08-07 14:02:38 +0000116 SkISize fAtlasSize; // size for all textures used with fTextureSamplers[].
Brian Salomon92be2f72018-06-19 14:33:47 -0400117 SkMatrix fLocalMatrix;
118 Attribute fInPosition;
Brian Osman4a3f5c82018-09-18 16:16:38 -0400119 Attribute fInTextureCoords;
Brian Salomon92be2f72018-06-19 14:33:47 -0400120 uint32_t fFlags;
jvanverth2d2a68c2014-06-10 06:42:56 -0700121#ifdef SK_GAMMA_APPLY_TO_A8
jvanverth21deace2015-04-01 12:43:48 -0700122 float fDistanceAdjust;
jvanverth2d2a68c2014-06-10 06:42:56 -0700123#endif
Brian Salomon92be2f72018-06-19 14:33:47 -0400124
Brian Osmand4c29702018-09-14 16:16:55 -0400125 static constexpr Attribute kInColor =
126 {"inColor", kUByte4_norm_GrVertexAttribType, kHalf4_GrSLType};
jvanverth@google.comd830d132013-11-11 20:54:09 +0000127
Brian Salomon0c26a9d2017-07-06 10:09:38 -0400128 GR_DECLARE_GEOMETRY_PROCESSOR_TEST
jvanverth@google.comd830d132013-11-11 20:54:09 +0000129
jvanverthfa38a302014-10-06 05:59:05 -0700130 typedef GrGeometryProcessor INHERITED;
131};
132
jvanverthfa38a302014-10-06 05:59:05 -0700133/**
Brian Salomon2bbdcc42017-09-07 12:36:34 -0400134 * The output color of this effect is a modulation of the input color and a sample from a
135 * distance field texture (using a smoothed step function near 0.5).
136 * It allows explicit specification of the filtering and wrap modes (GrSamplerState). The input
137 * coords are a custom attribute. No gamma correct blending is applied. Used for paths only.
138 */
jvanverth502286d2015-04-08 12:37:51 -0700139class GrDistanceFieldPathGeoProc : public GrGeometryProcessor {
jvanverthfa38a302014-10-06 05:59:05 -0700140public:
Brian Salomon7eae3e02018-08-07 14:02:38 +0000141 static constexpr int kMaxTextures = 4;
Jim Van Vertha950b632017-09-12 11:54:11 -0400142
Brian Salomon5c6ac642017-12-19 11:09:32 -0500143 /** The local matrix should be identity if local coords are not required by the GrPipeline. */
Brian Osman4a3f5c82018-09-18 16:16:38 -0400144 static sk_sp<GrGeometryProcessor> Make(const GrShaderCaps& caps,
145 const SkMatrix& matrix,
Robert Phillips4bc70112018-03-01 10:24:02 -0500146 const sk_sp<GrTextureProxy>* proxies,
Jim Van Verthcbeae032018-05-16 14:54:41 -0400147 int numActiveProxies,
Jim Van Verth5698c8a2017-10-12 10:18:44 -0400148 const GrSamplerState& params, uint32_t flags) {
Robert Phillipsdbc8eeb2017-02-21 10:04:31 -0500149 return sk_sp<GrGeometryProcessor>(
Brian Osman4a3f5c82018-09-18 16:16:38 -0400150 new GrDistanceFieldPathGeoProc(caps, matrix, proxies, numActiveProxies, params, flags));
Robert Phillipsdbc8eeb2017-02-21 10:04:31 -0500151 }
152
153 ~GrDistanceFieldPathGeoProc() override {}
jvanverthfa38a302014-10-06 05:59:05 -0700154
bsalomon32d1e952016-09-15 07:29:52 -0700155 const char* name() const override { return "DistanceFieldPath"; }
jvanverthfa38a302014-10-06 05:59:05 -0700156
Brian Salomon92be2f72018-06-19 14:33:47 -0400157 const Attribute& inPosition() const { return kInPosition; }
158 const Attribute& inColor() const { return kInColor; }
Brian Osman4a3f5c82018-09-18 16:16:38 -0400159 const Attribute& inTextureCoords() const { return fInTextureCoords; }
Jim Van Verth5698c8a2017-10-12 10:18:44 -0400160 const SkMatrix& matrix() const { return fMatrix; }
jvanverthfa38a302014-10-06 05:59:05 -0700161 uint32_t getFlags() const { return fFlags; }
Brian Salomon7eae3e02018-08-07 14:02:38 +0000162 const SkISize& atlasSize() const { return fAtlasSize; }
jvanverthfa38a302014-10-06 05:59:05 -0700163
Jim Van Verthcbeae032018-05-16 14:54:41 -0400164 void addNewProxies(const sk_sp<GrTextureProxy>*, int numActiveProxies, const GrSamplerState&);
Jim Van Vertheafa64b2017-09-18 10:05:00 -0400165
Brian Salomon94efbf52016-11-29 13:43:05 -0500166 void getGLSLProcessorKey(const GrShaderCaps& caps, GrProcessorKeyBuilder* b) const override;
jvanverthfa38a302014-10-06 05:59:05 -0700167
Brian Salomon94efbf52016-11-29 13:43:05 -0500168 GrGLSLPrimitiveProcessor* createGLSLInstance(const GrShaderCaps&) const override;
jvanverthfa38a302014-10-06 05:59:05 -0700169
170private:
Brian Osman4a3f5c82018-09-18 16:16:38 -0400171 GrDistanceFieldPathGeoProc(const GrShaderCaps& caps,
172 const SkMatrix& matrix,
Robert Phillips4bc70112018-03-01 10:24:02 -0500173 const sk_sp<GrTextureProxy>* proxies,
Jim Van Verthcbeae032018-05-16 14:54:41 -0400174 int numActiveProxies,
Jim Van Verth5698c8a2017-10-12 10:18:44 -0400175 const GrSamplerState&, uint32_t flags);
Robert Phillipsdbc8eeb2017-02-21 10:04:31 -0500176
Brian Salomon92be2f72018-06-19 14:33:47 -0400177 const Attribute& onVertexAttribute(int i) const override;
Brian Salomonf7dcd762018-07-30 14:48:15 -0400178 const TextureSampler& onTextureSampler(int i) const override { return fTextureSamplers[i]; }
Brian Salomon92be2f72018-06-19 14:33:47 -0400179
Brian Salomon7eae3e02018-08-07 14:02:38 +0000180 SkMatrix fMatrix; // view matrix if perspective, local matrix otherwise
Jim Van Vertha950b632017-09-12 11:54:11 -0400181 TextureSampler fTextureSamplers[kMaxTextures];
Brian Salomon7eae3e02018-08-07 14:02:38 +0000182 SkISize fAtlasSize; // size for all textures used with fTextureSamplers[].
Brian Osman4a3f5c82018-09-18 16:16:38 -0400183 Attribute fInTextureCoords;
joshualitt88c23fc2015-05-13 14:18:07 -0700184 uint32_t fFlags;
Brian Osmand4c29702018-09-14 16:16:55 -0400185 static constexpr Attribute kInPosition =
186 {"inPosition", kFloat2_GrVertexAttribType, kFloat2_GrSLType};
187 static constexpr Attribute kInColor =
188 {"inColor", kUByte4_norm_GrVertexAttribType, kHalf4_GrSLType};
jvanverthfa38a302014-10-06 05:59:05 -0700189
Brian Salomon0c26a9d2017-07-06 10:09:38 -0400190 GR_DECLARE_GEOMETRY_PROCESSOR_TEST
jvanverthfa38a302014-10-06 05:59:05 -0700191
192 typedef GrGeometryProcessor INHERITED;
jvanverth@google.comd830d132013-11-11 20:54:09 +0000193};
194
commit-bot@chromium.org609ced42014-04-03 18:25:48 +0000195/**
196 * The output color of this effect is a modulation of the input color and samples from a
197 * distance field texture (using a smoothed step function near 0.5), adjusted for LCD displays.
Brian Salomon2bbdcc42017-09-07 12:36:34 -0400198 * It allows explicit specification of the filtering and wrap modes (GrSamplerState). The input
jvanverth2d2a68c2014-06-10 06:42:56 -0700199 * coords are a custom attribute. Gamma correction is handled via a texture LUT.
commit-bot@chromium.org609ced42014-04-03 18:25:48 +0000200 */
jvanverth502286d2015-04-08 12:37:51 -0700201class GrDistanceFieldLCDTextGeoProc : public GrGeometryProcessor {
commit-bot@chromium.org609ced42014-04-03 18:25:48 +0000202public:
Brian Salomon7eae3e02018-08-07 14:02:38 +0000203 static constexpr int kMaxTextures = 4;
204
jvanverth21deace2015-04-01 12:43:48 -0700205 struct DistanceAdjust {
206 SkScalar fR, fG, fB;
207 static DistanceAdjust Make(SkScalar r, SkScalar g, SkScalar b) {
208 DistanceAdjust result;
209 result.fR = r; result.fG = g; result.fB = b;
210 return result;
211 }
212 bool operator==(const DistanceAdjust& wa) const {
213 return (fR == wa.fR && fG == wa.fG && fB == wa.fB);
214 }
215 bool operator!=(const DistanceAdjust& wa) const {
216 return !(*this == wa);
217 }
218 };
219
Brian Osman4a3f5c82018-09-18 16:16:38 -0400220 static sk_sp<GrGeometryProcessor> Make(const GrShaderCaps& caps,
221 const sk_sp<GrTextureProxy>* proxies,
Jim Van Verthcbeae032018-05-16 14:54:41 -0400222 int numActiveProxies,
Brian Salomon2bbdcc42017-09-07 12:36:34 -0400223 const GrSamplerState& params,
Robert Phillipsfbcef6e2017-06-15 12:07:18 -0400224 DistanceAdjust distanceAdjust,
225 uint32_t flags,
Brian Salomon5c6ac642017-12-19 11:09:32 -0500226 const SkMatrix& localMatrixIfUsesLocalCoords) {
Jim Van Verthcbeae032018-05-16 14:54:41 -0400227 return sk_sp<GrGeometryProcessor>(
Brian Osman4a3f5c82018-09-18 16:16:38 -0400228 new GrDistanceFieldLCDTextGeoProc(caps, proxies, numActiveProxies, params,
229 distanceAdjust, flags, localMatrixIfUsesLocalCoords));
Robert Phillipsdbc8eeb2017-02-21 10:04:31 -0500230 }
231
232 ~GrDistanceFieldLCDTextGeoProc() override {}
commit-bot@chromium.org609ced42014-04-03 18:25:48 +0000233
bsalomon32d1e952016-09-15 07:29:52 -0700234 const char* name() const override { return "DistanceFieldLCDText"; }
commit-bot@chromium.org609ced42014-04-03 18:25:48 +0000235
Brian Salomon92be2f72018-06-19 14:33:47 -0400236 const Attribute& inPosition() const { return fInPosition; }
237 const Attribute& inColor() const { return kInColor; }
Brian Osman4a3f5c82018-09-18 16:16:38 -0400238 const Attribute& inTextureCoords() const { return fInTextureCoords; }
jvanverth21deace2015-04-01 12:43:48 -0700239 DistanceAdjust getDistanceAdjust() const { return fDistanceAdjust; }
jvanverth78f07182014-07-30 06:17:59 -0700240 uint32_t getFlags() const { return fFlags; }
Brian Salomon5c6ac642017-12-19 11:09:32 -0500241 const SkMatrix& localMatrix() const { return fLocalMatrix; }
Brian Salomon7eae3e02018-08-07 14:02:38 +0000242 const SkISize& atlasSize() const { return fAtlasSize; }
commit-bot@chromium.org609ced42014-04-03 18:25:48 +0000243
Jim Van Verthcbeae032018-05-16 14:54:41 -0400244 void addNewProxies(const sk_sp<GrTextureProxy>*, int numActiveProxies, const GrSamplerState&);
Jim Van Vertheafa64b2017-09-18 10:05:00 -0400245
Brian Salomon94efbf52016-11-29 13:43:05 -0500246 void getGLSLProcessorKey(const GrShaderCaps& caps, GrProcessorKeyBuilder* b) const override;
commit-bot@chromium.org609ced42014-04-03 18:25:48 +0000247
Brian Salomon94efbf52016-11-29 13:43:05 -0500248 GrGLSLPrimitiveProcessor* createGLSLInstance(const GrShaderCaps&) const override;
commit-bot@chromium.org609ced42014-04-03 18:25:48 +0000249
250private:
Brian Osman4a3f5c82018-09-18 16:16:38 -0400251 GrDistanceFieldLCDTextGeoProc(const GrShaderCaps& caps, const sk_sp<GrTextureProxy>* proxies,
252 int numActiveProxies, const GrSamplerState& params,
253 DistanceAdjust wa, uint32_t flags, const SkMatrix& localMatrix);
Robert Phillipsdbc8eeb2017-02-21 10:04:31 -0500254
Brian Salomon92be2f72018-06-19 14:33:47 -0400255 const Attribute& onVertexAttribute(int) const override;
Brian Salomonf7dcd762018-07-30 14:48:15 -0400256 const TextureSampler& onTextureSampler(int i) const override { return fTextureSamplers[i]; }
Brian Salomon92be2f72018-06-19 14:33:47 -0400257
Jim Van Vertha950b632017-09-12 11:54:11 -0400258 TextureSampler fTextureSamplers[kMaxTextures];
Brian Salomon7eae3e02018-08-07 14:02:38 +0000259 SkISize fAtlasSize; // size for all textures used with fTextureSamplers[].
Mike Klein5045e502018-06-19 01:40:57 +0000260 const SkMatrix fLocalMatrix;
Brian Salomon92be2f72018-06-19 14:33:47 -0400261 DistanceAdjust fDistanceAdjust;
262 Attribute fInPosition;
Brian Osman4a3f5c82018-09-18 16:16:38 -0400263 Attribute fInTextureCoords;
Brian Salomon92be2f72018-06-19 14:33:47 -0400264 uint32_t fFlags;
265
Brian Osmand4c29702018-09-14 16:16:55 -0400266 static constexpr Attribute kInColor =
267 {"inColor", kUByte4_norm_GrVertexAttribType, kHalf4_GrSLType};
commit-bot@chromium.org609ced42014-04-03 18:25:48 +0000268
Brian Salomon0c26a9d2017-07-06 10:09:38 -0400269 GR_DECLARE_GEOMETRY_PROCESSOR_TEST
commit-bot@chromium.org609ced42014-04-03 18:25:48 +0000270
jvanverthfa38a302014-10-06 05:59:05 -0700271 typedef GrGeometryProcessor INHERITED;
commit-bot@chromium.org609ced42014-04-03 18:25:48 +0000272};
273
jvanverth@google.comd830d132013-11-11 20:54:09 +0000274#endif