[WPE] Bump WPEBackend-fdo requirement to API version 1.0
authoraperez@igalia.com <aperez@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 25 Feb 2019 21:48:24 +0000 (21:48 +0000)
committeraperez@igalia.com <aperez@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 25 Feb 2019 21:48:24 +0000 (21:48 +0000)
https://bugs.webkit.org/show_bug.cgi?id=195001

Reviewed by Carlos Garcia Campos.

.:

* Source/cmake/FindWPEBackend-fdo.cmake: Use WPEBackend-fdo-1.0.
* Source/cmake/OptionsWPE.cmake: Ditto.

Source/WebKit:

API version 1.0 always includes the functionality previously guarded with
WPE_BACKEND_CHECK_VERSION(): remove the guards and always use the new functions
unconditionally.

* UIProcess/API/wpe/WPEView.cpp:
(WKWPE::View::View): Remove usage of WPE_BACKEND_CHECK_VERSION().
(WKWPE::m_backend): Ditto.
* UIProcess/API/wpe/qt/WPEQtViewBackend.cpp:
(WPEQtViewBackend::WPEQtViewBackend): Use libWPEBackend-fdo-1.0 as
library name, remove call to wpe_fdo_initialize_for_egl_display().
(WPEQtViewBackend::create): Call wpe_fdo_initialize_for_egl_display()
here, to bail out early in case initialization fails.
* UIProcess/glib/WebProcessPoolGLib.cpp:
(WebKit::WebProcessPool::platformInitializeWebProcess): Remove usage of
WPE_BACKEND_CHECK_VERSION().

Tools:

API version 1.0 always includes the functionality previously guarded with
WPE_BACKEND_CHECK_VERSION(): remove the guards and always use the new functions
unconditionally.

* TestWebKitAPI/glib/WebKitGLib/TestMain.h:
(Test::createWebViewBackend): Remove usage of WPE_BACKEND_CHECK_VERSION().
* TestWebKitAPI/glib/WebKitGLib/wpe/WebViewTestWPE.cpp:
(WebViewTest::showInWindow): Ditto.
(WebViewTest::hideView): Ditto.
* wpe/backends/HeadlessViewBackend.cpp:
(WPEToolingBackends::HeadlessViewBackend::HeadlessViewBackend): Ditto.
* wpe/backends/ViewBackend.cpp:
(WPEToolingBackends::ViewBackend::ViewBackend): Use libWPEBackend-fdo-1.0 as library name.
* wpe/backends/WindowViewBackend.cpp:
(WPEToolingBackends::WindowViewBackend::WindowViewBackend): Remove usage of
WPE_BACKEND_CHECK_VERSION().
* wpe/jhbuild.modules: Build a version WPEBackend-fdo with the updated API version.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@242055 268f45cc-cd09-0410-ab3c-d52691b4dbfc

14 files changed:
ChangeLog
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/API/wpe/WPEView.cpp
Source/WebKit/UIProcess/API/wpe/qt/WPEQtViewBackend.cpp
Source/WebKit/UIProcess/glib/WebProcessPoolGLib.cpp
Source/cmake/FindWPEBackend-fdo.cmake
Source/cmake/OptionsWPE.cmake
Tools/ChangeLog
Tools/TestWebKitAPI/glib/WebKitGLib/TestMain.h
Tools/TestWebKitAPI/glib/WebKitGLib/wpe/WebViewTestWPE.cpp
Tools/wpe/backends/HeadlessViewBackend.cpp
Tools/wpe/backends/ViewBackend.cpp
Tools/wpe/backends/WindowViewBackend.cpp
Tools/wpe/jhbuild.modules

