commit-bot@chromium.org | 07e1c3f | 2013-08-22 20:41:15 +0000 | [diff] [blame] | 1 | /* |
| 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 | |
| 8 | #ifndef GrBezierEffect_DEFINED |
skia.committer@gmail.com | 44a77c8 | 2013-08-23 07:01:29 +0000 | [diff] [blame] | 9 | #define GrBezierEffect_DEFINED |
commit-bot@chromium.org | 07e1c3f | 2013-08-22 20:41:15 +0000 | [diff] [blame] | 10 | |
commit-bot@chromium.org | 07e1c3f | 2013-08-22 20:41:15 +0000 | [diff] [blame] | 11 | #include "GrDrawTargetCaps.h" |
joshualitt | b0a8a37 | 2014-09-23 09:50:21 -0700 | [diff] [blame] | 12 | #include "GrProcessor.h" |
joshualitt | 249af15 | 2014-09-15 11:41:13 -0700 | [diff] [blame] | 13 | #include "GrGeometryProcessor.h" |
egdaniel | 605dd0f | 2014-11-12 08:35:25 -0800 | [diff] [blame] | 14 | #include "GrInvariantOutput.h" |
commit-bot@chromium.org | cabf4b2 | 2014-03-05 18:27:43 +0000 | [diff] [blame] | 15 | #include "GrTypesPriv.h" |
commit-bot@chromium.org | 07e1c3f | 2013-08-22 20:41:15 +0000 | [diff] [blame] | 16 | |
| 17 | /** |
| 18 | * Shader is based off of Loop-Blinn Quadratic GPU Rendering |
| 19 | * The output of this effect is a hairline edge for conics. |
| 20 | * Conics specified by implicit equation K^2 - LM. |
| 21 | * K, L, and M, are the first three values of the vertex attribute, |
| 22 | * the fourth value is not used. Distance is calculated using a |
| 23 | * first order approximation from the taylor series. |
| 24 | * Coverage for AA is max(0, 1-distance). |
| 25 | * |
| 26 | * Test were also run using a second order distance approximation. |
| 27 | * There were two versions of the second order approx. The first version |
| 28 | * is of roughly the form: |
| 29 | * f(q) = |f(p)| - ||f'(p)||*||q-p|| - ||f''(p)||*||q-p||^2. |
| 30 | * The second is similar: |
| 31 | * f(q) = |f(p)| + ||f'(p)||*||q-p|| + ||f''(p)||*||q-p||^2. |
| 32 | * The exact version of the equations can be found in the paper |
| 33 | * "Distance Approximations for Rasterizing Implicit Curves" by Gabriel Taubin |
| 34 | * |
| 35 | * In both versions we solve the quadratic for ||q-p||. |
| 36 | * Version 1: |
| 37 | * gFM is magnitude of first partials and gFM2 is magnitude of 2nd partials (as derived from paper) |
| 38 | * builder->fsCodeAppend("\t\tedgeAlpha = (sqrt(gFM*gFM+4.0*func*gF2M) - gFM)/(2.0*gF2M);\n"); |
| 39 | * Version 2: |
| 40 | * builder->fsCodeAppend("\t\tedgeAlpha = (gFM - sqrt(gFM*gFM-4.0*func*gF2M))/(2.0*gF2M);\n"); |
| 41 | * |
| 42 | * Also note that 2nd partials of k,l,m are zero |
| 43 | * |
| 44 | * When comparing the two second order approximations to the first order approximations, |
| 45 | * the following results were found. Version 1 tends to underestimate the distances, thus it |
| 46 | * basically increases all the error that we were already seeing in the first order |
| 47 | * approx. So this version is not the one to use. Version 2 has the opposite effect |
| 48 | * and tends to overestimate the distances. This is much closer to what we are |
| 49 | * looking for. It is able to render ellipses (even thin ones) without the need to chop. |
| 50 | * However, it can not handle thin hyperbolas well and thus would still rely on |
| 51 | * chopping to tighten the clipping. Another side effect of the overestimating is |
| 52 | * that the curves become much thinner and "ropey". If all that was ever rendered |
| 53 | * were "not too thin" curves and ellipses then 2nd order may have an advantage since |
| 54 | * only one geometry would need to be rendered. However no benches were run comparing |
| 55 | * chopped first order and non chopped 2nd order. |
| 56 | */ |
| 57 | class GrGLConicEffect; |
| 58 | |
joshualitt | 249af15 | 2014-09-15 11:41:13 -0700 | [diff] [blame] | 59 | class GrConicEffect : public GrGeometryProcessor { |
commit-bot@chromium.org | 07e1c3f | 2013-08-22 20:41:15 +0000 | [diff] [blame] | 60 | public: |
joshualitt | 2e3b3e3 | 2014-12-09 13:31:14 -0800 | [diff] [blame] | 61 | static GrGeometryProcessor* Create(GrColor color, |
| 62 | const GrPrimitiveEdgeType edgeType, |
| 63 | const GrDrawTargetCaps& caps, |
| 64 | uint8_t coverage = 0xff) { |
commit-bot@chromium.org | cabf4b2 | 2014-03-05 18:27:43 +0000 | [diff] [blame] | 65 | switch (edgeType) { |
joshualitt | b0a8a37 | 2014-09-23 09:50:21 -0700 | [diff] [blame] | 66 | case kFillAA_GrProcessorEdgeType: |
commit-bot@chromium.org | cabf4b2 | 2014-03-05 18:27:43 +0000 | [diff] [blame] | 67 | if (!caps.shaderDerivativeSupport()) { |
| 68 | return NULL; |
| 69 | } |
joshualitt | 2e3b3e3 | 2014-12-09 13:31:14 -0800 | [diff] [blame] | 70 | return SkNEW_ARGS(GrConicEffect, (color, coverage, kFillAA_GrProcessorEdgeType)); |
joshualitt | b0a8a37 | 2014-09-23 09:50:21 -0700 | [diff] [blame] | 71 | case kHairlineAA_GrProcessorEdgeType: |
commit-bot@chromium.org | cabf4b2 | 2014-03-05 18:27:43 +0000 | [diff] [blame] | 72 | if (!caps.shaderDerivativeSupport()) { |
| 73 | return NULL; |
| 74 | } |
joshualitt | 2e3b3e3 | 2014-12-09 13:31:14 -0800 | [diff] [blame] | 75 | return SkNEW_ARGS(GrConicEffect, (color, coverage, |
| 76 | kHairlineAA_GrProcessorEdgeType)); |
joshualitt | b0a8a37 | 2014-09-23 09:50:21 -0700 | [diff] [blame] | 77 | case kFillBW_GrProcessorEdgeType: |
joshualitt | 2e3b3e3 | 2014-12-09 13:31:14 -0800 | [diff] [blame] | 78 | return SkNEW_ARGS(GrConicEffect, (color, coverage, kFillBW_GrProcessorEdgeType));; |
commit-bot@chromium.org | cabf4b2 | 2014-03-05 18:27:43 +0000 | [diff] [blame] | 79 | default: |
commit-bot@chromium.org | 07e1c3f | 2013-08-22 20:41:15 +0000 | [diff] [blame] | 80 | return NULL; |
commit-bot@chromium.org | 07e1c3f | 2013-08-22 20:41:15 +0000 | [diff] [blame] | 81 | } |
| 82 | } |
| 83 | |
| 84 | virtual ~GrConicEffect(); |
| 85 | |
joshualitt | eb2a676 | 2014-12-04 11:35:33 -0800 | [diff] [blame] | 86 | virtual const char* name() const SK_OVERRIDE { return "Conic"; } |
commit-bot@chromium.org | 07e1c3f | 2013-08-22 20:41:15 +0000 | [diff] [blame] | 87 | |
joshualitt | 2dd1ae0 | 2014-12-03 06:24:10 -0800 | [diff] [blame] | 88 | inline const GrAttribute* inPosition() const { return fInPosition; } |
| 89 | inline const GrAttribute* inConicCoeffs() const { return fInConicCoeffs; } |
joshualitt | b0a8a37 | 2014-09-23 09:50:21 -0700 | [diff] [blame] | 90 | inline bool isAntiAliased() const { return GrProcessorEdgeTypeIsAA(fEdgeType); } |
| 91 | inline bool isFilled() const { return GrProcessorEdgeTypeIsFill(fEdgeType); } |
| 92 | inline GrPrimitiveEdgeType getEdgeType() const { return fEdgeType; } |
commit-bot@chromium.org | 07e1c3f | 2013-08-22 20:41:15 +0000 | [diff] [blame] | 93 | |
joshualitt | eb2a676 | 2014-12-04 11:35:33 -0800 | [diff] [blame] | 94 | virtual void getGLProcessorKey(const GrBatchTracker& bt, |
| 95 | const GrGLCaps& caps, |
| 96 | GrProcessorKeyBuilder* b) const SK_OVERRIDE; |
commit-bot@chromium.org | 07e1c3f | 2013-08-22 20:41:15 +0000 | [diff] [blame] | 97 | |
joshualitt | eb2a676 | 2014-12-04 11:35:33 -0800 | [diff] [blame] | 98 | virtual GrGLGeometryProcessor* createGLInstance(const GrBatchTracker& bt) const SK_OVERRIDE; |
commit-bot@chromium.org | 07e1c3f | 2013-08-22 20:41:15 +0000 | [diff] [blame] | 99 | |
| 100 | private: |
joshualitt | 2e3b3e3 | 2014-12-09 13:31:14 -0800 | [diff] [blame] | 101 | GrConicEffect(GrColor, uint8_t coverage, GrPrimitiveEdgeType); |
commit-bot@chromium.org | 07e1c3f | 2013-08-22 20:41:15 +0000 | [diff] [blame] | 102 | |
bsalomon | 0e08fc1 | 2014-10-15 08:19:04 -0700 | [diff] [blame] | 103 | virtual bool onIsEqual(const GrGeometryProcessor& other) const SK_OVERRIDE; |
commit-bot@chromium.org | 07e1c3f | 2013-08-22 20:41:15 +0000 | [diff] [blame] | 104 | |
joshualitt | 56995b5 | 2014-12-11 15:44:02 -0800 | [diff] [blame^] | 105 | virtual void onGetInvariantOutputCoverage(GrInitInvariantOutput* out) const SK_OVERRIDE { |
| 106 | out->setUnknownSingleComponent(); |
egdaniel | 1a8ecdf | 2014-10-03 06:24:12 -0700 | [diff] [blame] | 107 | } |
| 108 | |
joshualitt | b0a8a37 | 2014-09-23 09:50:21 -0700 | [diff] [blame] | 109 | GrPrimitiveEdgeType fEdgeType; |
joshualitt | 2dd1ae0 | 2014-12-03 06:24:10 -0800 | [diff] [blame] | 110 | const GrAttribute* fInPosition; |
| 111 | const GrAttribute* fInConicCoeffs; |
commit-bot@chromium.org | 07e1c3f | 2013-08-22 20:41:15 +0000 | [diff] [blame] | 112 | |
joshualitt | b0a8a37 | 2014-09-23 09:50:21 -0700 | [diff] [blame] | 113 | GR_DECLARE_GEOMETRY_PROCESSOR_TEST; |
commit-bot@chromium.org | 07e1c3f | 2013-08-22 20:41:15 +0000 | [diff] [blame] | 114 | |
joshualitt | 249af15 | 2014-09-15 11:41:13 -0700 | [diff] [blame] | 115 | typedef GrGeometryProcessor INHERITED; |
commit-bot@chromium.org | 07e1c3f | 2013-08-22 20:41:15 +0000 | [diff] [blame] | 116 | }; |
| 117 | |
| 118 | /////////////////////////////////////////////////////////////////////////////// |
| 119 | /** |
| 120 | * The output of this effect is a hairline edge for quadratics. |
| 121 | * Quadratic specified by 0=u^2-v canonical coords. u and v are the first |
| 122 | * two components of the vertex attribute. At the three control points that define |
| 123 | * the Quadratic, u, v have the values {0,0}, {1/2, 0}, and {1, 1} respectively. |
| 124 | * Coverage for AA is min(0, 1-distance). 3rd & 4th cimponent unused. |
| 125 | * Requires shader derivative instruction support. |
| 126 | */ |
| 127 | class GrGLQuadEffect; |
| 128 | |
joshualitt | 249af15 | 2014-09-15 11:41:13 -0700 | [diff] [blame] | 129 | class GrQuadEffect : public GrGeometryProcessor { |
commit-bot@chromium.org | 07e1c3f | 2013-08-22 20:41:15 +0000 | [diff] [blame] | 130 | public: |
joshualitt | 2e3b3e3 | 2014-12-09 13:31:14 -0800 | [diff] [blame] | 131 | static GrGeometryProcessor* Create(GrColor color, |
| 132 | const GrPrimitiveEdgeType edgeType, |
| 133 | const GrDrawTargetCaps& caps, |
| 134 | uint8_t coverage = 0xff) { |
commit-bot@chromium.org | cabf4b2 | 2014-03-05 18:27:43 +0000 | [diff] [blame] | 135 | switch (edgeType) { |
joshualitt | b0a8a37 | 2014-09-23 09:50:21 -0700 | [diff] [blame] | 136 | case kFillAA_GrProcessorEdgeType: |
commit-bot@chromium.org | cabf4b2 | 2014-03-05 18:27:43 +0000 | [diff] [blame] | 137 | if (!caps.shaderDerivativeSupport()) { |
| 138 | return NULL; |
| 139 | } |
joshualitt | 2e3b3e3 | 2014-12-09 13:31:14 -0800 | [diff] [blame] | 140 | return SkNEW_ARGS(GrQuadEffect, (color, coverage, kFillAA_GrProcessorEdgeType)); |
joshualitt | b0a8a37 | 2014-09-23 09:50:21 -0700 | [diff] [blame] | 141 | case kHairlineAA_GrProcessorEdgeType: |
commit-bot@chromium.org | cabf4b2 | 2014-03-05 18:27:43 +0000 | [diff] [blame] | 142 | if (!caps.shaderDerivativeSupport()) { |
| 143 | return NULL; |
| 144 | } |
joshualitt | 2e3b3e3 | 2014-12-09 13:31:14 -0800 | [diff] [blame] | 145 | return SkNEW_ARGS(GrQuadEffect, (color, coverage, kHairlineAA_GrProcessorEdgeType)); |
joshualitt | b0a8a37 | 2014-09-23 09:50:21 -0700 | [diff] [blame] | 146 | case kFillBW_GrProcessorEdgeType: |
joshualitt | 2e3b3e3 | 2014-12-09 13:31:14 -0800 | [diff] [blame] | 147 | return SkNEW_ARGS(GrQuadEffect, (color, coverage, kFillBW_GrProcessorEdgeType)); |
commit-bot@chromium.org | cabf4b2 | 2014-03-05 18:27:43 +0000 | [diff] [blame] | 148 | default: |
commit-bot@chromium.org | 07e1c3f | 2013-08-22 20:41:15 +0000 | [diff] [blame] | 149 | return NULL; |
commit-bot@chromium.org | 07e1c3f | 2013-08-22 20:41:15 +0000 | [diff] [blame] | 150 | } |
| 151 | } |
| 152 | |
| 153 | virtual ~GrQuadEffect(); |
| 154 | |
joshualitt | eb2a676 | 2014-12-04 11:35:33 -0800 | [diff] [blame] | 155 | virtual const char* name() const SK_OVERRIDE { return "Quad"; } |
commit-bot@chromium.org | 07e1c3f | 2013-08-22 20:41:15 +0000 | [diff] [blame] | 156 | |
joshualitt | 2dd1ae0 | 2014-12-03 06:24:10 -0800 | [diff] [blame] | 157 | inline const GrAttribute* inPosition() const { return fInPosition; } |
| 158 | inline const GrAttribute* inHairQuadEdge() const { return fInHairQuadEdge; } |
joshualitt | b0a8a37 | 2014-09-23 09:50:21 -0700 | [diff] [blame] | 159 | inline bool isAntiAliased() const { return GrProcessorEdgeTypeIsAA(fEdgeType); } |
| 160 | inline bool isFilled() const { return GrProcessorEdgeTypeIsFill(fEdgeType); } |
| 161 | inline GrPrimitiveEdgeType getEdgeType() const { return fEdgeType; } |
commit-bot@chromium.org | 07e1c3f | 2013-08-22 20:41:15 +0000 | [diff] [blame] | 162 | |
joshualitt | eb2a676 | 2014-12-04 11:35:33 -0800 | [diff] [blame] | 163 | virtual void getGLProcessorKey(const GrBatchTracker& bt, |
| 164 | const GrGLCaps& caps, |
| 165 | GrProcessorKeyBuilder* b) const SK_OVERRIDE; |
commit-bot@chromium.org | 07e1c3f | 2013-08-22 20:41:15 +0000 | [diff] [blame] | 166 | |
joshualitt | eb2a676 | 2014-12-04 11:35:33 -0800 | [diff] [blame] | 167 | virtual GrGLGeometryProcessor* createGLInstance(const GrBatchTracker& bt) const SK_OVERRIDE; |
commit-bot@chromium.org | 07e1c3f | 2013-08-22 20:41:15 +0000 | [diff] [blame] | 168 | |
| 169 | private: |
joshualitt | 2e3b3e3 | 2014-12-09 13:31:14 -0800 | [diff] [blame] | 170 | GrQuadEffect(GrColor, uint8_t coverage, GrPrimitiveEdgeType); |
commit-bot@chromium.org | 07e1c3f | 2013-08-22 20:41:15 +0000 | [diff] [blame] | 171 | |
bsalomon | 0e08fc1 | 2014-10-15 08:19:04 -0700 | [diff] [blame] | 172 | virtual bool onIsEqual(const GrGeometryProcessor& other) const SK_OVERRIDE; |
commit-bot@chromium.org | 07e1c3f | 2013-08-22 20:41:15 +0000 | [diff] [blame] | 173 | |
joshualitt | 56995b5 | 2014-12-11 15:44:02 -0800 | [diff] [blame^] | 174 | virtual void onGetInvariantOutputCoverage(GrInitInvariantOutput* out) const SK_OVERRIDE { |
| 175 | out->setUnknownSingleComponent(); |
egdaniel | 1a8ecdf | 2014-10-03 06:24:12 -0700 | [diff] [blame] | 176 | } |
| 177 | |
joshualitt | b0a8a37 | 2014-09-23 09:50:21 -0700 | [diff] [blame] | 178 | GrPrimitiveEdgeType fEdgeType; |
joshualitt | 2dd1ae0 | 2014-12-03 06:24:10 -0800 | [diff] [blame] | 179 | const GrAttribute* fInPosition; |
| 180 | const GrAttribute* fInHairQuadEdge; |
commit-bot@chromium.org | 07e1c3f | 2013-08-22 20:41:15 +0000 | [diff] [blame] | 181 | |
joshualitt | b0a8a37 | 2014-09-23 09:50:21 -0700 | [diff] [blame] | 182 | GR_DECLARE_GEOMETRY_PROCESSOR_TEST; |
commit-bot@chromium.org | 07e1c3f | 2013-08-22 20:41:15 +0000 | [diff] [blame] | 183 | |
joshualitt | 249af15 | 2014-09-15 11:41:13 -0700 | [diff] [blame] | 184 | typedef GrGeometryProcessor INHERITED; |
commit-bot@chromium.org | 07e1c3f | 2013-08-22 20:41:15 +0000 | [diff] [blame] | 185 | }; |
| 186 | |
| 187 | ////////////////////////////////////////////////////////////////////////////// |
| 188 | /** |
| 189 | * Shader is based off of "Resolution Independent Curve Rendering using |
| 190 | * Programmable Graphics Hardware" by Loop and Blinn. |
| 191 | * The output of this effect is a hairline edge for non rational cubics. |
| 192 | * Cubics are specified by implicit equation K^3 - LM. |
| 193 | * K, L, and M, are the first three values of the vertex attribute, |
| 194 | * the fourth value is not used. Distance is calculated using a |
| 195 | * first order approximation from the taylor series. |
| 196 | * Coverage for AA is max(0, 1-distance). |
| 197 | */ |
| 198 | class GrGLCubicEffect; |
| 199 | |
joshualitt | 249af15 | 2014-09-15 11:41:13 -0700 | [diff] [blame] | 200 | class GrCubicEffect : public GrGeometryProcessor { |
commit-bot@chromium.org | 07e1c3f | 2013-08-22 20:41:15 +0000 | [diff] [blame] | 201 | public: |
joshualitt | 2e3b3e3 | 2014-12-09 13:31:14 -0800 | [diff] [blame] | 202 | static GrGeometryProcessor* Create(GrColor color, |
| 203 | const GrPrimitiveEdgeType edgeType, |
joshualitt | b0a8a37 | 2014-09-23 09:50:21 -0700 | [diff] [blame] | 204 | const GrDrawTargetCaps& caps) { |
commit-bot@chromium.org | cabf4b2 | 2014-03-05 18:27:43 +0000 | [diff] [blame] | 205 | switch (edgeType) { |
joshualitt | b0a8a37 | 2014-09-23 09:50:21 -0700 | [diff] [blame] | 206 | case kFillAA_GrProcessorEdgeType: |
commit-bot@chromium.org | cabf4b2 | 2014-03-05 18:27:43 +0000 | [diff] [blame] | 207 | if (!caps.shaderDerivativeSupport()) { |
| 208 | return NULL; |
| 209 | } |
joshualitt | 2e3b3e3 | 2014-12-09 13:31:14 -0800 | [diff] [blame] | 210 | return SkNEW_ARGS(GrCubicEffect, (color, kFillAA_GrProcessorEdgeType)); |
joshualitt | b0a8a37 | 2014-09-23 09:50:21 -0700 | [diff] [blame] | 211 | case kHairlineAA_GrProcessorEdgeType: |
commit-bot@chromium.org | cabf4b2 | 2014-03-05 18:27:43 +0000 | [diff] [blame] | 212 | if (!caps.shaderDerivativeSupport()) { |
| 213 | return NULL; |
| 214 | } |
joshualitt | 2e3b3e3 | 2014-12-09 13:31:14 -0800 | [diff] [blame] | 215 | return SkNEW_ARGS(GrCubicEffect, (color, kHairlineAA_GrProcessorEdgeType)); |
joshualitt | b0a8a37 | 2014-09-23 09:50:21 -0700 | [diff] [blame] | 216 | case kFillBW_GrProcessorEdgeType: |
joshualitt | 2e3b3e3 | 2014-12-09 13:31:14 -0800 | [diff] [blame] | 217 | return SkNEW_ARGS(GrCubicEffect, (color, kFillBW_GrProcessorEdgeType)); |
commit-bot@chromium.org | cabf4b2 | 2014-03-05 18:27:43 +0000 | [diff] [blame] | 218 | default: |
commit-bot@chromium.org | 07e1c3f | 2013-08-22 20:41:15 +0000 | [diff] [blame] | 219 | return NULL; |
commit-bot@chromium.org | 07e1c3f | 2013-08-22 20:41:15 +0000 | [diff] [blame] | 220 | } |
| 221 | } |
| 222 | |
| 223 | virtual ~GrCubicEffect(); |
| 224 | |
joshualitt | eb2a676 | 2014-12-04 11:35:33 -0800 | [diff] [blame] | 225 | virtual const char* name() const SK_OVERRIDE { return "Cubic"; } |
commit-bot@chromium.org | 07e1c3f | 2013-08-22 20:41:15 +0000 | [diff] [blame] | 226 | |
joshualitt | 2dd1ae0 | 2014-12-03 06:24:10 -0800 | [diff] [blame] | 227 | inline const GrAttribute* inPosition() const { return fInPosition; } |
| 228 | inline const GrAttribute* inCubicCoeffs() const { return fInCubicCoeffs; } |
joshualitt | b0a8a37 | 2014-09-23 09:50:21 -0700 | [diff] [blame] | 229 | inline bool isAntiAliased() const { return GrProcessorEdgeTypeIsAA(fEdgeType); } |
| 230 | inline bool isFilled() const { return GrProcessorEdgeTypeIsFill(fEdgeType); } |
| 231 | inline GrPrimitiveEdgeType getEdgeType() const { return fEdgeType; } |
commit-bot@chromium.org | 07e1c3f | 2013-08-22 20:41:15 +0000 | [diff] [blame] | 232 | |
joshualitt | eb2a676 | 2014-12-04 11:35:33 -0800 | [diff] [blame] | 233 | virtual void getGLProcessorKey(const GrBatchTracker& bt, |
| 234 | const GrGLCaps& caps, |
| 235 | GrProcessorKeyBuilder* b) const SK_OVERRIDE; |
commit-bot@chromium.org | 07e1c3f | 2013-08-22 20:41:15 +0000 | [diff] [blame] | 236 | |
joshualitt | eb2a676 | 2014-12-04 11:35:33 -0800 | [diff] [blame] | 237 | virtual GrGLGeometryProcessor* createGLInstance(const GrBatchTracker& bt) const SK_OVERRIDE; |
commit-bot@chromium.org | 07e1c3f | 2013-08-22 20:41:15 +0000 | [diff] [blame] | 238 | |
| 239 | private: |
joshualitt | 2e3b3e3 | 2014-12-09 13:31:14 -0800 | [diff] [blame] | 240 | GrCubicEffect(GrColor, GrPrimitiveEdgeType); |
commit-bot@chromium.org | 07e1c3f | 2013-08-22 20:41:15 +0000 | [diff] [blame] | 241 | |
bsalomon | 0e08fc1 | 2014-10-15 08:19:04 -0700 | [diff] [blame] | 242 | virtual bool onIsEqual(const GrGeometryProcessor& other) const SK_OVERRIDE; |
commit-bot@chromium.org | 07e1c3f | 2013-08-22 20:41:15 +0000 | [diff] [blame] | 243 | |
joshualitt | 56995b5 | 2014-12-11 15:44:02 -0800 | [diff] [blame^] | 244 | virtual void onGetInvariantOutputCoverage(GrInitInvariantOutput* out) const SK_OVERRIDE { |
| 245 | out->setUnknownSingleComponent(); |
egdaniel | 1a8ecdf | 2014-10-03 06:24:12 -0700 | [diff] [blame] | 246 | } |
| 247 | |
joshualitt | b0a8a37 | 2014-09-23 09:50:21 -0700 | [diff] [blame] | 248 | GrPrimitiveEdgeType fEdgeType; |
joshualitt | 2dd1ae0 | 2014-12-03 06:24:10 -0800 | [diff] [blame] | 249 | const GrAttribute* fInPosition; |
| 250 | const GrAttribute* fInCubicCoeffs; |
commit-bot@chromium.org | 07e1c3f | 2013-08-22 20:41:15 +0000 | [diff] [blame] | 251 | |
joshualitt | b0a8a37 | 2014-09-23 09:50:21 -0700 | [diff] [blame] | 252 | GR_DECLARE_GEOMETRY_PROCESSOR_TEST; |
commit-bot@chromium.org | 07e1c3f | 2013-08-22 20:41:15 +0000 | [diff] [blame] | 253 | |
joshualitt | 249af15 | 2014-09-15 11:41:13 -0700 | [diff] [blame] | 254 | typedef GrGeometryProcessor INHERITED; |
commit-bot@chromium.org | 07e1c3f | 2013-08-22 20:41:15 +0000 | [diff] [blame] | 255 | }; |
| 256 | |
| 257 | #endif |