Chromium Code Reviews| Index: Source/core/layout/compositing/CompositingReasonFinder.cpp |
| diff --git a/Source/core/layout/compositing/CompositingReasonFinder.cpp b/Source/core/layout/compositing/CompositingReasonFinder.cpp |
| index 872073d7418ac37fd9f1e91434c25268fd0d3432..1e6df4c0418dd90ffc5e0d341aa30f249171056d 100644 |
| --- a/Source/core/layout/compositing/CompositingReasonFinder.cpp |
| +++ b/Source/core/layout/compositing/CompositingReasonFinder.cpp |
| @@ -176,11 +176,17 @@ bool CompositingReasonFinder::requiresCompositingForAnimation(const ComputedStyl |
| bool CompositingReasonFinder::requiresCompositingForPositionFixed(const DeprecatedPaintLayer* layer) const |
| { |
| - if (!(m_compositingTriggers & ViewportConstrainedPositionedTrigger)) |
| - return false; |
| // Don't promote fixed position elements that are descendants of a non-view container, e.g. transformed elements. |
| // They will stay fixed wrt the container rather than the enclosing frame. |
| - return layer->scrollsWithViewport() && m_layoutView.frameView()->isScrollable(); |
| + if (!layer->scrollsWithViewport() || !m_layoutView.frameView()->isScrollable()) |
| + return false; |
| + |
| + if (m_compositingTriggers & ViewportConstrainedPositionedTrigger) |
| + return true; |
| + |
| + // If the layer is opaque we can still promote it since we will not lose LCD text |
| + LayoutRect bounds = layer->layoutBox()->visualOverflowRect(); |
|
trchen
2015/08/27 23:10:58
I looked at the semantics of visualOverflowRect(),
davidfox
2015/08/30 22:00:04
Wouldn't it be possible to call DeprecatedPaintLay
|
| + return layer->backgroundIsKnownToBeOpaqueInRect(bounds); |
| } |
| } |