Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2170)

Unified Diff: src/gpu/gl/builders/GrGLFragmentShaderBuilder.cpp

Issue 929503002: Multi-string shaders (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: windows warning Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/gl/builders/GrGLFragmentShaderBuilder.h ('k') | src/gpu/gl/builders/GrGLGeometryShaderBuilder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/builders/GrGLFragmentShaderBuilder.cpp
diff --git a/src/gpu/gl/builders/GrGLFragmentShaderBuilder.cpp b/src/gpu/gl/builders/GrGLFragmentShaderBuilder.cpp
index 86c622d45686693b8ec25df5a705db14a00b45d8..c739f1162a63fdd3faf3fcd61244f811c3485618 100644
--- a/src/gpu/gl/builders/GrGLFragmentShaderBuilder.cpp
+++ b/src/gpu/gl/builders/GrGLFragmentShaderBuilder.cpp
@@ -6,7 +6,6 @@
*/
#include "GrGLFragmentShaderBuilder.h"
-#include "GrGLShaderStringBuilder.h"
#include "GrGLProgramBuilder.h"
#include "../GrGLGpu.h"
@@ -210,33 +209,19 @@ const char* GrGLFragmentShaderBuilder::getSecondaryColorOutputName() const {
}
bool GrGLFragmentShaderBuilder::compileAndAttachShaders(GrGLuint programId,
- SkTDArray<GrGLuint>* shaderIds) const {
+ SkTDArray<GrGLuint>* shaderIds) {
GrGLGpu* gpu = fProgramBuilder->gpu();
- SkString fragShaderSrc(GrGetGLSLVersionDecl(gpu->ctxInfo()));
- fragShaderSrc.append(fExtensions);
+ this->versionDecl() = GrGetGLSLVersionDecl(gpu->ctxInfo());
append_default_precision_qualifier(kDefault_GrSLPrecision,
gpu->glStandard(),
- &fragShaderSrc);
- fProgramBuilder->appendUniformDecls(GrGLProgramBuilder::kFragment_Visibility, &fragShaderSrc);
- this->appendDecls(fInputs, &fragShaderSrc);
+ &this->precisionQualifier());
+ fProgramBuilder->appendUniformDecls(GrGLProgramBuilder::kFragment_Visibility,
+ &this->uniforms());
+ this->appendDecls(fInputs, &this->inputs());
// We shouldn't have declared outputs on 1.10
SkASSERT(k110_GrGLSLGeneration != gpu->glslGeneration() || fOutputs.empty());
- this->appendDecls(fOutputs, &fragShaderSrc);
- fragShaderSrc.append(fFunctions);
- fragShaderSrc.append("void main() {\n");
- fragShaderSrc.append(fCode);
- fragShaderSrc.append("}\n");
-
- GrGLuint fragShaderId = GrGLCompileAndAttachShader(gpu->glContext(), programId,
- GR_GL_FRAGMENT_SHADER, fragShaderSrc,
- gpu->stats());
- if (!fragShaderId) {
- return false;
- }
-
- *shaderIds->append() = fragShaderId;
-
- return true;
+ this->appendDecls(fOutputs, &this->outputs());
+ return this->finalize(programId, GR_GL_FRAGMENT_SHADER, shaderIds);
}
void GrGLFragmentShaderBuilder::bindFragmentShaderLocations(GrGLuint programID) {
« no previous file with comments | « src/gpu/gl/builders/GrGLFragmentShaderBuilder.h ('k') | src/gpu/gl/builders/GrGLGeometryShaderBuilder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698