Chromium Code Reviews| Index: Source/core/rendering/shapes/RasterShape.cpp |
| diff --git a/Source/core/rendering/shapes/RasterShape.cpp b/Source/core/rendering/shapes/RasterShape.cpp |
| index 2caf3ec295ae952d83a2a57a5013db8ae96e0c08..a8480b865049d31121c648f6a14246b4c9f927fa 100644 |
| --- a/Source/core/rendering/shapes/RasterShape.cpp |
| +++ b/Source/core/rendering/shapes/RasterShape.cpp |
| @@ -118,6 +118,23 @@ void RasterShapeIntervals::initializeBounds() |
| } |
| } |
| +void RasterShapeIntervals::buildBoundsPath(Path& path) const |
| +{ |
| + for (int y = bounds().y(); y < bounds().maxY(); y++) { |
|
apavlov
2014/04/17 16:11:32
You've got two loops using bounds().maxY() in the
Habib Virji
2014/04/17 16:27:02
Done.
|
| + if (intervalAt(y).isEmpty()) |
| + continue; |
| + |
| + IntShapeInterval extent = intervalAt(y); |
| + int endY = y + 1; |
|
apavlov
2014/04/17 16:11:32
This could easily go into the for-initializer
apavlov
2014/04/17 16:12:26
Sorry, it's not visible outside the loop, unlike i
|
| + for (; endY < bounds().maxY(); endY++) { |
| + if (intervalAt(endY).isEmpty() || intervalAt(endY) != extent) |
| + break; |
| + } |
| + path.addRect(FloatRect(extent.x1(), y, extent.width(), endY - y)); |
| + y = endY - 1; |
| + } |
| +} |
| + |
| const RasterShapeIntervals& RasterShape::marginIntervals() const |
| { |
| ASSERT(shapeMargin() >= 0); |