Diff
Modified: trunk/LayoutTests/ChangeLog (233511 => 233512)
--- trunk/LayoutTests/ChangeLog 2018-07-05 05:48:27 UTC (rev 233511)
+++ trunk/LayoutTests/ChangeLog 2018-07-05 06:54:12 UTC (rev 233512)
@@ -1,3 +1,14 @@
+2018-07-04 Carlos Garcia Campos <[email protected]>
+
+ REGRESSION(r233325): [GTK] Broke 40 animations tests
+ https://bugs.webkit.org/show_bug.cgi?id=187264
+
+ Reviewed by Žan Doberšek.
+
+ Remove expectations for tests that are passing now.
+
+ * platform/gtk/TestExpectations:
+
2018-07-04 Antti Koivisto <[email protected]>
Reparse user stylesheets when _useSystemAppearance changes
Modified: trunk/LayoutTests/platform/gtk/TestExpectations (233511 => 233512)
--- trunk/LayoutTests/platform/gtk/TestExpectations 2018-07-05 05:48:27 UTC (rev 233511)
+++ trunk/LayoutTests/platform/gtk/TestExpectations 2018-07-05 06:54:12 UTC (rev 233512)
@@ -1177,7 +1177,6 @@
# This seems to be testing Apple-specific behavior?
css3/color-filters/color-filter-ignore-semantic.html [ ImageOnlyFailure ]
-webkit.org/b/187044 animations/transition-and-animation-1.html [ Failure ]
webkit.org/b/187044 webanimations/opacity-animation-yields-compositing-span.html [ Failure Timeout ]
webkit.org/b/187041 imported/mozilla/css-animations/test_animation-pausing.html [ Failure Timeout ]
@@ -2333,42 +2332,7 @@
webkit.org/b/186341 fast/animation/css-animation-resuming-when-visible-with-style-change.html [ Timeout Failure Pass ]
webkit.org/b/186252 legacy-animation-engine/css3/filters/backdrop/animation.html [ Timeout ]
-webkit.org/b/186662 animations/transition-and-animation-3.html [ Timeout ]
-webkit.org/b/186853 imported/mozilla/css-transitions/test_element-get-animations.html [ Timeout ]
-webkit.org/b/187264 animations/transition-and-animation-2.html [ Failure ]
-webkit.org/b/187264 imported/w3c/web-platform-tests/web-animations/animation-model/keyframe-effects/effect-value-context.html [ Failure ]
-webkit.org/b/187264 imported/w3c/web-platform-tests/web-animations/interfaces/Animation/cancel.html [ Failure ]
-webkit.org/b/187264 imported/w3c/web-platform-tests/web-animations/interfaces/Animation/pause.html [ Failure ]
-webkit.org/b/187264 imported/w3c/web-platform-tests/web-animations/interfaces/Animation/pending.html [ Failure ]
-webkit.org/b/187264 imported/w3c/web-platform-tests/web-animations/interfaces/Animation/play.html [ Failure ]
-webkit.org/b/187264 imported/w3c/web-platform-tests/web-animations/interfaces/Animation/playbackRate.html [ Failure ]
-webkit.org/b/187264 imported/w3c/web-platform-tests/web-animations/interfaces/Animation/ready.html [ Failure ]
-webkit.org/b/187264 imported/w3c/web-platform-tests/web-animations/interfaces/Animation/startTime.html [ Failure ]
-webkit.org/b/187264 imported/w3c/web-platform-tests/web-animations/interfaces/AnimationEffectTiming/duration.html [ Failure ]
-webkit.org/b/187264 imported/w3c/web-platform-tests/web-animations/timing-model/animations/canceling-an-animation.html [ Failure ]
-webkit.org/b/187264 imported/w3c/web-platform-tests/web-animations/timing-model/animations/pausing-an-animation.html [ Failure ]
-webkit.org/b/187264 imported/w3c/web-platform-tests/web-animations/timing-model/animations/playing-an-animation.html [ Failure ]
-webkit.org/b/187264 imported/w3c/web-platform-tests/web-animations/timing-model/animations/reversing-an-animation.html [ Failure ]
-webkit.org/b/187264 imported/w3c/web-platform-tests/web-animations/timing-model/animations/set-the-target-effect-of-an-animation.html [ Failure ]
-webkit.org/b/187264 imported/w3c/web-platform-tests/web-animations/timing-model/animations/set-the-timeline-of-an-animation.html [ Failure ]
-webkit.org/b/187264 imported/w3c/web-platform-tests/web-animations/timing-model/timelines/document-timelines.html [ Failure ]
-webkit.org/b/187264 imported/mozilla/css-animations/test_animation-cancel.html [ Timeout ]
-webkit.org/b/187264 imported/mozilla/css-animations/test_animation-computed-timing.html [ Timeout ]
-webkit.org/b/187264 imported/mozilla/css-animations/test_animation-currenttime.html [ Timeout ]
-webkit.org/b/187264 imported/mozilla/css-animations/test_animation-finish.html [ Timeout ]
-webkit.org/b/187264 imported/mozilla/css-animations/test_animation-ready.html [ Timeout ]
-webkit.org/b/187264 imported/mozilla/css-animations/test_animation-starttime.html [ Timeout ]
-webkit.org/b/187264 imported/mozilla/css-animations/test_setting-effect.html [ Timeout ]
-webkit.org/b/187264 imported/mozilla/css-transitions/test_animation-cancel.html [ Timeout ]
-webkit.org/b/187264 imported/mozilla/css-transitions/test_animation-computed-timing.html [ Timeout ]
-webkit.org/b/187264 imported/mozilla/css-transitions/test_animation-currenttime.html [ Timeout ]
-webkit.org/b/187264 imported/mozilla/css-transitions/test_animation-pausing.html [ Timeout ]
-webkit.org/b/187264 imported/mozilla/css-transitions/test_animation-ready.html [ Timeout ]
-webkit.org/b/187264 imported/mozilla/css-transitions/test_animation-starttime.html [ Timeout ]
-webkit.org/b/187264 imported/mozilla/css-transitions/test_setting-effect.html [ Timeout ]
-webkit.org/b/187264 webanimations/opacity-animation-yields-compositing.html [ Timeout ]
-
webkit.org/b/187266 imported/w3c/web-platform-tests/html/semantics/embedded-content/media-elements/track/track-element/track-api-texttracks.html [ Pass Timeout ]
webkit.org/b/187267 imported/w3c/web-platform-tests/IndexedDB/idbcursor-continue.htm [ Pass Failure ]
@@ -3417,7 +3381,6 @@
webkit.org/b/184080 animations/animation-direction-normal.html [ Failure ]
webkit.org/b/184080 animations/animation-direction-reverse.html [ Failure ]
-webkit.org/b/184080 animations/change-keyframes.html [ Failure ]
webkit.org/b/184080 animations/play-state-in-shorthand.html [ Failure ]
webkit.org/b/184080 animations/transform-non-accelerated.html [ Failure ]
@@ -3485,8 +3448,6 @@
webkit.org/b/186100 css3/color-filters/color-filter-opacity.html [ ImageOnlyFailure ]
webkit.org/b/186100 fast/hidpi/filters-turbulence.html [ ImageOnlyFailure ]
-webkit.org/b/186138 imported/mozilla/css-transitions/test_event-dispatch.html [ Failure Timeout ]
-
webkit.org/b/186139 imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/addition-per-property.html [ Failure ]
webkit.org/b/186141 svg/dom/SVGGeometry-isPointInStroke.xhtml [ Failure ]
@@ -3493,12 +3454,8 @@
webkit.org/b/186142 imported/w3c/web-platform-tests/css/css-text/text-transform/text-transform-upperlower-016.html [ ImageOnlyFailure ]
-webkit.org/b/186144 transitions/transition-end-event-rendering.html [ Timeout ]
-
webkit.org/b/186252 legacy-animation-engine/css3/filters/composited-during-transition-layertree.html [ Failure ]
-webkit.org/b/186340 transitions/zero-duration-with-non-zero-delay-start.html [ Timeout Failure ]
-
webkit.org/b/186618 imported/w3c/web-platform-tests/fetch/api/headers/header-values.html [ Failure ]
webkit.org/b/186601 fullscreen/full-screen-layer-dump.html [ Failure ]
Modified: trunk/Source/WebCore/ChangeLog (233511 => 233512)
--- trunk/Source/WebCore/ChangeLog 2018-07-05 05:48:27 UTC (rev 233511)
+++ trunk/Source/WebCore/ChangeLog 2018-07-05 06:54:12 UTC (rev 233512)
@@ -1,3 +1,25 @@
+2018-07-04 Carlos Garcia Campos <[email protected]>
+
+ REGRESSION(r233325): [GTK] Broke 40 animations tests
+ https://bugs.webkit.org/show_bug.cgi?id=187264
+
+ Reviewed by Žan Doberšek.
+
+ This is because DocumentAnimationScheduler uses DisplayRefreshMonitor, that is only used by GTK port when
+ accelerated compositing is enabled. Add a GTK display refresh monitor implementation to be used as the default.
+
+ * PlatformGTK.cmake: Add new file to compilation.
+ * platform/graphics/DisplayRefreshMonitor.cpp:
+ (WebCore::DisplayRefreshMonitor::createDefaultDisplayRefreshMonitor): Create DisplayRefreshMonitorGtk in GTK.
+ * platform/graphics/gtk/DisplayRefreshMonitorGtk.cpp: Added.
+ (WebCore::DisplayRefreshMonitorGtk::DisplayRefreshMonitorGtk):
+ (WebCore::DisplayRefreshMonitorGtk::~DisplayRefreshMonitorGtk):
+ (WebCore::onFrameClockUpdate):
+ (WebCore::DisplayRefreshMonitorGtk::requestRefreshCallback):
+ (WebCore::DisplayRefreshMonitorGtk::displayLinkFired):
+ * platform/graphics/gtk/DisplayRefreshMonitorGtk.h: Added.
+ (WebCore::DisplayRefreshMonitorGtk::create):
+
2018-07-04 Antti Koivisto <[email protected]>
Reparse user stylesheets when _useSystemAppearance changes
Modified: trunk/Source/WebCore/PlatformGTK.cmake (233511 => 233512)
--- trunk/Source/WebCore/PlatformGTK.cmake 2018-07-05 05:48:27 UTC (rev 233511)
+++ trunk/Source/WebCore/PlatformGTK.cmake 2018-07-05 06:54:12 UTC (rev 233512)
@@ -48,6 +48,7 @@
platform/graphics/PlatformDisplay.cpp
platform/graphics/gtk/ColorGtk.cpp
+ platform/graphics/gtk/DisplayRefreshMonitorGtk.cpp
platform/graphics/gtk/GdkCairoUtilities.cpp
platform/graphics/gtk/IconGtk.cpp
platform/graphics/gtk/ImageBufferGtk.cpp
Modified: trunk/Source/WebCore/platform/graphics/DisplayRefreshMonitor.cpp (233511 => 233512)
--- trunk/Source/WebCore/platform/graphics/DisplayRefreshMonitor.cpp 2018-07-05 05:48:27 UTC (rev 233511)
+++ trunk/Source/WebCore/platform/graphics/DisplayRefreshMonitor.cpp 2018-07-05 06:54:12 UTC (rev 233512)
@@ -35,6 +35,8 @@
#include "DisplayRefreshMonitorIOS.h"
#elif PLATFORM(MAC)
#include "DisplayRefreshMonitorMac.h"
+#elif PLATFORM(GTK)
+#include "DisplayRefreshMonitorGtk.h"
#endif
namespace WebCore {
@@ -47,6 +49,9 @@
#if PLATFORM(IOS)
return DisplayRefreshMonitorIOS::create(displayID);
#endif
+#if PLATFORM(GTK)
+ return DisplayRefreshMonitorGtk::create(displayID);
+#endif
UNUSED_PARAM(displayID);
return nullptr;
}
Added: trunk/Source/WebCore/platform/graphics/gtk/DisplayRefreshMonitorGtk.cpp (0 => 233512)
--- trunk/Source/WebCore/platform/graphics/gtk/DisplayRefreshMonitorGtk.cpp (rev 0)
+++ trunk/Source/WebCore/platform/graphics/gtk/DisplayRefreshMonitorGtk.cpp 2018-07-05 06:54:12 UTC (rev 233512)
@@ -0,0 +1,98 @@
+/*
+ * Copyright (C) 2018 Igalia S.L.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "DisplayRefreshMonitorGtk.h"
+
+#if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
+
+#include <gtk/gtk.h>
+#include <wtf/RunLoop.h>
+
+namespace WebCore {
+
+DisplayRefreshMonitorGtk::DisplayRefreshMonitorGtk(PlatformDisplayID displayID)
+ : DisplayRefreshMonitor(displayID)
+{
+}
+
+DisplayRefreshMonitorGtk::~DisplayRefreshMonitorGtk()
+{
+ if (m_window)
+ gtk_widget_destroy(m_window);
+}
+
+#ifndef GTK_API_VERSION_2
+static void onFrameClockUpdate(GdkFrameClock*, DisplayRefreshMonitorGtk* monitor)
+{
+ monitor->displayLinkFired();
+}
+#endif
+
+bool DisplayRefreshMonitorGtk::requestRefreshCallback()
+{
+ if (!isActive())
+ return false;
+
+#ifndef GTK_API_VERSION_2
+ if (!m_window) {
+ // GdkFrameClockIdle is private in GDK, so we need to create a toplevel to get its frame clock.
+ m_window = gtk_offscreen_window_new();
+ gtk_widget_realize(m_window);
+
+ auto* frameClock = gtk_widget_get_frame_clock(m_window);
+ if (!frameClock)
+ return false;
+
+ g_signal_connect(frameClock, "update", G_CALLBACK(onFrameClockUpdate), this);
+ gdk_frame_clock_begin_updating(frameClock);
+
+ setIsActive(true);
+ }
+
+ LockHolder lock(mutex());
+ setIsScheduled(true);
+ return true;
+#else
+ return false;
+#endif
+}
+
+void DisplayRefreshMonitorGtk::displayLinkFired()
+{
+ {
+ LockHolder lock(mutex());
+ if (!isPreviousFrameDone())
+ return;
+
+ setIsPreviousFrameDone(false);
+ }
+ ASSERT(isMainThread());
+ handleDisplayRefreshedNotificationOnMainThread(this);
+}
+
+} // namespace WebCore
+
+#endif // USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
Added: trunk/Source/WebCore/platform/graphics/gtk/DisplayRefreshMonitorGtk.h (0 => 233512)
--- trunk/Source/WebCore/platform/graphics/gtk/DisplayRefreshMonitorGtk.h (rev 0)
+++ trunk/Source/WebCore/platform/graphics/gtk/DisplayRefreshMonitorGtk.h 2018-07-05 06:54:12 UTC (rev 233512)
@@ -0,0 +1,61 @@
+/*
+ * Copyright (C) 2018 Igalia S.L.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
+
+#include "DisplayRefreshMonitor.h"
+
+typedef struct _GtkWidget GtkWidget;
+
+namespace WebCore {
+
+class DisplayRefreshMonitorGtk : public DisplayRefreshMonitor {
+public:
+ static RefPtr<DisplayRefreshMonitorGtk> create(PlatformDisplayID displayID)
+ {
+#ifndef GTK_API_VERSION_2
+ return adoptRef(*new DisplayRefreshMonitorGtk(displayID));
+#else
+ UNUSED_PARAM(displayID);
+ return nullptr;
+#endif
+ }
+
+ virtual ~DisplayRefreshMonitorGtk();
+
+ void displayLinkFired() override;
+ bool requestRefreshCallback() override;
+
+private:
+ explicit DisplayRefreshMonitorGtk(PlatformDisplayID);
+
+ GtkWidget* m_window { nullptr };
+};
+
+} // namespace WebCore
+
+#endif // USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
Modified: trunk/Source/WebKit/ChangeLog (233511 => 233512)
--- trunk/Source/WebKit/ChangeLog 2018-07-05 05:48:27 UTC (rev 233511)
+++ trunk/Source/WebKit/ChangeLog 2018-07-05 06:54:12 UTC (rev 233512)
@@ -1,3 +1,28 @@
+2018-07-04 Carlos Garcia Campos <[email protected]>
+
+ REGRESSION(r233325): [GTK] Broke 40 animations tests
+ https://bugs.webkit.org/show_bug.cgi?id=187264
+
+ Reviewed by Žan Doberšek.
+
+ Use a different PlatformDisplayID for compositing in the GTK port. This way, when entering AC a window screen
+ changed is emitted and the GTK default display refresh monitor is destroyed, ensuring the one created by the
+ threaded compositor is used.
+
+ * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
+ (WebKit::ThreadedCompositor::create): Remove unused WebPage parameter and add PlatformDisplayID.
+ (WebKit::ThreadedCompositor::ThreadedCompositor): Create the display refresh monitor with the given displayID.
+ * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
+ * Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.cpp:
+ (WebKit::ThreadedDisplayRefreshMonitor::ThreadedDisplayRefreshMonitor): Pass the given displayID to the parent constructor.
+ * Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.h:
+ (WebKit::ThreadedDisplayRefreshMonitor::create): Add PlatformDisplayID parameter.
+ * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
+ (WebKit::ThreadedCoordinatedLayerTreeHost::ThreadedCoordinatedLayerTreeHost): Use compositingDisplayID when
+ creating the threaded compositor and notify about the window screen change.
+ (WebKit::ThreadedCoordinatedLayerTreeHost::setIsDiscardable): Use primaryDisplayID when leaving AC and
+ compositingDisplayID when re-entering.
+
2018-07-04 Olivia Barnett <[email protected]>
A WKWebView in a UIViewController that is presented modally and uses a file picker will be incorrectly dismissed by the system
Modified: trunk/Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp (233511 => 233512)
--- trunk/Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp 2018-07-05 05:48:27 UTC (rev 233511)
+++ trunk/Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp 2018-07-05 06:54:12 UTC (rev 233512)
@@ -45,18 +45,18 @@
namespace WebKit {
using namespace WebCore;
-Ref<ThreadedCompositor> ThreadedCompositor::create(Client& client, WebPage& webPage, const IntSize& viewportSize, float scaleFactor, ShouldDoFrameSync doFrameSync, TextureMapper::PaintFlags paintFlags)
+Ref<ThreadedCompositor> ThreadedCompositor::create(Client& client, PlatformDisplayID displayID, const IntSize& viewportSize, float scaleFactor, ShouldDoFrameSync doFrameSync, TextureMapper::PaintFlags paintFlags)
{
- return adoptRef(*new ThreadedCompositor(client, webPage, viewportSize, scaleFactor, doFrameSync, paintFlags));
+ return adoptRef(*new ThreadedCompositor(client, displayID, viewportSize, scaleFactor, doFrameSync, paintFlags));
}
-ThreadedCompositor::ThreadedCompositor(Client& client, WebPage& webPage, const IntSize& viewportSize, float scaleFactor, ShouldDoFrameSync doFrameSync, TextureMapper::PaintFlags paintFlags)
+ThreadedCompositor::ThreadedCompositor(Client& client, PlatformDisplayID displayID, const IntSize& viewportSize, float scaleFactor, ShouldDoFrameSync doFrameSync, TextureMapper::PaintFlags paintFlags)
: m_client(client)
, m_doFrameSync(doFrameSync)
, m_paintFlags(paintFlags)
, m_compositingRunLoop(std::make_unique<CompositingRunLoop>([this] { renderLayerTree(); }))
#if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
- , m_displayRefreshMonitor(ThreadedDisplayRefreshMonitor::create(*this))
+ , m_displayRefreshMonitor(ThreadedDisplayRefreshMonitor::create(displayID, *this))
#endif
{
{
Modified: trunk/Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h (233511 => 233512)
--- trunk/Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h 2018-07-05 05:48:27 UTC (rev 233511)
+++ trunk/Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h 2018-07-05 06:54:12 UTC (rev 233512)
@@ -47,7 +47,6 @@
class CoordinatedGraphicsScene;
class CoordinatedGraphicsSceneClient;
class ThreadedDisplayRefreshMonitor;
-class WebPage;
class ThreadedCompositor : public CoordinatedGraphicsSceneClient, public ThreadSafeRefCounted<ThreadedCompositor> {
WTF_MAKE_NONCOPYABLE(ThreadedCompositor);
@@ -66,7 +65,7 @@
enum class ShouldDoFrameSync { No, Yes };
- static Ref<ThreadedCompositor> create(Client&, WebPage&, const WebCore::IntSize&, float scaleFactor, ShouldDoFrameSync = ShouldDoFrameSync::Yes, WebCore::TextureMapper::PaintFlags = 0);
+ static Ref<ThreadedCompositor> create(Client&, WebCore::PlatformDisplayID, const WebCore::IntSize&, float scaleFactor, ShouldDoFrameSync = ShouldDoFrameSync::Yes, WebCore::TextureMapper::PaintFlags = 0);
virtual ~ThreadedCompositor();
void setNativeSurfaceHandleForCompositing(uint64_t);
@@ -90,7 +89,7 @@
void frameComplete();
private:
- ThreadedCompositor(Client&, WebPage&, const WebCore::IntSize&, float scaleFactor, ShouldDoFrameSync, WebCore::TextureMapper::PaintFlags);
+ ThreadedCompositor(Client&, WebCore::PlatformDisplayID, const WebCore::IntSize&, float scaleFactor, ShouldDoFrameSync, WebCore::TextureMapper::PaintFlags);
// CoordinatedGraphicsSceneClient
void updateViewport() override;
Modified: trunk/Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.cpp (233511 => 233512)
--- trunk/Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.cpp 2018-07-05 05:48:27 UTC (rev 233511)
+++ trunk/Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.cpp 2018-07-05 06:54:12 UTC (rev 233512)
@@ -37,8 +37,8 @@
namespace WebKit {
-ThreadedDisplayRefreshMonitor::ThreadedDisplayRefreshMonitor(ThreadedCompositor& compositor)
- : WebCore::DisplayRefreshMonitor(0)
+ThreadedDisplayRefreshMonitor::ThreadedDisplayRefreshMonitor(WebCore::PlatformDisplayID displayID, ThreadedCompositor& compositor)
+ : WebCore::DisplayRefreshMonitor(displayID)
, m_displayRefreshTimer(RunLoop::main(), this, &ThreadedDisplayRefreshMonitor::displayRefreshCallback)
, m_compositor(&compositor)
{
Modified: trunk/Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.h (233511 => 233512)
--- trunk/Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.h 2018-07-05 05:48:27 UTC (rev 233511)
+++ trunk/Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.h 2018-07-05 06:54:12 UTC (rev 233512)
@@ -36,9 +36,9 @@
class ThreadedDisplayRefreshMonitor : public WebCore::DisplayRefreshMonitor {
public:
- static Ref<ThreadedDisplayRefreshMonitor> create(ThreadedCompositor& compositor)
+ static Ref<ThreadedDisplayRefreshMonitor> create(WebCore::PlatformDisplayID displayID, ThreadedCompositor& compositor)
{
- return adoptRef(*new ThreadedDisplayRefreshMonitor(compositor));
+ return adoptRef(*new ThreadedDisplayRefreshMonitor(displayID, compositor));
}
virtual ~ThreadedDisplayRefreshMonitor() = default;
@@ -49,7 +49,7 @@
void invalidate();
private:
- ThreadedDisplayRefreshMonitor(ThreadedCompositor&);
+ ThreadedDisplayRefreshMonitor(WebCore::PlatformDisplayID, ThreadedCompositor&);
void displayRefreshCallback();
RunLoop::Timer<ThreadedDisplayRefreshMonitor> m_displayRefreshTimer;
Modified: trunk/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp (233511 => 233512)
--- trunk/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp 2018-07-05 05:48:27 UTC (rev 233511)
+++ trunk/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp 2018-07-05 06:54:12 UTC (rev 233512)
@@ -39,6 +39,13 @@
namespace WebKit {
using namespace WebCore;
+static const PlatformDisplayID primaryDisplayID = 0;
+#if PLATFORM(GTK)
+static const PlatformDisplayID compositingDisplayID = 1;
+#else
+static const PlatformDisplayID compositingDisplayID = primaryDisplayID;
+#endif
+
Ref<ThreadedCoordinatedLayerTreeHost> ThreadedCoordinatedLayerTreeHost::create(WebPage& webPage)
{
return adoptRef(*new ThreadedCoordinatedLayerTreeHost(webPage));
@@ -70,11 +77,13 @@
if (m_surface->shouldPaintMirrored())
paintFlags |= TextureMapper::PaintingMirrored;
- m_compositor = ThreadedCompositor::create(m_compositorClient, webPage, scaledSize, scaleFactor, ThreadedCompositor::ShouldDoFrameSync::Yes, paintFlags);
+ m_compositor = ThreadedCompositor::create(m_compositorClient, compositingDisplayID, scaledSize, scaleFactor, ThreadedCompositor::ShouldDoFrameSync::Yes, paintFlags);
m_layerTreeContext.contextID = m_surface->surfaceID();
} else
- m_compositor = ThreadedCompositor::create(m_compositorClient, webPage, scaledSize, scaleFactor);
+ m_compositor = ThreadedCompositor::create(m_compositorClient, compositingDisplayID, scaledSize, scaleFactor);
+ m_webPage.windowScreenDidChange(compositingDisplayID);
+
didChangeViewport();
}
@@ -253,8 +262,10 @@
m_isDiscardable = discardable;
if (m_isDiscardable) {
m_discardableSyncActions = OptionSet<DiscardableSyncActions>();
+ m_webPage.windowScreenDidChange(primaryDisplayID);
return;
}
+ m_webPage.windowScreenDidChange(compositingDisplayID);
if (m_discardableSyncActions.isEmpty())
return;