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

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

Issue 212223006: [CSS Shapes] Simplify RasterShape implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix style errors Created 6 years, 9 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
« no previous file with comments | « no previous file | Source/core/rendering/shapes/RasterShape.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/shapes/RasterShape.h
diff --git a/Source/core/rendering/shapes/RasterShape.h b/Source/core/rendering/shapes/RasterShape.h
index a5eb84570d7d15bde1d134ba293a6eee681c09b1..c66de8472bab1466ab7522134c27de4922e3f879 100644
--- a/Source/core/rendering/shapes/RasterShape.h
+++ b/Source/core/rendering/shapes/RasterShape.h
@@ -43,48 +43,37 @@ public:
RasterShapeIntervals(unsigned size, int offset = 0)
: m_offset(offset)
{
- m_intervalLists.resize(size);
+ m_intervals.resize(size);
}
+ void initializeBounds();
const IntRect& bounds() const { return m_bounds; }
bool isEmpty() const { return m_bounds.isEmpty(); }
- void appendInterval(int y, int x1, int x2);
- void getExcludedIntervals(int y1, int y2, IntShapeIntervals& result) const;
+ IntShapeInterval& intervalAt(int y)
+ {
+ ASSERT(y + m_offset >= 0 && static_cast<unsigned>(y + m_offset) < m_intervals.size());
+ return m_intervals[y + m_offset];
+ }
+
+ const IntShapeInterval& intervalAt(int y) const
+ {
+ ASSERT(y + m_offset >= 0 && static_cast<unsigned>(y + m_offset) < m_intervals.size());
+ return m_intervals[y + m_offset];
+ }
PassOwnPtr<RasterShapeIntervals> computeShapeMarginIntervals(int shapeMargin) const;
void buildBoundsPath(Path&) const;
private:
- int size() const { return m_intervalLists.size(); }
+ int size() const { return m_intervals.size(); }
int offset() const { return m_offset; }
int minY() const { return -m_offset; }
- int maxY() const { return -m_offset + m_intervalLists.size(); }
-
- IntShapeIntervals& intervalsAt(int y)
- {
- ASSERT(y + m_offset >= 0 && static_cast<unsigned>(y + m_offset) < m_intervalLists.size());
- return m_intervalLists[y + m_offset];
- }
-
- const IntShapeIntervals& intervalsAt(int y) const
- {
- ASSERT(y + m_offset >= 0 && static_cast<unsigned>(y + m_offset) < m_intervalLists.size());
- return m_intervalLists[y + m_offset];
- }
-
- IntShapeInterval limitIntervalAt(int y) const
- {
- const IntShapeIntervals& intervals = intervalsAt(y);
- return intervals.size() ? IntShapeInterval(intervals[0].x1(), intervals.last().x2()) : IntShapeInterval();
- }
+ int maxY() const { return -m_offset + m_intervals.size(); }
- bool contains(const IntRect&) const;
- bool getIntervalX1Values(int minY, int maxY, int minIntervalWidth, Vector<int>& result) const;
- void uniteMarginInterval(int y, const IntShapeInterval&);
IntRect m_bounds;
- Vector<IntShapeIntervals> m_intervalLists;
+ Vector<IntShapeInterval> m_intervals;
int m_offset;
};
@@ -95,6 +84,7 @@ public:
: m_intervals(intervals)
, m_marginRectSize(marginRectSize)
{
+ m_intervals->initializeBounds();
}
virtual LayoutRect shapeMarginLogicalBoundingBox() const OVERRIDE { return static_cast<LayoutRect>(marginIntervals().bounds()); }
« no previous file with comments | « no previous file | Source/core/rendering/shapes/RasterShape.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698