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.

     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  */
     8 #ifndef GrGLVertexEffect_DEFINED
     9 #define GrGLVertexEffect_DEFINED
    11 #include "GrGLEffect.h"
    13 /**
    14  * If a GL effect needs a GrGLFullShaderBuilder* object to emit vertex code, then 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; }
    23     /**
    24      * This is similar to emitCode() in the base class, except it takes a full shader builder.
    25      * This allows the effect subclass to emit vertex code.
    26      */
    27     virtual void emitCode(GrGLFullShaderBuilder* builder,
    28                           const GrDrawEffect& drawEffect,
    29                           EffectKey key,
    30                           const char* outputColor,
    31                           const char* inputColor,
    32                           const TransformedCoordsArray& coords,
    33                           const TextureSamplerArray& samplers) = 0;
    35     /**
    36      * Provide a default override for base class's emitCode() function.
    37      */
    38     virtual void emitCode(GrGLShaderBuilder* builder,
    39                           const GrDrawEffect& drawEffect,
    40                           EffectKey key,
    41                           const char* outputColor,
    42                           const char* inputColor,
    43                           const TransformedCoordsArray& coords,
    44                           const TextureSamplerArray& samplers) SK_OVERRIDE {
    45         GrCrash("GrGLVertexEffect requires GrGLFullShaderBuilder* overload for emitCode().");
    46     }
    48 private:
    49     typedef GrGLEffect INHERITED;
    50 };
    52 #endif

mercurial