Title: [264095] trunk/Source/WebKit
Revision
264095
Author
[email protected]
Date
2020-07-08 04:19:27 -0700 (Wed, 08 Jul 2020)

Log Message

[WPE][Qt] Deprecation warnings
https://bugs.webkit.org/show_bug.cgi?id=214074

Patch by Philippe Normand <[email protected]> on 2020-07-08
Reviewed by Carlos Garcia Campos.

* UIProcess/API/wpe/qt/WPEQtView.cpp:
(WPEQtView::updatePaintNode): Switch to new createTextureFromNativeObject API when building against Qt 5.15.
* UIProcess/API/wpe/qt/WPEQtViewBackend.cpp:
(WPEQtViewBackend::dispatchWheelEvent): Switch to new WPE axis 2D event API.

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (264094 => 264095)


--- trunk/Source/WebKit/ChangeLog	2020-07-08 11:02:30 UTC (rev 264094)
+++ trunk/Source/WebKit/ChangeLog	2020-07-08 11:19:27 UTC (rev 264095)
@@ -1,3 +1,15 @@
+2020-07-08  Philippe Normand  <[email protected]>
+
+        [WPE][Qt] Deprecation warnings
+        https://bugs.webkit.org/show_bug.cgi?id=214074
+
+        Reviewed by Carlos Garcia Campos.
+
+        * UIProcess/API/wpe/qt/WPEQtView.cpp:
+        (WPEQtView::updatePaintNode): Switch to new createTextureFromNativeObject API when building against Qt 5.15.
+        * UIProcess/API/wpe/qt/WPEQtViewBackend.cpp:
+        (WPEQtViewBackend::dispatchWheelEvent): Switch to new WPE axis 2D event API.
+
 2020-07-08  Carlos Garcia Campos  <[email protected]>
 
         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.29.3 release

Modified: trunk/Source/WebKit/UIProcess/API/wpe/qt/WPEQtView.cpp (264094 => 264095)


--- trunk/Source/WebKit/UIProcess/API/wpe/qt/WPEQtView.cpp	2020-07-08 11:02:30 UTC (rev 264094)
+++ trunk/Source/WebKit/UIProcess/API/wpe/qt/WPEQtView.cpp	2020-07-08 11:19:27 UTC (rev 264095)
@@ -28,6 +28,7 @@
 #include <QQuickWindow>
 #include <QSGSimpleTextureNode>
 #include <QScreen>
+#include <QtGlobal>
 #include <QtPlatformHeaders/QEGLNativeContext>
 #include <qpa/qplatformnativeinterface.h>
 #include <wtf/glib/GUniquePtr.h>
@@ -184,7 +185,12 @@
     if (!textureId)
         return node;
 
-    textureNode->setTexture(window()->createTextureFromId(textureId, m_size.toSize(), QQuickWindow::TextureHasAlphaChannel));
+#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0))
+    auto texture = window()->createTextureFromNativeObject(QQuickWindow::NativeObjectTexture, &textureId, 0, m_size.toSize(), QQuickWindow::TextureHasAlphaChannel);
+#else
+    auto texture = window()->createTextureFromId(textureId, m_size.toSize(), QQuickWindow::TextureHasAlphaChannel);
+#endif
+    textureNode->setTexture(texture);
     textureNode->setRect(boundingRect());
     return textureNode;
 }

Modified: trunk/Source/WebKit/UIProcess/API/wpe/qt/WPEQtViewBackend.cpp (264094 => 264095)


--- trunk/Source/WebKit/UIProcess/API/wpe/qt/WPEQtViewBackend.cpp	2020-07-08 11:02:30 UTC (rev 264094)
+++ trunk/Source/WebKit/UIProcess/API/wpe/qt/WPEQtViewBackend.cpp	2020-07-08 11:19:27 UTC (rev 264095)
@@ -300,14 +300,16 @@
 void WPEQtViewBackend::dispatchWheelEvent(QWheelEvent* event)
 {
     QPoint delta = event->angleDelta();
-    uint32_t axis = delta.y() == event->y();
     QPoint numDegrees = delta / 8;
-    QPoint numSteps = numDegrees / 15;
-    int32_t length = numSteps.y() ? numSteps.y() : numSteps.x();
-    struct wpe_input_axis_event wpeEvent = { wpe_input_axis_event_type_motion,
-        static_cast<uint32_t>(event->timestamp()),
-        event->x(), event->y(), axis, length, modifiers() };
-    wpe_view_backend_dispatch_axis_event(backend(), &wpeEvent);
+    struct wpe_input_axis_2d_event wpeEvent;
+    if (delta.y() == event->position().y())
+        wpeEvent.x_axis = numDegrees.x();
+    else
+        wpeEvent.y_axis = numDegrees.y();
+    wpeEvent.base.type = static_cast<wpe_input_axis_event_type>(wpe_input_axis_event_type_mask_2d | wpe_input_axis_event_type_motion_smooth);
+    wpeEvent.base.x = event->position().x();
+    wpeEvent.base.y = event->position().y();
+    wpe_view_backend_dispatch_axis_event(backend(), &wpeEvent.base);
 }
 
 void WPEQtViewBackend::dispatchKeyEvent(QKeyEvent* event, bool state)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to