Changeset 88200 in webkit
- Timestamp:
- Jun 6, 2011 4:21:20 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r88199 r88200 1 2011-06-06 Levi Weintraub <leviw@chromium.org> 2 3 Reviewed by Eric Seidel. 4 5 Switch shouldPaint to use IntPoint 6 https://bugs.webkit.org/show_bug.cgi?id=62158 7 8 Switching shouldPaint to take an IntPoint representing the paint offset instead 9 of a pair of ints. 10 11 No new tests as this is simple refactoring. 12 13 * rendering/RenderReplaced.cpp: 14 (WebCore::RenderReplaced::paint): 15 (WebCore::RenderReplaced::shouldPaint): 16 * rendering/RenderReplaced.h: 17 * rendering/RenderWidget.cpp: 18 (WebCore::RenderWidget::paint): 19 1 20 2011-06-06 James Simonsen <simonjam@chromium.org> 2 21 -
trunk/Source/WebCore/rendering/RenderReplaced.cpp
r88087 r88200 97 97 void RenderReplaced::paint(PaintInfo& paintInfo, int tx, int ty) 98 98 { 99 if (!shouldPaint(paintInfo, tx, ty))99 if (!shouldPaint(paintInfo, IntPoint(tx, ty))) 100 100 return; 101 101 … … 157 157 } 158 158 159 bool RenderReplaced::shouldPaint(PaintInfo& paintInfo, int& tx, int& ty)159 bool RenderReplaced::shouldPaint(PaintInfo& paintInfo, const IntPoint& paintOffset) 160 160 { 161 161 if (paintInfo.phase != PaintPhaseForeground && paintInfo.phase != PaintPhaseOutline && paintInfo.phase != PaintPhaseSelfOutline … … 170 170 return false; 171 171 172 int currentTX = tx + x(); 173 int currentTY = ty + y(); 172 IntPoint adjustedPaintOffset = paintOffset + location(); 174 173 175 174 // Early exit if the element touches the edges. 176 int top = currentTY+ minYVisualOverflow();177 int bottom = currentTY+ maxYVisualOverflow();175 int top = adjustedPaintOffset.y() + minYVisualOverflow(); 176 int bottom = adjustedPaintOffset.y() + maxYVisualOverflow(); 178 177 if (isSelected() && m_inlineBoxWrapper) { 179 int selTop = ty+ m_inlineBoxWrapper->root()->selectionTop();180 int selBottom = ty+ selTop + m_inlineBoxWrapper->root()->selectionHeight();178 int selTop = paintOffset.y() + m_inlineBoxWrapper->root()->selectionTop(); 179 int selBottom = paintOffset.y() + selTop + m_inlineBoxWrapper->root()->selectionHeight(); 181 180 top = min(selTop, top); 182 181 bottom = max(selBottom, bottom); … … 184 183 185 184 int os = 2 * maximalOutlineSize(paintInfo.phase); 186 if ( currentTX + minXVisualOverflow() >= paintInfo.rect.maxX() + os || currentTX+ maxXVisualOverflow() <= paintInfo.rect.x() - os)185 if (adjustedPaintOffset.x() + minXVisualOverflow() >= paintInfo.rect.maxX() + os || adjustedPaintOffset.x() + maxXVisualOverflow() <= paintInfo.rect.x() - os) 187 186 return false; 188 187 if (top >= paintInfo.rect.maxY() + os || bottom <= paintInfo.rect.y() - os) -
trunk/Source/WebCore/rendering/RenderReplaced.h
r87989 r88200 53 53 54 54 virtual void paint(PaintInfo&, int tx, int ty); 55 bool shouldPaint(PaintInfo&, int& tx, int& ty);55 bool shouldPaint(PaintInfo&, const IntPoint&); 56 56 IntRect localSelectionRect(bool checkWhetherSelected = true) const; // This is in local coordinates, but it's a physical rect (so the top left corner is physical top left). 57 57 -
trunk/Source/WebCore/rendering/RenderWidget.cpp
r88087 r88200 250 250 void RenderWidget::paint(PaintInfo& paintInfo, int tx, int ty) 251 251 { 252 if (!shouldPaint(paintInfo, tx, ty))252 if (!shouldPaint(paintInfo, IntPoint(tx, ty))) 253 253 return; 254 254
Note: See TracChangeset
for help on using the changeset viewer.