Add USE(LIBWPE) for AcceleratedSurface
authordon.olmstead@sony.com <don.olmstead@sony.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 15 May 2019 19:06:06 +0000 (19:06 +0000)
committerdon.olmstead@sony.com <don.olmstead@sony.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 15 May 2019 19:06:06 +0000 (19:06 +0000)
https://bugs.webkit.org/show_bug.cgi?id=197918

Reviewed by Michael Catanzaro.

Renamed AcceleratedSurfaceWPE to AcceleratedSurfaceLibWPE since it just uses the
libwpe APIs.

* PlatformWPE.cmake:
* SourcesWPE.txt:
* WebProcess/WebPage/AcceleratedSurface.cpp:
(WebKit::AcceleratedSurface::create):
* WebProcess/WebPage/libwpe/AcceleratedSurfaceLibWPE.cpp: Renamed from Source/WebKit/WebProcess/WebPage/wpe/AcceleratedSurfaceWPE.cpp.
(WebKit::AcceleratedSurfaceLibWPE::create):
(WebKit::AcceleratedSurfaceLibWPE::AcceleratedSurfaceLibWPE):
(WebKit::AcceleratedSurfaceLibWPE::~AcceleratedSurfaceLibWPE):
(WebKit::AcceleratedSurfaceLibWPE::initialize):
(WebKit::AcceleratedSurfaceLibWPE::finalize):
(WebKit::AcceleratedSurfaceLibWPE::window const):
(WebKit::AcceleratedSurfaceLibWPE::surfaceID const):
(WebKit::AcceleratedSurfaceLibWPE::clientResize):
(WebKit::AcceleratedSurfaceLibWPE::willRenderFrame):
(WebKit::AcceleratedSurfaceLibWPE::didRenderFrame):
* WebProcess/WebPage/libwpe/AcceleratedSurfaceLibWPE.h: Renamed from Source/WebKit/WebProcess/WebPage/wpe/AcceleratedSurfaceWPE.h.

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

Source/WebKit/ChangeLog
Source/WebKit/PlatformWPE.cmake
Source/WebKit/SourcesWPE.txt
Source/WebKit/WebProcess/WebPage/AcceleratedSurface.cpp
Source/WebKit/WebProcess/WebPage/libwpe/AcceleratedSurfaceLibWPE.cpp [moved from Source/WebKit/WebProcess/WebPage/wpe/AcceleratedSurfaceWPE.cpp with 81% similarity]
Source/WebKit/WebProcess/WebPage/libwpe/AcceleratedSurfaceLibWPE.h [moved from Source/WebKit/WebProcess/WebPage/wpe/AcceleratedSurfaceWPE.h with 86% similarity]

index bdee3c9..1a4bd78 100644 (file)
@@ -1,3 +1,30 @@
+2019-05-15  Don Olmstead  <don.olmstead@sony.com>
+
+        Add USE(LIBWPE) for AcceleratedSurface
+        https://bugs.webkit.org/show_bug.cgi?id=197918
+
+        Reviewed by Michael Catanzaro.
+
+        Renamed AcceleratedSurfaceWPE to AcceleratedSurfaceLibWPE since it just uses the
+        libwpe APIs.
+
+        * PlatformWPE.cmake:
+        * SourcesWPE.txt:
+        * WebProcess/WebPage/AcceleratedSurface.cpp:
+        (WebKit::AcceleratedSurface::create):
+        * WebProcess/WebPage/libwpe/AcceleratedSurfaceLibWPE.cpp: Renamed from Source/WebKit/WebProcess/WebPage/wpe/AcceleratedSurfaceWPE.cpp.
+        (WebKit::AcceleratedSurfaceLibWPE::create):
+        (WebKit::AcceleratedSurfaceLibWPE::AcceleratedSurfaceLibWPE):
+        (WebKit::AcceleratedSurfaceLibWPE::~AcceleratedSurfaceLibWPE):
+        (WebKit::AcceleratedSurfaceLibWPE::initialize):
+        (WebKit::AcceleratedSurfaceLibWPE::finalize):
+        (WebKit::AcceleratedSurfaceLibWPE::window const):
+        (WebKit::AcceleratedSurfaceLibWPE::surfaceID const):
+        (WebKit::AcceleratedSurfaceLibWPE::clientResize):
+        (WebKit::AcceleratedSurfaceLibWPE::willRenderFrame):
+        (WebKit::AcceleratedSurfaceLibWPE::didRenderFrame):
+        * WebProcess/WebPage/libwpe/AcceleratedSurfaceLibWPE.h: Renamed from Source/WebKit/WebProcess/WebPage/wpe/AcceleratedSurfaceWPE.h.
+
 2019-05-15  Youenn Fablet  <youenn@apple.com>
 
         getUserMedia sandbox extensions should not be revoked when a getUserMedia allowed request is being processed
