Changeset 21390 in webkit


Ignore:
Timestamp:
May 10, 2007 9:49:54 PM (17 years ago)
Author:
thatcher
Message:

LayoutTests:

Reviewed by Darin.

  • fast/repaint/layer-full-repaint-expected.checksum: Added.
  • fast/repaint/layer-full-repaint-expected.png: Added.
  • fast/repaint/layer-full-repaint-expected.txt: Added.
  • fast/repaint/layer-full-repaint.html: Added.
  • fast/repaint/repaint-resized-overflow-expected.checksum:
  • fast/repaint/repaint-resized-overflow-expected.png:

WebCore:

Reviewed by Darin.

Test: fast/repaint/layer-full-repaint.html

Removed custom repaint logic from RenderLayer. repaintAfterLayoutIfNeeded()
knows how to do everything we need now. The only catch is that we cannot
rely on its "do a full repaint if the object needs layout" behavior, since
by the time we call it, the needs layout flag has been reset. The solution
is to cache the need for a full repaint in the layer.

  • page/FrameView.cpp: (WebCore::FrameView::layout): Removed call to checkForRepaintOnResize().
  • rendering/RenderLayer.cpp: (WebCore::RenderLayer::checkForRepaintOnResize): Removed. (WebCore::RenderLayer::RenderLayer): Replaced the m_repaintOverflowOnResize flag with a m_needsFullRepaint flag, which indicates that the layer needs to do a full repaint in the next call to updateLayerPositions(). (WebCore::RenderLayer::updateLayerPositions): Simplified the repaint logic. Either call repaintAfterLayoutIfNeeded() or do a full repaint, depending on m_needsFullRepaint.
  • rendering/RenderLayer.h: (WebCore::RenderLayer::setNeedsFullRepaint):
  • rendering/RenderObject.cpp: (WebCore::RenderObject::setNeedsLayout): Mark the layer for full repaint.
