Skip to content
Permalink
Browse files
[Qt][WK1] Support WebGL with EGL on Linux
https://bugs.webkit.org/show_bug.cgi?id=118251

Reviewed by Kenneth Rohde Christiansen.

Source/WebCore:

Let GraphicsContext3D work without a GraphicsSurface.

* Target.pri:
* platform/graphics/OpenGLShims.cpp:
(WebCore::getProcAddress):
* platform/graphics/qt/GraphicsContext3DQt.cpp:
(WebCore::GraphicsContext3DPrivate::GraphicsContext3DPrivate):
(WebCore::GraphicsContext3DPrivate::paintToTextureMapper):

Tools:

* qmake/mkspecs/features/features.prf:

Canonical link: https://commits.webkit.org/136305@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@152282 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
carewolf committed Jul 2, 2013
1 parent fabb437 commit de17ad3ba41bfefa16f575f1131635f2bccff5a7
@@ -1,3 +1,19 @@
2013-07-02 Allan Sandfeld Jensen <allan.jensen@digia.com>

[Qt][WK1] Support WebGL with EGL on Linux
https://bugs.webkit.org/show_bug.cgi?id=118251

Reviewed by Kenneth Rohde Christiansen.

Let GraphicsContext3D work without a GraphicsSurface.

* Target.pri:
* platform/graphics/OpenGLShims.cpp:
(WebCore::getProcAddress):
* platform/graphics/qt/GraphicsContext3DQt.cpp:
(WebCore::GraphicsContext3DPrivate::GraphicsContext3DPrivate):
(WebCore::GraphicsContext3DPrivate::paintToTextureMapper):

2013-07-02 Catalin Badea <badea@adobe.com>

[CSS-Regions] OverrideLogicalHeight used by both regions and flexbox
@@ -4249,7 +4249,7 @@ use?(GRAPHICS_SURFACE) {
win32 {
SOURCES += platform/graphics/surfaces/win/GraphicsSurfaceWin.cpp
}
have?(XCOMPOSITE) {
use?(glx) {
HEADERS += \
platform/graphics/surfaces/glx/X11Helper.h \
platform/graphics/surfaces/glx/GLXConfigSelector.h
@@ -40,7 +40,9 @@ OpenGLFunctionTable* openGLFunctionTable()
#if PLATFORM(QT)
static void* getProcAddress(const char* procName)
{
return reinterpret_cast<void*>(QOpenGLContext::currentContext()->getProcAddress(procName));
if (QOpenGLContext* context = QOpenGLContext::currentContext())
return reinterpret_cast<void*>(context->getProcAddress(procName));
return 0;
}
#else
typedef void* (*glGetProcAddressType) (const char* procName);
@@ -120,7 +120,6 @@ GraphicsContext3DPrivate::GraphicsContext3DPrivate(GraphicsContext3D* context, H
return;
}

#if USE(GRAPHICS_SURFACE)
#if QT_VERSION >= 0x050100
QOffscreenSurface* surface = new QOffscreenSurface;
surface->create();
@@ -140,6 +139,8 @@ GraphicsContext3DPrivate::GraphicsContext3DPrivate(GraphicsContext3D* context, H
return;

makeCurrentIfNeeded();

#if USE(GRAPHICS_SURFACE)
IntSize surfaceSize(m_context->m_currentWidth, m_context->m_currentHeight);
m_surfaceFlags = GraphicsSurface::SupportsTextureTarget
| GraphicsSurface::SupportsSharing;
@@ -228,8 +229,9 @@ void GraphicsContext3DPrivate::paintToTextureMapper(TextureMapper* textureMapper
m_context->markLayerComposited();
blitMultisampleFramebufferAndRestoreContext();

if (textureMapper->accelerationMode() == TextureMapper::OpenGLMode) {
#if USE(GRAPHICS_SURFACE)
ASSERT(m_graphicsSurface);
if (textureMapper->accelerationMode() == TextureMapper::OpenGLMode) {
// CGL only provides us the context, but not the view the context is currently bound to.
// To make sure the context is bound the the right surface we have to do a makeCurrent through QOpenGL again.
// FIXME: Remove this code as soon as GraphicsSurfaceMac makes use of NSOpenGL.
@@ -246,9 +248,9 @@ void GraphicsContext3DPrivate::paintToTextureMapper(TextureMapper* textureMapper

TextureMapperGL* texmapGL = static_cast<TextureMapperGL*>(textureMapper);
m_graphicsSurface->paintToTextureMapper(texmapGL, targetRect, matrix, opacity);
#endif
return;
}
#endif

GraphicsContext* context = textureMapper->graphicsContext();
QPainter* painter = context->platformContext();
@@ -1,3 +1,12 @@
2013-07-02 Allan Sandfeld Jensen <allan.jensen@digia.com>

[Qt][WK1] Support WebGL with EGL on Linux
https://bugs.webkit.org/show_bug.cgi?id=118251

Reviewed by Kenneth Rohde Christiansen.

* qmake/mkspecs/features/features.prf:

2013-07-01 Nick Diego Yamane <nick.yamane@openbossa.org>

[Efl][Gtk] Look at WEBKIT_OUTPUTDIR instead of WEBKITOUTPUTDIR in jhbuildrc
@@ -140,7 +140,7 @@ defineTest(detectFeatures) {
use?(3d_graphics) {
mac: WEBKIT_CONFIG += use_graphics_surface
win32:contains(QT_CONFIG, opengles2): WEBKIT_CONFIG += use_graphics_surface
linux-*:contains(WEBKIT_CONFIG, have_glx):contains(WEBKIT_CONFIG, have_xcomposite):contains(WEBKIT_CONFIG, have_xrender): WEBKIT_CONFIG += use_graphics_surface use_glx
have?(glx):have?(xcomposite):have?(xrender): WEBKIT_CONFIG += use_graphics_surface use_glx
}

# Slider Touch is sensible to use when compiling WebKit2

0 comments on commit de17ad3

Please sign in to comment.