| 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 "config.h" | 5 #include "config.h" |
| 6 #include "core/rendering/compositing/CompositingReasonFinder.h" | 6 #include "core/rendering/compositing/CompositingReasonFinder.h" |
| 7 | 7 |
| 8 #include "core/CSSPropertyNames.h" | 8 #include "core/CSSPropertyNames.h" |
| 9 #include "core/dom/Document.h" | 9 #include "core/dom/Document.h" |
| 10 #include "core/frame/FrameView.h" | 10 #include "core/frame/FrameView.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 | 28 |
| 29 Settings& settings = m_renderView.document().page()->settings(); | 29 Settings& settings = m_renderView.document().page()->settings(); |
| 30 if (settings.compositedScrollingForFramesEnabled()) | 30 if (settings.compositedScrollingForFramesEnabled()) |
| 31 m_compositingTriggers |= ScrollableInnerFrameTrigger; | 31 m_compositingTriggers |= ScrollableInnerFrameTrigger; |
| 32 | 32 |
| 33 // We map both these settings to universal overlow scrolling. | 33 // We map both these settings to universal overlow scrolling. |
| 34 // FIXME: Replace these settings with a generic compositing setting for High
DPI. | 34 // FIXME: Replace these settings with a generic compositing setting for High
DPI. |
| 35 if (settings.acceleratedCompositingForOverflowScrollEnabled() || settings.co
mpositorDrivenAcceleratedScrollingEnabled()) | 35 if (settings.acceleratedCompositingForOverflowScrollEnabled() || settings.co
mpositorDrivenAcceleratedScrollingEnabled()) |
| 36 m_compositingTriggers |= OverflowScrollTrigger; | 36 m_compositingTriggers |= OverflowScrollTrigger; |
| 37 | 37 |
| 38 if (settings.acceleratedCompositingForFixedPositionEnabled()) | 38 if (settings.preferCompositingToLCDTextEnabled()) |
| 39 m_compositingTriggers |= ViewportConstrainedPositionedTrigger; | 39 m_compositingTriggers |= ViewportConstrainedPositionedTrigger; |
| 40 } | 40 } |
| 41 | 41 |
| 42 bool CompositingReasonFinder::hasOverflowScrollTrigger() const | 42 bool CompositingReasonFinder::hasOverflowScrollTrigger() const |
| 43 { | 43 { |
| 44 return m_compositingTriggers & OverflowScrollTrigger; | 44 return m_compositingTriggers & OverflowScrollTrigger; |
| 45 } | 45 } |
| 46 | 46 |
| 47 bool CompositingReasonFinder::isMainFrame() const | 47 bool CompositingReasonFinder::isMainFrame() const |
| 48 { | 48 { |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 bool CompositingReasonFinder::requiresCompositingForPositionFixed(const RenderLa
yer* layer) const | 169 bool CompositingReasonFinder::requiresCompositingForPositionFixed(const RenderLa
yer* layer) const |
| 170 { | 170 { |
| 171 if (!(m_compositingTriggers & ViewportConstrainedPositionedTrigger)) | 171 if (!(m_compositingTriggers & ViewportConstrainedPositionedTrigger)) |
| 172 return false; | 172 return false; |
| 173 // Don't promote fixed position elements that are descendants of a non-view
container, e.g. transformed elements. | 173 // Don't promote fixed position elements that are descendants of a non-view
container, e.g. transformed elements. |
| 174 // They will stay fixed wrt the container rather than the enclosing frame. | 174 // They will stay fixed wrt the container rather than the enclosing frame. |
| 175 return layer->scrollsWithViewport() && m_renderView.frameView()->isScrollabl
e(); | 175 return layer->scrollsWithViewport() && m_renderView.frameView()->isScrollabl
e(); |
| 176 } | 176 } |
| 177 | 177 |
| 178 } | 178 } |
| OLD | NEW |