| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 GrGLProgramBuilder_DEFINED | 8 #ifndef GrGLProgramBuilder_DEFINED |
| 9 #define GrGLProgramBuilder_DEFINED | 9 #define GrGLProgramBuilder_DEFINED |
| 10 | 10 |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 class GrGLProgramBuilder : public GrGLGPBuilder, | 179 class GrGLProgramBuilder : public GrGLGPBuilder, |
| 180 public GrGLFPBuilder { | 180 public GrGLFPBuilder { |
| 181 public: | 181 public: |
| 182 /** Generates a shader program. | 182 /** Generates a shader program. |
| 183 * | 183 * |
| 184 * The program implements what is specified in the stages given as input. | 184 * The program implements what is specified in the stages given as input. |
| 185 * After successful generation, the builder result objects are available | 185 * After successful generation, the builder result objects are available |
| 186 * to be used. | 186 * to be used. |
| 187 * @return true if generation was successful. | 187 * @return true if generation was successful. |
| 188 */ | 188 */ |
| 189 static GrGLProgram* CreateProgram(const GrOptDrawState&, GrGpuGL*); | 189 static GrGLProgram* CreateProgram(const GrOptDrawState&, GrGpu::DrawType, Gr
GpuGL*); |
| 190 | 190 |
| 191 virtual UniformHandle addUniform(uint32_t visibility, | 191 virtual UniformHandle addUniform(uint32_t visibility, |
| 192 GrSLType type, | 192 GrSLType type, |
| 193 const char* name, | 193 const char* name, |
| 194 const char** outName = NULL) SK_OVERRIDE { | 194 const char** outName = NULL) SK_OVERRIDE { |
| 195 return this->addUniformArray(visibility, type, name, GrGLShaderVar::kNon
Array, outName); | 195 return this->addUniformArray(visibility, type, name, GrGLShaderVar::kNon
Array, outName); |
| 196 } | 196 } |
| 197 virtual UniformHandle addUniformArray(uint32_t visibility, | 197 virtual UniformHandle addUniformArray(uint32_t visibility, |
| 198 GrSLType type, | 198 GrSLType type, |
| 199 const char* name, | 199 const char* name, |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 UniformHandle fDstCopyTopLeftUni; | 239 UniformHandle fDstCopyTopLeftUni; |
| 240 UniformHandle fDstCopyScaleUni; | 240 UniformHandle fDstCopyScaleUni; |
| 241 UniformHandle fDstCopySamplerUni; | 241 UniformHandle fDstCopySamplerUni; |
| 242 }; | 242 }; |
| 243 | 243 |
| 244 protected: | 244 protected: |
| 245 typedef GrGLProgramDataManager::UniformInfo UniformInfo; | 245 typedef GrGLProgramDataManager::UniformInfo UniformInfo; |
| 246 typedef GrGLProgramDataManager::UniformInfoArray UniformInfoArray; | 246 typedef GrGLProgramDataManager::UniformInfoArray UniformInfoArray; |
| 247 | 247 |
| 248 static GrGLProgramBuilder* CreateProgramBuilder(const GrOptDrawState&, | 248 static GrGLProgramBuilder* CreateProgramBuilder(const GrOptDrawState&, |
| 249 GrGpu::DrawType, |
| 249 bool hasGeometryProcessor, | 250 bool hasGeometryProcessor, |
| 250 GrGpuGL*); | 251 GrGpuGL*); |
| 251 | 252 |
| 252 GrGLProgramBuilder(GrGpuGL*, const GrOptDrawState&); | 253 GrGLProgramBuilder(GrGpuGL*, const GrOptDrawState&); |
| 253 | 254 |
| 254 const GrOptDrawState& optState() const { return fOptState; } | 255 const GrOptDrawState& optState() const { return fOptState; } |
| 255 const GrProgramDesc& desc() const { return fDesc; } | 256 const GrProgramDesc& desc() const { return fDesc; } |
| 256 const GrProgramDesc::KeyHeader& header() const { return fDesc.header(); } | 257 const GrProgramDesc::KeyHeader& header() const { return fDesc.header(); } |
| 257 | 258 |
| 258 // Generates a name for a variable. The generated string will be name prefix
ed by the prefix | 259 // Generates a name for a variable. The generated string will be name prefix
ed by the prefix |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 423 SkAutoTDelete<GrGLFragmentProcessor> fGLProc; | 424 SkAutoTDelete<GrGLFragmentProcessor> fGLProc; |
| 424 SkSTArray<2, Transform, true> fTransforms; | 425 SkSTArray<2, Transform, true> fTransforms; |
| 425 }; | 426 }; |
| 426 | 427 |
| 427 struct GrGLInstalledFragProcs : public SkRefCnt { | 428 struct GrGLInstalledFragProcs : public SkRefCnt { |
| 428 virtual ~GrGLInstalledFragProcs(); | 429 virtual ~GrGLInstalledFragProcs(); |
| 429 SkSTArray<8, GrGLInstalledFragProc*, true> fProcs; | 430 SkSTArray<8, GrGLInstalledFragProc*, true> fProcs; |
| 430 }; | 431 }; |
| 431 | 432 |
| 432 #endif | 433 #endif |
| OLD | NEW |