michael@0: /* michael@0: * Copyright 2013 Google Inc. michael@0: * michael@0: * Use of this source code is governed by a BSD-style license that can be michael@0: * found in the LICENSE file. michael@0: */ michael@0: michael@0: #ifndef GrGLVertexEffect_DEFINED michael@0: #define GrGLVertexEffect_DEFINED michael@0: michael@0: #include "GrGLEffect.h" michael@0: michael@0: /** michael@0: * If a GL effect needs a GrGLFullShaderBuilder* object to emit vertex code, then it must inherit michael@0: * from this class. Since paths don't have vertices, this class is only meant to be used internally michael@0: * by skia, for special cases. michael@0: */ michael@0: class GrGLVertexEffect : public GrGLEffect { michael@0: public: michael@0: GrGLVertexEffect(const GrBackendEffectFactory& factory) michael@0: : INHERITED(factory) { fIsVertexEffect = true; } michael@0: michael@0: /** michael@0: * This is similar to emitCode() in the base class, except it takes a full shader builder. michael@0: * This allows the effect subclass to emit vertex code. michael@0: */ michael@0: virtual void emitCode(GrGLFullShaderBuilder* builder, michael@0: const GrDrawEffect& drawEffect, michael@0: EffectKey key, michael@0: const char* outputColor, michael@0: const char* inputColor, michael@0: const TransformedCoordsArray& coords, michael@0: const TextureSamplerArray& samplers) = 0; michael@0: michael@0: /** michael@0: * Provide a default override for base class's emitCode() function. michael@0: */ michael@0: virtual void emitCode(GrGLShaderBuilder* builder, michael@0: const GrDrawEffect& drawEffect, michael@0: EffectKey key, michael@0: const char* outputColor, michael@0: const char* inputColor, michael@0: const TransformedCoordsArray& coords, michael@0: const TextureSamplerArray& samplers) SK_OVERRIDE { michael@0: GrCrash("GrGLVertexEffect requires GrGLFullShaderBuilder* overload for emitCode()."); michael@0: } michael@0: michael@0: private: michael@0: typedef GrGLEffect INHERITED; michael@0: }; michael@0: michael@0: #endif