Title: [87866] trunk/Source/WebCore
Revision
87866
Author
[email protected]
Date
2011-06-01 17:46:41 -0700 (Wed, 01 Jun 2011)

Log Message

2011-06-01  Levi Weintraub  <[email protected]>

        Reviewed by Eric Seidel.

        Switch paintCustomHighlight to use IntPoint
        https://bugs.webkit.org/show_bug.cgi?id=61562

        Switching paintCustomHighlight to use an IntPoint for
        its paint offset instead of a pair of ints.

        No new tests since this is refactoring.

        * rendering/InlineTextBox.cpp:
        (WebCore::InlineTextBox::paint):
        (WebCore::InlineTextBox::paintCustomHighlight):
        * rendering/InlineTextBox.h:
        * rendering/RenderBox.cpp:
        (WebCore::RenderBox::paintCustomHighlight):
        * rendering/RenderBox.h:
        * rendering/RenderImage.cpp:
        (WebCore::RenderImage::paintReplaced):
        * rendering/RenderListMarker.cpp:
        (WebCore::RenderListMarker::paint):
        * rendering/RenderWidget.cpp:
        (WebCore::RenderWidget::paint):
        * rendering/RootInlineBox.cpp:
        (WebCore::RootInlineBox::paintCustomHighlight):
        (WebCore::RootInlineBox::paint):
        * rendering/RootInlineBox.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (87865 => 87866)


--- trunk/Source/WebCore/ChangeLog	2011-06-01 23:19:02 UTC (rev 87865)
+++ trunk/Source/WebCore/ChangeLog	2011-06-02 00:46:41 UTC (rev 87866)
@@ -1,3 +1,33 @@
+2011-06-01  Levi Weintraub  <[email protected]>
+
+        Reviewed by Eric Seidel.
+
+        Switch paintCustomHighlight to use IntPoint
+        https://bugs.webkit.org/show_bug.cgi?id=61562
+
+        Switching paintCustomHighlight to use an IntPoint for
+        its paint offset instead of a pair of ints.
+
+        No new tests since this is refactoring.
+
+        * rendering/InlineTextBox.cpp:
+        (WebCore::InlineTextBox::paint):
+        (WebCore::InlineTextBox::paintCustomHighlight):
+        * rendering/InlineTextBox.h:
+        * rendering/RenderBox.cpp:
+        (WebCore::RenderBox::paintCustomHighlight):
+        * rendering/RenderBox.h:
+        * rendering/RenderImage.cpp:
+        (WebCore::RenderImage::paintReplaced):
+        * rendering/RenderListMarker.cpp:
+        (WebCore::RenderListMarker::paint):
+        * rendering/RenderWidget.cpp:
+        (WebCore::RenderWidget::paint):
+        * rendering/RootInlineBox.cpp:
+        (WebCore::RootInlineBox::paintCustomHighlight):
+        (WebCore::RootInlineBox::paint):
+        * rendering/RootInlineBox.h:
+
 2011-06-01  Emil A Eklund  <[email protected]>
 
         Reviewed by Eric Seidel.

Modified: trunk/Source/WebCore/rendering/InlineTextBox.cpp (87865 => 87866)


--- trunk/Source/WebCore/rendering/InlineTextBox.cpp	2011-06-01 23:19:02 UTC (rev 87865)
+++ trunk/Source/WebCore/rendering/InlineTextBox.cpp	2011-06-02 00:46:41 UTC (rev 87866)
@@ -544,7 +544,7 @@
 #if PLATFORM(MAC)
         // Custom highlighters go behind everything else.
         if (styleToUse->highlight() != nullAtom && !context->paintingDisabled())
-            paintCustomHighlight(adjustedPaintOffset.x(), adjustedPaintOffset.y(), styleToUse->highlight());
+            paintCustomHighlight(adjustedPaintOffset, styleToUse->highlight());
 #endif
 
         if (containsComposition && !useCustomUnderlines)
@@ -850,7 +850,7 @@
 
 #if PLATFORM(MAC)
 
-void InlineTextBox::paintCustomHighlight(int tx, int ty, const AtomicString& type)
+void InlineTextBox::paintCustomHighlight(const IntPoint& paintOffset, const AtomicString& type)
 {
     Frame* frame = renderer()->frame();
     if (!frame)
@@ -860,8 +860,8 @@
         return;
 
     RootInlineBox* r = root();
-    FloatRect rootRect(tx + r->x(), ty + selectionTop(), r->logicalWidth(), selectionHeight());
-    FloatRect textRect(tx + x(), rootRect.y(), logicalWidth(), rootRect.height());
+    FloatRect rootRect(paintOffset.x() + r->x(), paintOffset.y() + selectionTop(), r->logicalWidth(), selectionHeight());
+    FloatRect textRect(paintOffset.x() + x(), rootRect.y(), logicalWidth(), rootRect.height());
 
     page->chrome()->client()->paintCustomHighlight(renderer()->node(), type, textRect, rootRect, true, false);
 }

