OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 GrGLSLGeometryProcessor_DEFINED | 8 #ifndef GrGLSLGeometryProcessor_DEFINED |
9 #define GrGLSLGeometryProcessor_DEFINED | 9 #define GrGLSLGeometryProcessor_DEFINED |
10 | 10 |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 // Emit pre-transformed coords as a vertex attribute per coord-transform. | 63 // Emit pre-transformed coords as a vertex attribute per coord-transform. |
64 void emitTransforms(GrGLSLVertexBuilder*, | 64 void emitTransforms(GrGLSLVertexBuilder*, |
65 GrGLSLVaryingHandler*, | 65 GrGLSLVaryingHandler*, |
66 GrGLSLUniformHandler*, | 66 GrGLSLUniformHandler*, |
67 const GrShaderVar& posVar, | 67 const GrShaderVar& posVar, |
68 const char* localCoords, | 68 const char* localCoords, |
69 const SkMatrix& localMatrix, | 69 const SkMatrix& localMatrix, |
70 const TransformsIn&, | 70 const TransformsIn&, |
71 TransformsOut*); | 71 TransformsOut*); |
72 | 72 |
73 // caller has emitted transforms via attributes | |
74 void emitTransforms(GrGLSLVertexBuilder*, | |
75 GrGLSLVaryingHandler*, | |
76 const char* localCoords, | |
77 const TransformsIn& tin, | |
78 TransformsOut* tout); | |
79 | |
80 struct GrGPArgs { | 73 struct GrGPArgs { |
81 // The variable used by a GP to store its position. It can be | 74 // The variable used by a GP to store its position. It can be |
82 // either a vec2 or a vec3 depending on the presence of perspective. | 75 // either a vec2 or a vec3 depending on the presence of perspective. |
83 GrShaderVar fPositionVar; | 76 GrShaderVar fPositionVar; |
84 }; | 77 }; |
85 | 78 |
86 // Create the correct type of position variable given the CTM | 79 // Create the correct type of position variable given the CTM |
87 void setupPosition(GrGLSLVertexBuilder*, GrGPArgs*, const char* posName); | 80 void setupPosition(GrGLSLVertexBuilder*, GrGPArgs*, const char* posName); |
88 void setupPosition(GrGLSLVertexBuilder*, | 81 void setupPosition(GrGLSLVertexBuilder*, |
89 GrGLSLUniformHandler* uniformHandler, | 82 GrGLSLUniformHandler* uniformHandler, |
(...skipping 19 matching lines...) Expand all Loading... |
109 UniformHandle fHandle; | 102 UniformHandle fHandle; |
110 SkMatrix fCurrentValue = SkMatrix::InvalidMatrix(); | 103 SkMatrix fCurrentValue = SkMatrix::InvalidMatrix(); |
111 }; | 104 }; |
112 | 105 |
113 SkSTArray<8, SkSTArray<2, TransformUniform, true> > fInstalledTransforms; | 106 SkSTArray<8, SkSTArray<2, TransformUniform, true> > fInstalledTransforms; |
114 | 107 |
115 typedef GrGLSLPrimitiveProcessor INHERITED; | 108 typedef GrGLSLPrimitiveProcessor INHERITED; |
116 }; | 109 }; |
117 | 110 |
118 #endif | 111 #endif |
OLD | NEW |