Changeset 114926 in webkit
- Timestamp:
- Apr 23, 2012 11:59:59 AM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r114925 r114926 1 2012-04-23 Emil A Eklund <eae@chromium.org> 2 3 Clean up subpixel unit handling in hit testing code 4 https://bugs.webkit.org/show_bug.cgi?id=84496 5 6 Reviewed by Eric Seidel. 7 8 Fix use of IntRect and LayoutRect in hit testing code in preparation for 9 subpixel layout. 10 11 No new tests, no change in functionality. 12 13 * rendering/HitTestResult.cpp: 14 (WebCore::HitTestResult::rectForPoint): 15 Revert rectForPoint to IntRect as all call sites converted it to an 16 IntRect anyway to compare it with an IntPoint or another IntRect. 17 18 * rendering/HitTestingTransformState.cpp: 19 (WebCore::HitTestingTransformState::boundsOfMappedQuad): 20 * rendering/HitTestingTransformState.h: 21 Convert boundsOfMappedQuad to LayoutRect as the TransformationMatrix now 22 has subpixel precision. 23 1 24 2012-04-23 Kentaro Hara <haraken@chromium.org> 2 25 -
trunk/Source/WebCore/rendering/HitTestResult.cpp
r113358 r114926 653 653 } 654 654 655 LayoutRect HitTestResult::rectForPoint(const LayoutPoint& point, unsigned topPadding, unsigned rightPadding, unsigned bottomPadding, unsigned leftPadding)656 { 657 LayoutPoint actualPoint(point);658 actualPoint -= LayoutSize(leftPadding, topPadding);655 IntRect HitTestResult::rectForPoint(const LayoutPoint& point, unsigned topPadding, unsigned rightPadding, unsigned bottomPadding, unsigned leftPadding) 656 { 657 IntPoint actualPoint(roundedIntPoint(point)); 658 actualPoint -= IntSize(leftPadding, topPadding); 659 659 660 660 IntSize actualPadding(leftPadding + rightPadding, topPadding + bottomPadding); … … 662 662 actualPadding += IntSize(1, 1); 663 663 664 return LayoutRect(actualPoint, actualPadding);664 return IntRect(actualPoint, actualPadding); 665 665 } 666 666 -
trunk/Source/WebCore/rendering/HitTestResult.h
r113329 r114926 113 113 // Rect-based hit test related methods. 114 114 bool isRectBasedTest() const { return m_isRectBased; } 115 LayoutRect rectForPoint(const LayoutPoint&) const;116 static LayoutRect rectForPoint(const LayoutPoint&, unsigned topPadding, unsigned rightPadding, unsigned bottomPadding, unsigned leftPadding);115 IntRect rectForPoint(const LayoutPoint&) const; 116 static IntRect rectForPoint(const LayoutPoint&, unsigned topPadding, unsigned rightPadding, unsigned bottomPadding, unsigned leftPadding); 117 117 int topPadding() const { return m_topPadding; } 118 118 int rightPadding() const { return m_rightPadding; } … … 163 163 // width = leftPadding + rightPadding + 1 164 164 // height = topPadding + bottomPadding + 1 165 inline LayoutRect HitTestResult::rectForPoint(const LayoutPoint& point) const165 inline IntRect HitTestResult::rectForPoint(const LayoutPoint& point) const 166 166 { 167 167 return rectForPoint(point, m_topPadding, m_rightPadding, m_bottomPadding, m_leftPadding); -
trunk/Source/WebCore/rendering/HitTestingTransformState.cpp
r98361 r114926 74 74 } 75 75 76 IntRect HitTestingTransformState::boundsOfMappedQuad() const76 LayoutRect HitTestingTransformState::boundsOfMappedQuad() const 77 77 { 78 78 return m_accumulatedTransform.inverse().clampedBoundsOfProjectedQuad(m_lastPlanarQuad); -
trunk/Source/WebCore/rendering/HitTestingTransformState.h
r98361 r114926 59 59 FloatPoint mappedPoint() const; 60 60 FloatQuad mappedQuad() const; 61 IntRect boundsOfMappedQuad() const;61 LayoutRect boundsOfMappedQuad() const; 62 62 void flatten(); 63 63
Note: See TracChangeset
for help on using the changeset viewer.