| 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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 UniformHandle fColorUniform; | 86 UniformHandle fColorUniform; |
| 87 | 87 |
| 88 typedef GrGLGeometryProcessor INHERITED; | 88 typedef GrGLGeometryProcessor INHERITED; |
| 89 }; | 89 }; |
| 90 | 90 |
| 91 /////////////////////////////////////////////////////////////////////////////// | 91 /////////////////////////////////////////////////////////////////////////////// |
| 92 | 92 |
| 93 GrBitmapTextGeoProc::GrBitmapTextGeoProc(GrColor color, GrTexture* texture, | 93 GrBitmapTextGeoProc::GrBitmapTextGeoProc(GrColor color, GrTexture* texture, |
| 94 const GrTextureParams& params, bool use
ColorAttrib, | 94 const GrTextureParams& params, bool use
ColorAttrib, |
| 95 bool opaqueVertexColors, const SkMatrix
& localMatrix) | 95 bool opaqueVertexColors, const SkMatrix
& localMatrix) |
| 96 : INHERITED(color, opaqueVertexColors, localMatrix) | 96 : INHERITED(color, SkMatrix::I(), localMatrix, opaqueVertexColors) |
| 97 , fTextureAccess(texture, params) | 97 , fTextureAccess(texture, params) |
| 98 , fInColor(NULL) { | 98 , fInColor(NULL) { |
| 99 this->initClassID<GrBitmapTextGeoProc>(); | 99 this->initClassID<GrBitmapTextGeoProc>(); |
| 100 fInPosition = &this->addVertexAttrib(GrAttribute("inPosition", kVec2f_GrVert
exAttribType)); | 100 fInPosition = &this->addVertexAttrib(GrAttribute("inPosition", kVec2f_GrVert
exAttribType)); |
| 101 if (useColorAttrib) { | 101 if (useColorAttrib) { |
| 102 fInColor = &this->addVertexAttrib(GrAttribute("inColor", kVec4ub_GrVerte
xAttribType)); | 102 fInColor = &this->addVertexAttrib(GrAttribute("inColor", kVec4ub_GrVerte
xAttribType)); |
| 103 this->setHasVertexColor(); | 103 this->setHasVertexColor(); |
| 104 } | 104 } |
| 105 fInTextureCoords = &this->addVertexAttrib(GrAttribute("inTextureCoords", | 105 fInTextureCoords = &this->addVertexAttrib(GrAttribute("inTextureCoords", |
| 106 kVec2f_GrVertexAttribT
ype)); | 106 kVec2f_GrVertexAttribT
ype)); |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 kTileModes[random->nextULessThan(SK_ARRAY_COUNT(kTileModes))], | 172 kTileModes[random->nextULessThan(SK_ARRAY_COUNT(kTileModes))], |
| 173 kTileModes[random->nextULessThan(SK_ARRAY_COUNT(kTileModes))], | 173 kTileModes[random->nextULessThan(SK_ARRAY_COUNT(kTileModes))], |
| 174 }; | 174 }; |
| 175 GrTextureParams params(tileModes, random->nextBool() ? GrTextureParams::kBil
erp_FilterMode : | 175 GrTextureParams params(tileModes, random->nextBool() ? GrTextureParams::kBil
erp_FilterMode : |
| 176 GrTextureParams::kNon
e_FilterMode); | 176 GrTextureParams::kNon
e_FilterMode); |
| 177 | 177 |
| 178 return GrBitmapTextGeoProc::Create(GrRandomColor(random), textures[texIdx],
params, | 178 return GrBitmapTextGeoProc::Create(GrRandomColor(random), textures[texIdx],
params, |
| 179 random->nextBool(), random->nextBool(), | 179 random->nextBool(), random->nextBool(), |
| 180 GrProcessorUnitTest::TestMatrix(random)); | 180 GrProcessorUnitTest::TestMatrix(random)); |
| 181 } | 181 } |
| OLD | NEW |