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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 return layout_object.HasTransformRelatedProperty() && | 140 return layout_object.HasTransformRelatedProperty() && |
141 layout_object.StyleRef().Has3DTransform(); | 141 layout_object.StyleRef().Has3DTransform(); |
142 } | 142 } |
143 | 143 |
144 CompositingReasons CompositingReasonFinder::NonStyleDeterminedDirectReasons( | 144 CompositingReasons CompositingReasonFinder::NonStyleDeterminedDirectReasons( |
145 const PaintLayer* layer, | 145 const PaintLayer* layer, |
146 bool ignore_lcd_text) const { | 146 bool ignore_lcd_text) const { |
147 CompositingReasons direct_reasons = kCompositingReasonNone; | 147 CompositingReasons direct_reasons = kCompositingReasonNone; |
148 LayoutObject& layout_object = layer->GetLayoutObject(); | 148 LayoutObject& layout_object = layer->GetLayoutObject(); |
149 | 149 |
150 if (compositing_triggers_ & kOverflowScrollTrigger && layer->ClipParent()) | 150 if (layer->ClipParent()) |
151 direct_reasons |= kCompositingReasonOutOfFlowClipping; | 151 direct_reasons |= kCompositingReasonOutOfFlowClipping; |
152 | 152 |
153 if (layer->NeedsCompositedScrolling()) | 153 if (layer->NeedsCompositedScrolling()) |
154 direct_reasons |= kCompositingReasonOverflowScrollingTouch; | 154 direct_reasons |= kCompositingReasonOverflowScrollingTouch; |
155 | 155 |
156 // Composite |layer| if it is inside of an ancestor scrolling layer, but that | 156 // Composite |layer| if it is inside of an ancestor scrolling layer, but that |
157 // scrolling layer is not on the stacking context ancestor chain of |layer|. | 157 // scrolling layer is not on the stacking context ancestor chain of |layer|. |
158 // See the definition of the scrollParent property in Layer for more detail. | 158 // See the definition of the scrollParent property in Layer for more detail. |
159 if (const PaintLayer* scrolling_ancestor = layer->AncestorScrollingLayer()) { | 159 if (const PaintLayer* scrolling_ancestor = layer->AncestorScrollingLayer()) { |
160 if (scrolling_ancestor->NeedsCompositedScrolling() && layer->ScrollParent()) | 160 if (scrolling_ancestor->NeedsCompositedScrolling() && layer->ScrollParent()) |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 | 239 |
240 // Don't promote sticky position elements that cannot move with scrolls. | 240 // Don't promote sticky position elements that cannot move with scrolls. |
241 if (!layer->SticksToScroller()) | 241 if (!layer->SticksToScroller()) |
242 return false; | 242 return false; |
243 if (layer->AncestorOverflowLayer()->IsRootLayer()) | 243 if (layer->AncestorOverflowLayer()->IsRootLayer()) |
244 return layout_view_.GetFrameView()->IsScrollable(); | 244 return layout_view_.GetFrameView()->IsScrollable(); |
245 return layer->AncestorOverflowLayer()->ScrollsOverflow(); | 245 return layer->AncestorOverflowLayer()->ScrollsOverflow(); |
246 } | 246 } |
247 | 247 |
248 } // namespace blink | 248 } // namespace blink |
OLD | NEW |