Changeset 87825 in webkit
- Timestamp:
- Jun 1, 2011 10:59:02 AM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r87822 r87825 1 2011-06-01 Levi Weintraub <leviw@chromium.org> 2 3 Reviewed by Eric Seidel. 4 5 Switch RenderLineBoxList intersection functions to use IntPoint 6 https://bugs.webkit.org/show_bug.cgi?id=61794 7 8 Switching rangeIntersectsRect, anyLineIntersectsRect, and lineIntersectsDirtyRect 9 to take IntPoint instead of a tx/ty to represent the offset to be applied match 10 the rect and lines' coordinates. 11 12 No new tests since this is merely refactoring. 13 14 * rendering/RenderLineBoxList.cpp: 15 (WebCore::RenderLineBoxList::rangeIntersectsRect): 16 (WebCore::RenderLineBoxList::anyLineIntersectsRect): 17 (WebCore::RenderLineBoxList::lineIntersectsDirtyRect): 18 (WebCore::RenderLineBoxList::paint): 19 (WebCore::RenderLineBoxList::hitTest): 20 * rendering/RenderLineBoxList.h: 21 1 22 2011-05-19 Adrienne Walker <enne@google.com> 2 23 -
trunk/Source/WebCore/rendering/RenderLineBoxList.cpp
r87753 r87825 147 147 } 148 148 149 bool RenderLineBoxList::rangeIntersectsRect(RenderBoxModelObject* renderer, int logicalTop, int logicalBottom, const IntRect& rect, int tx, int ty) const149 bool RenderLineBoxList::rangeIntersectsRect(RenderBoxModelObject* renderer, int logicalTop, int logicalBottom, const IntRect& rect, const IntPoint& offset) const 150 150 { 151 151 RenderBox* block; … … 160 160 161 161 if (renderer->style()->isHorizontalWritingMode()) { 162 physicalStart += ty;162 physicalStart += offset.y(); 163 163 if (physicalStart >= rect.maxY() || physicalStart + physicalExtent <= rect.y()) 164 164 return false; 165 165 } else { 166 physicalStart += tx;166 physicalStart += offset.x(); 167 167 if (physicalStart >= rect.maxX() || physicalStart + physicalExtent <= rect.x()) 168 168 return false; … … 172 172 } 173 173 174 bool RenderLineBoxList::anyLineIntersectsRect(RenderBoxModelObject* renderer, const IntRect& rect, int tx, int ty, bool usePrintRect, int outlineSize) const174 bool RenderLineBoxList::anyLineIntersectsRect(RenderBoxModelObject* renderer, const IntRect& rect, const IntPoint& offset, bool usePrintRect, int outlineSize) const 175 175 { 176 176 // We can check the first box and last box and avoid painting/hit testing if we don't … … 189 189 int logicalBottom = outlineSize + lastLineBottom; 190 190 191 return rangeIntersectsRect(renderer, logicalTop, logicalBottom, rect, tx, ty);192 } 193 194 bool RenderLineBoxList::lineIntersectsDirtyRect(RenderBoxModelObject* renderer, InlineFlowBox* box, const PaintInfo& paintInfo, int tx, int ty) const191 return rangeIntersectsRect(renderer, logicalTop, logicalBottom, rect, offset); 192 } 193 194 bool RenderLineBoxList::lineIntersectsDirtyRect(RenderBoxModelObject* renderer, InlineFlowBox* box, const PaintInfo& paintInfo, const IntPoint& offset) const 195 195 { 196 196 RootInlineBox* root = box->root(); … … 198 198 int logicalBottom = box->logicalBottomVisualOverflow(root->lineBottom()) + renderer->maximalOutlineSize(paintInfo.phase); 199 199 200 return rangeIntersectsRect(renderer, logicalTop, logicalBottom, paintInfo.rect, tx, ty);200 return rangeIntersectsRect(renderer, logicalTop, logicalBottom, paintInfo.rect, offset); 201 201 } 202 202 … … 220 220 bool usePrintRect = !v->printRect().isEmpty(); 221 221 int outlineSize = renderer->maximalOutlineSize(paintInfo.phase); 222 if (!anyLineIntersectsRect(renderer, paintInfo.rect, tx, ty, usePrintRect, outlineSize))222 if (!anyLineIntersectsRect(renderer, paintInfo.rect, IntPoint(tx, ty), usePrintRect, outlineSize)) 223 223 return; 224 224 … … 258 258 } 259 259 260 if (lineIntersectsDirtyRect(renderer, curr, info, tx, ty)) {260 if (lineIntersectsDirtyRect(renderer, curr, info, IntPoint(tx, ty))) { 261 261 RootInlineBox* root = curr->root(); 262 262 curr->paint(info, IntPoint(tx, ty), root->lineTop(), root->lineBottom()); … … 290 290 IntRect(pointInContainer.x() - result.leftPadding(), pointInContainer.y(), result.rightPadding() + result.leftPadding() + 1, 1); 291 291 292 if (!anyLineIntersectsRect(renderer, rect, tx, ty))292 if (!anyLineIntersectsRect(renderer, rect, IntPoint(tx, ty))) 293 293 return false; 294 294 … … 298 298 for (InlineFlowBox* curr = lastLineBox(); curr; curr = curr->prevLineBox()) { 299 299 RootInlineBox* root = curr->root(); 300 if (rangeIntersectsRect(renderer, curr->logicalTopVisualOverflow(root->lineTop()), curr->logicalBottomVisualOverflow(root->lineBottom()), rect, tx, ty)) {300 if (rangeIntersectsRect(renderer, curr->logicalTopVisualOverflow(root->lineTop()), curr->logicalBottomVisualOverflow(root->lineBottom()), rect, IntPoint(tx, ty))) { 301 301 bool inside = curr->nodeAtPoint(request, result, pointInContainer, tx, ty, root->lineTop(), root->lineBottom()); 302 302 if (inside) { -
trunk/Source/WebCore/rendering/RenderLineBoxList.h
r87019 r87825 68 68 69 69 private: 70 bool anyLineIntersectsRect(RenderBoxModelObject*, const IntRect&, int tx, int ty, bool usePrintRect = false, int outlineSize = 0) const;71 bool lineIntersectsDirtyRect(RenderBoxModelObject*, InlineFlowBox*, const PaintInfo&, int tx, int ty) const;72 bool rangeIntersectsRect(RenderBoxModelObject*, int logicalTop, int logicalBottom, const IntRect&, int tx, int ty) const;70 bool anyLineIntersectsRect(RenderBoxModelObject*, const IntRect&, const IntPoint&, bool usePrintRect = false, int outlineSize = 0) const; 71 bool lineIntersectsDirtyRect(RenderBoxModelObject*, InlineFlowBox*, const PaintInfo&, const IntPoint&) const; 72 bool rangeIntersectsRect(RenderBoxModelObject*, int logicalTop, int logicalBottom, const IntRect&, const IntPoint&) const; 73 73 74 74 // For block flows, each box represents the root inline box for a line in the
Note: See TracChangeset
for help on using the changeset viewer.