| 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 "CSSPropertyNames.h" | 8 #include "CSSPropertyNames.h" |
| 9 #include "HTMLNames.h" | 9 #include "HTMLNames.h" |
| 10 #include "core/frame/FrameView.h" | 10 #include "core/frame/FrameView.h" |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 if (settings.acceleratedCompositingForCanvasEnabled()) | 52 if (settings.acceleratedCompositingForCanvasEnabled()) |
| 53 m_compositingTriggers |= CanvasTrigger; | 53 m_compositingTriggers |= CanvasTrigger; |
| 54 if (settings.acceleratedCompositingForAnimationEnabled()) | 54 if (settings.acceleratedCompositingForAnimationEnabled()) |
| 55 m_compositingTriggers |= AnimationTrigger; | 55 m_compositingTriggers |= AnimationTrigger; |
| 56 if (settings.compositedScrollingForFramesEnabled()) | 56 if (settings.compositedScrollingForFramesEnabled()) |
| 57 m_compositingTriggers |= ScrollableInnerFrameTrigger; | 57 m_compositingTriggers |= ScrollableInnerFrameTrigger; |
| 58 if (settings.acceleratedCompositingForFiltersEnabled()) | 58 if (settings.acceleratedCompositingForFiltersEnabled()) |
| 59 m_compositingTriggers |= FilterTrigger; | 59 m_compositingTriggers |= FilterTrigger; |
| 60 if (settings.acceleratedCompositingForGpuRasterizationHintEnabled()) | 60 if (settings.acceleratedCompositingForGpuRasterizationHintEnabled()) |
| 61 m_compositingTriggers |= GPURasterizationTrigger; | 61 m_compositingTriggers |= GPURasterizationTrigger; |
| 62 if (settings.acceleratedCompositingForOverflowScrollEnabled()) | 62 |
| 63 m_compositingTriggers |= LegacyOverflowScrollTrigger; | 63 // We map both these settings to universal overlow scrolling. |
| 64 if (settings.compositorDrivenAcceleratedScrollingEnabled()) | 64 // FIXME: Replace these settings with a generic compositing setting for High
DPI. |
| 65 if (settings.acceleratedCompositingForOverflowScrollEnabled() || settings.co
mpositorDrivenAcceleratedScrollingEnabled()) |
| 65 m_compositingTriggers |= OverflowScrollTrigger; | 66 m_compositingTriggers |= OverflowScrollTrigger; |
| 67 |
| 66 // FIXME: acceleratedCompositingForFixedPositionEnabled should be renamed ac
celeratedCompositingForViewportConstrainedPositionEnabled(). | 68 // FIXME: acceleratedCompositingForFixedPositionEnabled should be renamed ac
celeratedCompositingForViewportConstrainedPositionEnabled(). |
| 67 // Or the sticky and fixed position elements should be behind different flag
s. | 69 // Or the sticky and fixed position elements should be behind different flag
s. |
| 68 if (settings.acceleratedCompositingForFixedPositionEnabled()) | 70 if (settings.acceleratedCompositingForFixedPositionEnabled()) |
| 69 m_compositingTriggers |= ViewportConstrainedPositionedTrigger; | 71 m_compositingTriggers |= ViewportConstrainedPositionedTrigger; |
| 70 | |
| 71 // FIXME: This monkeying with the accelerated triggers is temporary and shou
ld | |
| 72 // be removed once the feature ships. | |
| 73 | |
| 74 // Currently, we must have the legacy path enabled to use the new path. | |
| 75 if (!(m_compositingTriggers & LegacyOverflowScrollTrigger)) | |
| 76 m_compositingTriggers &= ~OverflowScrollTrigger; | |
| 77 | |
| 78 // Enable universal overflow scrolling (and only universal overflow scrollin
g) | |
| 79 // on the new bleeding edge path. The above requirement (having legacy enabl
ed) | |
| 80 // was only necessary to avoid explosions; the legacy path created far fewer | |
| 81 // layers. In the world of squashing, this doesn't make sense. We never want | |
| 82 // to use the old path in that case. | |
| 83 if (RuntimeEnabledFeatures::bleedingEdgeFastPathsEnabled()) { | |
| 84 m_compositingTriggers |= OverflowScrollTrigger; | |
| 85 m_compositingTriggers &= ~LegacyOverflowScrollTrigger; | |
| 86 } | |
| 87 } | 72 } |
| 88 | 73 |
| 89 bool CompositingReasonFinder::has3DTransformTrigger() const | 74 bool CompositingReasonFinder::has3DTransformTrigger() const |
| 90 { | 75 { |
| 91 return m_compositingTriggers & ThreeDTransformTrigger; | 76 return m_compositingTriggers & ThreeDTransformTrigger; |
| 92 } | 77 } |
| 93 | 78 |
| 94 bool CompositingReasonFinder::hasAnimationTrigger() const | 79 bool CompositingReasonFinder::hasAnimationTrigger() const |
| 95 { | 80 { |
| 96 return m_compositingTriggers & AnimationTrigger; | 81 return m_compositingTriggers & AnimationTrigger; |
| (...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 380 *needToRecomputeCompositingRequirements = true; | 365 *needToRecomputeCompositingRequirements = true; |
| 381 } | 366 } |
| 382 return false; | 367 return false; |
| 383 } | 368 } |
| 384 } | 369 } |
| 385 | 370 |
| 386 return true; | 371 return true; |
| 387 } | 372 } |
| 388 | 373 |
| 389 } | 374 } |
| OLD | NEW |