[WPE][Qt] Port to new wpe_fdo_egl_exported_image API
authorphiln@webkit.org <philn@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 10 Jun 2019 14:04:12 +0000 (14:04 +0000)
committerphiln@webkit.org <philn@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 10 Jun 2019 14:04:12 +0000 (14:04 +0000)
https://bugs.webkit.org/show_bug.cgi?id=198713

Reviewed by Carlos Garcia Campos.

.:

* Source/cmake/OptionsWPE.cmake:

Source/WebKit:

* UIProcess/API/wpe/qt/WPEQtViewBackend.cpp:
(WPEQtViewBackend::WPEQtViewBackend):
(WPEQtViewBackend::texture):
(WPEQtViewBackend::displayImage):
* UIProcess/API/wpe/qt/WPEQtViewBackend.h:

Tools:

* flatpak/org.webkit.WPEModules.yaml: Include wpebackend-fdo
patches currently used in JHBuild.

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

ChangeLog
Source/WebKit/ChangeLog
Source/WebKit/PlatformWPE.cmake
Source/WebKit/UIProcess/API/wpe/qt/WPEQtViewBackend.cpp
Source/WebKit/UIProcess/API/wpe/qt/WPEQtViewBackend.h
Source/cmake/OptionsWPE.cmake
Tools/ChangeLog
Tools/flatpak/org.webkit.WPEModules.yaml

index 78c804e..6acf260 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2019-06-10  Philippe Normand  <pnormand@igalia.com>
+
+        [WPE][Qt] Port to new wpe_fdo_egl_exported_image API
+        https://bugs.webkit.org/show_bug.cgi?id=198713
+
+        Reviewed by Carlos Garcia Campos.
+
+        * Source/cmake/OptionsWPE.cmake:
+
 2019-06-04  Takashi Komori  <Takashi.Komori@sony.com>
 
         [WinCairo] Implement cpu and memory measuring functions.
index e968451..3f3cc03 100644 (file)
@@ -1,3 +1,16 @@
+2019-06-10  Philippe Normand  <pnormand@igalia.com>
+
+        [WPE][Qt] Port to new wpe_fdo_egl_exported_image API
+        https://bugs.webkit.org/show_bug.cgi?id=198713
+
+        Reviewed by Carlos Garcia Campos.
+
+        * UIProcess/API/wpe/qt/WPEQtViewBackend.cpp:
+        (WPEQtViewBackend::WPEQtViewBackend):
+        (WPEQtViewBackend::texture):
+        (WPEQtViewBackend::displayImage):
+        * UIProcess/API/wpe/qt/WPEQtViewBackend.h:
+
 2019-06-09  Brent Fulgham  <bfulgham@apple.com>
 
         [iOS] ResourceLoadStatistics state is not properly relayed to the NetworkProcess
index 75bf8a6..4322ab2 100644 (file)
@@ -377,14 +377,14 @@ if (ENABLE_WPE_QT_API)
         Qt5::Core Qt5::Quick
         WebKit
         ${LIBEPOXY_LIBRARIES}