Modified: trunk/Source/WebCore/rendering/InlineTextBox.h (87865 => 87866)


--- trunk/Source/WebCore/rendering/InlineTextBox.h	2011-06-01 23:19:02 UTC (rev 87865)
+++ trunk/Source/WebCore/rendering/InlineTextBox.h	2011-06-02 00:46:41 UTC (rev 87866)
@@ -169,7 +169,7 @@
     void paintDocumentMarkers(GraphicsContext*, const FloatPoint& boxOrigin, RenderStyle*, const Font&, bool background);
     void paintCompositionUnderline(GraphicsContext*, const FloatPoint& boxOrigin, const CompositionUnderline&);
 #if PLATFORM(MAC)
-    void paintCustomHighlight(int tx, int ty, const AtomicString& type);
+    void paintCustomHighlight(const IntPoint&, const AtomicString& type);
 #endif
 
 private:

Modified: trunk/Source/WebCore/rendering/RenderBox.cpp (87865 => 87866)


--- trunk/Source/WebCore/rendering/RenderBox.cpp	2011-06-01 23:19:02 UTC (rev 87865)
+++ trunk/Source/WebCore/rendering/RenderBox.cpp	2011-06-02 00:46:41 UTC (rev 87866)
@@ -1075,7 +1075,7 @@
 
 #if PLATFORM(MAC)
 
-void RenderBox::paintCustomHighlight(int tx, int ty, const AtomicString& type, bool behindText)
+void RenderBox::paintCustomHighlight(const IntPoint& paintOffset, const AtomicString& type, bool behindText)
 {
     Frame* frame = this->frame();
     if (!frame)
@@ -1087,11 +1087,11 @@
     InlineBox* boxWrap = inlineBoxWrapper();
     RootInlineBox* r = boxWrap ? boxWrap->root() : 0;
     if (r) {
-        FloatRect rootRect(tx + r->x(), ty + r->selectionTop(), r->logicalWidth(), r->selectionHeight());
-        FloatRect imageRect(tx + x(), rootRect.y(), width(), rootRect.height());
+        FloatRect rootRect(paintOffset.x() + r->x(), paintOffset.y() + r->selectionTop(), r->logicalWidth(), r->selectionHeight());
+        FloatRect imageRect(paintOffset.x() + x(), rootRect.y(), width(), rootRect.height());
         page->chrome()->client()->paintCustomHighlight(node(), type, imageRect, rootRect, behindText, false);
     } else {
-        FloatRect imageRect(tx + x(), ty + y(), width(), height());
+        FloatRect imageRect(paintOffset.x() + x(), paintOffset.y() + y(), width(), height());
         page->chrome()->client()->paintCustomHighlight(node(), type, imageRect, imageRect, behindText, false);
     }
 }

Modified: trunk/Source/WebCore/rendering/RenderBox.h (87865 => 87866)


--- trunk/Source/WebCore/rendering/RenderBox.h	2011-06-01 23:19:02 UTC (rev 87865)
+++ trunk/Source/WebCore/rendering/RenderBox.h	2011-06-02 00:46:41 UTC (rev 87866)
@@ -421,7 +421,7 @@
     void paintMaskImages(const PaintInfo&, const IntRect&);
 
 #if PLATFORM(MAC)
-    void paintCustomHighlight(int tx, int ty, const AtomicString& type, bool behindText);
+    void paintCustomHighlight(const IntPoint&, const AtomicString& type, bool behindText);
 #endif
 
     void computePositionedLogicalWidth();

Modified: trunk/Source/WebCore/rendering/RenderImage.cpp (87865 => 87866)


--- trunk/Source/WebCore/rendering/RenderImage.cpp	2011-06-01 23:19:02 UTC (rev 87865)
+++ trunk/Source/WebCore/rendering/RenderImage.cpp	2011-06-02 00:46:41 UTC (rev 87866)
@@ -301,7 +301,7 @@
 
 #if PLATFORM(MAC)
         if (style()->highlight() != nullAtom && !paintInfo.context->paintingDisabled())
-            paintCustomHighlight(tx - x(), ty - y(), style()->highlight(), true);
+            paintCustomHighlight(IntPoint(tx - x(), ty - y()), style()->highlight(), true);
 #endif
 
         IntSize contentSize(cWidth, cHeight);

Modified: trunk/Source/WebCore/rendering/RenderListMarker.cpp (87865 => 87866)


