OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #ifndef GrBezierEffect_DEFINED | 8 #ifndef GrBezierEffect_DEFINED |
9 #define GrBezierEffect_DEFINED | 9 #define GrBezierEffect_DEFINED |
10 | 10 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 * chopping to tighten the clipping. Another side effect of the overestimating i
s | 50 * chopping to tighten the clipping. Another side effect of the overestimating i
s |
51 * that the curves become much thinner and "ropey". If all that was ever rendere
d | 51 * that the curves become much thinner and "ropey". If all that was ever rendere
d |
52 * were "not too thin" curves and ellipses then 2nd order may have an advantage
since | 52 * were "not too thin" curves and ellipses then 2nd order may have an advantage
since |
53 * only one geometry would need to be rendered. However no benches were run comp
aring | 53 * only one geometry would need to be rendered. However no benches were run comp
aring |
54 * chopped first order and non chopped 2nd order. | 54 * chopped first order and non chopped 2nd order. |
55 */ | 55 */ |
56 class GrGLConicEffect; | 56 class GrGLConicEffect; |
57 | 57 |
58 class GrConicEffect : public GrVertexEffect { | 58 class GrConicEffect : public GrVertexEffect { |
59 public: | 59 public: |
60 static GrEffectRef* Create(const GrEffectEdgeType edgeType, const GrDrawTarg
etCaps& caps) { | 60 static GrEffect* Create(const GrEffectEdgeType edgeType, const GrDrawTargetC
aps& caps) { |
61 GR_CREATE_STATIC_EFFECT(gConicFillAA, GrConicEffect, (kFillAA_GrEffectEd
geType)); | 61 GR_CREATE_STATIC_EFFECT(gConicFillAA, GrConicEffect, (kFillAA_GrEffectEd
geType)); |
62 GR_CREATE_STATIC_EFFECT(gConicHairAA, GrConicEffect, (kHairlineAA_GrEffe
ctEdgeType)); | 62 GR_CREATE_STATIC_EFFECT(gConicHairAA, GrConicEffect, (kHairlineAA_GrEffe
ctEdgeType)); |
63 GR_CREATE_STATIC_EFFECT(gConicFillBW, GrConicEffect, (kFillBW_GrEffectEd
geType)); | 63 GR_CREATE_STATIC_EFFECT(gConicFillBW, GrConicEffect, (kFillBW_GrEffectEd
geType)); |
64 switch (edgeType) { | 64 switch (edgeType) { |
65 case kFillAA_GrEffectEdgeType: | 65 case kFillAA_GrEffectEdgeType: |
66 if (!caps.shaderDerivativeSupport()) { | 66 if (!caps.shaderDerivativeSupport()) { |
67 return NULL; | 67 return NULL; |
68 } | 68 } |
69 gConicFillAA->ref(); | 69 gConicFillAA->ref(); |
70 return gConicFillAA; | 70 return gConicFillAA; |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 * Quadratic specified by 0=u^2-v canonical coords. u and v are the first | 117 * Quadratic specified by 0=u^2-v canonical coords. u and v are the first |
118 * two components of the vertex attribute. At the three control points that defi
ne | 118 * two components of the vertex attribute. At the three control points that defi
ne |
119 * the Quadratic, u, v have the values {0,0}, {1/2, 0}, and {1, 1} respectively. | 119 * the Quadratic, u, v have the values {0,0}, {1/2, 0}, and {1, 1} respectively. |
120 * Coverage for AA is min(0, 1-distance). 3rd & 4th cimponent unused. | 120 * Coverage for AA is min(0, 1-distance). 3rd & 4th cimponent unused. |
121 * Requires shader derivative instruction support. | 121 * Requires shader derivative instruction support. |
122 */ | 122 */ |
123 class GrGLQuadEffect; | 123 class GrGLQuadEffect; |
124 | 124 |
125 class GrQuadEffect : public GrVertexEffect { | 125 class GrQuadEffect : public GrVertexEffect { |
126 public: | 126 public: |
127 static GrEffectRef* Create(const GrEffectEdgeType edgeType, const GrDrawTarg
etCaps& caps) { | 127 static GrEffect* Create(const GrEffectEdgeType edgeType, const GrDrawTargetC
aps& caps) { |
128 GR_CREATE_STATIC_EFFECT(gQuadFillAA, GrQuadEffect, (kFillAA_GrEffectEdge
Type)); | 128 GR_CREATE_STATIC_EFFECT(gQuadFillAA, GrQuadEffect, (kFillAA_GrEffectEdge
Type)); |
129 GR_CREATE_STATIC_EFFECT(gQuadHairAA, GrQuadEffect, (kHairlineAA_GrEffect
EdgeType)); | 129 GR_CREATE_STATIC_EFFECT(gQuadHairAA, GrQuadEffect, (kHairlineAA_GrEffect
EdgeType)); |
130 GR_CREATE_STATIC_EFFECT(gQuadFillBW, GrQuadEffect, (kFillBW_GrEffectEdge
Type)); | 130 GR_CREATE_STATIC_EFFECT(gQuadFillBW, GrQuadEffect, (kFillBW_GrEffectEdge
Type)); |
131 switch (edgeType) { | 131 switch (edgeType) { |
132 case kFillAA_GrEffectEdgeType: | 132 case kFillAA_GrEffectEdgeType: |
133 if (!caps.shaderDerivativeSupport()) { | 133 if (!caps.shaderDerivativeSupport()) { |
134 return NULL; | 134 return NULL; |
135 } | 135 } |
136 gQuadFillAA->ref(); | 136 gQuadFillAA->ref(); |
137 return gQuadFillAA; | 137 return gQuadFillAA; |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 * Cubics are specified by implicit equation K^3 - LM. | 186 * Cubics are specified by implicit equation K^3 - LM. |
187 * K, L, and M, are the first three values of the vertex attribute, | 187 * K, L, and M, are the first three values of the vertex attribute, |
188 * the fourth value is not used. Distance is calculated using a | 188 * the fourth value is not used. Distance is calculated using a |
189 * first order approximation from the taylor series. | 189 * first order approximation from the taylor series. |
190 * Coverage for AA is max(0, 1-distance). | 190 * Coverage for AA is max(0, 1-distance). |
191 */ | 191 */ |
192 class GrGLCubicEffect; | 192 class GrGLCubicEffect; |
193 | 193 |
194 class GrCubicEffect : public GrVertexEffect { | 194 class GrCubicEffect : public GrVertexEffect { |
195 public: | 195 public: |
196 static GrEffectRef* Create(const GrEffectEdgeType edgeType, const GrDrawTarg
etCaps& caps) { | 196 static GrEffect* Create(const GrEffectEdgeType edgeType, const GrDrawTargetC
aps& caps) { |
197 GR_CREATE_STATIC_EFFECT(gCubicFillAA, GrCubicEffect, (kFillAA_GrEffectEd
geType)); | 197 GR_CREATE_STATIC_EFFECT(gCubicFillAA, GrCubicEffect, (kFillAA_GrEffectEd
geType)); |
198 GR_CREATE_STATIC_EFFECT(gCubicHairAA, GrCubicEffect, (kHairlineAA_GrEffe
ctEdgeType)); | 198 GR_CREATE_STATIC_EFFECT(gCubicHairAA, GrCubicEffect, (kHairlineAA_GrEffe
ctEdgeType)); |
199 GR_CREATE_STATIC_EFFECT(gCubicFillBW, GrCubicEffect, (kFillBW_GrEffectEd
geType)); | 199 GR_CREATE_STATIC_EFFECT(gCubicFillBW, GrCubicEffect, (kFillBW_GrEffectEd
geType)); |
200 switch (edgeType) { | 200 switch (edgeType) { |
201 case kFillAA_GrEffectEdgeType: | 201 case kFillAA_GrEffectEdgeType: |
202 if (!caps.shaderDerivativeSupport()) { | 202 if (!caps.shaderDerivativeSupport()) { |
203 return NULL; | 203 return NULL; |
204 } | 204 } |
205 gCubicFillAA->ref(); | 205 gCubicFillAA->ref(); |
206 return gCubicFillAA; | 206 return gCubicFillAA; |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 virtual bool onIsEqual(const GrEffect& other) const SK_OVERRIDE; | 241 virtual bool onIsEqual(const GrEffect& other) const SK_OVERRIDE; |
242 | 242 |
243 GrEffectEdgeType fEdgeType; | 243 GrEffectEdgeType fEdgeType; |
244 | 244 |
245 GR_DECLARE_EFFECT_TEST; | 245 GR_DECLARE_EFFECT_TEST; |
246 | 246 |
247 typedef GrVertexEffect INHERITED; | 247 typedef GrVertexEffect INHERITED; |
248 }; | 248 }; |
249 | 249 |
250 #endif | 250 #endif |
OLD | NEW |