gfx/skia/trunk/src/gpu/gl/GrGLVertexEffect.h

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 /*
michael@0 2 * Copyright 2013 Google Inc.
michael@0 3 *
michael@0 4 * Use of this source code is governed by a BSD-style license that can be
michael@0 5 * found in the LICENSE file.
michael@0 6 */
michael@0 7
michael@0 8 #ifndef GrGLVertexEffect_DEFINED
michael@0 9 #define GrGLVertexEffect_DEFINED
michael@0 10
michael@0 11 #include "GrGLEffect.h"
michael@0 12
michael@0 13 /**
michael@0 14 * If a GL effect needs a GrGLFullShaderBuilder* object to emit vertex code, then it must inherit
michael@0 15 * from this class. Since paths don't have vertices, this class is only meant to be used internally
michael@0 16 * by skia, for special cases.
michael@0 17 */
michael@0 18 class GrGLVertexEffect : public GrGLEffect {
michael@0 19 public:
michael@0 20 GrGLVertexEffect(const GrBackendEffectFactory& factory)
michael@0 21 : INHERITED(factory) { fIsVertexEffect = true; }
michael@0 22
michael@0 23 /**
michael@0 24 * This is similar to emitCode() in the base class, except it takes a full shader builder.
michael@0 25 * This allows the effect subclass to emit vertex code.
michael@0 26 */
michael@0 27 virtual void emitCode(GrGLFullShaderBuilder* builder,
michael@0 28 const GrDrawEffect& drawEffect,
michael@0 29 EffectKey key,
michael@0 30 const char* outputColor,
michael@0 31 const char* inputColor,
michael@0 32 const TransformedCoordsArray& coords,
michael@0 33 const TextureSamplerArray& samplers) = 0;
michael@0 34
michael@0 35 /**
michael@0 36 * Provide a default override for base class's emitCode() function.
michael@0 37 */
michael@0 38 virtual void emitCode(GrGLShaderBuilder* builder,
michael@0 39 const GrDrawEffect& drawEffect,
michael@0 40 EffectKey key,
michael@0 41 const char* outputColor,
michael@0 42 const char* inputColor,
michael@0 43 const TransformedCoordsArray& coords,
michael@0 44 const TextureSamplerArray& samplers) SK_OVERRIDE {
michael@0 45 GrCrash("GrGLVertexEffect requires GrGLFullShaderBuilder* overload for emitCode().");
michael@0 46 }
michael@0 47
michael@0 48 private:
michael@0 49 typedef GrGLEffect INHERITED;
michael@0 50 };
michael@0 51
michael@0 52 #endif

mercurial