https://bugs.webkit.org/show_bug.cgi?id=108034
Patch by Kondapally Kalyan <kalyan.kondapally@intel.com> on 2013-03-03
Reviewed by Laszlo Gombos.
Covered by existing WebGL tests.
Currently, we set GRAPHICS_SURFACE to true if support for XCompositeWindow
is identified during compile time. This is ok, when using GLX. We might not
have support for XCompositeWindow when using EGL and GLES2.0. This patch
makes changes so that GRAPHICS_SURFACE is always enabled with EGL and adds
GLX guard to the parts of code dependent on XCompositeWindow support.
* platform/graphics/opengl/GLPlatformSurface.cpp:
* platform/graphics/surfaces/glx/GLXConfigSelector.h:
(WebCore::GLXConfigSelector::findMatchingConfig):
* platform/graphics/surfaces/glx/X11Helper.cpp:
(WebCore::X11Helper::createOffScreenWindow):
(WebCore::X11Helper::isXRenderExtensionSupported):
* platform/graphics/surfaces/glx/X11Helper.h:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@144602
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2013-03-03 Kondapally Kalyan <kalyan.kondapally@intel.com>
+
+ [EFL][WebGL] Add proper checks to enable GraphicsSurface usage on EGL without XCompositeWindow.
+ https://bugs.webkit.org/show_bug.cgi?id=108034
+
+ Reviewed by Laszlo Gombos.
+
+ Covered by existing WebGL tests.
+
+ Currently, we set GRAPHICS_SURFACE to true if support for XCompositeWindow
+ is identified during compile time. This is ok, when using GLX. We might not
+ have support for XCompositeWindow when using EGL and GLES2.0. This patch
+ makes changes so that GRAPHICS_SURFACE is always enabled with EGL and adds
+ GLX guard to the parts of code dependent on XCompositeWindow support.
+
+ * platform/graphics/opengl/GLPlatformSurface.cpp:
+ * platform/graphics/surfaces/glx/GLXConfigSelector.h:
+ (WebCore::GLXConfigSelector::findMatchingConfig):
+ * platform/graphics/surfaces/glx/X11Helper.cpp:
+ (WebCore::X11Helper::createOffScreenWindow):
+ (WebCore::X11Helper::isXRenderExtensionSupported):
+ * platform/graphics/surfaces/glx/X11Helper.h:
+
2013-03-03 Alexander Pavlov <apavlov@chromium.org>
Web Inspector: [PageAgent] can't find frame by security origin.
#if USE(ACCELERATED_COMPOSITING)
-#if HAVE(GLX)
+#if USE(GLX)
#include "GLXSurface.h"
#endif
if (!scopedVisualInfo.get())
continue;
-#if USE(GRAPHICS_SURFACE)
+#if USE(GRAPHICS_SURFACE) && USE(GLX)
if (X11Helper::isXRenderExtensionSupported()) {
XRenderPictFormat* format = XRenderFindVisualFormat(X11Helper::nativeDisplay(), scopedVisualInfo->visual);
#endif
#endif
+
void X11Helper::createOffScreenWindow(uint32_t* handleId, const XVisualInfo& visInfo, const IntSize& size)
{
-#if USE(GRAPHICS_SURFACE)
+#if USE(GRAPHICS_SURFACE) && USE(GLX)
Display* display = nativeDisplay();
if (!display)
return;
if (matchingVisuals) {
for (int i = 0; i< matchingCount; i++) {
XVisualInfo* temp = &matchingVisuals[i];
-
- if (isXRenderExtensionSupported()) {
- XRenderPictFormat* format = XRenderFindVisualFormat(nativeDisplay(), temp->visual);
-
- if (format) {
- if (supportsAlpha) {
- if (temp->depth == 32 && format->direct.alphaMask > 0)
- foundVisual = temp;
- } else if (!format->direct.alphaMask)
- foundVisual = temp;
- }
-
- if (foundVisual)
- break;
- }
-
int matchingdepth = supportsAlpha ? 32 : 24;
if (temp->depth == matchingdepth) {
if (!queryDone) {
queryDone = true;
-#if USE(GRAPHICS_SURFACE)
+#if USE(GRAPHICS_SURFACE) && USE(GLX)
Display* display = nativeDisplay();
if (display) {
}
}
+
#include "IntRect.h"
#include "OwnPtrX11.h"
-#if USE(GRAPHICS_SURFACE)
-
#if USE(EGL)
#include <opengl/GLDefs.h>
#endif
+#if USE(GRAPHICS_SURFACE) && USE(GLX)
#include <X11/extensions/Xcomposite.h>
#include <X11/extensions/Xrender.h>
-#endif
-
+#else
#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+#endif
namespace WebCore {
}
#endif
+
if (EGL_FOUND)
set(WTF_USE_EGL 1)
+ set(USE_GRAPHICS_SURFACE 1)
add_definitions(-DWTF_USE_EGL=1)
option(ENABLE_GLES2 ON)
endif ()
elseif (OPENGLX_FOUND)
add_definitions(-DWTF_USE_GLX=1)
- endif ()
- if ((OPENGLX_FOUND OR EGL_FOUND) AND X11_Xcomposite_FOUND AND X11_Xrender_FOUND)
- set(USE_GRAPHICS_SURFACE 1)
- endif ()
+ if (X11_Xcomposite_FOUND AND X11_Xrender_FOUND)
+ set(USE_GRAPHICS_SURFACE 1)
+ elseif (ENABLE_WEBGL)
+ # FIXME: Add support for NOT X11_Xcomposite for GLX
+ message(FATAL_ERROR "To use WebGL with GLX support requires X11_Xcomposite.")
+ endif ()
+ endif ()
endif ()
if (ENABLE_INSPECTOR)