⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 203497 in webkit


Ignore:
Timestamp:
Jul 21, 2016, 12:25:26 AM (10 years ago)
Author:
Carlos Garcia Campos
Message:

[GTK][Threaded Compositor] Web view background colors don't work
​https://bugs.webkit.org/show_bug.cgi?id=159465

Reviewed by Michael Catanzaro.

Source/WebCore:

  • rendering/RenderLayerBacking.cpp:

(WebCore::RenderLayerBacking::createPrimaryGraphicsLayer): Initialize frame view layer opacity for platforms not
using the tiled cache layer.

Source/WebKit2:

  • Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:

(WebKit::ThreadedCompositor::setDrawsBackground): Set m_drawsBackground in compositing thread and schedule a
layer flush.
(WebKit::ThreadedCompositor::renderLayerTree): Clear the area when not rendering backgrounds.

  • Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
  • WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:

(WebKit::ThreadedCoordinatedLayerTreeHost::pageBackgroundTransparencyChanged): Notify the compositor.

  • WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:
Location:
trunk/Source
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r203494 r203497  
     12016-07-21  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        [GTK][Threaded Compositor] Web view background colors don't work
     4        https://bugs.webkit.org/show_bug.cgi?id=159465
     5
     6        Reviewed by Michael Catanzaro.
     7
     8        * rendering/RenderLayerBacking.cpp:
     9        (WebCore::RenderLayerBacking::createPrimaryGraphicsLayer): Initialize frame view layer opacity for platforms not
     10        using the tiled cache layer.
     11
    1122016-07-20  Youenn Fablet  <youenn@apple.com>
    213
  • trunk/Source/WebCore/rendering/RenderLayerBacking.cpp

    r202536 r203497  
    316316    if (m_isMainFrameRenderViewLayer) {
    317317        // Page scale is applied above the RenderView on iOS.
    318         m_graphicsLayer->setContentsOpaque(true);
     318        m_graphicsLayer->setContentsOpaque(!compositor().viewHasTransparentBackground());
    319319        m_graphicsLayer->setAppliesPageScale();
    320320    }
  • trunk/Source/WebKit2/ChangeLog

    r203496 r203497  
     12016-07-21  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        [GTK][Threaded Compositor] Web view background colors don't work
     4        https://bugs.webkit.org/show_bug.cgi?id=159465
     5
     6        Reviewed by Michael Catanzaro.
     7
     8        * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
     9        (WebKit::ThreadedCompositor::setDrawsBackground): Set m_drawsBackground in compositing thread and schedule a
     10        layer flush.
     11        (WebKit::ThreadedCompositor::renderLayerTree): Clear the area when not rendering backgrounds.
     12        * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
     13        * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
     14        (WebKit::ThreadedCoordinatedLayerTreeHost::pageBackgroundTransparencyChanged): Notify the compositor.
     15        * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:
     16
    1172016-07-21  Carlos Garcia Campos  <cgarcia@igalia.com>
    218
  • trunk/Source/WebKit2/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp

    r203449 r203497  
    8888}
    8989
     90void ThreadedCompositor::setDrawsBackground(bool drawsBackground)
     91{
     92    m_compositingRunLoop->performTask([this, protectedThis = Ref<ThreadedCompositor>(*this), drawsBackground] {
     93        m_drawsBackground = drawsBackground;
     94        scheduleDisplayImmediately();
     95    });
     96}
     97
    9098void ThreadedCompositor::didChangeViewportSize(const IntSize& size)
    9199{
    … …  
    203211    viewportTransform.translate(-scrollPostion.x(), -scrollPostion.y());
    204212
    205     m_scene->paintToCurrentGLContext(viewportTransform, 1, clipRect, Color::white, false, scrollPostion);
     213    if (!m_drawsBackground) {
     214        glClearColor(0, 0, 0, 0);
     215        glClear(GL_COLOR_BUFFER_BIT);
     216    }
     217    m_scene->paintToCurrentGLContext(viewportTransform, 1, clipRect, Color::transparent, !m_drawsBackground, scrollPostion);
    206218
    207219    glContext()->swapBuffers();
  • trunk/Source/WebKit2/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h

    r203449 r203497  
    6767    void setNativeSurfaceHandleForCompositing(uint64_t);
    6868    void setDeviceScaleFactor(float);
     69    void setDrawsBackground(bool);
    6970
    7071    void updateSceneState(const WebCore::CoordinatedGraphicsState&);
    … …  
    107108    WebCore::IntSize m_viewportSize;
    108109    float m_deviceScaleFactor { 1 };
     110    bool m_drawsBackground { true };
    109111    uint64_t m_nativeSurfaceHandle { 0 };
    110112
  • trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp

    r203449 r203497  
    7878}
    7979
     80void ThreadedCoordinatedLayerTreeHost::pageBackgroundTransparencyChanged()
     81{
     82    CoordinatedLayerTreeHost::pageBackgroundTransparencyChanged();
     83    m_compositor->setDrawsBackground(m_webPage.drawsBackground());
     84}
     85
    8086void ThreadedCoordinatedLayerTreeHost::sizeDidChange(const IntSize& size)
    8187{
  • trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h

    r203449 r203497  
    5555    void sizeDidChange(const WebCore::IntSize&) override;
    5656    void deviceOrPageScaleFactorChanged() override;
     57    void pageBackgroundTransparencyChanged() override;
    5758
    5859    void contentsSizeChanged(const WebCore::IntSize&) override;
Note: See TracChangeset for help on using the changeset viewer.