2011-05-12 Levi Weintraub <leviw@chromium.org>
authorleviw@chromium.org <leviw@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 12 May 2011 22:15:26 +0000 (22:15 +0000)
committerleviw@chromium.org <leviw@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 12 May 2011 22:15:26 +0000 (22:15 +0000)
        Reviewed by Eric Seidel.

        Switch paintBoxDecorationWithSize to IntRect
        https://bugs.webkit.org/show_bug.cgi?id=60679

        Switching paintBoxDecorationWithSize to take an IntRect instead of 4 ints.

        No new tests as this is simple refactoring.

        * rendering/RenderBox.cpp:
        (WebCore::RenderBox::paintBoxDecorations): Cleaning up amazingly confusing logic.
        (WebCore::RenderBox::paintBoxDecorationsWithSize):
        * rendering/RenderBox.h:
        * rendering/RenderTextControlSingleLine.cpp:
        (WebCore::RenderTextControlSingleLine::paintBoxDecorations):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@86385 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderBox.cpp
Source/WebCore/rendering/RenderBox.h
Source/WebCore/rendering/RenderTextControlSingleLine.cpp

index 19f7e55d4a404879cc051f0561525a3371bec19f..0b06d47534f561078792f01442e9bbb1e18c9a83 100644 (file)
@@ -1,3 +1,21 @@
+2011-05-12  Levi Weintraub  <leviw@chromium.org>
+
+        Reviewed by Eric Seidel.
+
+        Switch paintBoxDecorationWithSize to IntRect
+        https://bugs.webkit.org/show_bug.cgi?id=60679
+
+        Switching paintBoxDecorationWithSize to take an IntRect instead of 4 ints.
+
+        No new tests as this is simple refactoring.
+
+        * rendering/RenderBox.cpp:
+        (WebCore::RenderBox::paintBoxDecorations): Cleaning up amazingly confusing logic.
+        (WebCore::RenderBox::paintBoxDecorationsWithSize):
+        * rendering/RenderBox.h:
+        * rendering/RenderTextControlSingleLine.cpp:
+        (WebCore::RenderTextControlSingleLine::paintBoxDecorations):
+
 2011-05-12  Levi Weintraub  <leviw@chromium.org>
 
         Reviewed by Eric Seidel.
index 7f6e2ddf4ed65aa590ca09eb711a01769444e16d..85e8e38b9211158c89e08fbbb291c6f270e44f38 100644 (file)
@@ -804,9 +804,8 @@ void RenderBox::paintRootBoxFillLayers(const PaintInfo& paintInfo)
 
 void RenderBox::paintBoxDecorations(PaintInfo& paintInfo, int tx, int ty)
 {
-    if (!paintInfo.shouldPaintWithinRoot(this))
-        return;
-    return paintBoxDecorationsWithSize(paintInfo, tx, ty, width(), height());
+    if (paintInfo.shouldPaintWithinRoot(this))
+        paintBoxDecorationsWithSize(paintInfo, IntRect(tx, ty, width(), height()));
 }
 
 BackgroundBleedAvoidance RenderBox::determineBackgroundBleedAvoidance(GraphicsContext* context) const
@@ -832,9 +831,8 @@ BackgroundBleedAvoidance RenderBox::determineBackgroundBleedAvoidance(GraphicsCo
     return BackgroundBleedUseTransparencyLayer;
 }
 
-void RenderBox::paintBoxDecorationsWithSize(PaintInfo& paintInfo, int tx, int ty, int width, int height)
+void RenderBox::paintBoxDecorationsWithSize(PaintInfo& paintInfo, IntRect paintRect)
 {
-    IntRect paintRect = IntRect(tx, ty, width, height);
     // border-fit can adjust where we paint our border and background.  If set, we snugly fit our line box descendants.  (The iChat
     // balloon layout is an example of this).
     borderFitAdjust(paintRect);
index 2c98c7faf495435cdce80d64151d90f1b20d0d35..d3a94fd80941112a3f0bea366e34fde68894ab2a 100644 (file)
@@ -408,7 +408,7 @@ protected:
     void paintFillLayer(const PaintInfo&, const Color&, const FillLayer*, const IntRect&, BackgroundBleedAvoidance, CompositeOperator, RenderObject* backgroundObject);
     void paintFillLayers(const PaintInfo&, const Color&, const FillLayer*, const IntRect&, BackgroundBleedAvoidance = BackgroundBleedNone, CompositeOperator = CompositeSourceOver, RenderObject* backgroundObject = 0);
 
-    void paintBoxDecorationsWithSize(PaintInfo&, int tx, int ty, int width, int height);
+    void paintBoxDecorationsWithSize(PaintInfo&, IntRect);
     void paintMaskImages(const PaintInfo&, const IntRect&);
 
 #if PLATFORM(MAC)
index ace8fb21f0c2de4ee987d9e95d28f97cf0a2bbcf..5fcc8569725c354f17f7f3d3a6ef242f2d916539 100644 (file)
@@ -233,7 +233,7 @@ void RenderTextControlSingleLine::paint(PaintInfo& paintInfo, int tx, int ty)
 
 void RenderTextControlSingleLine::paintBoxDecorations(PaintInfo& paintInfo, int tx, int ty)
 {
-    paintBoxDecorationsWithSize(paintInfo, tx, ty, width() - decorationWidthRight(), height());
+    paintBoxDecorationsWithSize(paintInfo, IntRect(tx, ty, width() - decorationWidthRight(), height()));
 }
 
 void RenderTextControlSingleLine::addFocusRingRects(Vector<IntRect>& rects, int tx, int ty)