| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 "GrDefaultGeoProcFactory.h" | 8 #include "GrDefaultGeoProcFactory.h" |
| 9 | 9 |
| 10 #include "GrInvariantOutput.h" | 10 #include "GrInvariantOutput.h" |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 bool fLocalCoordsWillBeRead; | 232 bool fLocalCoordsWillBeRead; |
| 233 bool fCoverageWillBeIgnored; | 233 bool fCoverageWillBeIgnored; |
| 234 | 234 |
| 235 GR_DECLARE_GEOMETRY_PROCESSOR_TEST; | 235 GR_DECLARE_GEOMETRY_PROCESSOR_TEST; |
| 236 | 236 |
| 237 typedef GrGeometryProcessor INHERITED; | 237 typedef GrGeometryProcessor INHERITED; |
| 238 }; | 238 }; |
| 239 | 239 |
| 240 GR_DEFINE_GEOMETRY_PROCESSOR_TEST(DefaultGeoProc); | 240 GR_DEFINE_GEOMETRY_PROCESSOR_TEST(DefaultGeoProc); |
| 241 | 241 |
| 242 GrGeometryProcessor* DefaultGeoProc::TestCreate(SkRandom* random, | 242 GrGeometryProcessor* DefaultGeoProc::TestCreate(GrProcessorTestData* d) { |
| 243 GrContext*, | |
| 244 const GrCaps& caps, | |
| 245 GrTexture*[]) { | |
| 246 uint32_t flags = 0; | 243 uint32_t flags = 0; |
| 247 if (random->nextBool()) { | 244 if (d->fRandom->nextBool()) { |
| 248 flags |= GrDefaultGeoProcFactory::kColor_GPType; | 245 flags |= GrDefaultGeoProcFactory::kColor_GPType; |
| 249 } | 246 } |
| 250 if (random->nextBool()) { | 247 if (d->fRandom->nextBool()) { |
| 251 flags |= GrDefaultGeoProcFactory::kCoverage_GPType; | 248 flags |= GrDefaultGeoProcFactory::kCoverage_GPType; |
| 252 } | 249 } |
| 253 if (random->nextBool()) { | 250 if (d->fRandom->nextBool()) { |
| 254 flags |= GrDefaultGeoProcFactory::kLocalCoord_GPType; | 251 flags |= GrDefaultGeoProcFactory::kLocalCoord_GPType; |
| 255 } | 252 } |
| 256 | 253 |
| 257 return DefaultGeoProc::Create(flags, | 254 return DefaultGeoProc::Create(flags, |
| 258 GrRandomColor(random), | 255 GrRandomColor(d->fRandom), |
| 259 GrTest::TestMatrix(random), | 256 GrTest::TestMatrix(d->fRandom), |
| 260 GrTest::TestMatrix(random), | 257 GrTest::TestMatrix(d->fRandom), |
| 261 random->nextBool(), | 258 d->fRandom->nextBool(), |
| 262 random->nextBool(), | 259 d->fRandom->nextBool(), |
| 263 GrRandomCoverage(random)); | 260 GrRandomCoverage(d->fRandom)); |
| 264 } | 261 } |
| 265 | 262 |
| 266 const GrGeometryProcessor* GrDefaultGeoProcFactory::Create(uint32_t gpTypeFlags, | 263 const GrGeometryProcessor* GrDefaultGeoProcFactory::Create(uint32_t gpTypeFlags, |
| 267 GrColor color, | 264 GrColor color, |
| 268 bool localCoordsWillB
eRead, | 265 bool localCoordsWillB
eRead, |
| 269 bool coverageWillBeIg
nored, | 266 bool coverageWillBeIg
nored, |
| 270 const SkMatrix& viewM
atrix, | 267 const SkMatrix& viewM
atrix, |
| 271 const SkMatrix& local
Matrix, | 268 const SkMatrix& local
Matrix, |
| 272 uint8_t coverage) { | 269 uint8_t coverage) { |
| 273 return DefaultGeoProc::Create(gpTypeFlags, | 270 return DefaultGeoProc::Create(gpTypeFlags, |
| 274 color, | 271 color, |
| 275 viewMatrix, | 272 viewMatrix, |
| 276 localMatrix, | 273 localMatrix, |
| 277 localCoordsWillBeRead, | 274 localCoordsWillBeRead, |
| 278 coverageWillBeIgnored, | 275 coverageWillBeIgnored, |
| 279 coverage); | 276 coverage); |
| 280 } | 277 } |
| OLD | NEW |