Title: [91057] trunk/Source/WebCore
Revision
91057
Author
[email protected]
Date
2011-07-15 00:23:01 -0700 (Fri, 15 Jul 2011)

Log Message

Move useRepaintBounds from RenderBlock::layoutRunsAndFloats to LineLayoutState
https://bugs.webkit.org/show_bug.cgi?id=64360

Patch by Alexandru Chiculita <[email protected]> on 2011-07-15
Reviewed by Hajime Morita.

No new tests needed because the patch is just a refactor.

* rendering/RenderBlock.h:
* rendering/RenderBlockLineLayout.cpp:
(WebCore::LineLayoutState::LineLayoutState):
(WebCore::LineLayoutState::usesRepaintBounds):
(WebCore::LineLayoutState::setRepaintRange):
(WebCore::LineLayoutState::updateRepaintRangeFromBox):
(WebCore::RenderBlock::layoutRunsAndFloats):
(WebCore::RenderBlock::determineStartPosition):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (91056 => 91057)


--- trunk/Source/WebCore/ChangeLog	2011-07-15 06:56:22 UTC (rev 91056)
+++ trunk/Source/WebCore/ChangeLog	2011-07-15 07:23:01 UTC (rev 91057)
@@ -1,3 +1,21 @@
+2011-07-15  Alexandru Chiculita  <[email protected]>
+
+        Move useRepaintBounds from RenderBlock::layoutRunsAndFloats to LineLayoutState
+        https://bugs.webkit.org/show_bug.cgi?id=64360
+
+        Reviewed by Hajime Morita.
+
+        No new tests needed because the patch is just a refactor.
+
+        * rendering/RenderBlock.h:
+        * rendering/RenderBlockLineLayout.cpp:
+        (WebCore::LineLayoutState::LineLayoutState):
+        (WebCore::LineLayoutState::usesRepaintBounds):
+        (WebCore::LineLayoutState::setRepaintRange):
+        (WebCore::LineLayoutState::updateRepaintRangeFromBox):
+        (WebCore::RenderBlock::layoutRunsAndFloats):
+        (WebCore::RenderBlock::determineStartPosition):
+
 2011-07-14  MORITA Hajime  <[email protected]>
 
         ExceptionCodePlaceholder should have its own ExceptionCodePlaceholder.cpp file

Modified: trunk/Source/WebCore/rendering/RenderBlock.h (91056 => 91057)


--- trunk/Source/WebCore/rendering/RenderBlock.h	2011-07-15 06:56:22 UTC (rev 91056)
+++ trunk/Source/WebCore/rendering/RenderBlock.h	2011-07-15 07:23:01 UTC (rev 91057)
@@ -543,7 +543,7 @@
     };
 
     void checkFloatsInCleanLine(RootInlineBox*, Vector<FloatWithRect>&, size_t& floatIndex, bool& encounteredNewFloat, bool& dirtiedByFloat);
-    RootInlineBox* determineStartPosition(LineLayoutState&, LineInfo&, InlineBidiResolver&, Vector<FloatWithRect>&, unsigned& numCleanFloats, bool& useRepaintBounds);
+    RootInlineBox* determineStartPosition(LineLayoutState&, LineInfo&, InlineBidiResolver&, Vector<FloatWithRect>&, unsigned& numCleanFloats);
     RootInlineBox* determineEndPosition(RootInlineBox* startBox, Vector<FloatWithRect>&, size_t floatIndex, InlineIterator& cleanLineStart, BidiStatus& cleanLineBidiStatus, int& yPos);
     bool matchedEndLine(LineLayoutState&, const InlineBidiResolver&, const InlineIterator& endLineStart, const BidiStatus& endLineStatus, RootInlineBox*& endLine, int& endYPos);
 

Modified: trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp (91056 => 91057)


--- trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp	2011-07-15 06:56:22 UTC (rev 91056)
+++ trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp	2011-07-15 07:23:01 UTC (rev 91057)
@@ -844,14 +844,23 @@
         : m_isFullLayout(fullLayout)
         , m_repaintLogicalTop(repaintLogicalTop)
         , m_repaintLogicalBottom(repaintLogicalBottom)
+        , m_usesRepaintBounds(false)
     { }
 
     void markForFullLayout() { m_isFullLayout = true; }
     bool isFullLayout() const { return m_isFullLayout; }
 
