OLD | NEW |
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 "GrGLPrimitiveProcessor.h" | 8 #include "GrGLPrimitiveProcessor.h" |
9 | 9 |
10 #include "builders/GrGLProgramBuilder.h" | 10 #include "builders/GrGLProgramBuilder.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 combined.set(SkMatrix::kMSkewY, | 24 combined.set(SkMatrix::kMSkewY, |
25 combined[SkMatrix::kMPersp0] - combined[SkMatrix::kMSkewY]); | 25 combined[SkMatrix::kMPersp0] - combined[SkMatrix::kMSkewY]); |
26 combined.set(SkMatrix::kMScaleY, | 26 combined.set(SkMatrix::kMScaleY, |
27 combined[SkMatrix::kMPersp1] - combined[SkMatrix::kMScaleY]); | 27 combined[SkMatrix::kMPersp1] - combined[SkMatrix::kMScaleY]); |
28 combined.set(SkMatrix::kMTransY, | 28 combined.set(SkMatrix::kMTransY, |
29 combined[SkMatrix::kMPersp2] - combined[SkMatrix::kMTransY]); | 29 combined[SkMatrix::kMPersp2] - combined[SkMatrix::kMTransY]); |
30 } | 30 } |
31 return combined; | 31 return combined; |
32 } | 32 } |
33 | 33 |
34 void GrGLPrimitiveProcessor::setupUniformColor(GrGLGPBuilder* pb, | 34 void GrGLPrimitiveProcessor::setupUniformColor(GrGLSLGPBuilder* pb, |
35 const char* outputName, | 35 const char* outputName, |
36 UniformHandle* colorUniform) { | 36 UniformHandle* colorUniform) { |
37 GrGLFragmentBuilder* fs = pb->getFragmentShaderBuilder(); | 37 GrGLFragmentBuilder* fs = pb->getFragmentShaderBuilder(); |
38 SkASSERT(colorUniform); | 38 SkASSERT(colorUniform); |
39 const char* stagedLocalVarName; | 39 const char* stagedLocalVarName; |
40 *colorUniform = pb->addUniform(GrGLProgramBuilder::kFragment_Visibility, | 40 *colorUniform = pb->addUniform(GrGLProgramBuilder::kFragment_Visibility, |
41 kVec4f_GrSLType, | 41 kVec4f_GrSLType, |
42 kDefault_GrSLPrecision, | 42 kDefault_GrSLPrecision, |
43 "Color", | 43 "Color", |
44 &stagedLocalVarName); | 44 &stagedLocalVarName); |
45 fs->codeAppendf("%s = %s;", outputName, stagedLocalVarName); | 45 fs->codeAppendf("%s = %s;", outputName, stagedLocalVarName); |
46 } | 46 } |
OLD | NEW |