Changeset 87866 in webkit
- Timestamp:
- Jun 1, 2011 5:46:41 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r87865 r87866 1 2011-06-01 Levi Weintraub <leviw@chromium.org> 2 3 Reviewed by Eric Seidel. 4 5 Switch paintCustomHighlight to use IntPoint 6 https://bugs.webkit.org/show_bug.cgi?id=61562 7 8 Switching paintCustomHighlight to use an IntPoint for 9 its paint offset instead of a pair of ints. 10 11 No new tests since this is refactoring. 12 13 * rendering/InlineTextBox.cpp: 14 (WebCore::InlineTextBox::paint): 15 (WebCore::InlineTextBox::paintCustomHighlight): 16 * rendering/InlineTextBox.h: 17 * rendering/RenderBox.cpp: 18 (WebCore::RenderBox::paintCustomHighlight): 19 * rendering/RenderBox.h: 20 * rendering/RenderImage.cpp: 21 (WebCore::RenderImage::paintReplaced): 22 * rendering/RenderListMarker.cpp: 23 (WebCore::RenderListMarker::paint): 24 * rendering/RenderWidget.cpp: 25 (WebCore::RenderWidget::paint): 26 * rendering/RootInlineBox.cpp: 27 (WebCore::RootInlineBox::paintCustomHighlight): 28 (WebCore::RootInlineBox::paint): 29 * rendering/RootInlineBox.h: 30 1 31 2011-06-01 Emil A Eklund <eae@chromium.org> 2 32 -
trunk/Source/WebCore/rendering/InlineTextBox.cpp
r87753 r87866 545 545 // Custom highlighters go behind everything else. 546 546 if (styleToUse->highlight() != nullAtom && !context->paintingDisabled()) 547 paintCustomHighlight(adjustedPaintOffset .x(), adjustedPaintOffset.y(), styleToUse->highlight());547 paintCustomHighlight(adjustedPaintOffset, styleToUse->highlight()); 548 548 #endif 549 549 … … 851 851 #if PLATFORM(MAC) 852 852 853 void InlineTextBox::paintCustomHighlight( int tx, int ty, const AtomicString& type)853 void InlineTextBox::paintCustomHighlight(const IntPoint& paintOffset, const AtomicString& type) 854 854 { 855 855 Frame* frame = renderer()->frame(); … … 861 861 862 862 RootInlineBox* r = root(); 863 FloatRect rootRect( tx + r->x(), ty+ selectionTop(), r->logicalWidth(), selectionHeight());864 FloatRect textRect( tx+ x(), rootRect.y(), logicalWidth(), rootRect.height());863 FloatRect rootRect(paintOffset.x() + r->x(), paintOffset.y() + selectionTop(), r->logicalWidth(), selectionHeight()); 864 FloatRect textRect(paintOffset.x() + x(), rootRect.y(), logicalWidth(), rootRect.height()); 865 865 866 866 page->chrome()->client()->paintCustomHighlight(renderer()->node(), type, textRect, rootRect, true, false); -
trunk/Source/WebCore/rendering/InlineTextBox.h
r87753 r87866 170 170 void paintCompositionUnderline(GraphicsContext*, const FloatPoint& boxOrigin, const CompositionUnderline&); 171 171 #if PLATFORM(MAC) 172 void paintCustomHighlight( int tx, int ty, const AtomicString& type);172 void paintCustomHighlight(const IntPoint&, const AtomicString& type); 173 173 #endif 174 174 -
trunk/Source/WebCore/rendering/RenderBox.cpp
r87801 r87866 1076 1076 #if PLATFORM(MAC) 1077 1077 1078 void RenderBox::paintCustomHighlight( int tx, int ty, const AtomicString& type, bool behindText)1078 void RenderBox::paintCustomHighlight(const IntPoint& paintOffset, const AtomicString& type, bool behindText) 1079 1079 { 1080 1080 Frame* frame = this->frame(); … … 1088 1088 RootInlineBox* r = boxWrap ? boxWrap->root() : 0; 1089 1089 if (r) { 1090 FloatRect rootRect( tx + r->x(), ty+ r->selectionTop(), r->logicalWidth(), r->selectionHeight());1091 FloatRect imageRect( tx+ x(), rootRect.y(), width(), rootRect.height());1090 FloatRect rootRect(paintOffset.x() + r->x(), paintOffset.y() + r->selectionTop(), r->logicalWidth(), r->selectionHeight()); 1091 FloatRect imageRect(paintOffset.x() + x(), rootRect.y(), width(), rootRect.height()); 1092 1092 page->chrome()->client()->paintCustomHighlight(node(), type, imageRect, rootRect, behindText, false); 1093 1093 } else { 1094 FloatRect imageRect( tx + x(), ty+ y(), width(), height());1094 FloatRect imageRect(paintOffset.x() + x(), paintOffset.y() + y(), width(), height()); 1095 1095 page->chrome()->client()->paintCustomHighlight(node(), type, imageRect, imageRect, behindText, false); 1096 1096 } -
trunk/Source/WebCore/rendering/RenderBox.h
r87801 r87866 422 422 423 423 #if PLATFORM(MAC) 424 void paintCustomHighlight( int tx, int ty, const AtomicString& type, bool behindText);424 void paintCustomHighlight(const IntPoint&, const AtomicString& type, bool behindText); 425 425 #endif 426 426 -
trunk/Source/WebCore/rendering/RenderImage.cpp
r87801 r87866 302 302 #if PLATFORM(MAC) 303 303 if (style()->highlight() != nullAtom && !paintInfo.context->paintingDisabled()) 304 paintCustomHighlight( tx - x(), ty - y(), style()->highlight(), true);304 paintCustomHighlight(IntPoint(tx - x(), ty - y()), style()->highlight(), true); 305 305 #endif 306 306 -
trunk/Source/WebCore/rendering/RenderListMarker.cpp
r87303 r87866 1128 1128 #if PLATFORM(MAC) 1129 1129 if (style()->highlight() != nullAtom && !paintInfo.context->paintingDisabled()) 1130 paintCustomHighlight( tx, ty, style()->highlight(), true);1130 paintCustomHighlight(IntPoint(tx, ty), style()->highlight(), true); 1131 1131 #endif 1132 1132 context->drawImage(m_image->image(this, marker.size()).get(), style()->colorSpace(), marker); … … 1142 1142 // FIXME: paint gap between marker and list item proper 1143 1143 if (style()->highlight() != nullAtom && !paintInfo.context->paintingDisabled()) 1144 paintCustomHighlight( tx, ty, style()->highlight(), true);1144 paintCustomHighlight(IntPoint(tx, ty), style()->highlight(), true); 1145 1145 #endif 1146 1146 -
trunk/Source/WebCore/rendering/RenderWidget.cpp
r86705 r87866 269 269 #if PLATFORM(MAC) 270 270 if (style()->highlight() != nullAtom && !paintInfo.context->paintingDisabled()) 271 paintCustomHighlight( tx - x(), ty - y(), style()->highlight(), true);271 paintCustomHighlight(IntPoint(tx - x(), ty - y()), style()->highlight(), true); 272 272 #endif 273 273 -
trunk/Source/WebCore/rendering/RootInlineBox.cpp
r87753 r87866 158 158 } 159 159 160 void RootInlineBox::paintCustomHighlight(PaintInfo& paintInfo, int tx, int ty, const AtomicString& highlightType)160 void RootInlineBox::paintCustomHighlight(PaintInfo& paintInfo, const IntPoint& paintOffset, const AtomicString& highlightType) 161 161 { 162 162 if (!paintInfo.shouldPaintWithinRoot(renderer()) || renderer()->style()->visibility() != VISIBLE || paintInfo.phase != PaintPhaseForeground) … … 171 171 172 172 // Get the inflated rect so that we can properly hit test. 173 FloatRect rootRect( tx + x(), ty+ selectionTop(), logicalWidth(), selectionHeight());173 FloatRect rootRect(paintOffset.x() + x(), paintOffset.y() + selectionTop(), logicalWidth(), selectionHeight()); 174 174 FloatRect inflatedRect = page->chrome()->client()->customHighlightRect(renderer()->node(), highlightType, rootRect); 175 175 if (inflatedRect.intersects(paintInfo.rect)) … … 186 186 RenderStyle* styleToUse = renderer()->style(m_firstLine); 187 187 if (styleToUse->highlight() != nullAtom && !paintInfo.context->paintingDisabled()) 188 paintCustomHighlight(paintInfo, paintOffset .x(), paintOffset.y(), styleToUse->highlight());188 paintCustomHighlight(paintInfo, paintOffset, styleToUse->highlight()); 189 189 #endif 190 190 } -
trunk/Source/WebCore/rendering/RootInlineBox.h
r87753 r87866 93 93 #if PLATFORM(MAC) 94 94 void addHighlightOverflow(); 95 void paintCustomHighlight(PaintInfo&, int tx, int ty, const AtomicString& highlightType);95 void paintCustomHighlight(PaintInfo&, const IntPoint&, const AtomicString& highlightType); 96 96 #endif 97 97
Note: See TracChangeset
for help on using the changeset viewer.