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 #include "GrBezierEffect.h" | 8 #include "GrBezierEffect.h" |
9 | 9 |
10 #include "gl/GrGLEffect.h" | 10 #include "gl/GrGLEffect.h" |
11 #include "gl/GrGLSL.h" | 11 #include "gl/GrGLSL.h" |
12 #include "GrTBackendEffectFactory.h" | 12 #include "GrTBackendEffectFactory.h" |
13 | 13 |
14 class GrGLConicEffect : public GrGLEffect { | 14 class GrGLConicEffect : public GrGLEffect { |
15 public: | 15 public: |
16 GrGLConicEffect(const GrBackendEffectFactory&, const GrDrawEffect&); | 16 GrGLConicEffect(const GrBackendEffectFactory&, const GrDrawEffect&); |
17 | 17 |
| 18 virtual bool requiresVertexShader(const GrDrawEffect&) const SK_OVERRIDE { r
eturn true; } |
| 19 |
18 virtual void emitCode(GrGLShaderBuilder* builder, | 20 virtual void emitCode(GrGLShaderBuilder* builder, |
19 const GrDrawEffect& drawEffect, | 21 const GrDrawEffect& drawEffect, |
20 EffectKey key, | 22 EffectKey key, |
21 const char* outputColor, | 23 const char* outputColor, |
22 const char* inputColor, | 24 const char* inputColor, |
23 const TextureSamplerArray&) SK_OVERRIDE; | 25 const TextureSamplerArray&) SK_OVERRIDE; |
24 | 26 |
25 static inline EffectKey GenKey(const GrDrawEffect&, const GrGLCaps&); | 27 static inline EffectKey GenKey(const GrDrawEffect&, const GrGLCaps&); |
26 | 28 |
27 virtual void setData(const GrGLUniformManager&, const GrDrawEffect&) SK_OVER
RIDE {} | 29 virtual void setData(const GrGLUniformManager&, const GrDrawEffect&) SK_OVER
RIDE {} |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 } | 153 } |
152 | 154 |
153 ////////////////////////////////////////////////////////////////////////////// | 155 ////////////////////////////////////////////////////////////////////////////// |
154 // Quad | 156 // Quad |
155 ////////////////////////////////////////////////////////////////////////////// | 157 ////////////////////////////////////////////////////////////////////////////// |
156 | 158 |
157 class GrGLQuadEffect : public GrGLEffect { | 159 class GrGLQuadEffect : public GrGLEffect { |
158 public: | 160 public: |
159 GrGLQuadEffect(const GrBackendEffectFactory&, const GrDrawEffect&); | 161 GrGLQuadEffect(const GrBackendEffectFactory&, const GrDrawEffect&); |
160 | 162 |
| 163 virtual bool requiresVertexShader(const GrDrawEffect&) const SK_OVERRIDE { r
eturn true; } |
| 164 |
161 virtual void emitCode(GrGLShaderBuilder* builder, | 165 virtual void emitCode(GrGLShaderBuilder* builder, |
162 const GrDrawEffect& drawEffect, | 166 const GrDrawEffect& drawEffect, |
163 EffectKey key, | 167 EffectKey key, |
164 const char* outputColor, | 168 const char* outputColor, |
165 const char* inputColor, | 169 const char* inputColor, |
166 const TextureSamplerArray&) SK_OVERRIDE; | 170 const TextureSamplerArray&) SK_OVERRIDE; |
167 | 171 |
168 static inline EffectKey GenKey(const GrDrawEffect&, const GrGLCaps&); | 172 static inline EffectKey GenKey(const GrDrawEffect&, const GrGLCaps&); |
169 | 173 |
170 virtual void setData(const GrGLUniformManager&, const GrDrawEffect&) SK_OVER
RIDE {} | 174 virtual void setData(const GrGLUniformManager&, const GrDrawEffect&) SK_OVER
RIDE {} |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
283 } | 287 } |
284 | 288 |
285 ////////////////////////////////////////////////////////////////////////////// | 289 ////////////////////////////////////////////////////////////////////////////// |
286 // Cubic | 290 // Cubic |
287 ////////////////////////////////////////////////////////////////////////////// | 291 ////////////////////////////////////////////////////////////////////////////// |
288 | 292 |
289 class GrGLCubicEffect : public GrGLEffect { | 293 class GrGLCubicEffect : public GrGLEffect { |
290 public: | 294 public: |
291 GrGLCubicEffect(const GrBackendEffectFactory&, const GrDrawEffect&); | 295 GrGLCubicEffect(const GrBackendEffectFactory&, const GrDrawEffect&); |
292 | 296 |
| 297 virtual bool requiresVertexShader(const GrDrawEffect&) const SK_OVERRIDE { r
eturn true; } |
| 298 |
293 virtual void emitCode(GrGLShaderBuilder* builder, | 299 virtual void emitCode(GrGLShaderBuilder* builder, |
294 const GrDrawEffect& drawEffect, | 300 const GrDrawEffect& drawEffect, |
295 EffectKey key, | 301 EffectKey key, |
296 const char* outputColor, | 302 const char* outputColor, |
297 const char* inputColor, | 303 const char* inputColor, |
298 const TextureSamplerArray&) SK_OVERRIDE; | 304 const TextureSamplerArray&) SK_OVERRIDE; |
299 | 305 |
300 static inline EffectKey GenKey(const GrDrawEffect&, const GrGLCaps&); | 306 static inline EffectKey GenKey(const GrDrawEffect&, const GrGLCaps&); |
301 | 307 |
302 virtual void setData(const GrGLUniformManager&, const GrDrawEffect&) SK_OVER
RIDE {} | 308 virtual void setData(const GrGLUniformManager&, const GrDrawEffect&) SK_OVER
RIDE {} |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
417 | 423 |
418 GR_DEFINE_EFFECT_TEST(GrCubicEffect); | 424 GR_DEFINE_EFFECT_TEST(GrCubicEffect); |
419 | 425 |
420 GrEffectRef* GrCubicEffect::TestCreate(SkMWCRandom* random, | 426 GrEffectRef* GrCubicEffect::TestCreate(SkMWCRandom* random, |
421 GrContext*, | 427 GrContext*, |
422 const GrDrawTargetCaps& caps, | 428 const GrDrawTargetCaps& caps, |
423 GrTexture*[]) { | 429 GrTexture*[]) { |
424 const GrBezierEdgeType edgeType = static_cast<GrBezierEdgeType>(random->next
ULessThan(3)); | 430 const GrBezierEdgeType edgeType = static_cast<GrBezierEdgeType>(random->next
ULessThan(3)); |
425 return GrCubicEffect::Create(edgeType, caps); | 431 return GrCubicEffect::Create(edgeType, caps); |
426 } | 432 } |
OLD | NEW |