Changeset 232543 in webkit


Ignore:
Timestamp:
Jun 6, 2018, 9:13:31 AM (7 years ago)
Author:
jer.noble@apple.com
Message:

Regions outside of the fullscreen window are exposed during zoom operations
https://bugs.webkit.org/show_bug.cgi?id=186330
<rdar://problem/34698009>

Reviewed by Simon Fraser.

Source/WebCore:

Test: fullscreen/full-screen-layer-dump.html

Introduce the concept of "requiresBackgroundLayer" to RenderLayerBacking, for use by
RenderFullScreen. Previously, the backgroundLayer in RenderLayerBacking was only used
by the root renderer with fixed backgrounds. Give the RenderFullScreen a background layer
that's approximately 3x as tall and wide as the renderer itself, so nothing is exposed
during pinch operations.

  • rendering/RenderLayerBacking.cpp:

(WebCore::RenderLayerBacking::RenderLayerBacking):
(WebCore::RenderLayerBacking::updateConfiguration):
(WebCore::RenderLayerBacking::updateGeometry):
(WebCore::RenderLayerBacking::updateDrawsContent):
(WebCore::RenderLayerBacking::setRequiresBackgroundLayer):
(WebCore::RenderLayerBacking::updateBackgroundLayer):
(WebCore::RenderLayerBacking::updateDirectlyCompositedBackgroundColor):
(WebCore::RenderLayerBacking::paintIntoLayer):

  • rendering/RenderLayerBacking.h:

LayoutTests:

  • fullscreen/full-screen-layer-dump-expected.txt: Added.
  • fullscreen/full-screen-layer-dump.html: Added.
