Title: [292164] trunk/Tools
Revision
292164
Author
don.olmst...@sony.com
Date
2022-03-31 12:52:33 -0700 (Thu, 31 Mar 2022)

Log Message

Add PlayStation WPEToolingBackend type
https://bugs.webkit.org/show_bug.cgi?id=238610

Reviewed by Adrian Perez de Castro.

Adds the implementation of HeadlessViewBackend for the WPE PlayStation backend.

* PlatformPlayStation.cmake:
* wpe/backends/CMakeLists.txt:
* wpe/backends/HeadlessViewBackend.h:
* wpe/backends/PlatformPlayStation.cmake: Added.
* wpe/backends/playstation/HeadlessViewBackendPlayStation.cpp: Copied from Tools/wpe/backends/HeadlessViewBackend.h.
(WPEToolingBackends::HeadlessViewBackend::HeadlessViewBackend):
(WPEToolingBackends::HeadlessViewBackend::~HeadlessViewBackend):
(WPEToolingBackends::HeadlessViewBackend::backend const):
(WPEToolingBackends::HeadlessViewBackend::snapshot):
(WPEToolingBackends::HeadlessViewBackend::updateSnapshot):
(WPEToolingBackends::HeadlessViewBackend::vsync):

Modified Paths

Added Paths

Diff

Modified: trunk/Tools/ChangeLog (292163 => 292164)


--- trunk/Tools/ChangeLog	2022-03-31 19:49:26 UTC (rev 292163)
+++ trunk/Tools/ChangeLog	2022-03-31 19:52:33 UTC (rev 292164)
@@ -1,3 +1,24 @@
+2022-03-31  Don Olmstead  <don.olmst...@sony.com>
+
+        Add PlayStation WPEToolingBackend type
+        https://bugs.webkit.org/show_bug.cgi?id=238610
+
+        Reviewed by Adrian Perez de Castro.
+
+        Adds the implementation of HeadlessViewBackend for the WPE PlayStation backend.
+
+        * PlatformPlayStation.cmake:
+        * wpe/backends/CMakeLists.txt:
+        * wpe/backends/HeadlessViewBackend.h:
+        * wpe/backends/PlatformPlayStation.cmake: Added.
+        * wpe/backends/playstation/HeadlessViewBackendPlayStation.cpp: Copied from Tools/wpe/backends/HeadlessViewBackend.h.
+        (WPEToolingBackends::HeadlessViewBackend::HeadlessViewBackend):
+        (WPEToolingBackends::HeadlessViewBackend::~HeadlessViewBackend):
+        (WPEToolingBackends::HeadlessViewBackend::backend const):
+        (WPEToolingBackends::HeadlessViewBackend::snapshot):
+        (WPEToolingBackends::HeadlessViewBackend::updateSnapshot):
+        (WPEToolingBackends::HeadlessViewBackend::vsync):
+
 2022-03-31  Jonathan Bedard  <jbed...@apple.com>
 
         [Merge-Queue] Skip RemoveFlagsOnPatch if no patch defined

Modified: trunk/Tools/PlatformPlayStation.cmake (292163 => 292164)


--- trunk/Tools/PlatformPlayStation.cmake	2022-03-31 19:49:26 UTC (rev 292163)
+++ trunk/Tools/PlatformPlayStation.cmake	2022-03-31 19:52:33 UTC (rev 292164)
@@ -1,3 +1,7 @@
+if (USE_WPE_BACKEND_PLAYSTATION AND (DEVELOPER_MODE OR ENABLE_MINIBROWSER))
+    add_subdirectory(wpe/backends)
+endif ()
+
 if (ENABLE_MINIBROWSER)
     add_subdirectory(MiniBrowser/playstation)
 endif ()

Modified: trunk/Tools/wpe/backends/CMakeLists.txt (292163 => 292164)


--- trunk/Tools/wpe/backends/CMakeLists.txt	2022-03-31 19:49:26 UTC (rev 292163)
+++ trunk/Tools/wpe/backends/CMakeLists.txt	2022-03-31 19:52:33 UTC (rev 292164)
@@ -20,11 +20,11 @@
 )
 
 set(WPEToolingBackends_LIBRARIES
-    Cairo::Cairo
     WPE::libwpe
 )
 
 if (USE_CAIRO)
