Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1806)

Unified Diff: Source/core/rendering/RenderObject.cpp

Issue 103533011: Revert 161821 "Remove 'FAST_MOBILE_SCROLLING'" (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/rendering/RenderBoxModelObject.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderObject.cpp
diff --git a/Source/core/rendering/RenderObject.cpp b/Source/core/rendering/RenderObject.cpp
index 9e96c62fc87aacd6c15321481e24bd16b9e02627..e5e485f2d7489c680686665c201a32d9583f992d 100644
--- a/Source/core/rendering/RenderObject.cpp
+++ b/Source/core/rendering/RenderObject.cpp
@@ -2027,11 +2027,20 @@ void RenderObject::styleWillChange(StyleDifference diff, const RenderStyle* newS
s_affectsParentBlock = false;
if (view()->frameView()) {
- bool newStyleSlowScroll = newStyle && newStyle->hasFixedBackgroundImage();
- bool oldStyleSlowScroll = m_style && m_style->hasFixedBackgroundImage();
+ bool shouldBlitOnFixedBackgroundImage = false;
+#if ENABLE(FAST_MOBILE_SCROLLING)
+ // On low-powered/mobile devices, preventing blitting on a scroll can cause noticeable delays
+ // when scrolling a page with a fixed background image. As an optimization, assuming there are
+ // no fixed positoned elements on the page, we can acclerate scrolling (via blitting) if we
+ // ignore the CSS property "background-attachment: fixed".
+ shouldBlitOnFixedBackgroundImage = true;
+#endif
+
+ bool newStyleSlowScroll = newStyle && !shouldBlitOnFixedBackgroundImage && newStyle->hasFixedBackgroundImage();
+ bool oldStyleSlowScroll = m_style && !shouldBlitOnFixedBackgroundImage && m_style->hasFixedBackgroundImage();
bool drawsRootBackground = isRoot() || (isBody() && !rendererHasBackground(document().documentElement()->renderer()));
- if (drawsRootBackground) {
+ if (drawsRootBackground && !shouldBlitOnFixedBackgroundImage) {
if (view()->compositor()->supportsFixedRootBackgroundCompositing()) {
if (newStyleSlowScroll && newStyle->hasEntirelyFixedBackground())
newStyleSlowScroll = false;
« no previous file with comments | « Source/core/rendering/RenderBoxModelObject.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698