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

Side by Side Diff: src/gpu/glsl/GrGLSLProgramBuilder.cpp

Issue 1416423003: Make GrGLSLProgramBuilder base class for ProgramBuilder (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: nit Created 5 years, 1 month 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/glsl/GrGLSLProgramBuilder.h ('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
(Empty)
1 /*
2 * Copyright 2015 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8 #include "glsl/GrGLSLProgramBuilder.h"
9
10 const int GrGLSLProgramBuilder::kVarsPerBlock = 8;
11
12 GrGLSLProgramBuilder::GrGLSLProgramBuilder(const DrawArgs& args)
13 : fVS(this)
14 , fGS(this)
15 , fFS(this, args.fDesc->header().fFragPosKey)
16 , fStageIndex(-1)
17 , fArgs(args) {
18 }
19
20 void GrGLSLProgramBuilder::nameVariable(SkString* out, char prefix, const char* name, bool mangle) {
21 if ('\0' == prefix) {
22 *out = name;
23 } else {
24 out->printf("%c%s", prefix, name);
25 }
26 if (mangle) {
27 if (out->endsWith('_')) {
28 // Names containing "__" are reserved.
29 out->append("x");
30 }
31 out->appendf("_Stage%d%s", fStageIndex, fFS.getMangleString().c_str());
32 }
33 }
34
35 void GrGLSLProgramBuilder::appendUniformDecls(ShaderVisibility visibility,
36 SkString* out) const {
37 this->onAppendUniformDecls(visibility, out);
38 }
39
OLDNEW
« no previous file with comments | « src/gpu/glsl/GrGLSLProgramBuilder.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698