Chromium Code Reviews| 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 "config.h" | 5 #include "config.h" |
| 6 #include "core/layout/compositing/CompositingReasonFinder.h" | 6 #include "core/layout/compositing/CompositingReasonFinder.h" |
| 7 | 7 |
| 8 #include "core/CSSPropertyNames.h" | 8 #include "core/CSSPropertyNames.h" |
| 9 #include "core/dom/Document.h" | 9 #include "core/dom/Document.h" |
| 10 #include "core/frame/FrameView.h" | 10 #include "core/frame/FrameView.h" |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 169 bool CompositingReasonFinder::requiresCompositingForAnimation(const ComputedStyl e& style) const | 169 bool CompositingReasonFinder::requiresCompositingForAnimation(const ComputedStyl e& style) const |
| 170 { | 170 { |
| 171 if (style.subtreeWillChangeContents()) | 171 if (style.subtreeWillChangeContents()) |
| 172 return style.isRunningAnimationOnCompositor(); | 172 return style.isRunningAnimationOnCompositor(); |
| 173 | 173 |
| 174 return style.shouldCompositeForCurrentAnimations(); | 174 return style.shouldCompositeForCurrentAnimations(); |
| 175 } | 175 } |
| 176 | 176 |
| 177 bool CompositingReasonFinder::requiresCompositingForPositionFixed(const Deprecat edPaintLayer* layer) const | 177 bool CompositingReasonFinder::requiresCompositingForPositionFixed(const Deprecat edPaintLayer* layer) const |
| 178 { | 178 { |
| 179 if (!(m_compositingTriggers & ViewportConstrainedPositionedTrigger)) | |
| 180 return false; | |
| 181 // Don't promote fixed position elements that are descendants of a non-view container, e.g. transformed elements. | 179 // Don't promote fixed position elements that are descendants of a non-view container, e.g. transformed elements. |
| 182 // They will stay fixed wrt the container rather than the enclosing frame. | 180 // They will stay fixed wrt the container rather than the enclosing frame. |
| 183 return layer->scrollsWithViewport() && m_layoutView.frameView()->isScrollabl e(); | 181 if (!layer->scrollsWithViewport() || !m_layoutView.frameView()->isScrollable ()) |
| 182 return false; | |
| 183 | |
| 184 if (m_compositingTriggers & ViewportConstrainedPositionedTrigger) | |
| 185 return true; | |
| 186 | |
| 187 // If the layer is opaque we can still promote it since we will not lose LCD text | |
| 188 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
| |
| 189 return layer->backgroundIsKnownToBeOpaqueInRect(bounds); | |
| 184 } | 190 } |
| 185 | 191 |
| 186 } | 192 } |
| OLD | NEW |