Title: [88186] trunk/Source/WebCore
Revision
88186
Author
[email protected]
Date
2011-06-06 13:42:09 -0700 (Mon, 06 Jun 2011)

Log Message

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

        Reviewed by Eric Seidel.

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

        Switching paintSelection to use an IntPoint to represent the paint offset
        instead of a pair of ints.

        No new tests since this is simple refactoring.

        * rendering/EllipsisBox.cpp:
        (WebCore::EllipsisBox::paint):
        (WebCore::EllipsisBox::paintSelection):
        * rendering/EllipsisBox.h:
        * rendering/RenderBlock.cpp:
        (WebCore::RenderBlock::paintObject):
        (WebCore::RenderBlock::paintSelection):
        * rendering/RenderBlock.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (88185 => 88186)


--- trunk/Source/WebCore/ChangeLog	2011-06-06 20:18:58 UTC (rev 88185)
+++ trunk/Source/WebCore/ChangeLog	2011-06-06 20:42:09 UTC (rev 88186)
@@ -1,3 +1,24 @@
+2011-06-03  Levi Weintraub  <[email protected]>
+
+        Reviewed by Eric Seidel.
+
+        Switch paintSelection to use IntPoint
+        https://bugs.webkit.org/show_bug.cgi?id=62059
+
+        Switching paintSelection to use an IntPoint to represent the paint offset
+        instead of a pair of ints.
+
+        No new tests since this is simple refactoring.
+
+        * rendering/EllipsisBox.cpp:
+        (WebCore::EllipsisBox::paint):
+        (WebCore::EllipsisBox::paintSelection):
+        * rendering/EllipsisBox.h:
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::paintObject):
+        (WebCore::RenderBlock::paintSelection):
+        * rendering/RenderBlock.h:
+
 2011-06-06  Emil A Eklund  <[email protected]>
 
         Reviewed by Eric Seidel.

Modified: trunk/Source/WebCore/rendering/EllipsisBox.cpp (88185 => 88186)


--- trunk/Source/WebCore/rendering/EllipsisBox.cpp	2011-06-06 20:18:58 UTC (rev 88185)
+++ trunk/Source/WebCore/rendering/EllipsisBox.cpp	2011-06-06 20:42:09 UTC (rev 88186)
@@ -46,7 +46,7 @@
 
     const Font& font = style->font();
     if (selectionState() != RenderObject::SelectionNone) {
-        paintSelection(context, paintOffset.x(), paintOffset.y(), style, font);
+        paintSelection(context, paintOffset, style, font);
 
         // Select the correct color for painting the text.
         Color foreground = paintInfo.forceBlackText ? Color::black : renderer()->selectionForegroundColor();
@@ -81,7 +81,7 @@
     return enclosingIntRect(font.selectionRectForText(RenderBlock::constructTextRun(renderer(), font, m_str, style, TextRun::AllowTrailingExpansion), IntPoint(x() + tx, y() + ty + root()->selectionTop()), root()->selectionHeight()));
 }
 
-void EllipsisBox::paintSelection(GraphicsContext* context, int tx, int ty, RenderStyle* style, const Font& font)
+void EllipsisBox::paintSelection(GraphicsContext* context, const IntPoint& paintOffset, RenderStyle* style, const Font& font)
 {
     Color textColor = style->visitedDependentColor(CSSPropertyColor);
     Color c = m_renderer->selectionBackgroundColor();
@@ -96,9 +96,9 @@
     GraphicsContextStateSaver stateSaver(*context);
     int top = root()->selectionTop();
     int h = root()->selectionHeight();
-    context->clip(IntRect(x() + tx, top + ty, m_logicalWidth, h));
+    context->clip(IntRect(x() + paintOffset.x(), top + paintOffset.y(), m_logicalWidth, h));
     // FIXME: Why is this always LTR? Fix by passing correct text run flags below.
-    context->drawHighlightForText(font, RenderBlock::constructTextRun(renderer(), font, m_str, style, TextRun::AllowTrailingExpansion), IntPoint(x() + tx, y() + ty + top), h, c, style->colorSpace());
+    context->drawHighlightForText(font, RenderBlock::constructTextRun(renderer(), font, m_str, style, TextRun::AllowTrailingExpansion), IntPoint(x() + paintOffset.x(), y() + paintOffset.y() + top), h, c, style->colorSpace());
 }
 
 bool EllipsisBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, const IntPoint& pointInContainer, int tx, int ty, int lineTop, int lineBottom)

Modified: trunk/Source/WebCore/rendering/EllipsisBox.h (88185 => 88186)


--- trunk/Source/WebCore/rendering/EllipsisBox.h	2011-06-06 20:18:58 UTC (rev 88185)
+++ trunk/Source/WebCore/rendering/EllipsisBox.h	2011-06-06 20:42:09 UTC (rev 88186)
@@ -47,7 +47,7 @@
 private:
     virtual int height() const { return m_height; }
     virtual RenderObject::SelectionState selectionState() { return m_selectionState; }
-    void paintSelection(GraphicsContext*, int tx, int ty, RenderStyle*, const Font&);
+    void paintSelection(GraphicsContext*, const IntPoint&, RenderStyle*, const Font&);
 
     int m_height;
     AtomicString m_str;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to