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

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

Issue 2146063002: Fix vertex count estimate in GrTessellator. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 5 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 "GrPathUtils.h" 10 #include "GrPathUtils.h"
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after
428 fTail->addEdge(e); 428 fTail->addEdge(e);
429 fCount++; 429 fCount++;
430 if (partner) { 430 if (partner) {
431 partner->addEdge(e, side, alloc); 431 partner->addEdge(e, side, alloc);
432 poly = partner; 432 poly = partner;
433 } else { 433 } else {
434 MonotonePoly* m = ALLOC_NEW(MonotonePoly, (e, side), alloc); 434 MonotonePoly* m = ALLOC_NEW(MonotonePoly, (e, side), alloc);
435 m->fPrev = fTail; 435 m->fPrev = fTail;
436 fTail->fNext = m; 436 fTail->fNext = m;
437 fTail = m; 437 fTail = m;
438 fCount += 2;
439 } 438 }
440 } 439 }
441 return poly; 440 return poly;
442 } 441 }
443 SkPoint* emit(SkPoint *data) { 442 SkPoint* emit(SkPoint *data) {
444 if (fCount < 3) { 443 if (fCount < 3) {
445 return data; 444 return data;
446 } 445 }
447 LOG("emit() %d, size %d\n", fID, fCount); 446 LOG("emit() %d, size %d\n", fID, fCount);
448 for (MonotonePoly* m = fHead; m != nullptr; m = m->fNext) { 447 for (MonotonePoly* m = fHead; m != nullptr; m = m->fNext) {
(...skipping 992 matching lines...) Expand 10 before | Expand all | Expand 10 after
1441 } 1440 }
1442 } 1441 }
1443 int actualCount = static_cast<int>(vertsEnd - *verts); 1442 int actualCount = static_cast<int>(vertsEnd - *verts);
1444 SkASSERT(actualCount <= count); 1443 SkASSERT(actualCount <= count);
1445 SkASSERT(pointsEnd - points == actualCount); 1444 SkASSERT(pointsEnd - points == actualCount);
1446 delete[] points; 1445 delete[] points;
1447 return actualCount; 1446 return actualCount;
1448 } 1447 }
1449 1448
1450 } // namespace 1449 } // 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