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