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

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

Issue 1457543003: Add ShaderBuilders to EmitArgs and remove gettings from ProgBuilder. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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/GrGLSLPrimitiveProcessor.h ('k') | src/gpu/glsl/GrGLSLProgramBuilder.h » ('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 #include "GrGLSLPrimitiveProcessor.h" 8 #include "GrGLSLPrimitiveProcessor.h"
9 9
10 #include "glsl/GrGLSLProgramBuilder.h" 10 #include "glsl/GrGLSLProgramBuilder.h"
(...skipping 15 matching lines...) Expand all
26 combined[SkMatrix::kMPersp0] - combined[SkMatrix::kMSkewY]); 26 combined[SkMatrix::kMPersp0] - combined[SkMatrix::kMSkewY]);
27 combined.set(SkMatrix::kMScaleY, 27 combined.set(SkMatrix::kMScaleY,
28 combined[SkMatrix::kMPersp1] - combined[SkMatrix::kMScaleY]); 28 combined[SkMatrix::kMPersp1] - combined[SkMatrix::kMScaleY]);
29 combined.set(SkMatrix::kMTransY, 29 combined.set(SkMatrix::kMTransY,
30 combined[SkMatrix::kMPersp2] - combined[SkMatrix::kMTransY]); 30 combined[SkMatrix::kMPersp2] - combined[SkMatrix::kMTransY]);
31 } 31 }
32 return combined; 32 return combined;
33 } 33 }
34 34
35 void GrGLSLPrimitiveProcessor::setupUniformColor(GrGLSLGPBuilder* pb, 35 void GrGLSLPrimitiveProcessor::setupUniformColor(GrGLSLGPBuilder* pb,
36 GrGLSLFragmentBuilder* fragBuil der,
36 const char* outputName, 37 const char* outputName,
37 UniformHandle* colorUniform) { 38 UniformHandle* colorUniform) {
38 GrGLSLFragmentBuilder* fs = pb->getFragmentShaderBuilder();
39 SkASSERT(colorUniform); 39 SkASSERT(colorUniform);
40 const char* stagedLocalVarName; 40 const char* stagedLocalVarName;
41 *colorUniform = pb->addUniform(GrGLSLProgramBuilder::kFragment_Visibility, 41 *colorUniform = pb->addUniform(GrGLSLProgramBuilder::kFragment_Visibility,
42 kVec4f_GrSLType, 42 kVec4f_GrSLType,
43 kDefault_GrSLPrecision, 43 kDefault_GrSLPrecision,
44 "Color", 44 "Color",
45 &stagedLocalVarName); 45 &stagedLocalVarName);
46 fs->codeAppendf("%s = %s;", outputName, stagedLocalVarName); 46 fragBuilder->codeAppendf("%s = %s;", outputName, stagedLocalVarName);
47 } 47 }
OLDNEW
« no previous file with comments | « src/gpu/glsl/GrGLSLPrimitiveProcessor.h ('k') | src/gpu/glsl/GrGLSLProgramBuilder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698