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 /** a helper which can setup vertex, constant, or uniform color depending on
inputType. | 77 void setupUniformColor(GrGLGPBuilder* pb, const char* outputName, UniformHan
dle* colorUniform); |
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); | |
87 | 78 |
88 const char* uViewM() const { return fViewMatrixName; } | 79 const char* uViewM() const { return fViewMatrixName; } |
89 | 80 |
90 /** a helper function to setup the uniform handle for the uniform view matri
x */ | 81 /** a helper function to setup the uniform handle for the uniform view matri
x */ |
91 void addUniformViewMatrix(GrGLGPBuilder*); | 82 void addUniformViewMatrix(GrGLGPBuilder*); |
92 | 83 |
93 | 84 |
94 /** a helper function to upload a uniform viewmatrix. | 85 /** a helper function to upload a uniform viewmatrix. |
95 * TODO we can remove this function when we have deferred geometry in place | 86 * TODO we can remove this function when we have deferred geometry in place |
96 */ | 87 */ |
(...skipping 24 matching lines...) Expand all Loading... |
121 | 112 |
122 SkSTArray<8, SkSTArray<2, Transform, true> > fInstalledTransforms; | 113 SkSTArray<8, SkSTArray<2, Transform, true> > fInstalledTransforms; |
123 | 114 |
124 private: | 115 private: |
125 UniformHandle fViewMatrixUniform; | 116 UniformHandle fViewMatrixUniform; |
126 SkMatrix fViewMatrix; | 117 SkMatrix fViewMatrix; |
127 const char* fViewMatrixName; | 118 const char* fViewMatrixName; |
128 }; | 119 }; |
129 | 120 |
130 #endif | 121 #endif |
OLD | NEW |