Changeset 154152 in webkit
- Timestamp:
- Aug 15, 2013 4:47:18 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r154150 r154152 1 2013-08-15 Hans Muller <hmuller@adobe.com> 2 3 [CSS Shapes] Add support for shape-outside image values 4 https://bugs.webkit.org/show_bug.cgi?id=119809 5 6 Two tests to verify that the initial implementation of shape valued images is working 7 for shape-outside. 8 9 Reviewed by Alexandru Chiculita. 10 11 * fast/shapes/shape-outside-floats/shape-outside-floats-image-001-expected.html: Added. 12 * fast/shapes/shape-outside-floats/shape-outside-floats-image-001.html: Added. 13 * fast/shapes/shape-outside-floats/shape-outside-floats-image-002-expected.html: Added. 14 * fast/shapes/shape-outside-floats/shape-outside-floats-image-002.html: Added. 15 1 16 2013-08-15 Ryosuke Niwa <rniwa@webkit.org> 2 17 -
trunk/Source/WebCore/ChangeLog
r154147 r154152 1 2013-08-15 Hans Muller <hmuller@adobe.com> 2 3 [CSS Shapes] Add support for shape-outside image values 4 https://bugs.webkit.org/show_bug.cgi?id=119809 5 6 Added minimal support for shape-outside image values. A new method that computes 7 the excluded intervals for a horizontal line segment was added to the RasterIntervals 8 class. The stub RasterShape getExcludedIntervals() method has been replaced by 9 one that uses the new method. 10 11 Image shapes are represented by a RasterIntervals object, which just encapsulates a 12 Region object. The new getExcludedIntervals() method computes the excluded intervals 13 for a horizontal line segment between y1 and y2. To find the excluded intervals we 14 vertically expand each of the image shape Region's rectangles that fall within the line 15 segment, so that they begin at y1 and have height = y2 - y1. The union of the expanded 16 rectangles produces a new Region whose horizontal projection defines the excluded intervals. 17 18 Reviewed by Alexandru Chiculita. 19 20 Tests: fast/shapes/shape-outside-floats/shape-outside-floats-image-001.html 21 fast/shapes/shape-outside-floats/shape-outside-floats-image-002.html 22 23 * rendering/shapes/RasterShape.cpp: 24 (WebCore::RasterShapeIntervals::getExcludedIntervals): See above. 25 (WebCore::RasterShape::getExcludedIntervals): Stub method has been replaced by one that uses RasterShapeIntervals::getExcludedIntervals(). 26 * rendering/shapes/RasterShape.h: 27 * rendering/shapes/ShapeOutsideInfo.cpp: 28 (WebCore::ShapeOutsideInfo::isEnabledFor): Enable Image valued shapes. 29 1 30 2013-08-15 Simon Fraser <simon.fraser@apple.com> 2 31 -
trunk/Source/WebCore/rendering/shapes/RasterShape.cpp
r154081 r154152 89 89 } 90 90 91 void RasterShapeIntervals::getExcludedIntervals(int y1, int y2, SegmentList& result) const 92 { 93 ASSERT(y2 >= y1); 94 95 IntRect lineRect(bounds().x(), y1, bounds().width(), y2 - y1); 96 Region lineRegion(lineRect); 97 lineRegion.intersect(m_region); 98 if (lineRegion.isEmpty()) 99 return; 100 101 Vector<IntRect> lineRects = lineRegion.rects(); 102 ASSERT(lineRects.size() > 0); 103 104 Region segmentsRegion; 105 for (unsigned i = 0; i < lineRects.size(); i++) 106 segmentsRegion.unite(Region(alignedRect(lineRects[i], y1, y2))); 107 108 Vector<IntRect> segmentRects = segmentsRegion.rects(); 109 for (unsigned i = 0; i < segmentRects.size(); i++) 110 result.append(LineSegment(segmentRects[i].x(), segmentRects[i].maxX() + 1)); 111 } 112 91 113 const RasterShapeIntervals& RasterShape::marginIntervals() const 92 114 { … … 109 131 } 110 132 111 void RasterShape::getExcludedIntervals(LayoutUnit , LayoutUnit, SegmentList&) const133 void RasterShape::getExcludedIntervals(LayoutUnit logicalTop, LayoutUnit logicalHeight, SegmentList& result) const 112 134 { 113 // FIXME: this method is only a stub, see https://bugs.webkit.org/show_bug.cgi?id=119809. 135 const RasterShapeIntervals& intervals = marginIntervals(); 136 if (intervals.isEmpty()) 137 return; 138 139 float y1 = logicalTop; 140 float y2 = logicalTop + logicalHeight; 141 142 if (y2 < intervals.bounds().y() || y1 >= intervals.bounds().maxY()) 143 return; 144 145 intervals.getExcludedIntervals(y1, y2, result); 114 146 } 115 147 -
trunk/Source/WebCore/rendering/shapes/RasterShape.h
r154081 r154152 47 47 void addInterval(int y, int x1, int x2); 48 48 void getIncludedIntervals(int y1, int y2, SegmentList&) const; 49 void getExcludedIntervals(int y1, int y2, SegmentList&) const; 49 50 50 51 private: -
trunk/Source/WebCore/rendering/shapes/ShapeOutsideInfo.cpp
r154081 r154152 47 47 return shapeValue->shape(); 48 48 case ShapeValue::Image: 49 return false; // FIXME, see https://bugs.webkit.org/show_bug.cgi?id=119809.49 return shapeValue->isImageValid(); 50 50 default: 51 51 return false;
Note: See TracChangeset
for help on using the changeset viewer.