Changeset 150529 in webkit
- Timestamp:
- May 22, 2013 12:06:09 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 6 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r150527 r150529 1 2013-05-22 Simon Fraser <simon.fraser@apple.com> 2 3 New Flickr doesn't get fast scrolling but should 4 https://bugs.webkit.org/show_bug.cgi?id=116514 5 6 Reviewed by Darin Adler. 7 8 slow-scrolling-hidden-background-toggle.html actually tests this patch. The other 9 two tests were added because there appear to be no tests for basic internals.mainThreadScrollingReasons() 10 functionality. 11 12 * platform/mac-wk2/tiled-drawing/slow-scrolling-background-toggle-expected.txt: Added. 13 * platform/mac-wk2/tiled-drawing/slow-scrolling-background-toggle.html: Added. 14 * platform/mac-wk2/tiled-drawing/slow-scrolling-expected.txt: Added. 15 * platform/mac-wk2/tiled-drawing/slow-scrolling-hidden-background-toggle-expected.txt: Added. 16 * platform/mac-wk2/tiled-drawing/slow-scrolling-hidden-background-toggle.html: Added. 17 * platform/mac-wk2/tiled-drawing/slow-scrolling.html: Added. 18 1 19 2013-05-22 Robert Hogan <robert@webkit.org> 2 20 -
trunk/Source/WebCore/ChangeLog
r150527 r150529 1 2013-05-22 Simon Fraser <simon.fraser@apple.com> 2 3 New Flickr doesn't get fast scrolling but should 4 https://bugs.webkit.org/show_bug.cgi?id=116514 5 6 Reviewed by Darin Adler. 7 8 RenderObject increments and decrements a counter of slow repaint objects on 9 FrameView when it sees style changes related to background-attachment:fixed. 10 However, it omitted to decrement the count when a renderer with a fixed background 11 was destroyed. 12 13 This caused Flickr to never fall into fast scrolling mode, since it toggled 14 display:none on an element with a fixed background during loading, then removed 15 the fixed background. 16 17 Did some minor cleanup of #ENABLE(FAST_MOBILE_SCROLLING) crap. 18 19 Tests: platform/mac-wk2/tiled-drawing/slow-scrolling-background-toggle.html 20 platform/mac-wk2/tiled-drawing/slow-scrolling-hidden-background-toggle.html 21 platform/mac-wk2/tiled-drawing/slow-scrolling.html 22 23 * rendering/RenderObject.cpp: 24 (WebCore::shouldRepaintFixedBackgroundsOnScroll): 25 (WebCore::RenderObject::styleWillChange): 26 (WebCore::RenderObject::willBeRemovedFromTree): 27 1 28 2013-05-22 Robert Hogan <robert@webkit.org> 2 29 -
trunk/Source/WebCore/rendering/RenderObject.cpp
r150527 r150529 121 121 122 122 COMPILE_ASSERT(sizeof(RenderObject) == sizeof(SameSizeAsRenderObject), RenderObject_should_stay_small); 123 124 // On low-powered/mobile devices, preventing blitting on a scroll can cause noticeable delays 125 // when scrolling a page with a fixed background image. As an optimization, assuming there are 126 // no fixed positoned elements on the page, we can acclerate scrolling (via blitting) if we 127 // ignore the CSS property "background-attachment: fixed". 128 static bool shouldRepaintFixedBackgroundsOnScroll(FrameView* frameView) 129 { 130 #if !ENABLE(FAST_MOBILE_SCROLLING) && !PLATFORM(QT) 131 UNUSED_PARAM(frameView); 132 #endif 133 134 bool repaintFixedBackgroundsOnScroll = true; 135 #if ENABLE(FAST_MOBILE_SCROLLING) 136 #if PLATFORM(QT) 137 if (frameView->delegatesScrolling()) 138 repaintFixedBackgroundsOnScroll = false; 139 #else 140 repaintFixedBackgroundsOnScroll = false; 141 #endif 142 #endif 143 return repaintFixedBackgroundsOnScroll; 144 } 123 145 124 146 bool RenderObject::s_affectsParentBlock = false; … … 1937 1959 } 1938 1960 1939 if (view()->frameView()) { 1940 bool shouldBlitOnFixedBackgroundImage = false; 1941 #if ENABLE(FAST_MOBILE_SCROLLING) 1942 // On low-powered/mobile devices, preventing blitting on a scroll can cause noticeable delays 1943 // when scrolling a page with a fixed background image. As an optimization, assuming there are 1944 // no fixed positoned elements on the page, we can acclerate scrolling (via blitting) if we 1945 // ignore the CSS property "background-attachment: fixed". 1946 #if PLATFORM(QT) 1947 if (view()->frameView()->delegatesScrolling()) 1948 #endif 1949 shouldBlitOnFixedBackgroundImage = true; 1950 #endif 1951 1952 bool newStyleSlowScroll = newStyle && !shouldBlitOnFixedBackgroundImage && newStyle->hasFixedBackgroundImage(); 1953 bool oldStyleSlowScroll = m_style && !shouldBlitOnFixedBackgroundImage && m_style->hasFixedBackgroundImage(); 1961 if (FrameView* frameView = view()->frameView()) { 1962 bool repaintFixedBackgroundsOnScroll = shouldRepaintFixedBackgroundsOnScroll(frameView); 1963 1964 bool newStyleSlowScroll = newStyle && repaintFixedBackgroundsOnScroll && newStyle->hasFixedBackgroundImage(); 1965 bool oldStyleSlowScroll = m_style && repaintFixedBackgroundsOnScroll && m_style->hasFixedBackgroundImage(); 1954 1966 1955 1967 #if USE(ACCELERATED_COMPOSITING) 1956 1968 bool drawsRootBackground = isRoot() || (isBody() && !rendererHasBackground(document()->documentElement()->renderer())); 1957 if (drawsRootBackground && !shouldBlitOnFixedBackgroundImage) {1969 if (drawsRootBackground && repaintFixedBackgroundsOnScroll) { 1958 1970 if (view()->compositor()->supportsFixedRootBackgroundCompositing()) { 1959 1971 if (newStyleSlowScroll && newStyle->hasEntirelyFixedBackground()) … … 1967 1979 if (oldStyleSlowScroll != newStyleSlowScroll) { 1968 1980 if (oldStyleSlowScroll) 1969 view()->frameView()->removeSlowRepaintObject(); 1981 frameView->removeSlowRepaintObject(); 1982 1970 1983 if (newStyleSlowScroll) 1971 view()->frameView()->addSlowRepaintObject();1984 frameView->addSlowRepaintObject(); 1972 1985 } 1973 1986 } … … 2511 2524 { 2512 2525 // FIXME: We should ASSERT(isRooted()) but we have some out-of-order removals which would need to be fixed first. 2526 2527 if (FrameView* frameView = view()->frameView()) { 2528 bool repaintFixedBackgroundsOnScroll = shouldRepaintFixedBackgroundsOnScroll(frameView); 2529 if (repaintFixedBackgroundsOnScroll && m_style && m_style->hasFixedBackgroundImage()) 2530 frameView->removeSlowRepaintObject(); 2531 } 2513 2532 2514 2533 // If we remove a visible child from an invisible parent, we don't know the layer visibility any more.
Note: See TracChangeset
for help on using the changeset viewer.