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 GrGLPrimitiveProcessor_DEFINED | 8 #ifndef GrGLPrimitiveProcessor_DEFINED |
9 #define GrGLPrimitiveProcessor_DEFINED | 9 #define GrGLPrimitiveProcessor_DEFINED |
10 | 10 |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 GrPrimitiveProcessor parameter is guaranteed to be of the same type that
created this | 67 GrPrimitiveProcessor parameter is guaranteed to be of the same type that
created this |
68 GrGLPrimitiveProcessor and to have an identical processor key as the one
that created this | 68 GrGLPrimitiveProcessor and to have an identical processor key as the one
that created this |
69 GrGLPrimitiveProcessor. */ | 69 GrGLPrimitiveProcessor. */ |
70 virtual void setData(const GrGLProgramDataManager&, | 70 virtual void setData(const GrGLProgramDataManager&, |
71 const GrPrimitiveProcessor&, | 71 const GrPrimitiveProcessor&, |
72 const GrBatchTracker&) = 0; | 72 const GrBatchTracker&) = 0; |
73 | 73 |
74 static SkMatrix GetTransformMatrix(const SkMatrix& localMatrix, const GrCoor
dTransform&); | 74 static SkMatrix GetTransformMatrix(const SkMatrix& localMatrix, const GrCoor
dTransform&); |
75 | 75 |
76 protected: | 76 protected: |
77 void setupUniformColor(GrGLGPBuilder* pb, const char* outputName, UniformHan
dle* colorUniform); | 77 /** a helper which can setup vertex, constant, or uniform color depending on
inputType. |
| 78 * This function will only do the minimum required to emit the correct shad
er code. If |
| 79 * inputType == attribute, then colorAttr must not be NULL. Likewise, if i
nputType == Uniform |
| 80 * then colorUniform must not be NULL. |
| 81 */ |
| 82 void setupColorPassThrough(GrGLGPBuilder* pb, |
| 83 GrGPInput inputType, |
| 84 const char* inputName, |
| 85 const GrPrimitiveProcessor::Attribute* colorAttr, |
| 86 UniformHandle* colorUniform); |
78 | 87 |
79 const char* uViewM() const { return fViewMatrixName; } | 88 const char* uViewM() const { return fViewMatrixName; } |
80 | 89 |
81 /** a helper function to setup the uniform handle for the uniform view matri
x */ | 90 /** a helper function to setup the uniform handle for the uniform view matri
x */ |
82 void addUniformViewMatrix(GrGLGPBuilder*); | 91 void addUniformViewMatrix(GrGLGPBuilder*); |
83 | 92 |
84 | 93 |
85 /** a helper function to upload a uniform viewmatrix. | 94 /** a helper function to upload a uniform viewmatrix. |
86 * TODO we can remove this function when we have deferred geometry in place | 95 * TODO we can remove this function when we have deferred geometry in place |
87 */ | 96 */ |
(...skipping 24 matching lines...) Expand all Loading... |
112 | 121 |
113 SkSTArray<8, SkSTArray<2, Transform, true> > fInstalledTransforms; | 122 SkSTArray<8, SkSTArray<2, Transform, true> > fInstalledTransforms; |
114 | 123 |
115 private: | 124 private: |
116 UniformHandle fViewMatrixUniform; | 125 UniformHandle fViewMatrixUniform; |
117 SkMatrix fViewMatrix; | 126 SkMatrix fViewMatrix; |
118 const char* fViewMatrixName; | 127 const char* fViewMatrixName; |
119 }; | 128 }; |
120 | 129 |
121 #endif | 130 #endif |
OLD | NEW |