Changeset 152222 in webkit


Ignore:
Timestamp:
Jul 1, 2013 7:29:22 AM (11 years ago)
Author:
allan.jensen@digia.com
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):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r152220 r152222  
     12013-07-01  Allan Sandfeld Jensen  <allan.jensen@digia.com>
     2
     3        [Qt] Avoid creating a QWindow for offscreen GraphicsContext3D
     4        https://bugs.webkit.org/show_bug.cgi?id=118244
     5
     6        Reviewed by Noam Rosenthal.
     7
     8        In Qt 5.0 we had to create invisible windows, but in Qt 5.1
     9        we can now create specific offscreen surfaces.
     10
     11        * platform/graphics/qt/GraphicsContext3DQt.cpp:
     12        (WebCore::GraphicsContext3DPrivate::GraphicsContext3DPrivate):
     13
    1142013-07-01  Allan Sandfeld Jensen  <allan.jensen@digia.com>
    215
  • trunk/Source/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp

    r149980 r152222  
    3636#include "SharedBuffer.h"
    3737#include "TextureMapperPlatformLayer.h"
    38 #include <QWindow>
    3938#include <qpa/qplatformpixmap.h>
    4039#include <wtf/text/CString.h>
     40
     41#if QT_VERSION >= 0x050100
     42#include <QOffscreenSurface>
     43#else
     44#include <QWindow>
     45#endif
    4146
    4247#if USE(TEXTURE_MAPPER_GL)
     
    117122
    118123#if USE(GRAPHICS_SURFACE)
    119     // FIXME: Find a way to create a QOpenGLContext without creating a QWindow at all.
    120     // We need to create a surface in order to create a QOpenGLContext and make it current.
     124#if QT_VERSION >= 0x050100
     125    QOffscreenSurface* surface = new QOffscreenSurface;
     126    surface->create();
     127    m_surface = surface;
     128    m_surfaceOwner = surface;
     129#else
    121130    QWindow* window = new QWindow;
    122131    window->setSurfaceType(QSurface::OpenGLSurface);
     
    125134    m_surface = window;
    126135    m_surfaceOwner = window;
    127 
    128     m_platformContext = new QOpenGLContext(window);
     136#endif
     137
     138    m_platformContext = new QOpenGLContext(m_surfaceOwner);
    129139    if (!m_platformContext->create())
    130140        return;
Note: See TracChangeset for help on using the changeset viewer.