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

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/gfx/skia/trunk/src/gpu/gl/GrGLVertexEffect.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,52 @@
     1.4 +/*
     1.5 + * Copyright 2013 Google Inc.
     1.6 + *
     1.7 + * Use of this source code is governed by a BSD-style license that can be
     1.8 + * found in the LICENSE file.
     1.9 + */
    1.10 +
    1.11 +#ifndef GrGLVertexEffect_DEFINED
    1.12 +#define GrGLVertexEffect_DEFINED
    1.13 +
    1.14 +#include "GrGLEffect.h"
    1.15 +
    1.16 +/**
    1.17 + * If a GL effect needs a GrGLFullShaderBuilder* object to emit vertex code, then it must inherit
    1.18 + * from this class. Since paths don't have vertices, this class is only meant to be used internally
    1.19 + * by skia, for special cases.
    1.20 + */
    1.21 +class GrGLVertexEffect : public GrGLEffect {
    1.22 +public:
    1.23 +    GrGLVertexEffect(const GrBackendEffectFactory& factory)
    1.24 +        : INHERITED(factory) { fIsVertexEffect = true; }
    1.25 +
    1.26 +    /**
    1.27 +     * This is similar to emitCode() in the base class, except it takes a full shader builder.
    1.28 +     * This allows the effect subclass to emit vertex code.
    1.29 +     */
    1.30 +    virtual void emitCode(GrGLFullShaderBuilder* builder,
    1.31 +                          const GrDrawEffect& drawEffect,
    1.32 +                          EffectKey key,
    1.33 +                          const char* outputColor,
    1.34 +                          const char* inputColor,
    1.35 +                          const TransformedCoordsArray& coords,
    1.36 +                          const TextureSamplerArray& samplers) = 0;
    1.37 +
    1.38 +    /**
    1.39 +     * Provide a default override for base class's emitCode() function.
    1.40 +     */
    1.41 +    virtual void emitCode(GrGLShaderBuilder* builder,
    1.42 +                          const GrDrawEffect& drawEffect,
    1.43 +                          EffectKey key,
    1.44 +                          const char* outputColor,
    1.45 +                          const char* inputColor,
    1.46 +                          const TransformedCoordsArray& coords,
    1.47 +                          const TextureSamplerArray& samplers) SK_OVERRIDE {
    1.48 +        GrCrash("GrGLVertexEffect requires GrGLFullShaderBuilder* overload for emitCode().");
    1.49 +    }
    1.50 +
    1.51 +private:
    1.52 +    typedef GrGLEffect INHERITED;
    1.53 +};
    1.54 +
    1.55 +#endif

mercurial