Changeset 106408 in webkit
- Timestamp:
- Jan 31, 2012 3:36:06 PM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r106406 r106408 1 2012-01-31 Dana Jansens <danakj@chromium.org> 2 3 Add contains() test to Region 4 https://bugs.webkit.org/show_bug.cgi?id=72294 5 6 Reviewed by Anders Carlsson. 7 8 * platform/graphics/Region.cpp: 9 (WebCore::Region::contains): 10 (WebCore): 11 * platform/graphics/Region.h: 12 (Region): 13 (Shape): 14 (WebCore::operator==): 15 (WebCore): 16 1 17 2012-01-31 Sami Kyostila <skyostil@chromium.org> 2 18 -
trunk/Source/WebCore/platform/graphics/Region.cpp
r95901 r106408 66 66 } 67 67 68 bool Region::contains(const Region& region) const 69 { 70 return WebCore::intersect(region, *this) == region; 71 } 72 68 73 Region::Shape::Shape() 69 74 { -
trunk/Source/WebCore/platform/graphics/Region.h
r95901 r106408 47 47 48 48 void translate(const IntSize&); 49 50 // Returns true if the query region is a subset of this region. 51 bool contains(const Region&) const; 49 52 50 53 #ifndef NDEBUG … … 105 108 bool canCoalesce(SegmentIterator begin, SegmentIterator end); 106 109 107 // FIXME: These vectors should have inline sizes. Figure out a good optimal value. 108 Vector<int> m_segments; 109 Vector<Span> m_spans; 110 Vector<int, 32> m_segments; 111 Vector<Span, 16> m_spans; 112 113 friend bool operator==(const Shape&, const Shape&); 110 114 }; 111 115 112 116 IntRect m_bounds; 113 117 Shape m_shape; 118 119 friend bool operator==(const Region&, const Region&); 120 friend bool operator==(const Shape&, const Shape&); 121 friend bool operator==(const Span&, const Span&); 114 122 }; 115 123 … … 138 146 } 139 147 148 inline bool operator==(const Region& a, const Region& b) 149 { 150 return a.m_bounds == b.m_bounds && a.m_shape == b.m_shape; 151 } 152 153 inline bool operator==(const Region::Shape& a, const Region::Shape& b) 154 { 155 return a.m_spans == b.m_spans && a.m_segments == b.m_segments; 156 } 157 158 inline bool operator==(const Region::Span& a, const Region::Span& b) 159 { 160 return a.y == b.y && a.segmentIndex == b.segmentIndex; 161 } 162 140 163 } // namespace WebCore 141 164
Note: See TracChangeset
for help on using the changeset viewer.