OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 "GrTessellator.h" | 8 #include "GrTessellator.h" |
9 | 9 |
10 #include "GrDefaultGeoProcFactory.h" | 10 #include "GrDefaultGeoProcFactory.h" |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 | 197 |
198 inline void* emit_vertex(Vertex* v, const AAParams* aaParams, void* data) { | 198 inline void* emit_vertex(Vertex* v, const AAParams* aaParams, void* data) { |
199 if (!aaParams) { | 199 if (!aaParams) { |
200 SkPoint* d = static_cast<SkPoint*>(data); | 200 SkPoint* d = static_cast<SkPoint*>(data); |
201 *d++ = v->fPoint; | 201 *d++ = v->fPoint; |
202 return d; | 202 return d; |
203 } | 203 } |
204 if (aaParams->fTweakAlpha) { | 204 if (aaParams->fTweakAlpha) { |
205 auto d = static_cast<GrDefaultGeoProcFactory::PositionColorAttr*>(data); | 205 auto d = static_cast<GrDefaultGeoProcFactory::PositionColorAttr*>(data); |
206 d->fPosition = v->fPoint; | 206 d->fPosition = v->fPoint; |
207 d->fColor = SkAlphaMulQ(aaParams->fColor, v->fAlpha); | 207 d->fColor = SkAlphaMulQ(aaParams->fColor, SkAlpha255To256(v->fAlpha)); |
208 d++; | 208 d++; |
209 return d; | 209 return d; |
210 } | 210 } |
211 auto d = static_cast<GrDefaultGeoProcFactory::PositionColorCoverageAttr*>(da
ta); | 211 auto d = static_cast<GrDefaultGeoProcFactory::PositionColorCoverageAttr*>(da
ta); |
212 d->fPosition = v->fPoint; | 212 d->fPosition = v->fPoint; |
213 d->fColor = aaParams->fColor; | 213 d->fColor = aaParams->fColor; |
214 d->fCoverage = GrNormalizeByteToFloat(v->fAlpha); | 214 d->fCoverage = GrNormalizeByteToFloat(v->fAlpha); |
215 d++; | 215 d++; |
216 return d; | 216 return d; |
217 } | 217 } |
(...skipping 1597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1815 } | 1815 } |
1816 } | 1816 } |
1817 int actualCount = static_cast<int>(vertsEnd - *verts); | 1817 int actualCount = static_cast<int>(vertsEnd - *verts); |
1818 SkASSERT(actualCount <= count); | 1818 SkASSERT(actualCount <= count); |
1819 SkASSERT(pointsEnd - points == actualCount); | 1819 SkASSERT(pointsEnd - points == actualCount); |
1820 delete[] points; | 1820 delete[] points; |
1821 return actualCount; | 1821 return actualCount; |
1822 } | 1822 } |
1823 | 1823 |
1824 } // namespace | 1824 } // namespace |
OLD | NEW |