+    list(APPEND WPEToolingBackends_LIBRARIES Cairo::Cairo)
     list(APPEND WPEToolingBackends_DEFINITIONS USE_CAIRO=1)
 endif ()
 

Modified: trunk/Tools/wpe/backends/HeadlessViewBackend.h (292163 => 292164)


--- trunk/Tools/wpe/backends/HeadlessViewBackend.h	2022-03-31 19:49:26 UTC (rev 292163)
+++ trunk/Tools/wpe/backends/HeadlessViewBackend.h	2022-03-31 19:52:33 UTC (rev 292164)
@@ -35,6 +35,13 @@
 using PlatformViewBackend = struct wpe_view_backend_exportable_fdo*;
 #endif
 
+#if defined(WPE_BACKEND_PLAYSTATION)
+#include <wpe/playstation.h>
+
+using PlatformBuffer = void*;
+using PlatformViewBackend = wpe_playstation_view_backend_exportable*;
+#endif
+
 #if defined(USE_CAIRO) && USE_CAIRO
 #include <cairo.h>
 

Added: trunk/Tools/wpe/backends/PlatformPlayStation.cmake (0 => 292164)


--- trunk/Tools/wpe/backends/PlatformPlayStation.cmake	                        (rev 0)
+++ trunk/Tools/wpe/backends/PlatformPlayStation.cmake	2022-03-31 19:52:33 UTC (rev 292164)
@@ -0,0 +1,7 @@
+list(APPEND WPEToolingBackends_SOURCES
+    playstation/HeadlessViewBackendPlayStation.cpp
+)
+
+list(APPEND WPEToolingBackends_LIBRARIES WPE::PlayStation)
+list(APPEND WPEToolingBackends_DEFINITIONS WPE_BACKEND_PLAYSTATION)
+list(APPEND WPEToolingBackends_PRIVATE_DEFINITIONS WPE_BACKEND="")

Copied: trunk/Tools/wpe/backends/playstation/HeadlessViewBackendPlayStation.cpp (from rev 292163, trunk/Tools/wpe/backends/HeadlessViewBackend.h) (0 => 292164)


--- trunk/Tools/wpe/backends/playstation/HeadlessViewBackendPlayStation.cpp	                        (rev 0)
+++ trunk/Tools/wpe/backends/playstation/HeadlessViewBackendPlayStation.cpp	2022-03-31 19:52:33 UTC (rev 292164)
@@ -0,0 +1,68 @@
+/*
+ * Copyright (C) 2022 Sony Interactive Entertainment Inc.
+ *
+ * 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. AND ITS CONTRIBUTORS ``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 ITS 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 "HeadlessViewBackend.h"
+
+namespace WPEToolingBackends {
+
+HeadlessViewBackend::HeadlessViewBackend(uint32_t width, uint32_t height)
+    : ViewBackend(width, height)
+{
+    static struct wpe_playstation_view_backend_exportable_client exportableClient = {
+        nullptr,
+        nullptr,
+        nullptr,
+        nullptr,
+    };
+    m_exportable = wpe_playstation_view_backend_exportable_create(&exportableClient, this, width, height);
+}
+
+HeadlessViewBackend::~HeadlessViewBackend()
+{
+    if (m_exportable)
+        wpe_playstation_view_backend_exportable_destroy(m_exportable);
+}
+
+struct wpe_view_backend* HeadlessViewBackend::backend() const
+{
+    if (m_exportable)
+        return wpe_playstation_view_backend_exportable_get_view_backend(m_exportable);
+    return nullptr;
+}
+
+PlatformImage HeadlessViewBackend::snapshot()
+{
+    return nullptr;
+}
+
+void HeadlessViewBackend::updateSnapshot(PlatformBuffer exportedBuffer)
+{
+}
+
+void HeadlessViewBackend::vsync()
+{
+}
+
+} // namespace WPEToolingBackends
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to