Changeset 70509 in webkit


Ignore:
Timestamp:
Oct 25, 2010 6:06:30 PM (13 years ago)
Author:
Simon Fraser
Message:

2010-10-25 Simon Fraser <Simon Fraser>

Reviewed by Dan Bernstein.

Fix scrolling of noncomposited iframes within composited document
https://bugs.webkit.org/show_bug.cgi?id=47391

When an iframe that is painting into a compositing layer is scrolled,
we need to repaint via the RenderObject (which dirties the compositing layer contents),
rather than going out to hostWindow.

Test: compositing/iframes/composited-iframe-scroll.html

  • page/FrameView.cpp: (WebCore::FrameView::scrollContentsSlowPath):
  • page/FrameView.h:
  • platform/ScrollView.cpp: (WebCore::ScrollView::scrollContents): (WebCore::ScrollView::scrollContentsSlowPath):
  • platform/ScrollView.h:
Location:
trunk
Files:
5 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r70508 r70509  
     12010-10-25  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Reviewed by Dan Bernstein.
     4
     5        Fix scrolling of noncomposited iframes within composited document
     6        https://bugs.webkit.org/show_bug.cgi?id=47391
     7       
     8        Testcase for scrolling a transformed iframe inside a compositing layer.
     9
     10        * compositing/iframes/composited-iframe-scroll-expected.checksum: Added.
     11        * compositing/iframes/composited-iframe-scroll-expected.png: Added.
     12        * compositing/iframes/composited-iframe-scroll-expected.txt: Added.
     13        * compositing/iframes/composited-iframe-scroll.html: Added.
     14        * compositing/iframes/resources/green-red-subframe.html: Added.
     15
    1162010-10-25  Kenneth Russell  <kbr@google.com>
    217
  • trunk/WebCore/ChangeLog

    r70503 r70509  
     12010-10-25  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Reviewed by Dan Bernstein.
     4
     5        Fix scrolling of noncomposited iframes within composited document
     6        https://bugs.webkit.org/show_bug.cgi?id=47391
     7       
     8        When an iframe that is painting into a compositing layer is scrolled,
     9        we need to repaint via the RenderObject (which dirties the compositing layer contents),
     10        rather than going out to hostWindow.
     11
     12        Test: compositing/iframes/composited-iframe-scroll.html
     13
     14        * page/FrameView.cpp:
     15        (WebCore::FrameView::scrollContentsSlowPath):
     16        * page/FrameView.h:
     17        * platform/ScrollView.cpp:
     18        (WebCore::ScrollView::scrollContents):
     19        (WebCore::ScrollView::scrollContentsSlowPath):
     20        * platform/ScrollView.h:
     21
    1222010-10-25  Ryosuke Niwa  <rniwa@webkit.org>
    223
  • trunk/WebCore/page/FrameView.cpp

    r70143 r70509  
    10011001}
    10021002
     1003void FrameView::scrollContentsSlowPath(const IntRect& updateRect)
     1004{
     1005#if USE(ACCELERATED_COMPOSITING)
     1006    if (RenderPart* frameRenderer = m_frame->ownerRenderer()) {
     1007        if (frameRenderer->containerForRepaint()) {
     1008            IntRect rect(frameRenderer->borderLeft() + frameRenderer->paddingLeft(),
     1009                         frameRenderer->borderTop() + frameRenderer->paddingTop(),
     1010                         visibleWidth(), visibleHeight());
     1011            frameRenderer->repaintRectangle(rect);
     1012            return;
     1013        }
     1014    }
     1015#endif
     1016
     1017    ScrollView::scrollContentsSlowPath(updateRect);
     1018}
     1019
    10031020// Note that this gets called at painting time.
    10041021void FrameView::setIsOverlapped(bool isOverlapped)
  • trunk/WebCore/page/FrameView.h

    r69896 r70509  
    243243protected:
    244244    virtual bool scrollContentsFastPath(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect);
    245    
     245    virtual void scrollContentsSlowPath(const IntRect& updateRect);
     246
    246247private:
    247248    FrameView(Frame*);
  • trunk/WebCore/platform/ScrollView.cpp

    r70143 r70509  
    536536
    537537    if (m_drawPanScrollIcon) {
     538        // FIXME: the pan icon is broken when accelerated compositing is on, since it will draw under the compositing layers.
     539        // https://bugs.webkit.org/show_bug.cgi?id=47837
    538540        int panIconDirtySquareSizeLength = 2 * (panIconSizeLength + max(abs(scrollDelta.width()), abs(scrollDelta.height()))); // We only want to repaint what's necessary
    539541        IntPoint panIconDirtySquareLocation = IntPoint(m_panScrollIconPoint.x() - (panIconDirtySquareSizeLength / 2), m_panScrollIconPoint.y() - (panIconDirtySquareSizeLength / 2));
     
    546548        // FIXME: Find a way to scroll subframes with this faster path
    547549        if (!scrollContentsFastPath(-scrollDelta, scrollViewRect, clipRect))
    548             hostWindow()->invalidateContentsForSlowScroll(updateRect, false);
     550            scrollContentsSlowPath(updateRect);
    549551    } else {
    550552       // We need to go ahead and repaint the entire backing store.  Do it now before moving the
    551553       // windowed plugins.
    552        hostWindow()->invalidateContentsForSlowScroll(updateRect, false);
     554       scrollContentsSlowPath(updateRect);
    553555    }
    554556
     
    564566    hostWindow()->scroll(scrollDelta, rectToScroll, clipRect);
    565567    return true;
     568}
     569
     570void ScrollView::scrollContentsSlowPath(const IntRect& updateRect)
     571{
     572    hostWindow()->invalidateContentsForSlowScroll(updateRect, false);
    566573}
    567574
  • trunk/WebCore/platform/ScrollView.h

    r68557 r70509  
    265265    virtual void paintScrollCorner(GraphicsContext*, const IntRect& cornerRect);
    266266
    267     // Scroll the content by blitting the pixels
     267    // Scroll the content by blitting the pixels.
    268268    virtual bool scrollContentsFastPath(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect);
     269    // Scroll the content by invalidating everything.
     270    virtual void scrollContentsSlowPath(const IntRect& updateRect);
    269271
    270272private:
Note: See TracChangeset for help on using the changeset viewer.