Chromium Code Reviews| Index: Source/core/rendering/RenderLayer.cpp |
| diff --git a/Source/core/rendering/RenderLayer.cpp b/Source/core/rendering/RenderLayer.cpp |
| index ae12437c9cdef7f295937445478a217fd6ffad36..1ea81a6c0a4499ba5d2b13adeccdcb2faf6567e4 100644 |
| --- a/Source/core/rendering/RenderLayer.cpp |
| +++ b/Source/core/rendering/RenderLayer.cpp |
| @@ -495,6 +495,26 @@ bool RenderLayer::acceleratedCompositingForOverflowScrollEnabled() const |
| return settings && settings->acceleratedCompositingForOverflowScrollEnabled(); |
| } |
| +bool RenderLayer::useCompositorDrivenAcceleratedScrolling() const |
| +{ |
| + TRACE_EVENT0("comp-scroll", "RenderLayer::useCompositorDrivenAcceleratedScrolling"); |
| + |
| + if (!compositorDrivenAcceleratedScrollingEnabled()) |
| + return false; |
| + |
| + const RenderLayer* scrollingLayer = ancestorScrollingLayer(); |
| + if (!scrollingLayer || scrollingLayer->isStackingContainer()) |
| + return false; |
| + |
| + if (scrollingLayer->m_canBePromotedToStackingContainerDirty) { |
|
Ian Vollick
2013/08/08 03:30:10
Can you describe how we get into the situation whe
hartmanng
2013/08/08 13:41:37
The situation I ran into looks like this:
[0x7f7
|
| + // We don't know if it's safe to promote to stacking container, and |
| + // aren't in a position to find out, so we have to assume the worst. |
| + return true; |
| + } |
| + |
| + return !scrollingLayer->canBeStackingContainer(); |
| +} |
| + |
| // FIXME: This is a temporary flag and should be removed once accelerated |
| // overflow scroll is ready (crbug.com/254111). |
| bool RenderLayer::compositorDrivenAcceleratedScrollingEnabled() const |