Chromium Code Reviews| Index: Source/core/layout/LayoutObject.cpp |
| diff --git a/Source/core/layout/LayoutObject.cpp b/Source/core/layout/LayoutObject.cpp |
| index 0fe7c9728b8669ad334778f128161090e6034ca3..2183034ce4d858fe8989a58785e6303627cadf01 100644 |
| --- a/Source/core/layout/LayoutObject.cpp |
| +++ b/Source/core/layout/LayoutObject.cpp |
| @@ -1836,11 +1836,6 @@ void LayoutObject::setStyle(PassRefPtr<ComputedStyle> style) |
| setShouldDoFullPaintInvalidation(); |
| } |
| -static inline bool layoutObjectHasBackground(const LayoutObject* layoutObject) |
| -{ |
| - return layoutObject && layoutObject->hasBackground(); |
| -} |
| - |
| void LayoutObject::styleWillChange(StyleDifference diff, const ComputedStyle& newStyle) |
| { |
| if (m_style) { |
| @@ -1886,37 +1881,6 @@ void LayoutObject::styleWillChange(StyleDifference diff, const ComputedStyle& ne |
| s_affectsParentBlock = false; |
| } |
| - if (view()->frameView()) { |
| - bool shouldBlitOnFixedBackgroundImage = false; |
| - if (RuntimeEnabledFeatures::fastMobileScrollingEnabled()) { |
| - // 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; |
| - } |
| - bool newStyleSlowScroll = !shouldBlitOnFixedBackgroundImage && newStyle.hasFixedBackgroundImage(); |
| - bool oldStyleSlowScroll = m_style && !shouldBlitOnFixedBackgroundImage && m_style->hasFixedBackgroundImage(); |
| - |
| - bool drawsRootBackground = isDocumentElement() || (isBody() && !layoutObjectHasBackground(document().documentElement()->layoutObject())); |
| - if (drawsRootBackground && !shouldBlitOnFixedBackgroundImage) { |
| - if (view()->compositor()->supportsFixedRootBackgroundCompositing()) { |
| - if (newStyleSlowScroll && newStyle.hasEntirelyFixedBackground()) |
| - newStyleSlowScroll = false; |
| - |
| - if (oldStyleSlowScroll && m_style->hasEntirelyFixedBackground()) |
| - oldStyleSlowScroll = false; |
| - } |
| - } |
| - |
| - if (oldStyleSlowScroll != newStyleSlowScroll) { |
| - if (oldStyleSlowScroll) |
| - view()->frameView()->removeSlowRepaintObject(); |
| - if (newStyleSlowScroll) |
| - view()->frameView()->addSlowRepaintObject(); |
| - } |
| - } |
| - |
| // Elements with non-auto touch-action will send a SetTouchAction message |
| // on touchstart in EventHandler::handleTouchEvent, and so effectively have |
| // a touchstart handler that must be reported. |
| @@ -2473,6 +2437,9 @@ void LayoutObject::willBeDestroyed() |
| removeShapeImageClient(m_style->shapeOutside()); |
| } |
| ResourceLoadPriorityOptimizer::resourceLoadPriorityOptimizer()->removeLayoutObject(this); |
| + |
| + if (frameView() && m_bitfields.isSlowRepaintObject()) |
| + frameView()->removeSlowRepaintObject(); |
|
Ian Vollick
2015/07/14 02:27:11
why not setIsSlowRepaintObject(false)?
trchen
2015/07/14 03:36:37
That probably works too. I can do that.
|
| } |
| void LayoutObject::insertedIntoTree() |
| @@ -3270,6 +3237,18 @@ void LayoutObject::setShouldDoFullPaintInvalidationIncludingNonCompositingDescen |
| setShouldDoFullPaintInvalidationIncludingNonCompositingDescendantsInternal(this); |
| } |
| +void LayoutObject::setIsSlowRepaintObject(bool isSlowRepaintObject) |
| +{ |
| + ASSERT(frameView()); |
| + if (m_bitfields.isSlowRepaintObject() == isSlowRepaintObject) |
| + return; |
| + m_bitfields.setIsSlowRepaintObject(isSlowRepaintObject); |
| + if (isSlowRepaintObject) |
| + frameView()->addSlowRepaintObject(); |
| + else |
| + frameView()->removeSlowRepaintObject(); |
| +} |
| + |
| } // namespace blink |
| #ifndef NDEBUG |