2009-06-29 Simon Fraser <simon.fraser@apple.com>
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 30 Jun 2009 05:12:33 +0000 (05:12 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 30 Jun 2009 05:12:33 +0000 (05:12 +0000)
        Reviewed by Dan Bernstein.

        Change RenderLayer::updateLayerPositions() to use a bitmask instead of two
        boolean arguments. FullUpdate is unused at present, but will be used soon.

        * page/FrameView.cpp:
        (WebCore::FrameView::layout):
        * rendering/RenderLayer.cpp:
        (WebCore::RenderLayer::updateLayerPositions):
        (WebCore::RenderLayer::scrollToOffset):
        * rendering/RenderLayer.h:
        (WebCore::RenderLayer::):

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

WebCore/ChangeLog
WebCore/page/FrameView.cpp
WebCore/rendering/RenderLayer.cpp
WebCore/rendering/RenderLayer.h

index e6132d5..df8c9d0 100644 (file)
@@ -1,3 +1,18 @@
+2009-06-29  Simon Fraser  <simon.fraser@apple.com>
+
+        Reviewed by Dan Bernstein.
+
+        Change RenderLayer::updateLayerPositions() to use a bitmask instead of two
+        boolean arguments. FullUpdate is unused at present, but will be used soon.
+
+        * page/FrameView.cpp:
+        (WebCore::FrameView::layout):
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::updateLayerPositions):
+        (WebCore::RenderLayer::scrollToOffset):
+        * rendering/RenderLayer.h:
+        (WebCore::RenderLayer::):
+
 2009-06-29  Nate Chapin  <japhet@chromium.org>
 
         Reviewed by Dimitri Glazkov.
index 41f2c5c..87ed1b5 100644 (file)
@@ -624,7 +624,9 @@ void FrameView::layout(bool allowSubtree)
 
     // Now update the positions of all layers.
     beginDeferredRepaints();
-    layer->updateLayerPositions(m_doFullRepaint);
+    layer->updateLayerPositions((m_doFullRepaint ? RenderLayer::DoFullRepaint : 0)
+                                | RenderLayer::CheckForRepaint
+                                | RenderLayer::FullUpdate);
     endDeferredRepaints();
 
 #if USE(ACCELERATED_COMPOSITING)
index ba85f1a..12dbc89 100644 (file)
@@ -255,17 +255,17 @@ void RenderLayer::setStaticY(int staticY)
     renderer()->setChildNeedsLayout(true, false);
 }
 
-void RenderLayer::updateLayerPositions(bool doFullRepaint, bool checkForRepaint)
+void RenderLayer::updateLayerPositions(UpdateLayerPositionsFlags flags)
 {
-    if (doFullRepaint) {
+    if (flags & DoFullRepaint) {
         renderer()->repaint();
 #if USE(ACCELERATED_COMPOSITING)
-        checkForRepaint = false;
+        flags &= ~CheckForRepaint;
         // We need the full repaint to propagate to child layers if we are hardware compositing.
         if (!compositor()->inCompositingMode())
-            doFullRepaint = false;
+            flags &= ~DoFullRepaint;
 #else
-        checkForRepaint = doFullRepaint = false;
+        flags &= ~(CheckForRepaint | DoFullRepaint);
 #endif
     }
     
@@ -292,7 +292,7 @@ void RenderLayer::updateLayerPositions(bool doFullRepaint, bool checkForRepaint)
         RenderBoxModelObject* repaintContainer = renderer()->containerForRepaint();
         IntRect newRect = renderer()->clippedOverflowRectForRepaint(repaintContainer);
         IntRect newOutlineBox = renderer()->outlineBoundsForRepaint(repaintContainer);
-        if (checkForRepaint) {
+        if (flags & CheckForRepaint) {
             if (view && !view->printing()) {
                 if (m_needsFullRepaint) {
                     renderer()->repaintUsingContainer(repaintContainer, m_repaintRect);
@@ -316,7 +316,7 @@ void RenderLayer::updateLayerPositions(bool doFullRepaint, bool checkForRepaint)
         m_reflection->layout();
 
     for (RenderLayer* child = firstChild(); child; child = child->nextSibling())
-        child->updateLayerPositions(doFullRepaint, checkForRepaint);
+        child->updateLayerPositions(flags);
 
 #if USE(ACCELERATED_COMPOSITING)
     if (isComposited())
@@ -1059,7 +1059,7 @@ void RenderLayer::scrollToOffset(int x, int y, bool updateScrollbars, bool repai
 
     // Update the positions of our child layers.
     for (RenderLayer* child = firstChild(); child; child = child->nextSibling())
-        child->updateLayerPositions(false, false);
+        child->updateLayerPositions(0);
 
 #if USE(ACCELERATED_COMPOSITING)
     if (compositor()->inCompositingMode()) {
index 4feede8..8fb2147 100644 (file)
@@ -294,7 +294,14 @@ public:
     bool hasAcceleratedCompositing() const;
     
     void updateLayerPosition();
-    void updateLayerPositions(bool doFullRepaint = false, bool checkForRepaint = true);
+    
+    enum UpdateLayerPositionsFlag {
+        DoFullRepaint = 1,
+        CheckForRepaint = 1 << 1,
+        FullUpdate = 1 << 2,
+    };
+    typedef unsigned UpdateLayerPositionsFlags;
+    void updateLayerPositions(UpdateLayerPositionsFlags = DoFullRepaint);
 
     void updateTransform();