index 8f4948e..980cfa7 100644 (file)
@@ -265,6 +265,7 @@ list(APPEND WebKit_INCLUDE_DIRECTORIES
     "${WEBKIT_DIR}/WebProcess/unix"
     "${WEBKIT_DIR}/WebProcess/WebCoreSupport/soup"
     "${WEBKIT_DIR}/WebProcess/WebPage/CoordinatedGraphics"
+    "${WEBKIT_DIR}/WebProcess/WebPage/libwpe"
     "${WEBKIT_DIR}/WebProcess/WebPage/wpe"
     "${WTF_DIR}/wtf/gtk/"
     "${WTF_DIR}/wtf/gobject"
index cbf299c..c302d82 100644 (file)
@@ -250,7 +250,8 @@ WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp
 
 WebProcess/WebPage/gstreamer/WebPageGStreamer.cpp
 
-WebProcess/WebPage/wpe/AcceleratedSurfaceWPE.cpp @no-unify
+WebProcess/WebPage/libwpe/AcceleratedSurfaceLibWPE.cpp @no-unify
+
 WebProcess/WebPage/wpe/WebInspectorUIWPE.cpp
 WebProcess/WebPage/wpe/WebPageWPE.cpp
 
index e579a5d..ef0d1fc 100644 (file)
@@ -37,8 +37,8 @@
 #include "AcceleratedSurfaceX11.h"
 #endif
 
-#if PLATFORM(WPE)
-#include "AcceleratedSurfaceWPE.h"
+#if USE(LIBWPE)
+#include "AcceleratedSurfaceLibWPE.h"
 #endif
 
 namespace WebKit {
@@ -54,9 +54,9 @@ std::unique_ptr<AcceleratedSurface> AcceleratedSurface::create(WebPage& webPage,
     if (PlatformDisplay::sharedDisplay().type() == PlatformDisplay::Type::X11)
         return AcceleratedSurfaceX11::create(webPage, client);
 #endif
-#if PLATFORM(WPE)
+#if USE(LIBWPE)
     if (PlatformDisplay::sharedDisplay().type() == PlatformDisplay::Type::WPE)
-        return AcceleratedSurfaceWPE::create(webPage, client);
+        return AcceleratedSurfaceLibWPE::create(webPage, client);
 #endif
     return nullptr;
 }
@@ -24,7 +24,7 @@
  */
 
 #include "config.h"
-#include "AcceleratedSurfaceWPE.h"
+#include "AcceleratedSurfaceLibWPE.h"
 
 #include "WebPage.h"
 #include <WebCore/PlatformDisplayLibWPE.h>
 namespace WebKit {
 using namespace WebCore;
 
-std::unique_ptr<AcceleratedSurfaceWPE> AcceleratedSurfaceWPE::create(WebPage& webPage, Client& client)
+std::unique_ptr<AcceleratedSurfaceLibWPE> AcceleratedSurfaceLibWPE::create(WebPage& webPage, Client& client)
 {
-    return std::unique_ptr<AcceleratedSurfaceWPE>(new AcceleratedSurfaceWPE(webPage, client));
+    return std::unique_ptr<AcceleratedSurfaceLibWPE>(new AcceleratedSurfaceLibWPE(webPage, client));
 }
 
-AcceleratedSurfaceWPE::AcceleratedSurfaceWPE(WebPage& webPage, Client& client)
+AcceleratedSurfaceLibWPE::AcceleratedSurfaceLibWPE(WebPage& webPage, Client& client)
     : AcceleratedSurface(webPage, client)
 {
 }
 
-AcceleratedSurfaceWPE::~AcceleratedSurfaceWPE()
+AcceleratedSurfaceLibWPE::~AcceleratedSurfaceLibWPE()
 {
     ASSERT(!m_backend);
 }
 
-void AcceleratedSurfaceWPE::initialize()
+void AcceleratedSurfaceLibWPE::initialize()
 {
     m_backend = wpe_renderer_backend_egl_target_create(m_webPage.releaseHostFileDescriptor());
     static struct wpe_renderer_backend_egl_target_client s_client = {
         // frame_complete
         [](void* data)
         {
-            auto& surface = *reinterpret_cast<AcceleratedSurfaceWPE*>(data);
+            auto& surface = *reinterpret_cast<AcceleratedSurfaceLibWPE*>(data);
             surface.m_client.frameComplete();
         },
         // padding
@@ -69,13 +69,13 @@ void AcceleratedSurfaceWPE::initialize()
         std::max(1, m_size.width()), std::max(1, m_size.height()));
 }
 
-void AcceleratedSurfaceWPE::finalize()
+void AcceleratedSurfaceLibWPE::finalize()
 {
     wpe_renderer_backend_egl_target_destroy(m_backend);
     m_backend = nullptr;
 }
 
-uint64_t AcceleratedSurfaceWPE::window() const
+uint64_t AcceleratedSurfaceLibWPE::window() const
 {
     ASSERT(m_backend);
     // EGLNativeWindowType changes depending on the EGL implementation: reinterpret_cast works
@@ -86,24 +86,24 @@ uint64_t AcceleratedSurfaceWPE::window() const
     return (uint64_t) wpe_renderer_backend_egl_target_get_native_window(m_backend);
 }
 
-uint64_t AcceleratedSurfaceWPE::surfaceID() const
+uint64_t AcceleratedSurfaceLibWPE::surfaceID() const
 {
     return m_webPage.pageID();
 }
 
-void AcceleratedSurfaceWPE::clientResize(const IntSize& size)
+void AcceleratedSurfaceLibWPE::clientResize(const IntSize& size)
 {
     ASSERT(m_backend);
     wpe_renderer_backend_egl_target_resize(m_backend, std::max(1, m_size.width()), std::max(1, m_size.height()));
 }
 
-void AcceleratedSurfaceWPE::willRenderFrame()
+void AcceleratedSurfaceLibWPE::willRenderFrame()
 {
     ASSERT(m_backend);
     wpe_renderer_backend_egl_target_frame_will_render(m_backend);
 }
 
-void AcceleratedSurfaceWPE::didRenderFrame()
+void AcceleratedSurfaceLibWPE::didRenderFrame()
 {
     ASSERT(m_backend);
     wpe_renderer_backend_egl_target_frame_rendered(m_backend);
@@ -35,11 +35,11 @@ namespace WebKit {
 
 class WebPage;
 
-class AcceleratedSurfaceWPE final : public AcceleratedSurface {
-    WTF_MAKE_NONCOPYABLE(AcceleratedSurfaceWPE); WTF_MAKE_FAST_ALLOCATED;
+class AcceleratedSurfaceLibWPE final : public AcceleratedSurface {
+    WTF_MAKE_NONCOPYABLE(AcceleratedSurfaceLibWPE); WTF_MAKE_FAST_ALLOCATED;
 public:
-    static std::unique_ptr<AcceleratedSurfaceWPE> create(WebPage&, Client&);
-    ~AcceleratedSurfaceWPE();
+    static std::unique_ptr<AcceleratedSurfaceLibWPE> create(WebPage&, Client&);
+    ~AcceleratedSurfaceLibWPE();
 
     uint64_t window() const override;
     uint64_t surfaceID() const override;
@@ -52,7 +52,7 @@ public:
     void didRenderFrame() override;
 
 private:
-    AcceleratedSurfaceWPE(WebPage&, Client&);
+    AcceleratedSurfaceLibWPE(WebPage&, Client&);
 
     struct wpe_renderer_backend_egl_target* m_backend { nullptr };
 };