-    void setRepaintRange(int logicalHeight) { m_repaintLogicalTop = m_repaintLogicalBottom = logicalHeight; }
+    bool usesRepaintBounds() const { return m_usesRepaintBounds; }
+
+    void setRepaintRange(int logicalHeight)
+    { 
+        m_usesRepaintBounds = true;
+        m_repaintLogicalTop = m_repaintLogicalBottom = logicalHeight; 
+    }
+    
     void updateRepaintRangeFromBox(RootInlineBox* box, int paginationDelta = 0)
     {
+        m_usesRepaintBounds = true;
         m_repaintLogicalTop = min(m_repaintLogicalTop, box->logicalTopVisualOverflow() + min(paginationDelta, 0));
         m_repaintLogicalBottom = max(m_repaintLogicalBottom, box->logicalBottomVisualOverflow() + max(paginationDelta, 0));
     }
@@ -862,6 +871,8 @@
     // FIXME: Should this be a range object instead of two ints?
     int& m_repaintLogicalTop;
     int& m_repaintLogicalBottom;
+    
+    bool m_usesRepaintBounds;
 };
 
 static void deleteLineRange(LineLayoutState& layoutState, RenderArena* arena, RootInlineBox* startLine, RootInlineBox* stopLine = 0)
@@ -883,12 +894,8 @@
     InlineBidiResolver resolver;
     unsigned floatIndex;
     LineInfo lineInfo;
-    // FIXME: Should useRepaintBounds be on the LineLayoutState?
-    // It appears to be used to track the case where we're only repainting a subset of our lines.
-    bool useRepaintBounds = false;
+    RootInlineBox* startLine = determineStartPosition(layoutState, lineInfo, resolver, floats, floatIndex);
 
-    RootInlineBox* startLine = determineStartPosition(layoutState, lineInfo, resolver, floats, floatIndex, useRepaintBounds);
-
     // FIXME: This would make more sense outside of this function, but since
     // determineStartPosition can change the fullLayout flag we have to do this here. Failure to call
     // determineStartPosition first will break fast/repaint/line-flow-with-floats-9.html.
@@ -918,10 +925,8 @@
         0 : determineEndPosition(startLine, floats, floatIndex, cleanLineStart, cleanLineBidiStatus, endLineLogicalTop);
 
     if (startLine) {
-        if (!useRepaintBounds) {
-            useRepaintBounds = true;
+        if (!layoutState.usesRepaintBounds())
             layoutState.setRepaintRange(logicalHeight());
-        }
         deleteLineRange(layoutState, renderArena(), startLine);
     }
 
@@ -1011,7 +1016,7 @@
 
             if (lineBox) {
                 lineBox->setLineBreakInfo(end.m_obj, end.m_pos, resolver.status());
-                if (useRepaintBounds)
+                if (layoutState.usesRepaintBounds())
                     layoutState.updateRepaintRangeFromBox(lineBox);
 
                 if (paginated) {
@@ -1020,7 +1025,7 @@
                     if (adjustment) {
                         int oldLineWidth = availableLogicalWidthForLine(oldLogicalHeight, lineInfo.isFirstLine());
                         lineBox->adjustBlockDirectionPosition(adjustment);
-                        if (useRepaintBounds)
+                        if (layoutState.usesRepaintBounds())
                             layoutState.updateRepaintRangeFromBox(lineBox);
 
                         if (availableLogicalWidthForLine(oldLogicalHeight + adjustment, lineInfo.isFirstLine()) != oldLineWidth) {
@@ -1267,7 +1272,7 @@
 }
 
 RootInlineBox* RenderBlock::determineStartPosition(LineLayoutState& layoutState, LineInfo& lineInfo, InlineBidiResolver& resolver, Vector<FloatWithRect>& floats,
-                                                   unsigned& numCleanFloats, bool& useRepaintBounds)
+                                                   unsigned& numCleanFloats)
 {
     RootInlineBox* curr = 0;
     RootInlineBox* last = 0;
@@ -1290,9 +1295,6 @@
                         break;
                     }
 
-                    if (!useRepaintBounds)
-                        useRepaintBounds = true;
-
                     layoutState.updateRepaintRangeFromBox(curr, paginationDelta);
                     curr->adjustBlockDirectionPosition(paginationDelta);
                 }
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to