Location:
trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r232538 r232543  
     12018-06-06  Jer Noble  <jer.noble@apple.com>
     2
     3        Regions outside of the fullscreen window are exposed during zoom operations
     4        https://bugs.webkit.org/show_bug.cgi?id=186330
     5        <rdar://problem/34698009>
     6
     7        Reviewed by Simon Fraser.
     8
     9        * fullscreen/full-screen-layer-dump-expected.txt: Added.
     10        * fullscreen/full-screen-layer-dump.html: Added.
     11
    1122018-06-06  Alicia Boya García  <aboya@igalia.com>
    213
  • trunk/Source/WebCore/ChangeLog

    r232542 r232543  
     12018-06-06  Jer Noble  <jer.noble@apple.com>
     2
     3        Regions outside of the fullscreen window are exposed during zoom operations
     4        https://bugs.webkit.org/show_bug.cgi?id=186330
     5        <rdar://problem/34698009>
     6
     7        Reviewed by Simon Fraser.
     8
     9        Test: fullscreen/full-screen-layer-dump.html
     10
     11        Introduce the concept of "requiresBackgroundLayer" to RenderLayerBacking, for use by
     12        RenderFullScreen. Previously, the backgroundLayer in RenderLayerBacking was only used
     13        by the root renderer with fixed backgrounds. Give the RenderFullScreen a background layer
     14        that's approximately 3x as tall and wide as the renderer itself, so nothing is exposed
     15        during pinch operations.
     16
     17        * rendering/RenderLayerBacking.cpp:
     18        (WebCore::RenderLayerBacking::RenderLayerBacking):
     19        (WebCore::RenderLayerBacking::updateConfiguration):
     20        (WebCore::RenderLayerBacking::updateGeometry):
     21        (WebCore::RenderLayerBacking::updateDrawsContent):
     22        (WebCore::RenderLayerBacking::setRequiresBackgroundLayer):
     23        (WebCore::RenderLayerBacking::updateBackgroundLayer):
     24        (WebCore::RenderLayerBacking::updateDirectlyCompositedBackgroundColor):
     25        (WebCore::RenderLayerBacking::paintIntoLayer):
     26        * rendering/RenderLayerBacking.h:
     27
    1282018-06-06  Jer Noble  <jer.noble@apple.com>
    229
  • trunk/Source/WebCore/rendering/RenderLayerBacking.cpp

    r232178 r232543  
    218218   
    219219    createPrimaryGraphicsLayer();
     220#if ENABLE(FULLSCREEN_API)
     221    setRequiresBackgroundLayer(layer.renderer().isRenderFullScreen());
     222#endif
    220223
    221224    if (auto* tiledBacking = this->tiledBacking()) {
     
    671674   
    672675    // The background layer is currently only used for fixed root backgrounds.
    673     if (updateBackgroundLayer(m_backgroundLayerPaintsFixedRootBackground))
     676    if (updateBackgroundLayer(m_backgroundLayerPaintsFixedRootBackground || m_requiresBackgroundLayer))
    674677        layerConfigChanged = true;
    675678
     
    10321035    }
    10331036
    1034     if (!m_isMainFrameRenderViewLayer && !m_isFrameLayerWithTiledBacking) {
     1037    if (!m_isMainFrameRenderViewLayer && !m_isFrameLayerWithTiledBacking && !m_requiresBackgroundLayer) {
    10351038        // For non-root layers, background is always painted by the primary graphics layer.
    10361039        ASSERT(!m_backgroundLayer);
     
    11211124            backgroundPosition = frameView.scrollPositionForFixedPosition();
    11221125            backgroundSize = frameView.layoutSize();
     1126        } else {
     1127            auto boundingBox = renderer().objectBoundingBox();
     1128            backgroundPosition = boundingBox.location();
     1129            backgroundSize = boundingBox.size();
    11231130        }
    11241131        m_backgroundLayer->setPosition(backgroundPosition);
     
    13871394
    13881395    if (m_backgroundLayer)
    1389         m_backgroundLayer->setDrawsContent(hasPaintedContent);
     1396        m_backgroundLayer->setDrawsContent(m_backgroundLayerPaintsFixedRootBackground ? hasPaintedContent : contentsInfo.paintsBoxDecorations());
    13901397}
    13911398
     
    14431450        renderer().view().frameView().removeSlowRepaintObject(*renderer().view().rendererForRootBackground());
    14441451    }
     1452}
     1453
     1454void RenderLayerBacking::setRequiresBackgroundLayer(bool requiresBackgroundLayer)
     1455{
     1456    m_requiresBackgroundLayer = requiresBackgroundLayer;
    14451457}
    14461458
     
    16411653    if (layerChanged) {
    16421654        m_graphicsLayer->setNeedsDisplay();
    1643         // This assumes that the background layer is only used for fixed backgrounds, which is currently a correct assumption.
    1644         compositor().fixedRootBackgroundLayerChanged();
     1655
     1656        if (m_backgroundLayerPaintsFixedRootBackground)
     1657            compositor().fixedRootBackgroundLayerChanged();
    16451658    }
    16461659   
     
    18911904void RenderLayerBacking::updateDirectlyCompositedBackgroundColor(PaintedContentsInfo& contentsInfo, bool& didUpdateContentsRect)
    18921905{
     1906    if (m_backgroundLayer && !m_backgroundLayerPaintsFixedRootBackground && !contentsInfo.paintsBoxDecorations()) {
     1907        m_graphicsLayer->setContentsToSolidColor(Color());
     1908        m_backgroundLayer->setContentsToSolidColor(rendererBackgroundColor());
     1909
     1910        FloatRect contentsRect = backgroundBoxForSimpleContainerPainting();
     1911        // NOTE: This is currently only used by RenderFullScreen, which we want to be
     1912        // big enough to hide overflow areas of the root.
     1913        contentsRect.inflate(contentsRect.size());
     1914        m_backgroundLayer->setContentsRect(contentsRect);
     1915        m_backgroundLayer->setContentsClippingRect(FloatRoundedRect(contentsRect));
     1916        return;
     1917    }
     1918
    18931919    if (!contentsInfo.isSimpleContainer() || (is<RenderBox>(renderer()) && !downcast<RenderBox>(renderer()).paintsOwnBackground())) {
    18941920        m_graphicsLayer->setContentsToSolidColor(Color());
     
    25202546        paintFlags |= RenderLayer::PaintLayerPaintingCompositingScrollingPhase;
    25212547
    2522     if (graphicsLayer == m_backgroundLayer.get())
     2548    if (graphicsLayer == m_backgroundLayer.get() && m_backgroundLayerPaintsFixedRootBackground)
    25232549        paintFlags |= (RenderLayer::PaintLayerPaintingRootBackgroundOnly | RenderLayer::PaintLayerPaintingCompositingForegroundPhase); // Need PaintLayerPaintingCompositingForegroundPhase to walk child layers.
    25242550    else if (compositor().fixedRootBackgroundLayer())
  • trunk/Source/WebCore/rendering/RenderLayerBacking.h

    r230574 r232543  
    9999    GraphicsLayer* backgroundLayer() const { return m_backgroundLayer.get(); }
    100100    bool backgroundLayerPaintsFixedRootBackground() const { return m_backgroundLayerPaintsFixedRootBackground; }
     101
     102    bool requiresBackgroundLayer() const { return m_requiresBackgroundLayer; }
     103    void setRequiresBackgroundLayer(bool);
    101104   
    102105    bool hasScrollingLayer() const { return m_scrollingLayer != nullptr; }
     
    385388#endif
    386389    bool m_backgroundLayerPaintsFixedRootBackground { false };
     390    bool m_requiresBackgroundLayer { false };
    387391    bool m_paintsSubpixelAntialiasedText { false }; // This is for logging only.
    388392};
Note: See TracChangeset for help on using the changeset viewer.