Chromium Code Reviews| 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..190c72e541af9696cd52def610fe38995ab66003 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()); |
|
eseidel
2014/04/02 19:59:11
RELEASE_ASSERT? I guess the Vector already does t
|
| + 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()); } |