| 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" |
| 11 #include "core/layout/LayoutView.h" | 11 #include "core/layout/LayoutView.h" |
| 12 #include "core/page/Page.h" | 12 #include "core/page/Page.h" |
| 13 #include "core/paint/PaintLayer.h" | 13 #include "core/paint/PaintLayer.h" |
| 14 | 14 |
| 15 namespace blink { | 15 namespace blink { |
| 16 | 16 |
| 17 CompositingReasonFinder::CompositingReasonFinder(LayoutView& layoutView) | 17 CompositingReasonFinder::CompositingReasonFinder(LayoutView& layoutView) |
| 18 : m_layoutView(layoutView), | 18 : m_layoutView(layoutView), |
| 19 m_compositingTriggers( | 19 m_compositingTriggers( |
| 20 static_cast<CompositingTriggerFlags>(AllCompositingTriggers)) { | 20 static_cast<CompositingTriggerFlags>(AllCompositingTriggers)) { |
| 21 updateTriggers(); | 21 updateTriggers(); |
| 22 } | 22 } |
| 23 | 23 |
| 24 void CompositingReasonFinder::updateTriggers() { | 24 void CompositingReasonFinder::updateTriggers() { |
| 25 m_compositingTriggers = 0; | 25 m_compositingTriggers = 0; |
| 26 | 26 |
| 27 Settings& settings = m_layoutView.document().page()->settings(); | 27 Settings& settings = m_layoutView.document().page()->settings(); |
| 28 if (settings.preferCompositingToLCDTextEnabled()) { | 28 if (settings.getPreferCompositingToLCDTextEnabled()) { |
| 29 m_compositingTriggers |= ScrollableInnerFrameTrigger; | 29 m_compositingTriggers |= ScrollableInnerFrameTrigger; |
| 30 m_compositingTriggers |= OverflowScrollTrigger; | 30 m_compositingTriggers |= OverflowScrollTrigger; |
| 31 m_compositingTriggers |= ViewportConstrainedPositionedTrigger; | 31 m_compositingTriggers |= ViewportConstrainedPositionedTrigger; |
| 32 } | 32 } |
| 33 } | 33 } |
| 34 | 34 |
| 35 bool CompositingReasonFinder::isMainFrame() const { | 35 bool CompositingReasonFinder::isMainFrame() const { |
| 36 return m_layoutView.document().isInMainFrame(); | 36 return m_layoutView.document().isInMainFrame(); |
| 37 } | 37 } |
| 38 | 38 |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 // Don't promote fixed position elements that are descendants of a non-view | 214 // Don't promote fixed position elements that are descendants of a non-view |
| 215 // container, e.g. transformed elements. They will stay fixed wrt the | 215 // container, e.g. transformed elements. They will stay fixed wrt the |
| 216 // container rather than the enclosing frame. | 216 // container rather than the enclosing frame. |
| 217 if (layer->sticksToViewport()) | 217 if (layer->sticksToViewport()) |
| 218 return m_layoutView.frameView()->isScrollable(); | 218 return m_layoutView.frameView()->isScrollable(); |
| 219 return layer->layoutObject()->style()->position() == StickyPosition && | 219 return layer->layoutObject()->style()->position() == StickyPosition && |
| 220 layer->ancestorOverflowLayer()->scrollsOverflow(); | 220 layer->ancestorOverflowLayer()->scrollsOverflow(); |
| 221 } | 221 } |
| 222 | 222 |
| 223 } // namespace blink | 223 } // namespace blink |
| OLD | NEW |