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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 | 120 |
121 /////////////////////////////////////////////////////////////////////////////// | 121 /////////////////////////////////////////////////////////////////////////////// |
122 | 122 |
123 GrBitmapTextGeoProc::GrBitmapTextGeoProc(GrColor color, GrTexture* texture, | 123 GrBitmapTextGeoProc::GrBitmapTextGeoProc(GrColor color, GrTexture* texture, |
124 const GrTextureParams& params, GrMaskFo
rmat format, | 124 const GrTextureParams& params, GrMaskFo
rmat format, |
125 const SkMatrix& localMatrix, bool usesL
ocalCoords) | 125 const SkMatrix& localMatrix, bool usesL
ocalCoords) |
126 : fColor(color) | 126 : fColor(color) |
127 , fLocalMatrix(localMatrix) | 127 , fLocalMatrix(localMatrix) |
128 , fUsesLocalCoords(usesLocalCoords) | 128 , fUsesLocalCoords(usesLocalCoords) |
129 , fTextureAccess(texture, params) | 129 , fTextureAccess(texture, params) |
130 , fInColor(NULL) | 130 , fInColor(nullptr) |
131 , fMaskFormat(format) { | 131 , fMaskFormat(format) { |
132 this->initClassID<GrBitmapTextGeoProc>(); | 132 this->initClassID<GrBitmapTextGeoProc>(); |
133 fInPosition = &this->addVertexAttrib(Attribute("inPosition", kVec2f_GrVertex
AttribType)); | 133 fInPosition = &this->addVertexAttrib(Attribute("inPosition", kVec2f_GrVertex
AttribType)); |
134 | 134 |
135 // TODO we could think about removing this attribute if color is ignored, bu
t unfortunately | 135 // TODO we could think about removing this attribute if color is ignored, bu
t unfortunately |
136 // we don't do text positioning in batch, so we can't quite do that yet. | 136 // we don't do text positioning in batch, so we can't quite do that yet. |
137 bool hasVertexColor = kA8_GrMaskFormat == fMaskFormat; | 137 bool hasVertexColor = kA8_GrMaskFormat == fMaskFormat; |
138 if (hasVertexColor) { | 138 if (hasVertexColor) { |
139 fInColor = &this->addVertexAttrib(Attribute("inColor", kVec4ub_GrVertexA
ttribType)); | 139 fInColor = &this->addVertexAttrib(Attribute("inColor", kVec4ub_GrVertexA
ttribType)); |
140 } | 140 } |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 break; | 184 break; |
185 case 2: | 185 case 2: |
186 format = kARGB_GrMaskFormat; | 186 format = kARGB_GrMaskFormat; |
187 break; | 187 break; |
188 } | 188 } |
189 | 189 |
190 return GrBitmapTextGeoProc::Create(GrRandomColor(d->fRandom), d->fTextures[t
exIdx], params, | 190 return GrBitmapTextGeoProc::Create(GrRandomColor(d->fRandom), d->fTextures[t
exIdx], params, |
191 format, GrTest::TestMatrix(d->fRandom), | 191 format, GrTest::TestMatrix(d->fRandom), |
192 d->fRandom->nextBool()); | 192 d->fRandom->nextBool()); |
193 } | 193 } |
OLD | NEW |