Title: [178509] trunk/Source/WebKit2
- Revision
- 178509
- Author
- [email protected]
- Date
- 2015-01-15 05:07:42 -0800 (Thu, 15 Jan 2015)
Log Message
REGRESSION(r177075): [GTK] Creating a second web view disables accelerated compositing in existing web view
https://bugs.webkit.org/show_bug.cgi?id=140494
Reviewed by Gustavo Noronha Silva.
The problem is that r177075 moved the creation of the redirected
XComposite window to realize method, but leaving the call to
webkitWebViewBaseUpdatePreferences() in both places Realize() and
CreateWebPage(). webkitWebViewBaseUpdatePreferences() only updates
the accelerating compositing setting nowadays, depending on
whether the redirected XComposited window could be created or not
(something that depends on whether XRender, XComposite and XDamage
extensions are available in the current display). So, when the
first web view is created, webkitWebViewBaseUpdatePreferences() is
called first from CreateWebPage(), and always disabling
accelerated compositing because the redirected window hasn't been
created yet, and then from Realize() right after the redirected
window is created so that accelerated compositing is enabled. When
the second web view is created the same happens, but since
settings are shared among web views, the first call to
webkitWebViewBaseUpdatePreferences() from CreateWebPage() disables
accelerated compositing and the web page exists accelerated
compositing mode and never enters it again unless the page is
reloaded. I guess the web page should enter accelerated
compositing mode again when the setting is enabled again from
Realize(), but since the setting is global and doesn't depend on
every web view, we should never disable it once it has been
enabled in any case.
Since we want to enable accelerated compositing mode when the
redirected XComposite window has been successfully created, we can
use the SetNativeSurfaceHandleForCompositing message to enable the
setting and remove webkitWebViewBaseUpdatePreferences().
* UIProcess/API/gtk/WebKitWebView.cpp:
(webkitWebViewUpdateSettings):
* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(webkitWebViewBaseRealize):
(webkitWebViewBaseCreateWebPage):
(webkitWebViewBaseUpdatePreferences): Deleted.
* UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
* WebProcess/WebPage/DrawingAreaImpl.cpp:
(WebKit::DrawingAreaImpl::setNativeSurfaceHandleForCompositing):
Modified Paths
Diff
Modified: trunk/Source/WebKit2/ChangeLog (178508 => 178509)
--- trunk/Source/WebKit2/ChangeLog 2015-01-15 12:20:45 UTC (rev 178508)
+++ trunk/Source/WebKit2/ChangeLog 2015-01-15 13:07:42 UTC (rev 178509)
@@ -1,3 +1,48 @@
+2015-01-15 Carlos Garcia Campos <[email protected]>
+
+ REGRESSION(r177075): [GTK] Creating a second web view disables accelerated compositing in existing web view
+ https://bugs.webkit.org/show_bug.cgi?id=140494
+
+ Reviewed by Gustavo Noronha Silva.
+
+ The problem is that r177075 moved the creation of the redirected
+ XComposite window to realize method, but leaving the call to
+ webkitWebViewBaseUpdatePreferences() in both places Realize() and
+ CreateWebPage(). webkitWebViewBaseUpdatePreferences() only updates
+ the accelerating compositing setting nowadays, depending on
+ whether the redirected XComposited window could be created or not
+ (something that depends on whether XRender, XComposite and XDamage
+ extensions are available in the current display). So, when the
+ first web view is created, webkitWebViewBaseUpdatePreferences() is
+ called first from CreateWebPage(), and always disabling
+ accelerated compositing because the redirected window hasn't been
+ created yet, and then from Realize() right after the redirected
+ window is created so that accelerated compositing is enabled. When
+ the second web view is created the same happens, but since
+ settings are shared among web views, the first call to
+ webkitWebViewBaseUpdatePreferences() from CreateWebPage() disables
+ accelerated compositing and the web page exists accelerated
+ compositing mode and never enters it again unless the page is
+ reloaded. I guess the web page should enter accelerated
+ compositing mode again when the setting is enabled again from
+ Realize(), but since the setting is global and doesn't depend on
+ every web view, we should never disable it once it has been
+ enabled in any case.
+ Since we want to enable accelerated compositing mode when the
+ redirected XComposite window has been successfully created, we can
+ use the SetNativeSurfaceHandleForCompositing message to enable the
+ setting and remove webkitWebViewBaseUpdatePreferences().
+
+ * UIProcess/API/gtk/WebKitWebView.cpp:
+ (webkitWebViewUpdateSettings):
+ * UIProcess/API/gtk/WebKitWebViewBase.cpp:
+ (webkitWebViewBaseRealize):
+ (webkitWebViewBaseCreateWebPage):
+ (webkitWebViewBaseUpdatePreferences): Deleted.
+ * UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
+ * WebProcess/WebPage/DrawingAreaImpl.cpp:
+ (WebKit::DrawingAreaImpl::setNativeSurfaceHandleForCompositing):
+
2015-01-14 Carlos Garcia Campos <[email protected]>
Unreviewed. Fix GTK+ build after r178464.
Modified: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp (178508 => 178509)
--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp 2015-01-15 12:20:45 UTC (rev 178508)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp 2015-01-15 13:07:42 UTC (rev 178509)
@@ -486,8 +486,6 @@
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);
Modified: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp (178508 => 178509)
--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp 2015-01-15 12:20:45 UTC (rev 178508)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp 2015-01-15 13:07:42 UTC (rev 178509)
@@ -328,7 +328,6 @@
DrawingAreaProxyImpl* drawingArea = static_cast<DrawingAreaProxyImpl*>(priv->pageProxy->drawingArea());
drawingArea->setNativeSurfaceHandleForCompositing(priv->redirectedWindow->windowID());
}
- webkitWebViewBaseUpdatePreferences(webView);
}
#endif
@@ -1105,19 +1104,6 @@
return webkitWebViewBase->priv->pageProxy.get();
}
-void webkitWebViewBaseUpdatePreferences(WebKitWebViewBase* webkitWebViewBase)
-{
- WebKitWebViewBasePrivate* priv = webkitWebViewBase->priv;
-
-#if USE(TEXTURE_MAPPER_GL) && PLATFORM(X11)
- bool acceleratedCompositingEnabled = priv->redirectedWindow ? true : false;
-#else
- bool acceleratedCompositingEnabled = false;
-#endif
-
- priv->pageProxy->preferences().setAcceleratedCompositingEnabled(acceleratedCompositingEnabled);
-}
-
#if HAVE(GTK_SCALE_FACTOR)
static void deviceScaleFactorChanged(WebKitWebViewBase* webkitWebViewBase)
{
@@ -1144,8 +1130,6 @@
priv->pageProxy->setIntrinsicDeviceScaleFactor(gtk_widget_get_scale_factor(GTK_WIDGET(webkitWebViewBase)));
g_signal_connect(webkitWebViewBase, "notify::scale-factor", G_CALLBACK(deviceScaleFactorChanged), nullptr);
#endif
-
- webkitWebViewBaseUpdatePreferences(webkitWebViewBase);
}
void webkitWebViewBaseSetTooltipText(WebKitWebViewBase* webViewBase, const char* tooltip)
Modified: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBasePrivate.h (178508 => 178509)
--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBasePrivate.h 2015-01-15 12:20:45 UTC (rev 178508)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBasePrivate.h 2015-01-15 13:07:42 UTC (rev 178509)
@@ -53,12 +53,7 @@
GdkEvent* webkitWebViewBaseTakeContextMenuEvent(WebKitWebViewBase*);
void webkitWebViewBaseSetInputMethodState(WebKitWebViewBase*, bool enabled);
void webkitWebViewBaseUpdateTextInputState(WebKitWebViewBase*);
-void webkitWebViewBaseUpdatePreferences(WebKitWebViewBase*);
-#if USE(TEXTURE_MAPPER_GL)
-void webkitWebViewBaseQueueDrawOfAcceleratedCompositingResults(WebKitWebViewBase*);
-#endif
-
void webkitWebViewBaseSetFocus(WebKitWebViewBase*, bool focused);
bool webkitWebViewBaseIsInWindowActive(WebKitWebViewBase*);
bool webkitWebViewBaseIsFocused(WebKitWebViewBase*);
Modified: trunk/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp (178508 => 178509)
--- trunk/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp 2015-01-15 12:20:45 UTC (rev 178508)
+++ trunk/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp 2015-01-15 13:07:42 UTC (rev 178509)
@@ -688,6 +688,7 @@
void DrawingAreaImpl::setNativeSurfaceHandleForCompositing(uint64_t handle)
{
m_nativeSurfaceHandleForCompositing = handle;
+ m_webPage.corePage()->settings().setAcceleratedCompositingEnabled(true);
#if USE(COORDINATED_GRAPHICS_THREADED)
if (m_layerTreeHost)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes