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 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 const SkMatrix& local
Matrix, | 268 const SkMatrix& local
Matrix, |
269 uint8_t coverage) { | 269 uint8_t coverage) { |
270 return DefaultGeoProc::Create(gpTypeFlags, | 270 return DefaultGeoProc::Create(gpTypeFlags, |
271 color, | 271 color, |
272 viewMatrix, | 272 viewMatrix, |
273 localMatrix, | 273 localMatrix, |
274 localCoordsWillBeRead, | 274 localCoordsWillBeRead, |
275 coverageWillBeIgnored, | 275 coverageWillBeIgnored, |
276 coverage); | 276 coverage); |
277 } | 277 } |
| 278 |
| 279 const GrGeometryProcessor* GrDefaultGeoProcFactory::Create(const Color& color, |
| 280 const Coverage& cover
age, |
| 281 LocalCoords::Type loc
alCoords, |
| 282 const SkMatrix& viewM
atrix, |
| 283 const SkMatrix& local
Matrix) { |
| 284 uint32_t flags = 0; |
| 285 flags |= color.fType == Color::kAttribute_Type ? kColor_GPType : 0; |
| 286 flags |= coverage.fType == Coverage::kAttribute_Type ? kCoverage_GPType : 0; |
| 287 flags |= localCoords == LocalCoords::kHasExplicit_Type ? kLocalCoord_GPType
: 0; |
| 288 |
| 289 uint8_t inCoverage = coverage.fCoverage; |
| 290 bool coverageWillBeIgnored = coverage.fType == Coverage::kNone_Type; |
| 291 bool localCoordsWillBeRead = localCoords != LocalCoords::kNone_Type; |
| 292 |
| 293 GrColor inColor = color.fColor; |
| 294 return DefaultGeoProc::Create(flags, |
| 295 inColor, |
| 296 viewMatrix, |
| 297 localMatrix, |
| 298 localCoordsWillBeRead, |
| 299 coverageWillBeIgnored, |
| 300 inCoverage); |
| 301 } |
OLD | NEW |