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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
135 // Note that we ask the layoutObject if it has a transform, because the styl e may have transforms, | 135 // Note that we ask the layoutObject if it has a transform, because the styl e may have transforms, |
136 // but the layoutObject may be an inline that doesn't support them. | 136 // but the layoutObject may be an inline that doesn't support them. |
137 return layoutObject->hasTransformRelatedProperty() && layoutObject->style()- >has3DTransform(); | 137 return layoutObject->hasTransformRelatedProperty() && layoutObject->style()- >has3DTransform(); |
138 } | 138 } |
139 | 139 |
140 CompositingReasons CompositingReasonFinder::nonStyleDeterminedDirectReasons(cons t PaintLayer* layer) const | 140 CompositingReasons CompositingReasonFinder::nonStyleDeterminedDirectReasons(cons t PaintLayer* layer) const |
141 { | 141 { |
142 CompositingReasons directReasons = CompositingReasonNone; | 142 CompositingReasons directReasons = CompositingReasonNone; |
143 LayoutObject* layoutObject = layer->layoutObject(); | 143 LayoutObject* layoutObject = layer->layoutObject(); |
144 | 144 |
145 if (hasOverflowScrollTrigger()) { | 145 if (layer->needsCompositedScrolling()) |
chrishtr
2016/09/07 20:38:07
Should hasOverflowScrollTrigger() now be deleted?
Stephen Chennney
2016/09/07 20:38:40
This has been removed because layer->needsComposit
Stephen Chennney
2016/09/07 20:49:36
Yeah, I don't see why not.
| |
146 if (layer->clipParent()) | 146 directReasons |= CompositingReasonOverflowScrollingTouch; |
147 directReasons |= CompositingReasonOutOfFlowClipping; | |
Stephen Chennney
2016/09/07 20:38:40
This is only used in CompositingRequirementsUpdate
| |
148 | |
149 if (layer->needsCompositedScrolling()) | |
150 directReasons |= CompositingReasonOverflowScrollingTouch; | |
Stephen Chennney
2016/09/07 20:38:40
This check is all that remains.
| |
151 } | |
152 | 147 |
153 // Composite |layer| if it is inside of an ancestor scrolling layer, but tha t | 148 // Composite |layer| if it is inside of an ancestor scrolling layer, but tha t |
154 // scrolling layer is not not on the stacking context ancestor chain of |lay er|. | 149 // scrolling layer is not on the stacking context ancestor chain of |layer|. |
155 // See the definition of the scrollParent property in Layer for more detail. | 150 // See the definition of the scrollParent property in Layer for more detail. |
156 if (const PaintLayer* scrollingAncestor = layer->ancestorScrollingLayer()) { | 151 if (const PaintLayer* scrollingAncestor = layer->ancestorScrollingLayer()) { |
157 if (scrollingAncestor->needsCompositedScrolling() && layer->scrollParent ()) | 152 if (scrollingAncestor->needsCompositedScrolling() && layer->scrollParent ()) |
158 directReasons |= CompositingReasonOverflowScrollingParent; | 153 directReasons |= CompositingReasonOverflowScrollingParent; |
159 } | 154 } |
160 | 155 |
161 if (requiresCompositingForPositionFixed(layer)) | 156 if (requiresCompositingForPositionFixed(layer)) |
162 directReasons |= CompositingReasonPositionFixed; | 157 directReasons |= CompositingReasonPositionFixed; |
163 | 158 |
164 directReasons |= layoutObject->additionalCompositingReasons(); | 159 directReasons |= layoutObject->additionalCompositingReasons(); |
(...skipping 13 matching lines...) Expand all Loading... | |
178 bool CompositingReasonFinder::requiresCompositingForPositionFixed(const PaintLay er* layer) const | 173 bool CompositingReasonFinder::requiresCompositingForPositionFixed(const PaintLay er* layer) const |
179 { | 174 { |
180 if (!(m_compositingTriggers & ViewportConstrainedPositionedTrigger)) | 175 if (!(m_compositingTriggers & ViewportConstrainedPositionedTrigger)) |
181 return false; | 176 return false; |
182 // Don't promote fixed position elements that are descendants of a non-view container, e.g. transformed elements. | 177 // Don't promote fixed position elements that are descendants of a non-view container, e.g. transformed elements. |
183 // They will stay fixed wrt the container rather than the enclosing frame. | 178 // They will stay fixed wrt the container rather than the enclosing frame. |
184 return layer->scrollsWithViewport() && m_layoutView.frameView()->isScrollabl e(); | 179 return layer->scrollsWithViewport() && m_layoutView.frameView()->isScrollabl e(); |
185 } | 180 } |
186 | 181 |
187 } // namespace blink | 182 } // namespace blink |
OLD | NEW |