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

Side by Side Diff: src/gpu/GrDefaultGeoProcFactory.cpp

Issue 1684063006: Add GrShaderFlags enum (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Bit->Flag Created 4 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 unified diff | Download patch
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 #include "GrDefaultGeoProcFactory.h" 8 #include "GrDefaultGeoProcFactory.h"
9 9
10 #include "GrInvariantOutput.h" 10 #include "GrInvariantOutput.h"
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 // Setup coverage as pass through 122 // Setup coverage as pass through
123 if (!gp.coverageWillBeIgnored()) { 123 if (!gp.coverageWillBeIgnored()) {
124 if (gp.hasVertexCoverage()) { 124 if (gp.hasVertexCoverage()) {
125 fragBuilder->codeAppendf("float alpha = 1.0;"); 125 fragBuilder->codeAppendf("float alpha = 1.0;");
126 varyingHandler->addPassThroughAttribute(gp.inCoverage(), "al pha"); 126 varyingHandler->addPassThroughAttribute(gp.inCoverage(), "al pha");
127 fragBuilder->codeAppendf("%s = vec4(alpha);", args.fOutputCo verage); 127 fragBuilder->codeAppendf("%s = vec4(alpha);", args.fOutputCo verage);
128 } else if (gp.coverage() == 0xff) { 128 } else if (gp.coverage() == 0xff) {
129 fragBuilder->codeAppendf("%s = vec4(1);", args.fOutputCovera ge); 129 fragBuilder->codeAppendf("%s = vec4(1);", args.fOutputCovera ge);
130 } else { 130 } else {
131 const char* fragCoverage; 131 const char* fragCoverage;
132 fCoverageUniform = uniformHandler->addUniform( 132 fCoverageUniform = uniformHandler->addUniform(kFragment_GrSh aderFlag,
133 GrGLSLUniformHandler::k Fragment_Visibility, 133 kFloat_GrSLTyp e,
134 kFloat_GrSLType, 134 kDefault_GrSLP recision,
135 kDefault_GrSLPrecision, 135 "Coverage",
136 "Coverage", 136 &fragCoverage) ;
137 &fragCoverage);
138 fragBuilder->codeAppendf("%s = vec4(%s);", args.fOutputCover age, fragCoverage); 137 fragBuilder->codeAppendf("%s = vec4(%s);", args.fOutputCover age, fragCoverage);
139 } 138 }
140 } 139 }
141 } 140 }
142 141
143 static inline void GenKey(const GrGeometryProcessor& gp, 142 static inline void GenKey(const GrGeometryProcessor& gp,
144 const GrGLSLCaps&, 143 const GrGLSLCaps&,
145 GrProcessorKeyBuilder* b) { 144 GrProcessorKeyBuilder* b) {
146 const DefaultGeoProc& def = gp.cast<DefaultGeoProc>(); 145 const DefaultGeoProc& def = gp.cast<DefaultGeoProc>();
147 uint32_t key = def.fFlags; 146 uint32_t key = def.fFlags;
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 } 334 }
336 335
337 if (localCoords.hasLocalMatrix()) { 336 if (localCoords.hasLocalMatrix()) {
338 invert.preConcat(*localCoords.fMatrix); 337 invert.preConcat(*localCoords.fMatrix);
339 } 338 }
340 } 339 }
341 340
342 LocalCoords inverted(LocalCoords::kUsePosition_Type, &invert); 341 LocalCoords inverted(LocalCoords::kUsePosition_Type, &invert);
343 return Create(color, coverage, inverted, SkMatrix::I()); 342 return Create(color, coverage, inverted, SkMatrix::I());
344 } 343 }
OLDNEW
« no previous file with comments | « src/effects/gradients/SkTwoPointConicalGradient_gpu.cpp ('k') | src/gpu/GrFragmentProcessor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698