Location:
trunk
Files:
4 added
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r21389 r21390  
     12007-05-10  Mitz Pettel  <mitz@webkit.org>
     2
     3        Reviewed by Darin.
     4
     5        - repaint test and updated results for http://bugs.webkit.org/show_bug.cgi?id=13655
     6          Incomplete repaint when text-shadow is used in a render layer with explicit height
     7
     8        * fast/repaint/layer-full-repaint-expected.checksum: Added.
     9        * fast/repaint/layer-full-repaint-expected.png: Added.
     10        * fast/repaint/layer-full-repaint-expected.txt: Added.
     11        * fast/repaint/layer-full-repaint.html: Added.
     12        * fast/repaint/repaint-resized-overflow-expected.checksum:
     13        * fast/repaint/repaint-resized-overflow-expected.png:
     14
    1152007-05-10  Justin Garcia  <justin.garcia@apple.com>
    216
  • trunk/LayoutTests/fast/repaint/repaint-resized-overflow-expected.checksum

    r14089 r21390  
    1 4a08fade6137f2ea6dca995ae001e2e6
     17bcff2ca869022f6515c572a36c58b4c
  • trunk/WebCore/ChangeLog

    r21389 r21390  
     12007-05-10  Mitz Pettel  <mitz@webkit.org>
     2
     3        Reviewed by Darin.
     4
     5        - fix http://bugs.webkit.org/show_bug.cgi?id=13655
     6          Incomplete repaint when text-shadow is used in a render layer with explicit height
     7
     8        Test: fast/repaint/layer-full-repaint.html
     9
     10        Removed custom repaint logic from RenderLayer. repaintAfterLayoutIfNeeded()
     11        knows how to do everything we need now. The only catch is that we cannot
     12        rely on its "do a full repaint if the object needs layout" behavior, since
     13        by the time we call it, the needs layout flag has been reset. The solution
     14        is to cache the need for a full repaint in the layer.
     15
     16        * page/FrameView.cpp:
     17        (WebCore::FrameView::layout): Removed call to checkForRepaintOnResize().
     18        * rendering/RenderLayer.cpp:
     19        (WebCore::RenderLayer::checkForRepaintOnResize): Removed.
     20        (WebCore::RenderLayer::RenderLayer): Replaced the m_repaintOverflowOnResize
     21        flag with a m_needsFullRepaint flag, which indicates that the layer needs
     22        to do a full repaint in the next call to updateLayerPositions().
     23        (WebCore::RenderLayer::updateLayerPositions): Simplified the repaint logic.
     24        Either call repaintAfterLayoutIfNeeded() or do a full repaint, depending on
     25        m_needsFullRepaint.
     26        * rendering/RenderLayer.h:
     27        (WebCore::RenderLayer::setNeedsFullRepaint):
     28        * rendering/RenderObject.cpp:
     29        (WebCore::RenderObject::setNeedsLayout): Mark the layer for full repaint.
     30
    1312007-05-10  Justin Garcia  <justin.garcia@apple.com>
    232
  • trunk/WebCore/page/FrameView.cpp

    r21329 r21390  
    406406    RenderLayer* layer = root->enclosingLayer();
    407407     
    408     if (!d->doFullRepaint)
    409         layer->checkForRepaintOnResize();
    410 
    411408    pauseScheduledEvents();
    412409
  • trunk/WebCore/rendering/RenderLayer.cpp

    r21387 r21390  
    142142    , m_usedTransparency(false)
    143143    , m_inOverflowRelayout(false)
    144     , m_repaintOverflowOnResize(false)
     144    , m_needsFullRepaint(false)
    145145    , m_overflowStatusDirty(true)
    146146    , m_visibleContentStatusDirty(true)
     
    175175}
    176176
    177 void RenderLayer::checkForRepaintOnResize()
    178 {
    179     // FIXME: The second part of the condition is probably no longer needed. The first part can be
    180     // done when the object is marked for layout instead of walking the tree here.
    181     m_repaintOverflowOnResize = m_object->selfNeedsLayout() || m_object->hasOverflowClip() && m_object->normalChildNeedsLayout();
    182     for (RenderLayer* child = firstChild(); child; child = child->nextSibling())
    183         child->checkForRepaintOnResize();
    184 }
    185 
    186177void RenderLayer::updateLayerPositions(bool doFullRepaint, bool checkForRepaint)
    187178{
     
    210201        if (checkForRepaint) {
    211202            if (view && !view->printing()) {
    212                 bool didMove = newOutlineBox.location() != m_outlineBox.location();
    213                 if (!didMove && !m_repaintOverflowOnResize)
     203                if (m_needsFullRepaint) {
     204                    view->repaintViewRectangle(m_repaintRect);
     205                    if (newRect != m_repaintRect)
     206                        view->repaintViewRectangle(newRect);
     207                } else
    214208                    m_object->repaintAfterLayoutIfNeeded(m_repaintRect, m_outlineBox);
    215                 else if (didMove || newRect != m_repaintRect) {
    216                     view->repaintViewRectangle(m_repaintRect);
    217                     view->repaintViewRectangle(newRect);
    218                 }
    219209            }
    220210        }
     
    225215        m_outlineBox = IntRect();
    226216    }
     217
     218    m_needsFullRepaint = false;
    227219   
    228220    for (RenderLayer* child = firstChild(); child; child = child->nextSibling())
  • trunk/WebCore/rendering/RenderLayer.h

    r21276 r21390  
    281281    void updateLayerPosition();
    282282    void updateLayerPositions(bool doFullRepaint = false, bool checkForRepaint = true);
    283     void checkForRepaintOnResize();
    284283
    285284    void relativePositionOffset(int& relX, int& relY) { relX += m_relX; relY += m_relY; }
     
    340339
    341340    IntRect repaintRect() const { return m_repaintRect; }
     341    void setNeedsFullRepaint(bool f = true) { m_needsFullRepaint = f; }
    342342   
    343343    int staticX() const { return m_staticX; }
     
    448448                                 // blend).
    449449    bool m_inOverflowRelayout : 1;
    450     bool m_repaintOverflowOnResize : 1;
     450    bool m_needsFullRepaint : 1;
    451451
    452452    bool m_overflowStatusDirty : 1;
  • trunk/WebCore/rendering/RenderObject.cpp

    r21329 r21390  
    685685    m_needsLayout = b;
    686686    if (b) {
    687         if (!alreadyNeededLayout && markParents)
    688             markContainingBlocksForLayout();
     687        if (!alreadyNeededLayout) {
     688            if (markParents)
     689                markContainingBlocksForLayout();
     690            if (hasLayer())
     691                layer()->setNeedsFullRepaint();
     692        }
    689693    } else {
    690694        m_posChildNeedsLayout = false;
Note: See TracChangeset for help on using the changeset viewer.