index a59dec7..06a1e37 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2019-02-25  Adrian Perez de Castro  <aperez@igalia.com>
+
+        [WPE] Bump WPEBackend-fdo requirement to API version 1.0
+        https://bugs.webkit.org/show_bug.cgi?id=195001
+
+        Reviewed by Carlos Garcia Campos.
+
+        * Source/cmake/FindWPEBackend-fdo.cmake: Use WPEBackend-fdo-1.0.
+        * Source/cmake/OptionsWPE.cmake: Ditto.
+
 2019-02-25  Miguel Gomez  <magomez@igalia.com>
 
         [WPE] Add support for holepunch using an external video player
index 2f9e89e..dcd651e 100644 (file)
@@ -1,3 +1,26 @@
+2019-02-25  Adrian Perez de Castro  <aperez@igalia.com>
+
+        [WPE] Bump WPEBackend-fdo requirement to API version 1.0
+        https://bugs.webkit.org/show_bug.cgi?id=195001
+
+        Reviewed by Carlos Garcia Campos.
+
+        API version 1.0 always includes the functionality previously guarded with
+        WPE_BACKEND_CHECK_VERSION(): remove the guards and always use the new functions
+        unconditionally.
+
+        * UIProcess/API/wpe/WPEView.cpp:
+        (WKWPE::View::View): Remove usage of WPE_BACKEND_CHECK_VERSION().
+        (WKWPE::m_backend): Ditto.
+        * UIProcess/API/wpe/qt/WPEQtViewBackend.cpp:
+        (WPEQtViewBackend::WPEQtViewBackend): Use libWPEBackend-fdo-1.0 as
+        library name, remove call to wpe_fdo_initialize_for_egl_display().
+        (WPEQtViewBackend::create): Call wpe_fdo_initialize_for_egl_display()
+        here, to bail out early in case initialization fails.
+        * UIProcess/glib/WebProcessPoolGLib.cpp:
+        (WebKit::WebProcessPool::platformInitializeWebProcess): Remove usage of
+        WPE_BACKEND_CHECK_VERSION().
+
 2019-02-25  Per Arne Vollan  <pvollan@apple.com>
 
         A prewarmed Web process should have a process assertion.
