[WK2][GTK] ASSERTION in WebKit::LayerTreeHostGtk::invalidate
authorberto@igalia.com <berto@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 4 Sep 2013 21:59:27 +0000 (21:59 +0000)
committerberto@igalia.com <berto@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 4 Sep 2013 21:59:27 +0000 (21:59 +0000)
https://bugs.webkit.org/show_bug.cgi?id=117733

Reviewed by Martin Robinson.

If the GL context cannot be created then an invalid
LayerTreeHostGtk object will be returned.

This patch disables accelerated compositing if the system doesn't
support it.

* UIProcess/API/gtk/WebKitWebView.cpp:
(webkitWebViewUpdateSettings):
* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(webkitWebViewBaseUpdatePreferences):
(webkitWebViewBaseCreateWebPage):
* UIProcess/API/gtk/WebKitWebViewBasePrivate.h:

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

Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp
Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp
Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBasePrivate.h

index aeaf52eb55c7602b3ded5b04a68bae0a41760900..e3f3f787be8d6237e838d0d5c9ccc98aa35afe4f 100644 (file)
@@ -1,3 +1,23 @@
+2013-09-04  Alberto Garcia  <berto@igalia.com>
+
+        [WK2][GTK] ASSERTION in WebKit::LayerTreeHostGtk::invalidate
+        https://bugs.webkit.org/show_bug.cgi?id=117733
+
+        Reviewed by Martin Robinson.
+
+        If the GL context cannot be created then an invalid
+        LayerTreeHostGtk object will be returned.
+
+        This patch disables accelerated compositing if the system doesn't
+        support it.
+
+        * UIProcess/API/gtk/WebKitWebView.cpp:
+        (webkitWebViewUpdateSettings):
+        * UIProcess/API/gtk/WebKitWebViewBase.cpp:
+        (webkitWebViewBaseUpdatePreferences):
+        (webkitWebViewBaseCreateWebPage):
+        * UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
+
 2013-09-04  Commit Queue  <commit-queue@webkit.org>
 
         Unreviewed, rolling out r154989.
index 72fe66a42ead22faf2d9a485a99122532622fed2..dd5e8dee834d08d3730ca32e05bed403cf7e53a5 100644 (file)
@@ -379,6 +379,8 @@ static void webkitWebViewUpdateSettings(WebKitWebView* webView)
     page->setCanRunModal(webkit_settings_get_allow_modal_dialogs(settings));
     page->setCustomUserAgent(String::fromUTF8(webkit_settings_get_user_agent(settings)));
 
+    webkitWebViewBaseUpdatePreferences(WEBKIT_WEB_VIEW_BASE(webView));
+
     g_signal_connect(settings, "notify::allow-modal-dialogs", G_CALLBACK(allowModalDialogsChanged), webView);
     g_signal_connect(settings, "notify::zoom-text-only", G_CALLBACK(zoomTextOnlyChanged), webView);
     g_signal_connect(settings, "notify::user-agent", G_CALLBACK(userAgentChanged), webView);
index 087331b5af5a2c9a8384093ab14ed48915bdf778..bdc8d5fd0995b1bf5821df39fbb247e830a02e3f 100644 (file)
@@ -40,7 +40,9 @@
 #include "WebKitPrivate.h"
 #include "WebKitWebViewBaseAccessible.h"
 #include "WebKitWebViewBasePrivate.h"
+#include "WebPageGroup.h"
 #include "WebPageProxy.h"
+#include "WebPreferences.h"
 #include "WebViewBaseInputMethodFilter.h"
 #include <WebCore/ClipboardUtilitiesGtk.h>
 #include <WebCore/DataObjectGtk.h>
@@ -892,6 +894,16 @@ WebPageProxy* webkitWebViewBaseGetPage(WebKitWebViewBase* webkitWebViewBase)
     return webkitWebViewBase->priv->pageProxy.get();
 }
 
+void webkitWebViewBaseUpdatePreferences(WebKitWebViewBase* webkitWebViewBase)
+{
+#if USE(TEXTURE_MAPPER_GL)
+    WebKitWebViewBasePrivate* priv = webkitWebViewBase->priv;
+
+    if (!priv->redirectedWindow)
+        priv->pageProxy->pageGroup()->preferences()->setAcceleratedCompositingEnabled(false);
+#endif
+}
+
 void webkitWebViewBaseCreateWebPage(WebKitWebViewBase* webkitWebViewBase, WebContext* context, WebPageGroup* pageGroup)
 {
     WebKitWebViewBasePrivate* priv = webkitWebViewBase->priv;
@@ -908,6 +920,8 @@ void webkitWebViewBaseCreateWebPage(WebKitWebViewBase* webkitWebViewBase, WebCon
         priv->pageProxy->setAcceleratedCompositingWindowId(priv->redirectedWindow->windowId());
 #endif
 
+    webkitWebViewBaseUpdatePreferences(webkitWebViewBase);
+
     // This must happen here instead of the instance initializer, because the input method
     // filter must have access to the page.
     priv->inputMethodFilter.setWebView(webkitWebViewBase);
index e30fd949ecb9fac14b4fbfd3ac954a805af00ab5..f9b8bfa31cb663d36838032fe38adbaae1576450 100644 (file)
@@ -51,6 +51,7 @@ WebKit::WebContextMenuProxyGtk* webkitWebViewBaseGetActiveContextMenuProxy(WebKi
 GdkEvent* webkitWebViewBaseTakeContextMenuEvent(WebKitWebViewBase*);
 void webkitWebViewBaseSetInputMethodState(WebKitWebViewBase*, bool enabled);
 void webkitWebViewBaseUpdateTextInputState(WebKitWebViewBase*);
+void webkitWebViewBaseUpdatePreferences(WebKitWebViewBase*);
 
 #if USE(TEXTURE_MAPPER_GL)
 void webkitWebViewBaseQueueDrawOfAcceleratedCompositingResults(WebKitWebViewBase*);