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 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 | 251 |
252 return DefaultGeoProc::Create(flags, | 252 return DefaultGeoProc::Create(flags, |
253 GrRandomColor(d->fRandom), | 253 GrRandomColor(d->fRandom), |
254 GrTest::TestMatrix(d->fRandom), | 254 GrTest::TestMatrix(d->fRandom), |
255 GrTest::TestMatrix(d->fRandom), | 255 GrTest::TestMatrix(d->fRandom), |
256 d->fRandom->nextBool(), | 256 d->fRandom->nextBool(), |
257 d->fRandom->nextBool(), | 257 d->fRandom->nextBool(), |
258 GrRandomCoverage(d->fRandom)); | 258 GrRandomCoverage(d->fRandom)); |
259 } | 259 } |
260 | 260 |
261 const GrGeometryProcessor* GrDefaultGeoProcFactory::Create(uint32_t gpTypeFlags, | |
262 GrColor color, | |
263 bool localCoordsWillB
eRead, | |
264 bool coverageWillBeIg
nored, | |
265 const SkMatrix& viewM
atrix, | |
266 const SkMatrix& local
Matrix, | |
267 uint8_t coverage) { | |
268 return DefaultGeoProc::Create(gpTypeFlags, | |
269 color, | |
270 viewMatrix, | |
271 localMatrix, | |
272 localCoordsWillBeRead, | |
273 coverageWillBeIgnored, | |
274 coverage); | |
275 } | |
276 | |
277 const GrGeometryProcessor* GrDefaultGeoProcFactory::Create(const Color& color, | 261 const GrGeometryProcessor* GrDefaultGeoProcFactory::Create(const Color& color, |
278 const Coverage& cover
age, | 262 const Coverage& cover
age, |
279 const LocalCoords& lo
calCoords, | 263 const LocalCoords& lo
calCoords, |
280 const SkMatrix& viewM
atrix) { | 264 const SkMatrix& viewM
atrix) { |
281 uint32_t flags = 0; | 265 uint32_t flags = 0; |
282 flags |= color.fType == Color::kAttribute_Type ? kColor_GPType : 0; | 266 flags |= color.fType == Color::kAttribute_Type ? kColor_GPType : 0; |
283 flags |= coverage.fType == Coverage::kAttribute_Type ? kCoverage_GPType : 0; | 267 flags |= coverage.fType == Coverage::kAttribute_Type ? kCoverage_GPType : 0; |
284 flags |= localCoords.fType == LocalCoords::kHasExplicit_Type ? kLocalCoord_G
PType : 0; | 268 flags |= localCoords.fType == LocalCoords::kHasExplicit_Type ? kLocalCoord_G
PType : 0; |
285 | 269 |
286 uint8_t inCoverage = coverage.fCoverage; | 270 uint8_t inCoverage = coverage.fCoverage; |
(...skipping 22 matching lines...) Expand all Loading... |
309 return NULL; | 293 return NULL; |
310 } | 294 } |
311 | 295 |
312 if (localCoords.hasLocalMatrix()) { | 296 if (localCoords.hasLocalMatrix()) { |
313 invert.preConcat(*localCoords.fMatrix); | 297 invert.preConcat(*localCoords.fMatrix); |
314 } | 298 } |
315 | 299 |
316 LocalCoords inverted(LocalCoords::kUsePosition_Type, &invert); | 300 LocalCoords inverted(LocalCoords::kUsePosition_Type, &invert); |
317 return Create(color, coverage, inverted); | 301 return Create(color, coverage, inverted); |
318 } | 302 } |
OLD | NEW |