| Differences between
and this patch
- a/Source/WebCore/ChangeLog +25 lines
Lines 1-3 a/Source/WebCore/ChangeLog_sec1
1
2017-05-11  Frederic Wang  <fwang@igalia.com>
2
3
        Unify hasTouchScrollableOverflow/needsCompositedScrolling concepts
4
        https://bugs.webkit.org/show_bug.cgi?id=171974
5
6
        Reviewed by Simon Fraser.
7
8
        This commit moves the following pattern in a single RenderLayer::usesAcceleratedScrolling function:
9
        #if PLATFORM(IOS)
10
        ...hasTouchScrollableOverflow()...
11
        #else
12
        ...needsCompositedScrolling()...
13
        #endif
14
15
        No new tests, behavior unchanged.
16
17
        * rendering/RenderLayer.cpp:
18
        (WebCore::RenderLayer::usesAcceleratedScrolling): Introduce helper function.
19
        * rendering/RenderLayer.h: Declare the function.
20
        * rendering/RenderLayerBacking.cpp:
21
        (WebCore::layerOrAncestorIsTransformedOrUsingCompositedScrolling): Use the new function.
22
        (WebCore::RenderLayerBacking::updateConfiguration): Ditto.
23
        * rendering/RenderLayerCompositor.cpp:
24
        (WebCore::useCoordinatedScrollingForLayer): Ditto.
25
1
2017-05-10  Eric Carlson  <eric.carlson@apple.com>
26
2017-05-10  Eric Carlson  <eric.carlson@apple.com>
2
27
3
        [MediaStream] CoreAudioCaptureSource claims to never be muted
28
        [MediaStream] CoreAudioCaptureSource claims to never be muted
- a/Source/WebCore/rendering/RenderLayer.cpp +9 lines
Lines 2188-2193 bool RenderLayer::handleTouchEvent(const PlatformTouchEvent& touchEvent) a/Source/WebCore/rendering/RenderLayer.cpp_sec1
2188
#endif
2188
#endif
2189
#endif // PLATFORM(IOS)
2189
#endif // PLATFORM(IOS)
2190
2190
2191
bool RenderLayer::usesAcceleratedScrolling() const
2192
{
2193
#if PLATFORM(IOS)
2194
    return hasTouchScrollableOverflow();
2195
#else
2196
    return needsCompositedScrolling();
2197
#endif
2198
}
2199
2191
#if ENABLE(IOS_TOUCH_EVENTS)
2200
#if ENABLE(IOS_TOUCH_EVENTS)
2192
void RenderLayer::registerAsTouchEventListenerForScrolling()
2201
void RenderLayer::registerAsTouchEventListenerForScrolling()
2193
{
2202
{
- a/Source/WebCore/rendering/RenderLayer.h +1 lines
Lines 265-270 public: a/Source/WebCore/rendering/RenderLayer.h_sec1
265
    bool hasAcceleratedTouchScrolling() const { return false; }
265
    bool hasAcceleratedTouchScrolling() const { return false; }
266
    bool hasTouchScrollableOverflow() const { return false; }
266
    bool hasTouchScrollableOverflow() const { return false; }
267
#endif
267
#endif
268
    bool usesAcceleratedScrolling() const;
268
269
269
    int verticalScrollbarWidth(OverlayScrollbarSizeRelevancy = IgnoreOverlayScrollbarSize) const;
270
    int verticalScrollbarWidth(OverlayScrollbarSizeRelevancy = IgnoreOverlayScrollbarSize) const;
270
    int horizontalScrollbarHeight(OverlayScrollbarSizeRelevancy = IgnoreOverlayScrollbarSize) const;
271
    int horizontalScrollbarHeight(OverlayScrollbarSizeRelevancy = IgnoreOverlayScrollbarSize) const;
- a/Source/WebCore/rendering/RenderLayerBacking.cpp -14 / +3 lines
Lines 546-562 void RenderLayerBacking::updateCustomAppearance(const RenderStyle& style) a/Source/WebCore/rendering/RenderLayerBacking.cpp_sec1
546
        m_graphicsLayer->setCustomAppearance(GraphicsLayer::NoCustomAppearance);
546
        m_graphicsLayer->setCustomAppearance(GraphicsLayer::NoCustomAppearance);
547
}
547
}
548
548
549
// FIXME: the hasAcceleratedTouchScrolling()/needsCompositedScrolling() concepts need to be merged.
550
static bool layerOrAncestorIsTransformedOrUsingCompositedScrolling(RenderLayer& layer)
549
static bool layerOrAncestorIsTransformedOrUsingCompositedScrolling(RenderLayer& layer)
551
{
550
{
552
    for (RenderLayer* curr = &layer; curr; curr = curr->parent()) {
551
    for (RenderLayer* curr = &layer; curr; curr = curr->parent()) {
553
        if (curr->hasTransform()
552
        if (curr->hasTransform() || curr->usesAcceleratedScrolling())
554
#if PLATFORM(IOS)
555
            || curr->hasTouchScrollableOverflow()
556
#else
557
            || curr->needsCompositedScrolling()
558
#endif
559
            )
560
            return true;
553
            return true;
561
    }
554
    }
562
555
Lines 682-693 bool RenderLayerBacking::updateConfiguration() a/Source/WebCore/rendering/RenderLayerBacking.cpp_sec2
682
    bool needsDescendantsClippingLayer = compositor().clipsCompositingDescendants(m_owningLayer);
675
    bool needsDescendantsClippingLayer = compositor().clipsCompositingDescendants(m_owningLayer);
683
676
684
    if (!renderer().view().needsLayout()) {
677
    if (!renderer().view().needsLayout()) {
685
        bool usesCompositedScrolling;
678
        bool usesCompositedScrolling = m_owningLayer.usesAcceleratedScrolling();
686
#if PLATFORM(IOS)
679
687
        usesCompositedScrolling = m_owningLayer.hasTouchScrollableOverflow();
688
#else
689
        usesCompositedScrolling = m_owningLayer.needsCompositedScrolling();
690
#endif
691
        // Our scrolling layer will clip.
680
        // Our scrolling layer will clip.
692
        if (usesCompositedScrolling)
681
        if (usesCompositedScrolling)
693
            needsDescendantsClippingLayer = false;
682
            needsDescendantsClippingLayer = false;
- a/Source/WebCore/rendering/RenderLayerCompositor.cpp -5 / +1 lines
Lines 2723-2733 static bool useCoordinatedScrollingForLayer(RenderView& view, const RenderLayer& a/Source/WebCore/rendering/RenderLayerCompositor.cpp_sec1
2723
    if (layer.isRootLayer() && view.frameView().frame().isMainFrame())
2723
    if (layer.isRootLayer() && view.frameView().frame().isMainFrame())
2724
        return true;
2724
        return true;
2725
2725
2726
#if PLATFORM(IOS)
2726
    return layer.usesAcceleratedScrolling();
2727
    return layer.hasTouchScrollableOverflow();
2728
#else
2729
    return layer.needsCompositedScrolling();
2730
#endif
2731
}
2727
}
2732
2728
2733
bool RenderLayerCompositor::requiresCompositingForPosition(RenderLayerModelObject& renderer, const RenderLayer& layer, RenderLayer::ViewportConstrainedNotCompositedReason* viewportConstrainedNotCompositedReason) const
2729
bool RenderLayerCompositor::requiresCompositingForPosition(RenderLayerModelObject& renderer, const RenderLayer& layer, RenderLayer::ViewportConstrainedNotCompositedReason* viewportConstrainedNotCompositedReason) const

Return to Bug 171974