| OLD | NEW |
| (Empty) |
| 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 GrGLVertexEffect_DEFINED | |
| 9 #define GrGLVertexEffect_DEFINED | |
| 10 | |
| 11 #include "GrGLEffect.h" | |
| 12 | |
| 13 /** | |
| 14 * If a GL effect needs a GrGLFullShaderBuilder* object to emit vertex code, the
n it must inherit | |
| 15 * from this class. Since paths don't have vertices, this class is only meant to
be used internally | |
| 16 * by skia, for special cases. | |
| 17 */ | |
| 18 class GrGLVertexEffect : public GrGLEffect { | |
| 19 public: | |
| 20 GrGLVertexEffect(const GrBackendEffectFactory& factory) | |
| 21 : INHERITED(factory) { fIsVertexEffect = true; } | |
| 22 | |
| 23 /** | |
| 24 * This is similar to emitCode() in the base class, except it takes a full s
hader builder. | |
| 25 * This allows the effect subclass to emit vertex code. | |
| 26 */ | |
| 27 virtual void emitCode(GrGLFullProgramBuilder* builder, | |
| 28 const GrDrawEffect& drawEffect, | |
| 29 const GrEffectKey& key, | |
| 30 const char* outputColor, | |
| 31 const char* inputColor, | |
| 32 const TransformedCoordsArray& coords, | |
| 33 const TextureSamplerArray& samplers) = 0; | |
| 34 /** | |
| 35 * Provide a default override for base class's emitCode() function. | |
| 36 */ | |
| 37 virtual void emitCode(GrGLProgramBuilder* builder, | |
| 38 const GrDrawEffect& drawEffect, | |
| 39 const GrEffectKey& key, | |
| 40 const char* outputColor, | |
| 41 const char* inputColor, | |
| 42 const TransformedCoordsArray& coords, | |
| 43 const TextureSamplerArray& samplers) SK_OVERRIDE { | |
| 44 SkFAIL("GrGLVertexEffect requires GrGLFullProgramBuilder* overload for e
mitCode()."); | |
| 45 } | |
| 46 | |
| 47 | |
| 48 private: | |
| 49 typedef GrGLEffect INHERITED; | |
| 50 }; | |
| 51 | |
| 52 #endif | |
| OLD | NEW |