Changeset 39217 in webkit


Ignore:
Timestamp:
Dec 11, 2008 1:56:07 PM (15 years ago)
Author:
cwzwarich@webkit.org
Message:

2008-12-11 Cameron Zwarich <zwarich@apple.com>

Reviewed by Dave Hyatt.

Bug 21256: REGRESSION (r36906): horizontally repeating image leaves ghosts when vertical scrolling
<https://bugs.webkit.org/show_bug.cgi?id=21256>
<rdar://problem/6362978>

The ScrollView refactoring in r36906 caused the ScrollView and the
platform widget to disagree about whether optimizing scrolling via
blitting is allowed. The easiest way to fix this is to make ScrollView
simply ask the platform widget whether this is safe on platforms that
are affected.

It is not possible to write a layout test for this bug because it
involves the back/forward cache.

  • platform/ScrollView.cpp: (WebCore::ScrollView::ScrollView): (WebCore::ScrollView::setCanBlitOnScroll): (WebCore::ScrollView::canBlitOnScroll): (WebCore::ScrollView::platformSetCanBlitOnScroll): (WebCore::ScrollView::platformCanBlitOnScroll):
  • platform/ScrollView.h:
  • platform/mac/ScrollViewMac.mm: (WebCore::ScrollView::platformSetCanBlitOnScroll): (WebCore::ScrollView::platformCanBlitOnScroll):
  • platform/wx/ScrollViewWx.cpp: (WebCore::ScrollView::platformSetCanBlitOnScroll): (WebCore::ScrollView::platformCanBlitOnScroll):
