| 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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 | 92 |
| 93 if (style.hasInlineTransform()) | 93 if (style.hasInlineTransform()) |
| 94 reasons |= CompositingReasonInlineTransform; | 94 reasons |= CompositingReasonInlineTransform; |
| 95 | 95 |
| 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 TRACE_EVENT0("compositor-worker", "CompositingReasonFinder -- has compos
itor proxy"); |
| 103 reasons |= CompositingReasonCompositorProxy; | 104 reasons |= CompositingReasonCompositorProxy; |
| 105 } |
| 104 | 106 |
| 105 // If the implementation of createsGroup changes, we need to be aware of tha
t in this part of code. | 107 // 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()); | 108 ASSERT((layoutObject->isTransparent() || layoutObject->hasMask() || layoutOb
ject->hasFilter() || style.hasBlendMode()) == layoutObject->createsGroup()); |
| 107 | 109 |
| 108 if (style.hasMask()) | 110 if (style.hasMask()) |
| 109 reasons |= CompositingReasonMaskWithCompositedDescendants; | 111 reasons |= CompositingReasonMaskWithCompositedDescendants; |
| 110 | 112 |
| 111 if (style.hasFilter()) | 113 if (style.hasFilter()) |
| 112 reasons |= CompositingReasonFilterWithCompositedDescendants; | 114 reasons |= CompositingReasonFilterWithCompositedDescendants; |
| 113 | 115 |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 bool CompositingReasonFinder::requiresCompositingForPositionFixed(const PaintLay
er* layer) const | 181 bool CompositingReasonFinder::requiresCompositingForPositionFixed(const PaintLay
er* layer) const |
| 180 { | 182 { |
| 181 if (!(m_compositingTriggers & ViewportConstrainedPositionedTrigger)) | 183 if (!(m_compositingTriggers & ViewportConstrainedPositionedTrigger)) |
| 182 return false; | 184 return false; |
| 183 // Don't promote fixed position elements that are descendants of a non-view
container, e.g. transformed elements. | 185 // 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. | 186 // They will stay fixed wrt the container rather than the enclosing frame. |
| 185 return layer->scrollsWithViewport() && m_layoutView.frameView()->isScrollabl
e(); | 187 return layer->scrollsWithViewport() && m_layoutView.frameView()->isScrollabl
e(); |
| 186 } | 188 } |
| 187 | 189 |
| 188 } | 190 } |
| OLD | NEW |