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

Side by Side Diff: src/gpu/gl/GrGLShaderBuilder.cpp

Issue 23526008: Modify GLSL version declaration to allow access to compat. features (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/gpu/gl/GrGLSL.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2012 Google Inc. 2 * Copyright 2012 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 #include "gl/GrGLShaderBuilder.h" 8 #include "gl/GrGLShaderBuilder.h"
9 #include "gl/GrGLProgram.h" 9 #include "gl/GrGLProgram.h"
10 #include "gl/GrGLUniformHandle.h" 10 #include "gl/GrGLUniformHandle.h"
(...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after
582 void GrGLShaderBuilder::appendUniformDecls(ShaderType stype, SkString* out) cons t { 582 void GrGLShaderBuilder::appendUniformDecls(ShaderType stype, SkString* out) cons t {
583 for (int i = 0; i < fUniforms.count(); ++i) { 583 for (int i = 0; i < fUniforms.count(); ++i) {
584 if (fUniforms[i].fVisibility & stype) { 584 if (fUniforms[i].fVisibility & stype) {
585 fUniforms[i].fVariable.appendDecl(fCtxInfo, out); 585 fUniforms[i].fVariable.appendDecl(fCtxInfo, out);
586 out->append(";\n"); 586 out->append(";\n");
587 } 587 }
588 } 588 }
589 } 589 }
590 590
591 void GrGLShaderBuilder::getShader(ShaderType type, SkString* shaderStr) const { 591 void GrGLShaderBuilder::getShader(ShaderType type, SkString* shaderStr) const {
592 const char* version = GrGetGLSLVersionDecl(fCtxInfo.binding(), fCtxInfo.glsl Generation()); 592 const char* version = GrGetGLSLVersionDecl(fCtxInfo);
593 593
594 switch (type) { 594 switch (type) {
595 case kVertex_ShaderType: 595 case kVertex_ShaderType:
596 *shaderStr = version; 596 *shaderStr = version;
597 this->appendUniformDecls(kVertex_ShaderType, shaderStr); 597 this->appendUniformDecls(kVertex_ShaderType, shaderStr);
598 this->appendDecls(fVSAttrs, shaderStr); 598 this->appendDecls(fVSAttrs, shaderStr);
599 this->appendDecls(fVSOutputs, shaderStr); 599 this->appendDecls(fVSOutputs, shaderStr);
600 shaderStr->append("void main() {\n"); 600 shaderStr->append("void main() {\n");
601 shaderStr->append(fVSCode); 601 shaderStr->append(fVSCode);
602 shaderStr->append("}\n"); 602 shaderStr->append("}\n");
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
720 for (const AttributePair* attrib = this->getEffectAttributes().begin(); 720 for (const AttributePair* attrib = this->getEffectAttributes().begin();
721 attrib != attribEnd; 721 attrib != attribEnd;
722 ++attrib) { 722 ++attrib) {
723 if (attrib->fIndex == attributeIndex) { 723 if (attrib->fIndex == attributeIndex) {
724 return &attrib->fName; 724 return &attrib->fName;
725 } 725 }
726 } 726 }
727 727
728 return NULL; 728 return NULL;
729 } 729 }
OLDNEW
« no previous file with comments | « src/gpu/gl/GrGLSL.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698