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 11 matching lines...) Expand all Loading... |
22 updateTriggers(); | 22 updateTriggers(); |
23 } | 23 } |
24 | 24 |
25 void CompositingReasonFinder::updateTriggers() | 25 void CompositingReasonFinder::updateTriggers() |
26 { | 26 { |
27 m_compositingTriggers = 0; | 27 m_compositingTriggers = 0; |
28 | 28 |
29 Settings& settings = m_renderView.document().page()->settings(); | 29 Settings& settings = m_renderView.document().page()->settings(); |
30 if (settings.preferCompositingToLCDTextEnabled()) { | 30 if (settings.preferCompositingToLCDTextEnabled()) { |
31 m_compositingTriggers |= ScrollableInnerFrameTrigger; | 31 m_compositingTriggers |= ScrollableInnerFrameTrigger; |
| 32 m_compositingTriggers |= OverflowScrollTrigger; |
32 m_compositingTriggers |= ViewportConstrainedPositionedTrigger; | 33 m_compositingTriggers |= ViewportConstrainedPositionedTrigger; |
33 } | 34 } |
34 | |
35 // We map both these settings to universal overlow scrolling. | |
36 // FIXME: Replace these settings with a generic compositing setting for High
DPI. | |
37 if (settings.acceleratedCompositingForOverflowScrollEnabled() || settings.co
mpositorDrivenAcceleratedScrollingEnabled()) | |
38 m_compositingTriggers |= OverflowScrollTrigger; | |
39 } | 35 } |
40 | 36 |
41 bool CompositingReasonFinder::hasOverflowScrollTrigger() const | 37 bool CompositingReasonFinder::hasOverflowScrollTrigger() const |
42 { | 38 { |
43 return m_compositingTriggers & OverflowScrollTrigger; | 39 return m_compositingTriggers & OverflowScrollTrigger; |
44 } | 40 } |
45 | 41 |
46 bool CompositingReasonFinder::isMainFrame() const | 42 bool CompositingReasonFinder::isMainFrame() const |
47 { | 43 { |
48 // FIXME: LocalFrame::isMainFrame() is probably better. | 44 // FIXME: LocalFrame::isMainFrame() is probably better. |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 bool CompositingReasonFinder::requiresCompositingForPositionFixed(const RenderLa
yer* layer) const | 164 bool CompositingReasonFinder::requiresCompositingForPositionFixed(const RenderLa
yer* layer) const |
169 { | 165 { |
170 if (!(m_compositingTriggers & ViewportConstrainedPositionedTrigger)) | 166 if (!(m_compositingTriggers & ViewportConstrainedPositionedTrigger)) |
171 return false; | 167 return false; |
172 // Don't promote fixed position elements that are descendants of a non-view
container, e.g. transformed elements. | 168 // Don't promote fixed position elements that are descendants of a non-view
container, e.g. transformed elements. |
173 // They will stay fixed wrt the container rather than the enclosing frame. | 169 // They will stay fixed wrt the container rather than the enclosing frame. |
174 return layer->scrollsWithViewport() && m_renderView.frameView()->isScrollabl
e(); | 170 return layer->scrollsWithViewport() && m_renderView.frameView()->isScrollabl
e(); |
175 } | 171 } |
176 | 172 |
177 } | 173 } |
OLD | NEW |