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

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

Issue 23537028: Enable vertexless shading when path rendering is supported (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
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 #ifndef GrGLShaderBuilder_DEFINED 8 #ifndef GrGLShaderBuilder_DEFINED
9 #define GrGLShaderBuilder_DEFINED 9 #define GrGLShaderBuilder_DEFINED
10 10
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 GrSLType coordType = kVec2f_GrSLType); 161 GrSLType coordType = kVec2f_GrSLType);
162 162
163 /** Emits a helper function outside of main() in the fragment shader. */ 163 /** Emits a helper function outside of main() in the fragment shader. */
164 void fsEmitFunction(GrSLType returnType, 164 void fsEmitFunction(GrSLType returnType,
165 const char* name, 165 const char* name,
166 int argCnt, 166 int argCnt,
167 const GrGLShaderVar* args, 167 const GrGLShaderVar* args,
168 const char* body, 168 const char* body,
169 SkString* outName); 169 SkString* outName);
170 170
171 void addTexGenUnit(GrSLType type,
172 SkString* fsInName = NULL,
173 int* unitIdx = NULL,
174 int* numComponents = NULL);
175 int getNumTexGenUnits() { return fNumTexGenUnits; }
176
171 /** Add input/output variable declarations (i.e. 'varying') to the fragment shader. */ 177 /** Add input/output variable declarations (i.e. 'varying') to the fragment shader. */
172 GrGLShaderVar& fsInputAppend() { return fFSInputs.push_back(); } 178 GrGLShaderVar& fsInputAppend() { return fFSInputs.push_back(); }
173 GrGLShaderVar& fsOutputAppend() { return fFSOutputs.push_back(); } 179 GrGLShaderVar& fsOutputAppend() { return fFSOutputs.push_back(); }
174 GrGLShaderVar& fsInputAppend(const GrGLShaderVar& var) { return fFSInputs.pu sh_back(var); } 180 GrGLShaderVar& fsInputAppend(const GrGLShaderVar& var) { return fFSInputs.pu sh_back(var); }
175 GrGLShaderVar& fsOutputAppend(const GrGLShaderVar& var) { return fFSOutputs. push_back(var); } 181 GrGLShaderVar& fsOutputAppend(const GrGLShaderVar& var) { return fFSOutputs. push_back(var); }
176 182
177 /** Generates a EffectKey for the shader code based on the texture access pa rameters and the 183 /** Generates a EffectKey for the shader code based on the texture access pa rameters and the
178 capabilities of the GL context. This is useful for keying the shader pr ograms that may 184 capabilities of the GL context. This is useful for keying the shader pr ograms that may
179 have multiple representations, based on the type/format of textures used . */ 185 have multiple representations, based on the type/format of textures used . */
180 static GrBackendEffectFactory::EffectKey KeyForTextureAccess(const GrTexture Access&, 186 static GrBackendEffectFactory::EffectKey KeyForTextureAccess(const GrTexture Access&,
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
481 SkString fFSCode; 487 SkString fFSCode;
482 488
483 bool fSetupFragPosition; 489 bool fSetupFragPosition;
484 TextureSampler fDstCopySampler; 490 TextureSampler fDstCopySampler;
485 491
486 GrGLUniformManager::UniformHandle fRTHeightUniform; 492 GrGLUniformManager::UniformHandle fRTHeightUniform;
487 GrGLUniformManager::UniformHandle fDstCopyTopLeftUniform; 493 GrGLUniformManager::UniformHandle fDstCopyTopLeftUniform;
488 GrGLUniformManager::UniformHandle fDstCopyScaleUniform; 494 GrGLUniformManager::UniformHandle fDstCopyScaleUniform;
489 495
490 bool fTopLeftFragPosRead; 496 bool fTopLeftFragPosRead;
497 int fNumTexGenUnits;
491 498
492 SkAutoTDelete<VertexBuilder> fVertexBuilder; 499 SkAutoTDelete<VertexBuilder> fVertexBuilder;
493 }; 500 };
494 501
495 #endif 502 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698