Location:
trunk/WebCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r39213 r39217  
     12008-12-11  Cameron Zwarich  <zwarich@apple.com>
     2
     3        Reviewed by Dave Hyatt.
     4
     5        Bug 21256: REGRESSION (r36906): horizontally repeating image leaves ghosts when vertical scrolling
     6        <https://bugs.webkit.org/show_bug.cgi?id=21256>
     7        <rdar://problem/6362978>
     8
     9        The ScrollView refactoring in r36906 caused the ScrollView and the
     10        platform widget to disagree about whether optimizing scrolling via
     11        blitting is allowed. The easiest way to fix this is to make ScrollView
     12        simply ask the platform widget whether this is safe on platforms that
     13        are affected.
     14
     15        It is not possible to write a layout test for this bug because it
     16        involves the back/forward cache.
     17
     18        * platform/ScrollView.cpp:
     19        (WebCore::ScrollView::ScrollView):
     20        (WebCore::ScrollView::setCanBlitOnScroll):
     21        (WebCore::ScrollView::canBlitOnScroll):
     22        (WebCore::ScrollView::platformSetCanBlitOnScroll):
     23        (WebCore::ScrollView::platformCanBlitOnScroll):
     24        * platform/ScrollView.h:
     25        * platform/mac/ScrollViewMac.mm:
     26        (WebCore::ScrollView::platformSetCanBlitOnScroll):
     27        (WebCore::ScrollView::platformCanBlitOnScroll):
     28        * platform/wx/ScrollViewWx.cpp:
     29        (WebCore::ScrollView::platformSetCanBlitOnScroll):
     30        (WebCore::ScrollView::platformCanBlitOnScroll):
     31
    1322008-12-11  Brent Fulgham  <bfulgham@gmail.com>
    233
  • trunk/WebCore/platform/ScrollView.cpp

    r39201 r39217  
    5151    platformInit();
    5252    if (platformWidget())
    53         platformSetCanBlitOnScroll();
     53        platformSetCanBlitOnScroll(true);
    5454}
    5555
     
    148148void ScrollView::setCanBlitOnScroll(bool b)
    149149{
    150     if (m_canBlitOnScroll == b)
    151         return;
     150    if (platformWidget()) {
     151        platformSetCanBlitOnScroll(b);
     152        return;
     153    }
     154
    152155    m_canBlitOnScroll = b;
    153     if (platformWidget())
    154         platformSetCanBlitOnScroll();
     156}
     157
     158bool ScrollView::canBlitOnScroll() const
     159{
     160    if (platformWidget())
     161        return platformCanBlitOnScroll();
     162
     163    return m_canBlitOnScroll;
    155164}
    156165
     
    778787
    779788#if !PLATFORM(MAC)
    780 void ScrollView::platformSetCanBlitOnScroll()
    781 {
    782 }
    783 
    784789void ScrollView::platformSetScrollbarsSuppressed(bool repaintOnUnsuppress)
    785790{
     
    796801}
    797802
     803void ScrollView::platformSetCanBlitOnScroll(bool)
     804{
     805}
     806
     807bool ScrollView::platformCanBlitOnScroll() const
     808{
     809    return false;
     810}
     811
    798812IntRect ScrollView::platformVisibleContentRect(bool) const
    799813{
  • trunk/WebCore/platform/ScrollView.h

    r39201 r39217  
    106106    // where it would cause rendering glitches (such as with fixed backgrounds or when the view is partially transparent).
    107107    void setCanBlitOnScroll(bool);
    108     bool canBlitOnScroll() const { return m_canBlitOnScroll; }
     108    bool canBlitOnScroll() const;
    109109
    110110    // The visible content rect has a location that is the scrolled offset of the document. The width and height are the viewport width
     
    233233
    234234    HashSet<Widget*> m_children;
     235
     236    // This bool is unused on Mac OS because we directly ask the platform widget
     237    // whether it is safe to blit on scroll.
    235238    bool m_canBlitOnScroll;
     239
    236240    IntSize m_scrollOffset; // FIXME: Would rather store this as a position, but we will wait to make this change until more code is shared.
    237241    IntSize m_contentsSize;
     
    257261    void platformSetScrollbarModes();
    258262    void platformScrollbarModes(ScrollbarMode& horizontal, ScrollbarMode& vertical) const;
    259     void platformSetCanBlitOnScroll();
     263    void platformSetCanBlitOnScroll(bool);
     264    bool platformCanBlitOnScroll() const;
    260265    IntRect platformVisibleContentRect(bool includeScrollbars) const;
    261266    IntSize platformContentsSize() const;
  • trunk/WebCore/platform/mac/ScrollViewMac.mm

    r37244 r39217  
    9393    END_BLOCK_OBJC_EXCEPTIONS;
    9494}
    95    
    96 void ScrollView::platformSetCanBlitOnScroll()
    97 {
    98     BEGIN_BLOCK_OBJC_EXCEPTIONS;
    99     [[scrollView() contentView] setCopiesOnScroll:canBlitOnScroll()];
    100     END_BLOCK_OBJC_EXCEPTIONS;
     95
     96void ScrollView::platformSetCanBlitOnScroll(bool canBlitOnScroll)
     97{
     98    BEGIN_BLOCK_OBJC_EXCEPTIONS;
     99    [[scrollView() contentView] setCopiesOnScroll:canBlitOnScroll];
     100    END_BLOCK_OBJC_EXCEPTIONS;
     101}
     102
     103bool ScrollView::platformCanBlitOnScroll() const
     104{
     105    return [[scrollView() contentView] copiesOnScroll];
    101106}
    102107
  • trunk/WebCore/platform/wx/ScrollViewWx.cpp

    r37667 r39217  
    307307}
    308308
     309void ScrollView::platformSetCanBlitOnScroll(bool canBlitOnScroll)
     310{
     311    m_canBlitOnScroll = canBlitOnScroll;
     312}
     313
     314bool ScrollView::platformCanBlitOnScroll() const
     315{
     316    return m_canBlitOnScroll;
     317}
     318
    309319// used for subframes support
    310320void ScrollView::platformAddChild(Widget* widget)
Note: See TracChangeset for help on using the changeset viewer.