Fix 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

Review URL: https://codereview.chromium.org/237123002

git-svn-id: svn://svn.chromium.org/blink/trunk@171569 bbb929c8-8fbe-4397-9dbb-9b2b20218538
3 files changed
tree: 62a61080f353196413c31605b17ce421d128dff0
  1. third_party/