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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 // we don't do text positioning in batch, so we can't quite do that yet. | 139 // we don't do text positioning in batch, so we can't quite do that yet. |
140 bool hasVertexColor = kA8_GrMaskFormat == fMaskFormat; | 140 bool hasVertexColor = kA8_GrMaskFormat == fMaskFormat; |
141 if (hasVertexColor) { | 141 if (hasVertexColor) { |
142 fInColor = &this->addVertexAttrib(Attribute("inColor", kVec4ub_GrVertexA
ttribType)); | 142 fInColor = &this->addVertexAttrib(Attribute("inColor", kVec4ub_GrVertexA
ttribType)); |
143 } | 143 } |
144 fInTextureCoords = &this->addVertexAttrib(Attribute("inTextureCoords", | 144 fInTextureCoords = &this->addVertexAttrib(Attribute("inTextureCoords", |
145 kVec2s_GrVertexAttribTyp
e)); | 145 kVec2s_GrVertexAttribTyp
e)); |
146 this->addTextureAccess(&fTextureAccess); | 146 this->addTextureAccess(&fTextureAccess); |
147 } | 147 } |
148 | 148 |
149 void GrBitmapTextGeoProc::getGLProcessorKey(const GrGLSLCaps& caps,GrProcessorKe
yBuilder* b) const { | 149 void GrBitmapTextGeoProc::getGLSLProcessorKey(const GrGLSLCaps& caps, |
| 150 GrProcessorKeyBuilder* b) const { |
150 GrGLBitmapTextGeoProc::GenKey(*this, caps, b); | 151 GrGLBitmapTextGeoProc::GenKey(*this, caps, b); |
151 } | 152 } |
152 | 153 |
153 GrGLSLPrimitiveProcessor* GrBitmapTextGeoProc::createGLInstance(const GrGLSLCaps
& caps) const { | 154 GrGLSLPrimitiveProcessor* GrBitmapTextGeoProc::createGLSLInstance(const GrGLSLCa
ps& caps) const { |
154 return new GrGLBitmapTextGeoProc(); | 155 return new GrGLBitmapTextGeoProc(); |
155 } | 156 } |
156 | 157 |
157 /////////////////////////////////////////////////////////////////////////////// | 158 /////////////////////////////////////////////////////////////////////////////// |
158 | 159 |
159 GR_DEFINE_GEOMETRY_PROCESSOR_TEST(GrBitmapTextGeoProc); | 160 GR_DEFINE_GEOMETRY_PROCESSOR_TEST(GrBitmapTextGeoProc); |
160 | 161 |
161 const GrGeometryProcessor* GrBitmapTextGeoProc::TestCreate(GrProcessorTestData*
d) { | 162 const GrGeometryProcessor* GrBitmapTextGeoProc::TestCreate(GrProcessorTestData*
d) { |
162 int texIdx = d->fRandom->nextBool() ? GrProcessorUnitTest::kSkiaPMTextureIdx
: | 163 int texIdx = d->fRandom->nextBool() ? GrProcessorUnitTest::kSkiaPMTextureIdx
: |
163 GrProcessorUnitTest::kAlphaTextureIdx; | 164 GrProcessorUnitTest::kAlphaTextureIdx; |
(...skipping 19 matching lines...) Expand all Loading... |
183 break; | 184 break; |
184 case 2: | 185 case 2: |
185 format = kARGB_GrMaskFormat; | 186 format = kARGB_GrMaskFormat; |
186 break; | 187 break; |
187 } | 188 } |
188 | 189 |
189 return GrBitmapTextGeoProc::Create(GrRandomColor(d->fRandom), d->fTextures[t
exIdx], params, | 190 return GrBitmapTextGeoProc::Create(GrRandomColor(d->fRandom), d->fTextures[t
exIdx], params, |
190 format, GrTest::TestMatrix(d->fRandom), | 191 format, GrTest::TestMatrix(d->fRandom), |
191 d->fRandom->nextBool()); | 192 d->fRandom->nextBool()); |
192 } | 193 } |
OLD | NEW |