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):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@39217
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+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):
+
2008-12-11 Brent Fulgham <bfulgham@gmail.com>
Reviewed by Adam Roben.
{
platformInit();
if (platformWidget())
- platformSetCanBlitOnScroll();
+ platformSetCanBlitOnScroll(true);
}
ScrollView::~ScrollView()
void ScrollView::setCanBlitOnScroll(bool b)
{
- if (m_canBlitOnScroll == b)
+ if (platformWidget()) {
+ platformSetCanBlitOnScroll(b);
return;
+ }
+
m_canBlitOnScroll = b;
+}
+
+bool ScrollView::canBlitOnScroll() const
+{
if (platformWidget())
- platformSetCanBlitOnScroll();
+ return platformCanBlitOnScroll();
+
+ return m_canBlitOnScroll;
}
IntRect ScrollView::visibleContentRect(bool includeScrollbars) const
#endif
#if !PLATFORM(MAC)
-void ScrollView::platformSetCanBlitOnScroll()
-{
-}
-
void ScrollView::platformSetScrollbarsSuppressed(bool repaintOnUnsuppress)
{
}
{
}
+void ScrollView::platformSetCanBlitOnScroll(bool)
+{
+}
+
+bool ScrollView::platformCanBlitOnScroll() const
+{
+ return false;
+}
+
IntRect ScrollView::platformVisibleContentRect(bool) const
{
return IntRect();
// Whether or not a scroll view will blit visible contents when it is scrolled. Blitting is disabled in situations
// where it would cause rendering glitches (such as with fixed backgrounds or when the view is partially transparent).
void setCanBlitOnScroll(bool);
- bool canBlitOnScroll() const { return m_canBlitOnScroll; }
+ bool canBlitOnScroll() const;
// The visible content rect has a location that is the scrolled offset of the document. The width and height are the viewport width
// and height. By default the scrollbars themselves are excluded from this rectangle, but an optional boolean argument allows them to be
bool m_prohibitsScrolling;
HashSet<Widget*> m_children;
+
+ // This bool is unused on Mac OS because we directly ask the platform widget
+ // whether it is safe to blit on scroll.
bool m_canBlitOnScroll;
+
IntSize m_scrollOffset; // FIXME: Would rather store this as a position, but we will wait to make this change until more code is shared.
IntSize m_contentsSize;
void platformRemoveChild(Widget*);
void platformSetScrollbarModes();
void platformScrollbarModes(ScrollbarMode& horizontal, ScrollbarMode& vertical) const;
- void platformSetCanBlitOnScroll();
+ void platformSetCanBlitOnScroll(bool);
+ bool platformCanBlitOnScroll() const;
IntRect platformVisibleContentRect(bool includeScrollbars) const;
IntSize platformContentsSize() const;
void platformSetContentsSize();
[scrollView() scrollingModes:&horizontal vertical:&vertical];
END_BLOCK_OBJC_EXCEPTIONS;
}
-
-void ScrollView::platformSetCanBlitOnScroll()
+
+void ScrollView::platformSetCanBlitOnScroll(bool canBlitOnScroll)
{
BEGIN_BLOCK_OBJC_EXCEPTIONS;
- [[scrollView() contentView] setCopiesOnScroll:canBlitOnScroll()];
+ [[scrollView() contentView] setCopiesOnScroll:canBlitOnScroll];
END_BLOCK_OBJC_EXCEPTIONS;
}
+bool ScrollView::platformCanBlitOnScroll() const
+{
+ return [[scrollView() contentView] copiesOnScroll];
+}
+
IntRect ScrollView::platformVisibleContentRect(bool includeScrollbars) const
{
BEGIN_BLOCK_OBJC_EXCEPTIONS;
vertical = m_data->vScrollbarMode;
}
+void ScrollView::platformSetCanBlitOnScroll(bool canBlitOnScroll)
+{
+ m_canBlitOnScroll = canBlitOnScroll;
+}
+
+bool ScrollView::platformCanBlitOnScroll() const
+{
+ return m_canBlitOnScroll;
+}
+
// used for subframes support
void ScrollView::platformAddChild(Widget* widget)
{