-        ${WPE_BACKEND_FDO_LIBRARIES}
+        ${WPEBACKEND_FDO_LIBRARIES}
     )
 
     set(qtwpe_INCLUDE_DIRECTORIES
         ${Qt5_INCLUDE_DIRS}
         ${Qt5Gui_PRIVATE_INCLUDE_DIRS}
         ${LIBEPOXY_INCLUDE_DIRS}
-        ${WPE_BACKEND_FDO_INCLUDE_DIRS}
+        ${WPEBACKEND_FDO_INCLUDE_DIRS}
     )
 
     list(APPEND WPE_API_INSTALLED_HEADERS
index 266fe27..a8526ce 100644 (file)
@@ -113,13 +113,14 @@ WPEQtViewBackend::WPEQtViewBackend(const QSizeF& size, EGLDisplay display, EGLCo
     m_textureUniform = glFunctions->glGetUniformLocation(m_program, "u_texture");
 
     static struct wpe_view_backend_exportable_fdo_egl_client exportableClient = {
-        // export_buffer_resource
-        [](void* data, EGLImageKHR image)
+        // export_egl_image
+        nullptr,
+        [](void* data, struct wpe_fdo_egl_exported_image* image)
         {
             static_cast<WPEQtViewBackend*>(data)->displayImage(image);
         },
         // padding
-        nullptr, nullptr, nullptr, nullptr
+        nullptr, nullptr, nullptr
     };
 
     m_exportable = wpe_view_backend_exportable_fdo_egl_create(&exportableClient, this, m_size.width(), m_size.height());
@@ -171,7 +172,7 @@ GLuint WPEQtViewBackend::texture(QOpenGLContext* context)
 
     glFunctions->glActiveTexture(GL_TEXTURE0);
     glFunctions->glBindTexture(GL_TEXTURE_2D, m_textureId);
-    imageTargetTexture2DOES(GL_TEXTURE_2D, m_lockedImage);
+    imageTargetTexture2DOES(GL_TEXTURE_2D, wpe_fdo_egl_exported_image_get_egl_image(m_lockedImage));
     glFunctions->glUniform1i(m_textureUniform, 0);
 
     static const GLfloat vertices[4][2] = {
@@ -200,15 +201,15 @@ GLuint WPEQtViewBackend::texture(QOpenGLContext* context)
     glFunctions->glDisableVertexAttribArray(1);
 
     wpe_view_backend_exportable_fdo_dispatch_frame_complete(m_exportable);
-    wpe_view_backend_exportable_fdo_egl_dispatch_release_image(m_exportable, m_lockedImage);
-    m_lockedImage = EGL_NO_IMAGE_KHR;
+    wpe_view_backend_exportable_fdo_egl_dispatch_release_exported_image(m_exportable, m_lockedImage);
+    m_lockedImage = nullptr;
 
     return m_textureId;
 }
 
-void WPEQtViewBackend::displayImage(EGLImageKHR image)
+void WPEQtViewBackend::displayImage(struct wpe_fdo_egl_exported_image* image)
 {
-    RELEASE_ASSERT(m_lockedImage == EGL_NO_IMAGE_KHR);
+    RELEASE_ASSERT(!m_lockedImage);
     m_lockedImage = image;
     if (m_view)
         m_view->triggerUpdate();
index f0456d6..a0c0e7d 100644 (file)
@@ -61,14 +61,13 @@ public:
     struct wpe_view_backend* backend() const { return wpe_view_backend_exportable_fdo_get_view_backend(m_exportable); };
 
 private:
-    void displayImage(EGLImageKHR);
+    void displayImage(struct wpe_fdo_egl_exported_image*);
     uint32_t modifiers() const;
 
     EGLDisplay m_eglDisplay { nullptr };
     EGLContext m_eglContext { nullptr };
     struct wpe_view_backend_exportable_fdo* m_exportable { nullptr };
-
-    EGLImageKHR m_lockedImage { EGL_NO_IMAGE_KHR };
+    struct wpe_fdo_egl_exported_image* m_lockedImage { nullptr };
 
     QPointer<WPEQtView> m_view;
     QOffscreenSurface m_surface;
index 5c99232..4f2d8a0 100644 (file)
@@ -172,7 +172,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-1.0)
+    find_package(WPEBackend-fdo 1.3.0 REQUIRED)
 endif ()
 
 add_definitions(-DBUILDING_WPE__=1)
index 6f135b6..7442b82 100644 (file)
@@ -1,3 +1,13 @@
+2019-06-10  Philippe Normand  <pnormand@igalia.com>
+
+        [WPE][Qt] Port to new wpe_fdo_egl_exported_image API
+        https://bugs.webkit.org/show_bug.cgi?id=198713
+
+        Reviewed by Carlos Garcia Campos.
+
+        * flatpak/org.webkit.WPEModules.yaml: Include wpebackend-fdo
+        patches currently used in JHBuild.
+
 2019-06-10  Adrian Perez de Castro  <aperez@igalia.com>
 
         [GTK][Flatpak] webkit-build fails due to missing libwpe in Flatpak environment
index 970348f..5155ae2 100644 (file)
@@ -10,3 +10,7 @@
     - type: archive
       url: https://wpewebkit.org/releases/wpebackend-fdo-1.3.0.tar.xz
       sha256: fed9ab29f5d53cf465188da80d014f3aa067c77704f8508c6bd17971fded359d
+    - type: patch
+      path: ../gtk/patches/wpebackend-fdo-Handle-the-case-of-new-target-created-for-the-same-v.patch
+    - type: patch
+      path: ../gtk/wpebackend-fdo-view-backend-exportable-private-don-t-double-free-ca.patch