OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #ifndef GrGLEffect_DEFINED | 8 #ifndef GrGLEffect_DEFINED |
9 #define GrGLEffect_DEFINED | 9 #define GrGLEffect_DEFINED |
10 | 10 |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 const TransformedCoordsArray& coords, | 76 const TransformedCoordsArray& coords, |
77 const TextureSamplerArray& samplers) = 0; | 77 const TextureSamplerArray& samplers) = 0; |
78 | 78 |
79 /** A GrGLEffect instance can be reused with any GrEffect that produces the
same stage | 79 /** A GrGLEffect instance can be reused with any GrEffect that produces the
same stage |
80 key; this function reads data from a GrEffect and uploads any uniform va
riables required | 80 key; this function reads data from a GrEffect and uploads any uniform va
riables required |
81 by the shaders created in emitCode(). The GrEffect installed in the GrDr
awEffect is | 81 by the shaders created in emitCode(). The GrEffect installed in the GrDr
awEffect is |
82 guaranteed to be of the same type that created this GrGLEffect and to ha
ve an identical | 82 guaranteed to be of the same type that created this GrGLEffect and to ha
ve an identical |
83 effect key as the one that created this GrGLEffect. Effects that use loc
al coords have | 83 effect key as the one that created this GrGLEffect. Effects that use loc
al coords have |
84 to consider whether the GrEffectStage's coord change matrix should be us
ed. When explicit | 84 to consider whether the GrEffectStage's coord change matrix should be us
ed. When explicit |
85 local coordinates are used it can be ignored. */ | 85 local coordinates are used it can be ignored. */ |
86 virtual void setData(const GrGLUniformManager&, const GrDrawEffect&) {} | 86 virtual void setData(const GrGLProgramDataManager&, const GrDrawEffect&) {} |
87 | 87 |
88 const char* name() const { return fFactory.name(); } | 88 const char* name() const { return fFactory.name(); } |
89 | 89 |
90 static void GenKey(const GrDrawEffect&, const GrGLCaps&, GrEffectKeyBuilder*
) {} | 90 static void GenKey(const GrDrawEffect&, const GrGLCaps&, GrEffectKeyBuilder*
) {} |
91 | 91 |
92 /** Used by the system when generating shader code, to see if this effect ca
n be downcasted to | 92 /** Used by the system when generating shader code, to see if this effect ca
n be downcasted to |
93 the internal GrGLVertexEffect type */ | 93 the internal GrGLVertexEffect type */ |
94 bool isVertexEffect() const { return fIsVertexEffect; } | 94 bool isVertexEffect() const { return fIsVertexEffect; } |
95 | 95 |
96 protected: | 96 protected: |
97 const GrBackendEffectFactory& fFactory; | 97 const GrBackendEffectFactory& fFactory; |
98 | 98 |
99 private: | 99 private: |
100 friend class GrGLVertexEffect; // to set fIsVertexEffect | 100 friend class GrGLVertexEffect; // to set fIsVertexEffect |
101 | 101 |
102 bool fIsVertexEffect; | 102 bool fIsVertexEffect; |
103 }; | 103 }; |
104 | 104 |
105 #endif | 105 #endif |
OLD | NEW |