Title: [144602] trunk/Source
Revision
144602
Author
commit-qu...@webkit.org
Date
2013-03-03 23:57:44 -0800 (Sun, 03 Mar 2013)

Log Message

[EFL][WebGL] Add proper checks to enable GraphicsSurface usage on EGL without XCompositeWindow.
https://bugs.webkit.org/show_bug.cgi?id=108034

Patch by Kondapally Kalyan <kalyan.kondapa...@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:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (144601 => 144602)


--- trunk/Source/WebCore/ChangeLog	2013-03-04 07:44:50 UTC (rev 144601)
+++ trunk/Source/WebCore/ChangeLog	2013-03-04 07:57:44 UTC (rev 144602)
@@ -1,3 +1,26 @@
+2013-03-03  Kondapally Kalyan  <kalyan.kondapa...@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  <apav...@chromium.org>
 
         Web Inspector: [PageAgent] can't find frame by security origin.

Modified: trunk/Source/WebCore/platform/graphics/opengl/GLPlatformSurface.cpp (144601 => 144602)


--- trunk/Source/WebCore/platform/graphics/opengl/GLPlatformSurface.cpp	2013-03-04 07:44:50 UTC (rev 144601)
+++ trunk/Source/WebCore/platform/graphics/opengl/GLPlatformSurface.cpp	2013-03-04 07:57:44 UTC (rev 144602)
@@ -28,7 +28,7 @@
 
 #if USE(ACCELERATED_COMPOSITING)
 
-#if HAVE(GLX)
+#if USE(GLX)
 #include "GLXSurface.h"
 #endif
 

Modified: trunk/Source/WebCore/platform/graphics/surfaces/glx/GLXConfigSelector.h (144601 => 144602)


--- trunk/Source/WebCore/platform/graphics/surfaces/glx/GLXConfigSelector.h	2013-03-04 07:44:50 UTC (rev 144601)
+++ trunk/Source/WebCore/platform/graphics/surfaces/glx/GLXConfigSelector.h	2013-03-04 07:57:44 UTC (rev 144602)
@@ -151,7 +151,7 @@
             if (!scopedVisualInfo.get())
                 continue;
 
-#if USE(GRAPHICS_SURFACE)
+#if USE(GRAPHICS_SURFACE) && USE(GLX)
             if (X11Helper::isXRenderExtensionSupported()) {
                 XRenderPictFormat* format = XRenderFindVisualFormat(X11Helper::nativeDisplay(), scopedVisualInfo->visual);
 
@@ -208,3 +208,4 @@
 #endif
 
 #endif
+

Modified: trunk/Source/WebCore/platform/graphics/surfaces/glx/X11Helper.cpp (144601 => 144602)


--- trunk/Source/WebCore/platform/graphics/surfaces/glx/X11Helper.cpp	2013-03-04 07:44:50 UTC (rev 144601)
+++ trunk/Source/WebCore/platform/graphics/surfaces/glx/X11Helper.cpp	2013-03-04 07:57:44 UTC (rev 144602)
@@ -183,7 +183,7 @@
 
 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;
@@ -241,22 +241,6 @@
     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) {
@@ -295,7 +279,7 @@
 
     if (!queryDone) {
         queryDone = true;
-#if USE(GRAPHICS_SURFACE)
+#if USE(GRAPHICS_SURFACE) && USE(GLX)
         Display* display = nativeDisplay();
 
         if (display) {
@@ -322,3 +306,4 @@
 }
 
 }
+

Modified: trunk/Source/WebCore/platform/graphics/surfaces/glx/X11Helper.h (144601 => 144602)


--- trunk/Source/WebCore/platform/graphics/surfaces/glx/X11Helper.h	2013-03-04 07:44:50 UTC (rev 144601)
+++ trunk/Source/WebCore/platform/graphics/surfaces/glx/X11Helper.h	2013-03-04 07:57:44 UTC (rev 144602)
@@ -29,18 +29,18 @@
 #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>
+#else
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
 #endif
 
-#include <X11/Xlib.h>
-
 namespace WebCore {
 
 class X11Helper {
@@ -73,3 +73,4 @@
 }
 
 #endif
+

Modified: trunk/Source/cmake/OptionsEfl.cmake (144601 => 144602)


--- trunk/Source/cmake/OptionsEfl.cmake	2013-03-04 07:44:50 UTC (rev 144601)
+++ trunk/Source/cmake/OptionsEfl.cmake	2013-03-04 07:57:44 UTC (rev 144602)
@@ -186,6 +186,7 @@
 
     if (EGL_FOUND)
         set(WTF_USE_EGL 1)
+        set(USE_GRAPHICS_SURFACE 1)
         add_definitions(-DWTF_USE_EGL=1)
         option(ENABLE_GLES2 ON)
 
@@ -199,11 +200,14 @@
         endif ()
      elseif (OPENGLX_FOUND)
          add_definitions(-DWTF_USE_GLX=1)
+
+         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 ()
-
-     if ((OPENGLX_FOUND OR EGL_FOUND) AND X11_Xcomposite_FOUND AND X11_Xrender_FOUND)
-         set(USE_GRAPHICS_SURFACE 1)
-     endif ()
 endif ()
 
 if (ENABLE_INSPECTOR)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to