| 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 "GrDrawState.h" | 10 #include "GrDrawState.h" |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 kFloat_GrVertexAttr
ibType)); | 121 kFloat_GrVertexAttr
ibType)); |
| 122 this->setHasVertexCoverage(); | 122 this->setHasVertexCoverage(); |
| 123 } | 123 } |
| 124 } | 124 } |
| 125 | 125 |
| 126 virtual bool onIsEqual(const GrGeometryProcessor& other) const SK_OVERRIDE { | 126 virtual bool onIsEqual(const GrGeometryProcessor& other) const SK_OVERRIDE { |
| 127 const DefaultGeoProc& gp = other.cast<DefaultGeoProc>(); | 127 const DefaultGeoProc& gp = other.cast<DefaultGeoProc>(); |
| 128 return gp.fFlags == this->fFlags; | 128 return gp.fFlags == this->fFlags; |
| 129 } | 129 } |
| 130 | 130 |
| 131 virtual void onGetInvariantOutputCoverage(GrInitInvariantOutput* out) const
SK_OVERRIDE { | 131 virtual void onComputeInvariantOutput(GrInvariantOutput* inout) const SK_OVE
RRIDE { |
| 132 if (fInCoverage) { | 132 if (fInCoverage) { |
| 133 out->setUnknownSingleComponent(); | 133 inout->mulByUnknownAlpha(); |
| 134 } else { | 134 } else { |
| 135 // uniform coverage | 135 inout->mulByKnownAlpha(255); |
| 136 out->setKnownSingleComponent(this->coverage()); | |
| 137 } | 136 } |
| 138 } | 137 } |
| 139 | 138 |
| 140 const GrAttribute* fInPosition; | 139 const GrAttribute* fInPosition; |
| 141 const GrAttribute* fInColor; | 140 const GrAttribute* fInColor; |
| 142 const GrAttribute* fInLocalCoords; | 141 const GrAttribute* fInLocalCoords; |
| 143 const GrAttribute* fInCoverage; | 142 const GrAttribute* fInCoverage; |
| 144 uint32_t fFlags; | 143 uint32_t fFlags; |
| 145 | 144 |
| 146 GR_DECLARE_GEOMETRY_PROCESSOR_TEST; | 145 GR_DECLARE_GEOMETRY_PROCESSOR_TEST; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 165 flags |= GrDefaultGeoProcFactory::kLocalCoord_GPType; | 164 flags |= GrDefaultGeoProcFactory::kLocalCoord_GPType; |
| 166 } | 165 } |
| 167 | 166 |
| 168 return DefaultGeoProc::Create(GrRandomColor(random), GrRandomCoverage(random
), flags); | 167 return DefaultGeoProc::Create(GrRandomColor(random), GrRandomCoverage(random
), flags); |
| 169 } | 168 } |
| 170 | 169 |
| 171 const GrGeometryProcessor* GrDefaultGeoProcFactory::Create(GrColor color, uint32
_t gpTypeFlags, | 170 const GrGeometryProcessor* GrDefaultGeoProcFactory::Create(GrColor color, uint32
_t gpTypeFlags, |
| 172 uint8_t coverage) { | 171 uint8_t coverage) { |
| 173 return DefaultGeoProc::Create(color, coverage, gpTypeFlags); | 172 return DefaultGeoProc::Create(color, coverage, gpTypeFlags); |
| 174 } | 173 } |
| OLD | NEW |