Hi, All

I like to get some comment from you.

I am planning to enable wayland webgl support in webkit-efl. Basically they 
support X. With the update, I will not change the original mechanism and just 
translate X operation to wayland operation.

I think more and more developers will come across such issue when they want to 
support Wayland.

Here are some code translation.

First part: open Display

+#if ENABLE(TIZEN_WAYLAND)
+        g_nativeDisplay = wl_display_connect(NULL);
+        assert(g_nativeDisplay);
+        struct wl_registry *registry = 
wl_display_get_registry(g_nativeDisplay);
+        wl_registry_add_listener(registry, NULL, NULL);
+        wl_display_dispatch(g_nativeDisplay);
+        m_window = (void *)wl_egl_window_create(NULL, 1, 1);
+#else
+        g_nativeDisplay = XOpenDisplay(0);
+        g_nativeWindow = XCreateSimpleWindow(g_nativeDisplay, 
XDefaultRootWindow(g_nativeDisplay),
                             0, 0, 1, 1, 0,
                             BlackPixel(g_nativeDisplay, 0), 
WhitePixel(g_nativeDisplay, 0));
+        XFlush(g_nativeDisplay);
+#endif

Second part: create surface

+#if ENABLE(TIZEN_WAYLAND)
+    m_window = (void *)wl_egl_window_create(NULL, 1, 1);
+    m_surface = eglCreateWindowSurface(m_display, surfaceConfig, (struct 
wl_egl_window *)m_window, NULL);
+#else
     m_pixmapID = XCreatePixmap(g_nativeDisplay, g_nativeWindow, 1, 1, 32);
     m_surface = eglCreatePixmapSurface(m_display, surfaceConfig, m_pixmapID, 
NULL);
+#endif

Wayland has no pixmap and wl_egl_pixmap has been moved out from mesa and 
wayland. Therefore I have to use window to replace them.

Currently with testing, it is fine. However I am afraid I miss something 
unexpected. Need Wayland expert like you to have a review of them.

Any suggestion for that?

Thanks

Regards

Quanxian Wang


_______________________________________________
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel

Reply via email to