Title: [152222] trunk/Source/WebCore
Revision
152222
Author
[email protected]
Date
2013-07-01 07:29:22 -0700 (Mon, 01 Jul 2013)

Log Message

[Qt] Avoid creating a QWindow for offscreen GraphicsContext3D
https://bugs.webkit.org/show_bug.cgi?id=118244

Reviewed by Noam Rosenthal.

In Qt 5.0 we had to create invisible windows, but in Qt 5.1
we can now create specific offscreen surfaces.

* platform/graphics/qt/GraphicsContext3DQt.cpp:
(WebCore::GraphicsContext3DPrivate::GraphicsContext3DPrivate):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (152221 => 152222)


--- trunk/Source/WebCore/ChangeLog	2013-07-01 13:31:10 UTC (rev 152221)
+++ trunk/Source/WebCore/ChangeLog	2013-07-01 14:29:22 UTC (rev 152222)
@@ -1,5 +1,18 @@
 2013-07-01  Allan Sandfeld Jensen  <[email protected]>
 
+        [Qt] Avoid creating a QWindow for offscreen GraphicsContext3D
+        https://bugs.webkit.org/show_bug.cgi?id=118244
+
+        Reviewed by Noam Rosenthal.
+
+        In Qt 5.0 we had to create invisible windows, but in Qt 5.1
+        we can now create specific offscreen surfaces.
+
+        * platform/graphics/qt/GraphicsContext3DQt.cpp:
+        (WebCore::GraphicsContext3DPrivate::GraphicsContext3DPrivate):
+
+2013-07-01  Allan Sandfeld Jensen  <[email protected]>
+
         [Qt] Remove long unused Qt4 forward definitions
 
         Unreviewed cleanu-up.

Modified: trunk/Source/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp (152221 => 152222)


--- trunk/Source/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp	2013-07-01 13:31:10 UTC (rev 152221)
+++ trunk/Source/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp	2013-07-01 14:29:22 UTC (rev 152222)
@@ -35,10 +35,15 @@
 #include "QWebPageClient.h"
 #include "SharedBuffer.h"
 #include "TextureMapperPlatformLayer.h"
-#include <QWindow>
 #include <qpa/qplatformpixmap.h>
 #include <wtf/text/CString.h>
 
+#if QT_VERSION >= 0x050100
+#include <QOffscreenSurface>
+#else
+#include <QWindow>
+#endif
+
 #if USE(TEXTURE_MAPPER_GL)
 #include <texmap/TextureMapperGL.h>
 #endif
@@ -116,16 +121,21 @@
     }
 
 #if USE(GRAPHICS_SURFACE)
-    // FIXME: Find a way to create a QOpenGLContext without creating a QWindow at all.
-    // We need to create a surface in order to create a QOpenGLContext and make it current.
+#if QT_VERSION >= 0x050100
+    QOffscreenSurface* surface = new QOffscreenSurface;
+    surface->create();
+    m_surface = surface;
+    m_surfaceOwner = surface;
+#else
     QWindow* window = new QWindow;
     window->setSurfaceType(QSurface::OpenGLSurface);
     window->setGeometry(-10, -10, 1, 1);
     window->create();
     m_surface = window;
     m_surfaceOwner = window;
+#endif
 
-    m_platformContext = new QOpenGLContext(window);
+    m_platformContext = new QOpenGLContext(m_surfaceOwner);
     if (!m_platformContext->create())
         return;
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to