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

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

Issue 454123002: Refactor getExcludedIntervals since only one LineSegment is ever returned (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 4 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 64c5a96a383fd39f350f29e7b869047c0d6db857..958ffab8eab9e773cdb53c1cf43e9b482e9f231d 100644
--- a/Source/core/rendering/shapes/RasterShape.cpp
+++ b/Source/core/rendering/shapes/RasterShape.cpp
@@ -150,17 +150,17 @@ const RasterShapeIntervals& RasterShape::marginIntervals() const
return *m_marginIntervals;
}
-void RasterShape::getExcludedIntervals(LayoutUnit logicalTop, LayoutUnit logicalHeight, SegmentList& result) const
+LineSegment RasterShape::getExcludedInterval(LayoutUnit logicalTop, LayoutUnit logicalHeight) const
{
const RasterShapeIntervals& intervals = marginIntervals();
if (intervals.isEmpty())
- return;
+ return LineSegment();
int y1 = logicalTop;
int y2 = logicalTop + logicalHeight;
ASSERT(y2 >= y1);
if (y2 < intervals.bounds().y() || y1 >= intervals.bounds().maxY())
- return;
+ return LineSegment();
y1 = std::max(y1, intervals.bounds().y());
y2 = std::min(y2, intervals.bounds().maxY());
@@ -176,7 +176,7 @@ void RasterShape::getExcludedIntervals(LayoutUnit logicalTop, LayoutUnit logical
// Note: |marginIntervals()| returns end-point exclusive
// intervals. |excludedInterval.x2()| contains the left-most pixel
// offset to the right of the calculated union.
- result.append(LineSegment(excludedInterval.x1(), excludedInterval.x2()));
+ return LineSegment(excludedInterval.x1(), excludedInterval.x2());
}
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698