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 GrGLGeometryProcessor_DEFINED | 8 #ifndef GrGLGeometryProcessor_DEFINED |
9 #define GrGLGeometryProcessor_DEFINED | 9 #define GrGLGeometryProcessor_DEFINED |
10 | 10 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
46 | 46 |
47 struct GrGPArgs { | 47 struct GrGPArgs { |
48 // The variable used by a GP to store its position. It can be | 48 // The variable used by a GP to store its position. It can be |
49 // either a vec2 or a vec3 depending on the presence of perspective. | 49 // either a vec2 or a vec3 depending on the presence of perspective. |
50 GrShaderVar fPositionVar; | 50 GrShaderVar fPositionVar; |
51 }; | 51 }; |
52 | 52 |
53 // Create the correct type of position variable given the CTM | 53 // Create the correct type of position variable given the CTM |
54 void setupPosition(GrGLGPBuilder* pb, | 54 void setupPosition(GrGLGPBuilder* pb, |
55 GrGPArgs* gpArgs, | 55 GrGPArgs* gpArgs, |
56 const char* posName, | 56 const char* posName, |
robertphillips
2015/05/14 16:20:10
Hmmm
| |
57 const SkMatrix& mat); | 57 const SkMatrix& mat = SkMatrix::I()); |
58 | 58 |
59 static uint32_t ComputePosKey(const SkMatrix& mat) { | 59 static uint32_t ComputePosKey(const SkMatrix& mat) { |
60 if (mat.isIdentity()) { | 60 if (mat.isIdentity()) { |
61 return 0x0; | 61 return 0x0; |
62 } else if (!mat.hasPerspective()) { | 62 } else if (!mat.hasPerspective()) { |
63 return 0x01; | 63 return 0x01; |
64 } else { | 64 } else { |
65 return 0x02; | 65 return 0x02; |
66 } | 66 } |
67 } | 67 } |
68 | 68 |
69 private: | 69 private: |
70 virtual void onEmitCode(EmitArgs&, GrGPArgs*) = 0; | 70 virtual void onEmitCode(EmitArgs&, GrGPArgs*) = 0; |
71 | 71 |
72 typedef GrGLPrimitiveProcessor INHERITED; | 72 typedef GrGLPrimitiveProcessor INHERITED; |
73 }; | 73 }; |
74 | 74 |
75 #endif | 75 #endif |
OLD | NEW |