Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 GrGLSLProgramBuilder_DEFINED | 8 #ifndef GrGLSLProgramBuilder_DEFINED |
| 9 #define GrGLSLProgramBuilder_DEFINED | 9 #define GrGLSLProgramBuilder_DEFINED |
| 10 | 10 |
|
robertphillips
2016/09/15 20:44:30
Why do we need utility ?
bsalomon
2016/09/15 20:55:52
Hm, maybe at one point I had a std::unique_ptr in
| |
| 11 #include <utility> | |
| 12 | |
| 13 #include "GrCoordTransform.h" | |
| 11 #include "GrGeometryProcessor.h" | 14 #include "GrGeometryProcessor.h" |
| 12 #include "GrGpu.h" | 15 #include "GrGpu.h" |
| 13 #include "glsl/GrGLSLFragmentProcessor.h" | 16 #include "glsl/GrGLSLFragmentProcessor.h" |
| 14 #include "glsl/GrGLSLFragmentShaderBuilder.h" | 17 #include "glsl/GrGLSLFragmentShaderBuilder.h" |
| 15 #include "glsl/GrGLSLGeometryShaderBuilder.h" | 18 #include "glsl/GrGLSLGeometryShaderBuilder.h" |
| 16 #include "glsl/GrGLSLPrimitiveProcessor.h" | 19 #include "glsl/GrGLSLPrimitiveProcessor.h" |
| 17 #include "glsl/GrGLSLProgramDataManager.h" | 20 #include "glsl/GrGLSLProgramDataManager.h" |
| 18 #include "glsl/GrGLSLUniformHandler.h" | 21 #include "glsl/GrGLSLUniformHandler.h" |
| 19 #include "glsl/GrGLSLSampler.h" | 22 #include "glsl/GrGLSLSampler.h" |
| 20 #include "glsl/GrGLSLVertexShaderBuilder.h" | 23 #include "glsl/GrGLSLVertexShaderBuilder.h" |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 132 GrGLSLProgramBuilder* fPB; | 135 GrGLSLProgramBuilder* fPB; |
| 133 }; | 136 }; |
| 134 | 137 |
| 135 // Generates a possibly mangled name for a stage variable and writes it to t he fragment shader. | 138 // Generates a possibly mangled name for a stage variable and writes it to t he fragment shader. |
| 136 // If GrGLSLExpr4 has a valid name then it will use that instead | 139 // If GrGLSLExpr4 has a valid name then it will use that instead |
| 137 void nameExpression(GrGLSLExpr4*, const char* baseName); | 140 void nameExpression(GrGLSLExpr4*, const char* baseName); |
| 138 | 141 |
| 139 void emitAndInstallPrimProc(const GrPrimitiveProcessor&, | 142 void emitAndInstallPrimProc(const GrPrimitiveProcessor&, |
| 140 GrGLSLExpr4* outputColor, | 143 GrGLSLExpr4* outputColor, |
| 141 GrGLSLExpr4* outputCoverage); | 144 GrGLSLExpr4* outputCoverage); |
| 142 void emitAndInstallFragProcs(int procOffset, int numProcs, GrGLSLExpr4* inOu t); | 145 void emitAndInstallFragProcs(GrGLSLExpr4* colorInOut, GrGLSLExpr4* coverageI nOut); |
| 143 void emitAndInstallFragProc(const GrFragmentProcessor&, | 146 void emitAndInstallFragProc(const GrFragmentProcessor&, |
| 144 int index, | 147 int index, |
| 148 int transformedCoordVarsIdx, | |
| 145 const GrGLSLExpr4& input, | 149 const GrGLSLExpr4& input, |
| 146 GrGLSLExpr4* output); | 150 GrGLSLExpr4* output); |
| 147 void emitAndInstallXferProc(const GrXferProcessor&, | 151 void emitAndInstallXferProc(const GrXferProcessor&, |
| 148 const GrGLSLExpr4& colorIn, | 152 const GrGLSLExpr4& colorIn, |
| 149 const GrGLSLExpr4& coverageIn, | 153 const GrGLSLExpr4& coverageIn, |
| 150 bool ignoresCoverage, | 154 bool ignoresCoverage, |
| 151 GrPixelLocalStorageState plsState); | 155 GrPixelLocalStorageState plsState); |
| 152 | 156 |
| 153 void emitSamplers(const GrProcessor& processor, | 157 void emitSamplers(const GrProcessor& processor, |
| 154 SkTArray<SamplerHandle>* outTexSamplers, | 158 SkTArray<SamplerHandle>* outTexSamplers, |
| 155 SkTArray<SamplerHandle>* outBufferSamplers); | 159 SkTArray<SamplerHandle>* outBufferSamplers); |
| 156 void emitSampler(GrSLType samplerType, | 160 void emitSampler(GrSLType samplerType, |
| 157 GrPixelConfig, | 161 GrPixelConfig, |
| 158 const char* name, | 162 const char* name, |
| 159 GrShaderFlags visibility, | 163 GrShaderFlags visibility, |
| 160 SkTArray<SamplerHandle>* outSamplers); | 164 SkTArray<SamplerHandle>* outSamplers); |
| 161 void emitFSOutputSwizzle(bool hasSecondaryOutput); | 165 void emitFSOutputSwizzle(bool hasSecondaryOutput); |
| 162 bool checkSamplerCounts(); | 166 bool checkSamplerCounts(); |
| 163 | 167 |
| 164 #ifdef SK_DEBUG | 168 #ifdef SK_DEBUG |
| 165 void verify(const GrPrimitiveProcessor&); | 169 void verify(const GrPrimitiveProcessor&); |
| 166 void verify(const GrXferProcessor&); | 170 void verify(const GrXferProcessor&); |
| 167 void verify(const GrFragmentProcessor&); | 171 void verify(const GrFragmentProcessor&); |
| 168 #endif | 172 #endif |
| 169 | 173 |
| 170 GrGLSLPrimitiveProcessor::TransformsIn fCoordTransforms; | 174 int fNumVertexSamplers; |
| 171 GrGLSLPrimitiveProcessor::TransformsOut fOutCoords; | 175 int fNumGeometrySamplers; |
| 172 int fNumVertexSamplers; | 176 int fNumFragmentSamplers; |
| 173 int fNumGeometrySamplers; | 177 SkSTArray<4, GrShaderVar> fTransformedCoordVars; |
| 174 int fNumFragmentSamplers; | |
| 175 }; | 178 }; |
| 176 | 179 |
| 177 #endif | 180 #endif |
| OLD | NEW |