OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 GrGLProgramEffects_DEFINED | 8 #ifndef GrGLProgramEffects_DEFINED |
9 #define GrGLProgramEffects_DEFINED | 9 #define GrGLProgramEffects_DEFINED |
10 | 10 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 */ | 47 */ |
48 void setData(GrGpuGL*, | 48 void setData(GrGpuGL*, |
49 const GrGLUniformManager&, | 49 const GrGLUniformManager&, |
50 const GrEffectStage* effectStages[]); | 50 const GrEffectStage* effectStages[]); |
51 | 51 |
52 /** | 52 /** |
53 * Passed to GrGLEffects so they can add transformed coordinates to their sh
ader code. | 53 * Passed to GrGLEffects so they can add transformed coordinates to their sh
ader code. |
54 */ | 54 */ |
55 class TransformedCoords { | 55 class TransformedCoords { |
56 public: | 56 public: |
57 TransformedCoords(const char* name, GrSLType type, const char* vsName) | 57 TransformedCoords(const char* name, GrSLType type) |
58 : fName(name), fType(type), fVSName(vsName) { | 58 : fName(name), fType(type) { |
59 } | 59 } |
60 | 60 |
61 const char* c_str() const { return fName.c_str(); } | 61 const char* c_str() const { return fName.c_str(); } |
62 GrSLType type() const { return fType; } | 62 GrSLType type() const { return fType; } |
63 const SkString& getName() const { return fName; } | 63 const SkString& getName() const { return fName; } |
64 // TODO: Remove the VS name when we have vertexless shaders, and gradien
ts are reworked. | |
65 const SkString& getVSName() const { return fVSName; } | |
66 | 64 |
67 private: | 65 private: |
68 SkString fName; | 66 SkString fName; |
69 GrSLType fType; | 67 GrSLType fType; |
70 SkString fVSName; | |
71 }; | 68 }; |
72 | 69 |
73 typedef SkTArray<TransformedCoords> TransformedCoordsArray; | 70 typedef SkTArray<TransformedCoords> TransformedCoordsArray; |
74 | 71 |
75 /** | 72 /** |
76 * Passed to GrGLEffects so they can add texture reads to their shader code. | 73 * Passed to GrGLEffects so they can add texture reads to their shader code. |
77 */ | 74 */ |
78 class TextureSampler { | 75 class TextureSampler { |
79 public: | 76 public: |
80 TextureSampler(UniformHandle uniform, const GrTextureAccess& access) | 77 TextureSampler(UniformHandle uniform, const GrTextureAccess& access) |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 * is in turn passed to the effect's emitCode() function. | 180 * is in turn passed to the effect's emitCode() function. |
184 */ | 181 */ |
185 void emitSamplers(const GrEffectRef&, | 182 void emitSamplers(const GrEffectRef&, |
186 GrGLProgramEffects::TextureSamplerArray*); | 183 GrGLProgramEffects::TextureSamplerArray*); |
187 | 184 |
188 GrGLShaderBuilder* fBuilder; | 185 GrGLShaderBuilder* fBuilder; |
189 SkAutoTDelete<GrGLProgramEffects> fProgramEffects; | 186 SkAutoTDelete<GrGLProgramEffects> fProgramEffects; |
190 }; | 187 }; |
191 | 188 |
192 #endif | 189 #endif |
OLD | NEW |