Diff
Modified: trunk/Source/WebCore/ChangeLog (203496 => 203497)
--- trunk/Source/WebCore/ChangeLog 2016-07-21 07:18:03 UTC (rev 203496)
+++ trunk/Source/WebCore/ChangeLog 2016-07-21 07:25:26 UTC (rev 203497)
@@ -1,3 +1,14 @@
+2016-07-21 Carlos Garcia Campos <[email protected]>
+
+ [GTK][Threaded Compositor] Web view background colors don't work
+ https://bugs.webkit.org/show_bug.cgi?id=159465
+
+ Reviewed by Michael Catanzaro.
+
+ * rendering/RenderLayerBacking.cpp:
+ (WebCore::RenderLayerBacking::createPrimaryGraphicsLayer): Initialize frame view layer opacity for platforms not
+ using the tiled cache layer.
+
2016-07-20 Youenn Fablet <[email protected]>
[XHR] Cache response JS object in case of arraybuffer and blob response types
Modified: trunk/Source/WebCore/rendering/RenderLayerBacking.cpp (203496 => 203497)
--- trunk/Source/WebCore/rendering/RenderLayerBacking.cpp 2016-07-21 07:18:03 UTC (rev 203496)
+++ trunk/Source/WebCore/rendering/RenderLayerBacking.cpp 2016-07-21 07:25:26 UTC (rev 203497)
@@ -315,7 +315,7 @@
#if !PLATFORM(IOS)
if (m_isMainFrameRenderViewLayer) {
// Page scale is applied above the RenderView on iOS.
- m_graphicsLayer->setContentsOpaque(true);
+ m_graphicsLayer->setContentsOpaque(!compositor().viewHasTransparentBackground());
m_graphicsLayer->setAppliesPageScale();
}
#endif
Modified: trunk/Source/WebKit2/ChangeLog (203496 => 203497)
--- trunk/Source/WebKit2/ChangeLog 2016-07-21 07:18:03 UTC (rev 203496)
+++ trunk/Source/WebKit2/ChangeLog 2016-07-21 07:25:26 UTC (rev 203497)
@@ -1,5 +1,21 @@
2016-07-21 Carlos Garcia Campos <[email protected]>
+ [GTK][Threaded Compositor] Web view background colors don't work
+ https://bugs.webkit.org/show_bug.cgi?id=159465
+
+ Reviewed by Michael Catanzaro.
+
+ * 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:
+
+2016-07-21 Carlos Garcia Campos <[email protected]>
+
[GTK] Web view background colors don't work in accelerated compositing mode
https://bugs.webkit.org/show_bug.cgi?id=159455
Modified: trunk/Source/WebKit2/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp (203496 => 203497)
--- trunk/Source/WebKit2/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp 2016-07-21 07:18:03 UTC (rev 203496)
+++ trunk/Source/WebKit2/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp 2016-07-21 07:25:26 UTC (rev 203497)
@@ -87,6 +87,14 @@
});
}
+void ThreadedCompositor::setDrawsBackground(bool drawsBackground)
+{
+ m_compositingRunLoop->performTask([this, protectedThis = Ref<ThreadedCompositor>(*this), drawsBackground] {
+ m_drawsBackground = drawsBackground;
+ scheduleDisplayImmediately();
+ });
+}
+
void ThreadedCompositor::didChangeViewportSize(const IntSize& size)
{
m_compositingRunLoop->performTaskSync([this, protectedThis = makeRef(*this), size] {
@@ -202,7 +210,11 @@
viewportTransform.scale(m_viewportController->pageScaleFactor() * m_deviceScaleFactor);
viewportTransform.translate(-scrollPostion.x(), -scrollPostion.y());
- m_scene->paintToCurrentGLContext(viewportTransform, 1, clipRect, Color::white, false, scrollPostion);
+ if (!m_drawsBackground) {
+ glClearColor(0, 0, 0, 0);
+ glClear(GL_COLOR_BUFFER_BIT);
+ }
+ m_scene->paintToCurrentGLContext(viewportTransform, 1, clipRect, Color::transparent, !m_drawsBackground, scrollPostion);
glContext()->swapBuffers();
}
Modified: trunk/Source/WebKit2/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h (203496 => 203497)
--- trunk/Source/WebKit2/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h 2016-07-21 07:18:03 UTC (rev 203496)
+++ trunk/Source/WebKit2/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h 2016-07-21 07:25:26 UTC (rev 203497)
@@ -66,6 +66,7 @@
void setNativeSurfaceHandleForCompositing(uint64_t);
void setDeviceScaleFactor(float);
+ void setDrawsBackground(bool);
void updateSceneState(const WebCore::CoordinatedGraphicsState&);
@@ -106,6 +107,7 @@
WebCore::IntSize m_viewportSize;
float m_deviceScaleFactor { 1 };
+ bool m_drawsBackground { true };
uint64_t m_nativeSurfaceHandle { 0 };
std::unique_ptr<CompositingRunLoop> m_compositingRunLoop;
Modified: trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp (203496 => 203497)
--- trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp 2016-07-21 07:18:03 UTC (rev 203496)
+++ trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp 2016-07-21 07:25:26 UTC (rev 203497)
@@ -77,6 +77,12 @@
m_compositor->setDeviceScaleFactor(m_webPage.deviceScaleFactor());
}
+void ThreadedCoordinatedLayerTreeHost::pageBackgroundTransparencyChanged()
+{
+ CoordinatedLayerTreeHost::pageBackgroundTransparencyChanged();
+ m_compositor->setDrawsBackground(m_webPage.drawsBackground());
+}
+
void ThreadedCoordinatedLayerTreeHost::sizeDidChange(const IntSize& size)
{
CoordinatedLayerTreeHost::sizeDidChange(size);
Modified: trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h (203496 => 203497)
--- trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h 2016-07-21 07:18:03 UTC (rev 203496)
+++ trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h 2016-07-21 07:25:26 UTC (rev 203497)
@@ -54,6 +54,7 @@
void scrollNonCompositedContents(const WebCore::IntRect& scrollRect) override;
void sizeDidChange(const WebCore::IntSize&) override;
void deviceOrPageScaleFactorChanged() override;
+ void pageBackgroundTransparencyChanged() override;
void contentsSizeChanged(const WebCore::IntSize&) override;
void didChangeViewportProperties(const WebCore::ViewportAttributes&) override;