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

Unified Diff: Source/core/rendering/shapes/RasterShape.cpp

Issue 237313003: CSS shapes support in Web Inspector (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Code review comment and add test Created 6 years, 8 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
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);

Powered by Google App Engine
This is Rietveld 408576698