| 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 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 GrGLPrimitiveProcessor* | 152 GrGLPrimitiveProcessor* |
| 153 GrBitmapTextGeoProc::createGLInstance(const GrBatchTracker& bt, | 153 GrBitmapTextGeoProc::createGLInstance(const GrBatchTracker& bt, |
| 154 const GrGLSLCaps& caps) const { | 154 const GrGLSLCaps& caps) const { |
| 155 return new GrGLBitmapTextGeoProc(*this, bt); | 155 return new GrGLBitmapTextGeoProc(*this, bt); |
| 156 } | 156 } |
| 157 | 157 |
| 158 /////////////////////////////////////////////////////////////////////////////// | 158 /////////////////////////////////////////////////////////////////////////////// |
| 159 | 159 |
| 160 GR_DEFINE_GEOMETRY_PROCESSOR_TEST(GrBitmapTextGeoProc); | 160 GR_DEFINE_GEOMETRY_PROCESSOR_TEST(GrBitmapTextGeoProc); |
| 161 | 161 |
| 162 const GrGeometryProcessor* GrBitmapTextGeoProc::TestCreate(GrProcessorTestData*
d) { | 162 GrGeometryProcessor* GrBitmapTextGeoProc::TestCreate(GrProcessorTestData* d) { |
| 163 int texIdx = d->fRandom->nextBool() ? GrProcessorUnitTest::kSkiaPMTextureIdx
: | 163 int texIdx = d->fRandom->nextBool() ? GrProcessorUnitTest::kSkiaPMTextureIdx
: |
| 164 GrProcessorUnitTest::kAlphaTextureIdx; | 164 GrProcessorUnitTest::kAlphaTextureIdx; |
| 165 static const SkShader::TileMode kTileModes[] = { | 165 static const SkShader::TileMode kTileModes[] = { |
| 166 SkShader::kClamp_TileMode, | 166 SkShader::kClamp_TileMode, |
| 167 SkShader::kRepeat_TileMode, | 167 SkShader::kRepeat_TileMode, |
| 168 SkShader::kMirror_TileMode, | 168 SkShader::kMirror_TileMode, |
| 169 }; | 169 }; |
| 170 SkShader::TileMode tileModes[] = { | 170 SkShader::TileMode tileModes[] = { |
| 171 kTileModes[d->fRandom->nextULessThan(SK_ARRAY_COUNT(kTileModes))], | 171 kTileModes[d->fRandom->nextULessThan(SK_ARRAY_COUNT(kTileModes))], |
| 172 kTileModes[d->fRandom->nextULessThan(SK_ARRAY_COUNT(kTileModes))], | 172 kTileModes[d->fRandom->nextULessThan(SK_ARRAY_COUNT(kTileModes))], |
| (...skipping 11 matching lines...) Expand all 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 |