DescriptionFix off-by-one error in RasterShape of CSS shapes
Be consistent about using end-point exclusive intervals. Before this
patch we created an end-point _inclusive_ interval when scanning to
then end of the line, but an end-point _exclusive_ when ending an
interval somewhere along the scan-line because of a triggered alpha
channel threshold.
Examples:
01234..
[XXXXXXXXXXXXXXXXXXXX] (X means above alpha channel threshold)
would create the interval 0-19. Since we haven't triggered the alpha
channel threshold, and x points at the last index (19) the end point
is included in the interval and we're supposedly creating an end-point
inclusive interval.
But in the other case:
01234..
[XXXXXXXXXX..........]
would create the interval 0-10, because when we notice that the alpha
channel threshold doesn't hold, we're already outside the interval,
and x is excluded from the interval meaning we supposedly want to
create a end-point exclusive interval.
To make up for the end-point inclusive intervals,
RasterShape::getExcludedIntervals added an increment to get end-point
exclusive intervals, since that is what the caller of
getExcludedIntervals expects. This obviously broke the other case. We
did have a test for the other case, but the off-by-one error was
accounted for in the test.
After this patch, Shape::createRasterShape always creates end-point
exclusive intervals so we can remove the increment and fix the test.
BUG=363126
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=171569
Patch Set 1 #Patch Set 2 : Address review comment and rename variable for consistency #
Total comments: 2
Patch Set 3 : Add missing space #
Messages
Total messages: 7 (0 generated)
|