[GTK] Using a native window for the WebView breaks GtkOverlay
authormrobinson@webkit.org <mrobinson@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 21 Aug 2012 20:29:16 +0000 (20:29 +0000)
committermrobinson@webkit.org <mrobinson@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 21 Aug 2012 20:29:16 +0000 (20:29 +0000)
commit0e512cb175985890f97182e98f57cbb7c18e2107
tree4bda177e0eef89f60ecb4b39773f972b4b20f03f
parent96a68c284ea62508ce864df86f83624afed9c9e5
[GTK] Using a native window for the WebView breaks GtkOverlay
https://bugs.webkit.org/show_bug.cgi?id=90085

Reviewed by Alejandro G. Castro.

.:

* configure.ac: Parse xcomposite pkg-config file during configuration.

Source/WebCore:

No new tests. This will be covered by pixel test for accelerated
compositing when they are activated.

* GNUmakefile.am: Add XComposite libraries to the linker list.
* GNUmakefile.list.am: Add RedirectedXCompositeWindow files to the source list.
Make a new section for GLX specific files.
* platform/graphics/glx/GLContextGLX.cpp:
(WebCore::GLContextGLX::sharedDisplay): Expose sharedDisplay as a static method
so that it can be called by other X11 specific code.
* platform/graphics/glx/GLContextGLX.h: Ditto.
* platform/gtk/RedirectedXCompositeWindow.cpp: Added. An implementation of a GL surface
that renders to an X-window which redirects to a pixmap.
* platform/gtk/RedirectedXCompositeWindow.h: Added.

Source/WebKit/gtk:

Rewrite AcceleratedCompositingContext for TextureMapperGL to be more similar to
the WebKit2 LayerTreeHost and switch from rendering directly to the widget window
to a window redirected to a pixmap via XComposite. The AcceleratedCompositingContext
now handles painting the non-composited content itself and no longer relies on the
ChromeClient backing store.

This fixes issues with using GtkOverlay WebKitWebView as well as making it possible
to run pixel tests with accelerated compositing turned on.

* WebCoreSupport/AcceleratedCompositingContext.h:
(AcceleratedCompositingContext):
* WebCoreSupport/AcceleratedCompositingContextGL.cpp:
Rename some methods to make them more similar to LayerTreeHost. Now we wait to render
the OpenGL context to the window until the widget's draw signal. Escape out of all
methods early if accelerated compositing is disabled.
* WebCoreSupport/ChromeClientGtk.cpp: Always check if accelerated compositing is on
before calling into AcceleratedCompositingContext methods. When AC is on, never paint
the backing store, deferring immediately to the AcceleratedCompositingContext. When
AC is turned on the backing store now shrinks to a small size to save memory.
* webkit/webkitwebview.cpp:
(resizeWebViewFromAllocation): ChromeClient is now responsible for talking to the
AcceleratedCompositingContext directly.
(webkit_web_view_size_allocate): Exit early if the allocation is not a resize. This
makes some deeper logic a bit simpler and avoids accidentally doing too much work for
widget movement.
(webkit_web_view_realize): We no longer need a native window.

Source/WebKit2:

Add XComposite libraries to the linker list for WebKit2.

* GNUmakefile.am: Add XComposite

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@126182 268f45cc-cd09-0410-ab3c-d52691b4dbfc
18 files changed:
ChangeLog
Source/WebCore/ChangeLog
Source/WebCore/GNUmakefile.am
Source/WebCore/GNUmakefile.list.am
Source/WebCore/platform/graphics/glx/GLContextGLX.cpp
Source/WebCore/platform/graphics/glx/GLContextGLX.h
Source/WebCore/platform/gtk/RedirectedXCompositeWindow.cpp [new file with mode: 0644]
Source/WebCore/platform/gtk/RedirectedXCompositeWindow.h [new file with mode: 0644]
Source/WebKit/gtk/ChangeLog
Source/WebKit/gtk/GNUmakefile.am
Source/WebKit/gtk/WebCoreSupport/AcceleratedCompositingContext.h
Source/WebKit/gtk/WebCoreSupport/AcceleratedCompositingContextGL.cpp
Source/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp
Source/WebKit/gtk/WebCoreSupport/ChromeClientGtk.h
Source/WebKit/gtk/webkit/webkitwebview.cpp
Source/WebKit2/ChangeLog
Source/WebKit2/GNUmakefile.am
configure.ac