| 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 24 matching lines...) Expand all Loading... |
| 35 } | 35 } |
| 36 | 36 |
| 37 const char* name() const SK_OVERRIDE { return "DefaultGeometryProcessor"; } | 37 const char* name() const SK_OVERRIDE { return "DefaultGeometryProcessor"; } |
| 38 | 38 |
| 39 const Attribute* inPosition() const { return fInPosition; } | 39 const Attribute* inPosition() const { return fInPosition; } |
| 40 const Attribute* inColor() const { return fInColor; } | 40 const Attribute* inColor() const { return fInColor; } |
| 41 const Attribute* inLocalCoords() const { return fInLocalCoords; } | 41 const Attribute* inLocalCoords() const { return fInLocalCoords; } |
| 42 const Attribute* inCoverage() const { return fInCoverage; } | 42 const Attribute* inCoverage() const { return fInCoverage; } |
| 43 uint8_t coverage() const { return fCoverage; } | 43 uint8_t coverage() const { return fCoverage; } |
| 44 | 44 |
| 45 void initBatchTracker(GrBatchTracker* bt, const InitBT& init) const SK_OVERR
IDE { | 45 void initBatchTracker(GrBatchTracker* bt, const GrPipelineInfo& init) const
SK_OVERRIDE { |
| 46 BatchTracker* local = bt->cast<BatchTracker>(); | 46 BatchTracker* local = bt->cast<BatchTracker>(); |
| 47 local->fInputColorType = GetColorInputType(&local->fColor, this->color()
, init, | 47 local->fInputColorType = GetColorInputType(&local->fColor, this->color()
, init, |
| 48 SkToBool(fInColor)); | 48 SkToBool(fInColor)); |
| 49 | 49 |
| 50 bool hasVertexCoverage = SkToBool(fInCoverage) && !init.fCoverageIgnored
; | 50 bool hasVertexCoverage = SkToBool(fInCoverage) && !init.fCoverageIgnored
; |
| 51 bool covIsSolidWhite = !hasVertexCoverage && 0xff == this->coverage(); | 51 bool covIsSolidWhite = !hasVertexCoverage && 0xff == this->coverage(); |
| 52 if (covIsSolidWhite) { | 52 if (covIsSolidWhite) { |
| 53 local->fInputCoverageType = kAllOnes_GrGPInput; | 53 local->fInputCoverageType = kAllOnes_GrGPInput; |
| 54 } else if (!hasVertexCoverage) { | 54 } else if (!hasVertexCoverage) { |
| 55 local->fInputCoverageType = kUniform_GrGPInput; | 55 local->fInputCoverageType = kUniform_GrGPInput; |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 282 const SkMatrix& local
Matrix, | 282 const SkMatrix& local
Matrix, |
| 283 bool opaqueVertexColo
rs, | 283 bool opaqueVertexColo
rs, |
| 284 uint8_t coverage) { | 284 uint8_t coverage) { |
| 285 return DefaultGeoProc::Create(gpTypeFlags, | 285 return DefaultGeoProc::Create(gpTypeFlags, |
| 286 color, | 286 color, |
| 287 viewMatrix, | 287 viewMatrix, |
| 288 localMatrix, | 288 localMatrix, |
| 289 opaqueVertexColors, | 289 opaqueVertexColors, |
| 290 coverage); | 290 coverage); |
| 291 } | 291 } |
| OLD | NEW |