| 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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 if (style.transformStyle3D() == TransformStyle3DPreserve3D) | 96 if (style.transformStyle3D() == TransformStyle3DPreserve3D) |
| 97 reasons |= CompositingReasonPreserve3DWith3DDescendants; | 97 reasons |= CompositingReasonPreserve3DWith3DDescendants; |
| 98 | 98 |
| 99 if (style.hasPerspective()) | 99 if (style.hasPerspective()) |
| 100 reasons |= CompositingReasonPerspectiveWith3DDescendants; | 100 reasons |= CompositingReasonPerspectiveWith3DDescendants; |
| 101 | 101 |
| 102 if (style.hasCompositorProxy()) | 102 if (style.hasCompositorProxy()) |
| 103 reasons |= CompositingReasonCompositorProxy; | 103 reasons |= CompositingReasonCompositorProxy; |
| 104 | 104 |
| 105 // If the implementation of createsGroup changes, we need to be aware of tha
t in this part of code. | 105 // If the implementation of createsGroup changes, we need to be aware of tha
t in this part of code. |
| 106 ASSERT((layoutObject->isTransparent() || layoutObject->hasMask() || layoutOb
ject->hasFilter() || style.hasBlendMode()) == layoutObject->createsGroup()); | 106 ASSERT((layoutObject->isTransparent() || layoutObject->hasMask() || layoutOb
ject->hasFilterInducingProperty() || style.hasBlendMode()) == layoutObject->crea
tesGroup()); |
| 107 | 107 |
| 108 if (style.hasMask()) | 108 if (style.hasMask()) |
| 109 reasons |= CompositingReasonMaskWithCompositedDescendants; | 109 reasons |= CompositingReasonMaskWithCompositedDescendants; |
| 110 | 110 |
| 111 if (style.hasFilter()) | 111 if (style.hasFilterInducingProperty()) |
| 112 reasons |= CompositingReasonFilterWithCompositedDescendants; | 112 reasons |= CompositingReasonFilterWithCompositedDescendants; |
| 113 | 113 |
| 114 if (style.hasBackdropFilter()) | 114 if (style.hasBackdropFilter()) |
| 115 reasons |= CompositingReasonBackdropFilter; | 115 reasons |= CompositingReasonBackdropFilter; |
| 116 | 116 |
| 117 // See Layer::updateTransform for an explanation of why we check both. | 117 // See Layer::updateTransform for an explanation of why we check both. |
| 118 if (layoutObject->hasTransformRelatedProperty() && style.hasTransform()) | 118 if (layoutObject->hasTransformRelatedProperty() && style.hasTransform()) |
| 119 reasons |= CompositingReasonTransformWithCompositedDescendants; | 119 reasons |= CompositingReasonTransformWithCompositedDescendants; |
| 120 | 120 |
| 121 if (layoutObject->isTransparent()) | 121 if (layoutObject->isTransparent()) |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 bool CompositingReasonFinder::requiresCompositingForPositionFixed(const PaintLay
er* layer) const | 179 bool CompositingReasonFinder::requiresCompositingForPositionFixed(const PaintLay
er* layer) const |
| 180 { | 180 { |
| 181 if (!(m_compositingTriggers & ViewportConstrainedPositionedTrigger)) | 181 if (!(m_compositingTriggers & ViewportConstrainedPositionedTrigger)) |
| 182 return false; | 182 return false; |
| 183 // Don't promote fixed position elements that are descendants of a non-view
container, e.g. transformed elements. | 183 // Don't promote fixed position elements that are descendants of a non-view
container, e.g. transformed elements. |
| 184 // They will stay fixed wrt the container rather than the enclosing frame. | 184 // They will stay fixed wrt the container rather than the enclosing frame. |
| 185 return layer->scrollsWithViewport() && m_layoutView.frameView()->isScrollabl
e(); | 185 return layer->scrollsWithViewport() && m_layoutView.frameView()->isScrollabl
e(); |
| 186 } | 186 } |
| 187 | 187 |
| 188 } // namespace blink | 188 } // namespace blink |
| OLD | NEW |