index eb13b43..dbb51b4 100644 (file)
@@ -45,9 +45,7 @@ View::View(struct wpe_view_backend* backend, const API::PageConfiguration& baseC
     : m_client(std::make_unique<API::ViewClient>())
     , m_pageClient(std::make_unique<PageClientImpl>(*this))
     , m_size { 800, 600 }
-#if !defined(WPE_BACKEND_CHECK_VERSION) || !WPE_BACKEND_CHECK_VERSION(1, 1, 0)
     , m_viewStateFlags { WebCore::ActivityState::WindowIsActive, WebCore::ActivityState::IsFocused, WebCore::ActivityState::IsVisible, WebCore::ActivityState::IsInWindow }
-#endif
     , m_backend(backend)
 {
     ASSERT(m_backend);
@@ -87,7 +85,6 @@ View::View(struct wpe_view_backend* backend, const API::PageConfiguration& baseC
             auto& view = *reinterpret_cast<View*>(data);
             view.frameDisplayed();
         },
-#if defined(WPE_BACKEND_CHECK_VERSION) && WPE_BACKEND_CHECK_VERSION(1, 1, 0)
         // activity_state_changed
         [](void* data, uint32_t state)
         {
@@ -103,9 +100,6 @@ View::View(struct wpe_view_backend* backend, const API::PageConfiguration& baseC
                 flags.add(WebCore::ActivityState::IsInWindow);
             view.setViewState(flags);
         },
-#else
-        nullptr,
-#endif
         // padding
         nullptr,
         nullptr,
index 51430aa..266fe27 100644 (file)
@@ -37,7 +37,7 @@ std::unique_ptr<WPEQtViewBackend> WPEQtViewBackend::create(const QSizeF& size, Q
 
     eglInitialize(eglDisplay, nullptr, nullptr);
 
-    if (!eglBindAPI(EGL_OPENGL_ES_API))
+    if (!eglBindAPI(EGL_OPENGL_ES_API) || !wpe_fdo_initialize_for_egl_display(eglDisplay))
         return nullptr;
 
     static const EGLint configAttributes[13] = {
@@ -74,11 +74,7 @@ WPEQtViewBackend::WPEQtViewBackend(const QSizeF& size, EGLDisplay display, EGLCo
     , m_view(view)
     , m_size(size)
 {
-#if defined(WPE_BACKEND_CHECK_VERSION) && WPE_BACKEND_CHECK_VERSION(0, 2, 0)
-    wpe_loader_init("libWPEBackend-fdo-0.1.so");
-#endif
-
-    wpe_fdo_initialize_for_egl_display(m_eglDisplay);
+    wpe_loader_init("libWPEBackend-fdo-1.0.so");
 
     imageTargetTexture2DOES = reinterpret_cast<PFNGLEGLIMAGETARGETTEXTURE2DOESPROC>(eglGetProcAddress("glEGLImageTargetTexture2DOES"));
 
@@ -128,9 +124,7 @@ WPEQtViewBackend::WPEQtViewBackend(const QSizeF& size, EGLDisplay display, EGLCo
 
     m_exportable = wpe_view_backend_exportable_fdo_egl_create(&exportableClient, this, m_size.width(), m_size.height());
 
-#if defined(WPE_BACKEND_CHECK_VERSION) && WPE_BACKEND_CHECK_VERSION(1, 1, 0)
     wpe_view_backend_add_activity_state(backend(), wpe_view_activity_state_visible | wpe_view_activity_state_focused | wpe_view_activity_state_in_window);
-#endif
 
     m_surface.setFormat(context->format());
     m_surface.create();
index 205fa6b..b5fd6c4 100644 (file)
@@ -92,10 +92,8 @@ void WebProcessPool::platformInitializeWebProcess(WebProcessCreationParameters&
 {
 #if PLATFORM(WPE)
     parameters.hostClientFileDescriptor = wpe_renderer_host_create_client();
-#if defined(WPE_BACKEND_CHECK_VERSION) && WPE_BACKEND_CHECK_VERSION(0, 2, 0)
     parameters.implementationLibraryName = FileSystem::fileSystemRepresentation(wpe_loader_get_loaded_implementation_library_name());
 #endif
-#endif
 
     parameters.memoryCacheDisabled = m_memoryCacheDisabled || cacheModel() == CacheModel::DocumentViewer;
     parameters.proxySettings = m_networkProxySettings;
index 2a58751..fc69691 100644 (file)
@@ -29,7 +29,7 @@
 # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 find_package(PkgConfig)
-pkg_check_modules(PC_WPEBACKEND_FDO QUIET wpebackend-fdo-0.1)
+pkg_check_modules(PC_WPEBACKEND_FDO QUIET wpebackend-fdo-1.0)
 
 find_path(WPEBACKEND_FDO_INCLUDE_DIRS
     NAMES wpe/fdo.h
@@ -37,7 +37,7 @@ find_path(WPEBACKEND_FDO_INCLUDE_DIRS
 )
 
 find_library(WPEBACKEND_FDO_LIBRARIES
-    NAMES WPEBackend-fdo-0.1
+    NAMES WPEBackend-fdo-1.0
     HINTS ${PC_WPEBACKEND_FDO_LIBDIR} ${PC_WPEBACKEND_FDO_LIBRARY_DIRS}
 )
 
index 05c5d29..6c54f87 100644 (file)
@@ -140,7 +140,7 @@ if (ENABLE_WPE_QT_API)
     find_package(Qt5 REQUIRED COMPONENTS Core Quick Gui)
     find_package(Qt5Test REQUIRED)
     find_package(PkgConfig)
-    pkg_check_modules(WPE_BACKEND_FDO REQUIRED wpebackend-fdo-0.1)
+    pkg_check_modules(WPE_BACKEND_FDO REQUIRED wpebackend-fdo-1.0)
 endif ()
 
 add_definitions(-DBUILDING_WPE__=1)
index 7a5345a..2246b26 100644 (file)
@@ -1,3 +1,28 @@
+2019-02-25  Adrian Perez de Castro  <aperez@igalia.com>
+
+        [WPE] Bump WPEBackend-fdo requirement to API version 1.0
+        https://bugs.webkit.org/show_bug.cgi?id=195001
+
+        Reviewed by Carlos Garcia Campos.
+
+        API version 1.0 always includes the functionality previously guarded with
+        WPE_BACKEND_CHECK_VERSION(): remove the guards and always use the new functions
+        unconditionally.
+
+        * TestWebKitAPI/glib/WebKitGLib/TestMain.h:
+        (Test::createWebViewBackend): Remove usage of WPE_BACKEND_CHECK_VERSION().
+        * TestWebKitAPI/glib/WebKitGLib/wpe/WebViewTestWPE.cpp:
+        (WebViewTest::showInWindow): Ditto.
+        (WebViewTest::hideView): Ditto.
+        * wpe/backends/HeadlessViewBackend.cpp:
+        (WPEToolingBackends::HeadlessViewBackend::HeadlessViewBackend): Ditto.
+        * wpe/backends/ViewBackend.cpp:
+        (WPEToolingBackends::ViewBackend::ViewBackend): Use libWPEBackend-fdo-1.0 as library name.
+        * wpe/backends/WindowViewBackend.cpp:
+        (WPEToolingBackends::WindowViewBackend::WindowViewBackend): Remove usage of
+        WPE_BACKEND_CHECK_VERSION().
+        * wpe/jhbuild.modules: Build a version WPEBackend-fdo with the updated API version.
+
 2019-02-25  Thibault Saunier  <tsaunier@igalia.com>
 
         [Flatpak] Add support for flatpak > 1.1.2
index b0334a8..8beb4a7 100644 (file)
@@ -143,10 +143,8 @@ public:
     static WebKitWebViewBackend* createWebViewBackend()
     {
         auto* headlessBackend = new WPEToolingBackends::HeadlessViewBackend(800, 600);
-#if defined(WPE_BACKEND_CHECK_VERSION) && WPE_BACKEND_CHECK_VERSION(1, 1, 0)
         // Make the view initially hidden for consistency with GTK+ tests.
         wpe_view_backend_remove_activity_state(headlessBackend->backend(), wpe_view_activity_state_visible | wpe_view_activity_state_focused);
-#endif
         return webkit_web_view_backend_new(headlessBackend->backend(), [](gpointer userData) {
             delete static_cast<WPEToolingBackends::HeadlessViewBackend*>(userData);
         }, headlessBackend);
index 6494186..0d0ec0b 100644 (file)
@@ -43,18 +43,14 @@ void WebViewTest::resizeView(int width, int height)
 
 void WebViewTest::showInWindow()
 {
-#if defined(WPE_BACKEND_CHECK_VERSION) && WPE_BACKEND_CHECK_VERSION(1, 1, 0)
     auto* backend = webkit_web_view_backend_get_wpe_backend(webkit_web_view_get_backend(m_webView));
     wpe_view_backend_add_activity_state(backend, wpe_view_activity_state_visible | wpe_view_activity_state_in_window | wpe_view_activity_state_focused);
-#endif
 }
 
 void WebViewTest::hideView()
 {
-#if defined(WPE_BACKEND_CHECK_VERSION) && WPE_BACKEND_CHECK_VERSION(1, 1, 0)
     auto* backend = webkit_web_view_backend_get_wpe_backend(webkit_web_view_get_backend(m_webView));
     wpe_view_backend_remove_activity_state(backend, wpe_view_activity_state_visible | wpe_view_activity_state_focused);
-#endif
 }
 
 void WebViewTest::mouseMoveTo(int x, int y, unsigned mouseModifiers)
index 8e12ee6..f07e08d 100644 (file)
@@ -72,9 +72,7 @@ HeadlessViewBackend::HeadlessViewBackend(uint32_t width, uint32_t height)
     if (!initialize())
         return;
 
-#if defined(WPE_BACKEND_CHECK_VERSION) && WPE_BACKEND_CHECK_VERSION(1, 1, 0)
     wpe_view_backend_add_activity_state(backend(), wpe_view_activity_state_visible | wpe_view_activity_state_focused | wpe_view_activity_state_in_window);
-#endif
 
     if (!eglMakeCurrent(m_eglDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, m_eglContext))
         return;
index 8dab0aa..e9aa59e 100644 (file)
@@ -35,9 +35,7 @@ ViewBackend::ViewBackend(uint32_t width, uint32_t height)
     : m_width(width)
     , m_height(height)
 {
-#if defined(WPE_BACKEND_CHECK_VERSION) && WPE_BACKEND_CHECK_VERSION(0, 2, 0)
-    wpe_loader_init("libWPEBackend-fdo-0.1.so");
-#endif
+    wpe_loader_init("libWPEBackend-fdo-1.0.so");
 }
 
 ViewBackend::~ViewBackend()
index 20f03b8..da8cf36 100644 (file)
@@ -439,7 +439,6 @@ const struct zxdg_toplevel_v6_listener WindowViewBackend::s_xdgToplevelListener
         auto& window = *static_cast<WindowViewBackend*>(data);
         wpe_view_backend_dispatch_set_size(window.backend(), width, height);
 
-#if defined(WPE_BACKEND_CHECK_VERSION) && WPE_BACKEND_CHECK_VERSION(1, 1, 0)
         bool isFocused = false;
         void* p;
         wl_array_for_each(p, states)
@@ -462,19 +461,12 @@ const struct zxdg_toplevel_v6_listener WindowViewBackend::s_xdgToplevelListener
             wpe_view_backend_add_activity_state(window.backend(), wpe_view_activity_state_focused);
         else
             wpe_view_backend_remove_activity_state(window.backend(), wpe_view_activity_state_focused);
-#else
-        (void)states;
-#endif
     },
     // close
     [](void* data, struct zxdg_toplevel_v6*)
     {
-#if defined(WPE_BACKEND_CHECK_VERSION) && WPE_BACKEND_CHECK_VERSION(1, 1, 0)
         auto& window = *static_cast<WindowViewBackend*>(data);
         wpe_view_backend_remove_activity_state(window.backend(), wpe_view_activity_state_visible | wpe_view_activity_state_focused | wpe_view_activity_state_in_window);
-#else
-        (void)data;
-#endif
     },
 };
 
@@ -525,9 +517,7 @@ WindowViewBackend::WindowViewBackend(uint32_t width, uint32_t height)
             zxdg_toplevel_v6_add_listener(m_xdgToplevel, &s_xdgToplevelListener, this);
             zxdg_toplevel_v6_set_title(m_xdgToplevel, "WPE");
             wl_surface_commit(m_surface);
-#if defined(WPE_BACKEND_CHECK_VERSION) && WPE_BACKEND_CHECK_VERSION(1, 1, 0)
             wpe_view_backend_add_activity_state(backend(), wpe_view_activity_state_visible | wpe_view_activity_state_in_window);
-#endif
         }
     }
 
index e553070..20a594a 100644 (file)
       <dep package="glib"/>
     </dependencies>
     <branch repo="github.com" module="Igalia/wpebackend-fdo.git" checkoutdir="wpebackend-fdo"
-            tag="d7eeab26375b1f08c6a35dbe2d34f02197708a03"/>
+            tag="fa227dac7c6a133d62b35d7a6af0332582b64d4d"/>
   </cmake>
 
   <autotools id="libgpg-error" autogen-sh="configure">