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

Unified Diff: src/gpu/GrRectanizer_skyline.cpp

Issue 324693002: Add some comments to GrRectanizer_skyline (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/GrRectanizer_skyline.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrRectanizer_skyline.cpp
diff --git a/src/gpu/GrRectanizer_skyline.cpp b/src/gpu/GrRectanizer_skyline.cpp
index b759cb22ac439ed087c66e74eb649586fd356090..44da1c326a1295fc20c9b071f4b4fba004a531c1 100755
--- a/src/gpu/GrRectanizer_skyline.cpp
+++ b/src/gpu/GrRectanizer_skyline.cpp
@@ -81,8 +81,9 @@ void GrRectanizerSkyline::addSkylineLevel(int skylineIndex, int x, int y, int wi
SkASSERT(newSegment.fX + newSegment.fWidth <= this->width());
SkASSERT(newSegment.fY <= this->height());
- // delete width of this skyline segment from following ones
+ // delete width of the new skyline segment from following ones
for (int i = skylineIndex+1; i < fSkyline.count(); ++i) {
+ // The new segment subsumes all or part of fSkyline[i]
SkASSERT(fSkyline[i-1].fX <= fSkyline[i].fX);
if (fSkyline[i].fX < fSkyline[i-1].fX + fSkyline[i-1].fWidth) {
@@ -92,9 +93,11 @@ void GrRectanizerSkyline::addSkylineLevel(int skylineIndex, int x, int y, int wi
fSkyline[i].fWidth -= shrink;
if (fSkyline[i].fWidth <= 0) {
+ // fully consumed
fSkyline.remove(i);
--i;
} else {
+ // only partially consumed
break;
}
} else {
« no previous file with comments | « src/gpu/GrRectanizer_skyline.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698