Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(13)

Side by Side Diff: src/gpu/GrTessellator.cpp

Issue 2405813003: fix vertex alpha calculation in GrTesselator (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698