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 |
11 #include "GrGLFragmentShaderBuilder.h" | 11 #include "GrGLFragmentShaderBuilder.h" |
12 #include "GrGLGeometryShaderBuilder.h" | 12 #include "GrGLGeometryShaderBuilder.h" |
13 #include "GrGLVertexShaderBuilder.h" | 13 #include "GrGLVertexShaderBuilder.h" |
14 #include "../GrGLProgramDataManager.h" | 14 #include "../GrGLProgramDataManager.h" |
15 #include "../GrGLUniformHandle.h" | 15 #include "../GrGLUniformHandle.h" |
16 #include "../GrGLGeometryProcessor.h" | 16 #include "../GrGLGeometryProcessor.h" |
17 #include "../GrGLXferProcessor.h" | 17 #include "../GrGLXferProcessor.h" |
18 #include "../../GrOptDrawState.h" | |
19 #include "../../GrPendingFragmentStage.h" | 18 #include "../../GrPendingFragmentStage.h" |
| 19 #include "../../GrPipeline.h" |
20 | 20 |
21 /* | 21 /* |
22 * This is the base class for a series of interfaces. This base class *MUST* re
main abstract with | 22 * This is the base class for a series of interfaces. This base class *MUST* re
main abstract with |
23 * NO data members because it is used in multiple interface inheritance. | 23 * NO data members because it is used in multiple interface inheritance. |
24 * Heirarchy: | 24 * Heirarchy: |
25 * GrGLUniformBuilder | 25 * GrGLUniformBuilder |
26 * / \ | 26 * / \ |
27 * GrGLFPBuilder GrGLGPBuilder | 27 * GrGLFPBuilder GrGLGPBuilder |
28 * \ / | 28 * \ / |
29 * GrGLProgramBuilder(internal use only) | 29 * GrGLProgramBuilder(internal use only) |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 | 276 |
277 protected: | 277 protected: |
278 typedef GrGLProgramDataManager::UniformInfo UniformInfo; | 278 typedef GrGLProgramDataManager::UniformInfo UniformInfo; |
279 typedef GrGLProgramDataManager::UniformInfoArray UniformInfoArray; | 279 typedef GrGLProgramDataManager::UniformInfoArray UniformInfoArray; |
280 | 280 |
281 static GrGLProgramBuilder* CreateProgramBuilder(const DrawArgs&, GrGLGpu*); | 281 static GrGLProgramBuilder* CreateProgramBuilder(const DrawArgs&, GrGLGpu*); |
282 | 282 |
283 GrGLProgramBuilder(GrGLGpu*, const DrawArgs&); | 283 GrGLProgramBuilder(GrGLGpu*, const DrawArgs&); |
284 | 284 |
285 const GrPrimitiveProcessor& primitiveProcessor() const { return *fArgs.fPrim
itiveProcessor; } | 285 const GrPrimitiveProcessor& primitiveProcessor() const { return *fArgs.fPrim
itiveProcessor; } |
286 const GrOptDrawState& optState() const { return *fArgs.fOptState; } | 286 const GrPipeline& pipeline() const { return *fArgs.fPipeline; } |
287 const GrProgramDesc& desc() const { return *fArgs.fDesc; } | 287 const GrProgramDesc& desc() const { return *fArgs.fDesc; } |
288 const GrBatchTracker& batchTracker() const { return *fArgs.fBatchTracker; } | 288 const GrBatchTracker& batchTracker() const { return *fArgs.fBatchTracker; } |
289 const GrProgramDesc::KeyHeader& header() const { return fArgs.fDesc->header(
); } | 289 const GrProgramDesc::KeyHeader& header() const { return fArgs.fDesc->header(
); } |
290 | 290 |
291 // Generates a name for a variable. The generated string will be name prefix
ed by the prefix | 291 // Generates a name for a variable. The generated string will be name prefix
ed by the prefix |
292 // char (unless the prefix is '\0'). It also mangles the name to be stage-sp
ecific if we're | 292 // char (unless the prefix is '\0'). It also mangles the name to be stage-sp
ecific if we're |
293 // generating stage code. | 293 // generating stage code. |
294 void nameVariable(SkString* out, char prefix, const char* name); | 294 void nameVariable(SkString* out, char prefix, const char* name); |
295 // Generates a possibly mangled name for a stage variable and writes it to t
he fragment shader. | 295 // Generates a possibly mangled name for a stage variable and writes it to t
he fragment shader. |
296 // If GrGLSLExpr4 has a valid name then it will use that instead | 296 // If GrGLSLExpr4 has a valid name then it will use that instead |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
391 UniformInfoArray fUniforms; | 391 UniformInfoArray fUniforms; |
392 GrGLPrimitiveProcessor::TransformsIn fCoordTransforms; | 392 GrGLPrimitiveProcessor::TransformsIn fCoordTransforms; |
393 GrGLPrimitiveProcessor::TransformsOut fOutCoords; | 393 GrGLPrimitiveProcessor::TransformsOut fOutCoords; |
394 | 394 |
395 friend class GrGLShaderBuilder; | 395 friend class GrGLShaderBuilder; |
396 friend class GrGLVertexBuilder; | 396 friend class GrGLVertexBuilder; |
397 friend class GrGLFragmentShaderBuilder; | 397 friend class GrGLFragmentShaderBuilder; |
398 friend class GrGLGeometryBuilder; | 398 friend class GrGLGeometryBuilder; |
399 }; | 399 }; |
400 #endif | 400 #endif |
OLD | NEW |