Commit 1022a8e8 authored by zandobersek@gmail.com's avatar zandobersek@gmail.com

[GTK][WK2] Only set up a RedirectedXCompositeWindow if running under an X11 display

https://bugs.webkit.org/show_bug.cgi?id=120321

Reviewed by Gustavo Noronha Silva.

Only set up the RedirectedXCompositeWindow member of the WebKitWebViewBasePrivate struct
if we're running under an X11 display. This is now done in the webkitWebViewBaseConstructed
function rather than the constructor, which is removed.

This allows for the UIProcess to run in a Wayland environment even when built with accelerated
compositing enabled. Of course, at the moment there's no support yet for accelerated compositing
under Wayland, so we fall back to rendering the backing store. No changes are introduced to
the behavior under X11 - accelerated compositing will be used where possible, if supported.

* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(webkitWebViewBaseConstructed):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154729 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent fe4d213e
2013-08-28 Zan Dobersek <zdobersek@igalia.com>
[GTK][WK2] Only set up a RedirectedXCompositeWindow if running under an X11 display
https://bugs.webkit.org/show_bug.cgi?id=120321
Reviewed by Gustavo Noronha Silva.
Only set up the RedirectedXCompositeWindow member of the WebKitWebViewBasePrivate struct
if we're running under an X11 display. This is now done in the webkitWebViewBaseConstructed
function rather than the constructor, which is removed.
This allows for the UIProcess to run in a Wayland environment even when built with accelerated
compositing enabled. Of course, at the moment there's no support yet for accelerated compositing
under Wayland, so we fall back to rendering the backing store. No changes are introduced to
the behavior under X11 - accelerated compositing will be used where possible, if supported.
* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(webkitWebViewBaseConstructed):
2013-08-28 Zan Dobersek <zdobersek@igalia.com>
[GTK][WK2] Disable accelerated compositing under Wayland
......
......@@ -57,6 +57,9 @@
#include <WebCore/Region.h>
#include <gdk/gdk.h>
#include <gdk/gdkkeysyms.h>
#ifdef GDK_WINDOWING_X11
#include <gdk/gdkx.h>
#endif
#include <wtf/HashMap.h>
#include <wtf/gobject/GOwnPtr.h>
#include <wtf/gobject/GRefPtr.h>
......@@ -80,13 +83,6 @@ void redirectedWindowDamagedCallback(void* data);
#endif
struct _WebKitWebViewBasePrivate {
_WebKitWebViewBasePrivate()
#if USE(TEXTURE_MAPPER_GL)
: redirectedWindow(RedirectedXCompositeWindow::create(IntSize(1, 1), RedirectedXCompositeWindow::DoNotCreateGLContext))
#endif
{
}
~_WebKitWebViewBasePrivate()
{
pageProxy->close();
......@@ -382,9 +378,13 @@ static void webkitWebViewBaseConstructed(GObject* object)
priv->pageClient = PageClientImpl::create(viewWidget);
priv->dragAndDropHelper.setWidget(viewWidget);
#if USE(TEXTURE_MAPPER_GL)
if (priv->redirectedWindow)
priv->redirectedWindow->setDamageNotifyCallback(redirectedWindowDamagedCallback, object);
#if USE(TEXTURE_MAPPER_GL) && defined(GDK_WINDOWING_X11)
GdkDisplay* display = gdk_display_manager_get_default_display(gdk_display_manager_get());
if (GDK_IS_X11_DISPLAY(display)) {
priv->redirectedWindow = RedirectedXCompositeWindow::create(IntSize(1, 1), RedirectedXCompositeWindow::DoNotCreateGLContext);
if (priv->redirectedWindow)
priv->redirectedWindow->setDamageNotifyCallback(redirectedWindowDamagedCallback, object);
}
#endif
priv->authenticationDialog = 0;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment