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

Side by Side Diff: src/gpu/gl/builders/GrGLFragmentShaderBuilder.h

Issue 522303004: Add option to add precision to varyings in shader (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Change param to fsPrecision Created 6 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
« no previous file with comments | « src/gpu/effects/GrBezierEffect.cpp ('k') | src/gpu/gl/builders/GrGLFragmentShaderBuilder.cpp » ('j') | 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 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 GrGLFragmentShaderBuilder_DEFINED 8 #ifndef GrGLFragmentShaderBuilder_DEFINED
9 #define GrGLFragmentShaderBuilder_DEFINED 9 #define GrGLFragmentShaderBuilder_DEFINED
10 #include "GrGLShaderBuilder.h" 10 #include "GrGLShaderBuilder.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 /** Returns a variable name that represents the position of the fragment in the FS. The position 58 /** Returns a variable name that represents the position of the fragment in the FS. The position
59 is in device space (e.g. 0,0 is the top left and pixel centers are at ha lf-integers). */ 59 is in device space (e.g. 0,0 is the top left and pixel centers are at ha lf-integers). */
60 const char* fragmentPosition(); 60 const char* fragmentPosition();
61 61
62 private: 62 private:
63 /* 63 /*
64 * An internal call for GrGLFullProgramBuilder to use to add varyings to the vertex shader 64 * An internal call for GrGLFullProgramBuilder to use to add varyings to the vertex shader
65 */ 65 */
66 void addVarying(GrSLType type, 66 void addVarying(GrSLType type,
67 const char* name, 67 const char* name,
68 const char** fsInName); 68 const char** fsInName,
69 GrGLShaderVar::Precision fsPrecision = GrGLShaderVar::kDefaul t_Precision);
69 70
70 /* 71 /*
71 * Private functions used by GrGLProgramBuilder for compilation 72 * Private functions used by GrGLProgramBuilder for compilation
72 */ 73 */
73 void bindProgramLocations(GrGLuint programId); 74 void bindProgramLocations(GrGLuint programId);
74 bool compileAndAttachShaders(GrGLuint programId, SkTDArray<GrGLuint>* shader Ids) const; 75 bool compileAndAttachShaders(GrGLuint programId, SkTDArray<GrGLuint>* shader Ids) const;
75 void emitCodeBeforeEffects(); 76 void emitCodeBeforeEffects();
76 void emitCodeAfterEffects(const GrGLSLExpr4& inputColor, const GrGLSLExpr4& inputCoverage); 77 void emitCodeAfterEffects(const GrGLSLExpr4& inputColor, const GrGLSLExpr4& inputCoverage);
77 78
78 /** Enables using the secondary color output and returns the name of the var in which it is 79 /** Enables using the secondary color output and returns the name of the var in which it is
(...skipping 30 matching lines...) Expand all
109 bool fSetupFragPosition; 110 bool fSetupFragPosition;
110 bool fTopLeftFragPosRead; 111 bool fTopLeftFragPosRead;
111 112
112 friend class GrGLProgramBuilder; 113 friend class GrGLProgramBuilder;
113 friend class GrGLFullProgramBuilder; 114 friend class GrGLFullProgramBuilder;
114 115
115 typedef GrGLShaderBuilder INHERITED; 116 typedef GrGLShaderBuilder INHERITED;
116 }; 117 };
117 118
118 #endif 119 #endif
OLDNEW
« no previous file with comments | « src/gpu/effects/GrBezierEffect.cpp ('k') | src/gpu/gl/builders/GrGLFragmentShaderBuilder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698