| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "core/layout/compositing/CompositingReasonFinder.h" | 5 #include "core/layout/compositing/CompositingReasonFinder.h" |
| 6 | 6 |
| 7 #include "core/CSSPropertyNames.h" | 7 #include "core/CSSPropertyNames.h" |
| 8 #include "core/dom/Document.h" | 8 #include "core/dom/Document.h" |
| 9 #include "core/frame/FrameView.h" | 9 #include "core/frame/FrameView.h" |
| 10 #include "core/frame/Settings.h" | 10 #include "core/frame/Settings.h" |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 bool CompositingReasonFinder::requiresCompositingForTransformAnimation( | 209 bool CompositingReasonFinder::requiresCompositingForTransformAnimation( |
| 210 const ComputedStyle& style) { | 210 const ComputedStyle& style) { |
| 211 return style.subtreeWillChangeContents() | 211 return style.subtreeWillChangeContents() |
| 212 ? style.isRunningTransformAnimationOnCompositor() | 212 ? style.isRunningTransformAnimationOnCompositor() |
| 213 : style.hasCurrentTransformAnimation(); | 213 : style.hasCurrentTransformAnimation(); |
| 214 } | 214 } |
| 215 | 215 |
| 216 bool CompositingReasonFinder::requiresCompositingForScrollDependentPosition( | 216 bool CompositingReasonFinder::requiresCompositingForScrollDependentPosition( |
| 217 const PaintLayer* layer, | 217 const PaintLayer* layer, |
| 218 bool ignoreLCDText) const { | 218 bool ignoreLCDText) const { |
| 219 if (layer->layoutObject().style()->position() != EPosition::kFixed && | 219 if (!layer->layoutObject().style()->hasViewportConstrainedPosition() && |
| 220 layer->layoutObject().style()->position() != EPosition::kSticky) | 220 !layer->layoutObject().style()->hasStickyConstrainedPosition()) |
| 221 return false; | 221 return false; |
| 222 | 222 |
| 223 if (!(ignoreLCDText || | 223 if (!(ignoreLCDText || |
| 224 (m_compositingTriggers & ViewportConstrainedPositionedTrigger)) && | 224 (m_compositingTriggers & ViewportConstrainedPositionedTrigger)) && |
| 225 (!RuntimeEnabledFeatures::compositeOpaqueFixedPositionEnabled() || | 225 (!RuntimeEnabledFeatures::compositeOpaqueFixedPositionEnabled() || |
| 226 !layer->backgroundIsKnownToBeOpaqueInRect( | 226 !layer->backgroundIsKnownToBeOpaqueInRect( |
| 227 LayoutRect(layer->boundingBoxForCompositing())) || | 227 LayoutRect(layer->boundingBoxForCompositing())) || |
| 228 layer->compositesWithTransform() || layer->compositesWithOpacity())) { | 228 layer->compositesWithTransform() || layer->compositesWithOpacity())) { |
| 229 return false; | 229 return false; |
| 230 } | 230 } |
| (...skipping 18 matching lines...) Expand all Loading... |
| 249 | 249 |
| 250 // Don't promote sticky position elements that cannot move with scrolls. | 250 // Don't promote sticky position elements that cannot move with scrolls. |
| 251 if (!layer->sticksToScroller()) | 251 if (!layer->sticksToScroller()) |
| 252 return false; | 252 return false; |
| 253 if (layer->ancestorOverflowLayer()->isRootLayer()) | 253 if (layer->ancestorOverflowLayer()->isRootLayer()) |
| 254 return m_layoutView.frameView()->isScrollable(); | 254 return m_layoutView.frameView()->isScrollable(); |
| 255 return layer->ancestorOverflowLayer()->scrollsOverflow(); | 255 return layer->ancestorOverflowLayer()->scrollsOverflow(); |
| 256 } | 256 } |
| 257 | 257 |
| 258 } // namespace blink | 258 } // namespace blink |
| OLD | NEW |