aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrRectanizer_skyline.cpp
diff options
context:
space:
mode:
authorGravatar robertphillips <robertphillips@google.com>2014-06-09 07:59:25 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-06-09 07:59:25 -0700
commit4cbf8e3dce10ef0d06e5ef95ea88b084bbad2553 (patch)
treee9c1d6a360236b3eea3d1cba83bd5f1d6cc30456 /src/gpu/GrRectanizer_skyline.cpp
parentb6b02526438d6839481fb40ccf610d28f7652397 (diff)
Add some comments to GrRectanizer_skyline
R=jvanverth@google.com Author: robertphillips@google.com Review URL: https://codereview.chromium.org/324693002
Diffstat (limited to 'src/gpu/GrRectanizer_skyline.cpp')
-rwxr-xr-xsrc/gpu/GrRectanizer_skyline.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gpu/GrRectanizer_skyline.cpp b/src/gpu/GrRectanizer_skyline.cpp
index b759cb22ac..44da1c326a 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 {