--- trunk/Source/WebCore/rendering/RenderListMarker.cpp	2011-06-01 23:19:02 UTC (rev 87865)
+++ trunk/Source/WebCore/rendering/RenderListMarker.cpp	2011-06-02 00:46:41 UTC (rev 87866)
@@ -1127,7 +1127,7 @@
     if (isImage()) {
 #if PLATFORM(MAC)
         if (style()->highlight() != nullAtom && !paintInfo.context->paintingDisabled())
-            paintCustomHighlight(tx, ty, style()->highlight(), true);
+            paintCustomHighlight(IntPoint(tx, ty), style()->highlight(), true);
 #endif
         context->drawImage(m_image->image(this, marker.size()).get(), style()->colorSpace(), marker);
         if (selectionState() != SelectionNone) {
@@ -1141,7 +1141,7 @@
 #if PLATFORM(MAC)
     // FIXME: paint gap between marker and list item proper
     if (style()->highlight() != nullAtom && !paintInfo.context->paintingDisabled())
-        paintCustomHighlight(tx, ty, style()->highlight(), true);
+        paintCustomHighlight(IntPoint(tx, ty), style()->highlight(), true);
 #endif
 
     if (selectionState() != SelectionNone) {

Modified: trunk/Source/WebCore/rendering/RenderWidget.cpp (87865 => 87866)


--- trunk/Source/WebCore/rendering/RenderWidget.cpp	2011-06-01 23:19:02 UTC (rev 87865)
+++ trunk/Source/WebCore/rendering/RenderWidget.cpp	2011-06-02 00:46:41 UTC (rev 87866)
@@ -268,7 +268,7 @@
 
 #if PLATFORM(MAC)
     if (style()->highlight() != nullAtom && !paintInfo.context->paintingDisabled())
-        paintCustomHighlight(tx - x(), ty - y(), style()->highlight(), true);
+        paintCustomHighlight(IntPoint(tx - x(), ty - y()), style()->highlight(), true);
 #endif
 
     if (style()->hasBorderRadius()) {

Modified: trunk/Source/WebCore/rendering/RootInlineBox.cpp (87865 => 87866)


--- trunk/Source/WebCore/rendering/RootInlineBox.cpp	2011-06-01 23:19:02 UTC (rev 87865)
+++ trunk/Source/WebCore/rendering/RootInlineBox.cpp	2011-06-02 00:46:41 UTC (rev 87866)
@@ -157,7 +157,7 @@
     setOverflowFromLogicalRects(inflatedRect, inflatedRect, lineTop(), lineBottom());
 }
 
-void RootInlineBox::paintCustomHighlight(PaintInfo& paintInfo, int tx, int ty, const AtomicString& highlightType)
+void RootInlineBox::paintCustomHighlight(PaintInfo& paintInfo, const IntPoint& paintOffset, const AtomicString& highlightType)
 {
     if (!paintInfo.shouldPaintWithinRoot(renderer()) || renderer()->style()->visibility() != VISIBLE || paintInfo.phase != PaintPhaseForeground)
         return;
@@ -170,7 +170,7 @@
         return;
 
     // Get the inflated rect so that we can properly hit test.
-    FloatRect rootRect(tx + x(), ty + selectionTop(), logicalWidth(), selectionHeight());
+    FloatRect rootRect(paintOffset.x() + x(), paintOffset.y() + selectionTop(), logicalWidth(), selectionHeight());
     FloatRect inflatedRect = page->chrome()->client()->customHighlightRect(renderer()->node(), highlightType, rootRect);
     if (inflatedRect.intersects(paintInfo.rect))
         page->chrome()->client()->paintCustomHighlight(renderer()->node(), highlightType, rootRect, rootRect, false, true);
@@ -185,7 +185,7 @@
 #if PLATFORM(MAC)
     RenderStyle* styleToUse = renderer()->style(m_firstLine);
     if (styleToUse->highlight() != nullAtom && !paintInfo.context->paintingDisabled())
-        paintCustomHighlight(paintInfo, paintOffset.x(), paintOffset.y(), styleToUse->highlight());
+        paintCustomHighlight(paintInfo, paintOffset, styleToUse->highlight());
 #endif
 }
 

Modified: trunk/Source/WebCore/rendering/RootInlineBox.h (87865 => 87866)


--- trunk/Source/WebCore/rendering/RootInlineBox.h	2011-06-01 23:19:02 UTC (rev 87865)
+++ trunk/Source/WebCore/rendering/RootInlineBox.h	2011-06-02 00:46:41 UTC (rev 87866)
@@ -92,7 +92,7 @@
 
 #if PLATFORM(MAC)
     void addHighlightOverflow();
-    void paintCustomHighlight(PaintInfo&, int tx, int ty, const AtomicString& highlightType);
+    void paintCustomHighlight(PaintInfo&, const IntPoint&, const AtomicString& highlightType);
 #endif
 
     virtual void paint(PaintInfo&, const IntPoint&, int lineTop, int lineBottom);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to