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 #include "GrBitmapTextGeoProc.h" | 8 #include "GrBitmapTextGeoProc.h" |
9 #include "GrInvariantOutput.h" | 9 #include "GrInvariantOutput.h" |
10 #include "GrTexture.h" | 10 #include "GrTexture.h" |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 }; | 127 }; |
128 | 128 |
129 /////////////////////////////////////////////////////////////////////////////// | 129 /////////////////////////////////////////////////////////////////////////////// |
130 | 130 |
131 GrBitmapTextGeoProc::GrBitmapTextGeoProc(GrColor color, GrTexture* texture, | 131 GrBitmapTextGeoProc::GrBitmapTextGeoProc(GrColor color, GrTexture* texture, |
132 const GrTextureParams& params, GrMaskFo
rmat format, | 132 const GrTextureParams& params, GrMaskFo
rmat format, |
133 const SkMatrix& localMatrix, bool usesL
ocalCoords) | 133 const SkMatrix& localMatrix, bool usesL
ocalCoords) |
134 : fColor(color) | 134 : fColor(color) |
135 , fLocalMatrix(localMatrix) | 135 , fLocalMatrix(localMatrix) |
136 , fUsesLocalCoords(usesLocalCoords) | 136 , fUsesLocalCoords(usesLocalCoords) |
137 , fTextureAccess(texture, params) | 137 , fTextureAccess(texture, nullptr, params) |
138 , fInColor(nullptr) | 138 , fInColor(nullptr) |
139 , fMaskFormat(format) { | 139 , fMaskFormat(format) { |
140 this->initClassID<GrBitmapTextGeoProc>(); | 140 this->initClassID<GrBitmapTextGeoProc>(); |
141 fInPosition = &this->addVertexAttrib(Attribute("inPosition", kVec2f_GrVertex
AttribType)); | 141 fInPosition = &this->addVertexAttrib(Attribute("inPosition", kVec2f_GrVertex
AttribType)); |
142 | 142 |
143 bool hasVertexColor = kA8_GrMaskFormat == fMaskFormat || | 143 bool hasVertexColor = kA8_GrMaskFormat == fMaskFormat || |
144 kA565_GrMaskFormat == fMaskFormat; | 144 kA565_GrMaskFormat == fMaskFormat; |
145 if (hasVertexColor) { | 145 if (hasVertexColor) { |
146 fInColor = &this->addVertexAttrib(Attribute("inColor", kVec4ub_GrVertexA
ttribType)); | 146 fInColor = &this->addVertexAttrib(Attribute("inColor", kVec4ub_GrVertexA
ttribType)); |
147 } | 147 } |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 break; | 189 break; |
190 case 2: | 190 case 2: |
191 format = kARGB_GrMaskFormat; | 191 format = kARGB_GrMaskFormat; |
192 break; | 192 break; |
193 } | 193 } |
194 | 194 |
195 return GrBitmapTextGeoProc::Make(GrRandomColor(d->fRandom), d->fTextures[tex
Idx], params, | 195 return GrBitmapTextGeoProc::Make(GrRandomColor(d->fRandom), d->fTextures[tex
Idx], params, |
196 format, GrTest::TestMatrix(d->fRandom), | 196 format, GrTest::TestMatrix(d->fRandom), |
197 d->fRandom->nextBool()); | 197 d->fRandom->nextBool()); |
198 } | 198 } |
OLD | NEW |