| Differences between
and this patch
- ChangeLog +12 lines
Lines 1-3 ChangeLog_sec1
1
2012-12-20  Kondapally Kalyan  <kalyan.kondapally@intel.com>
2
3
        [EFL][WebGL][Wk2] Replace HAVE checks with USE
4
        https://bugs.webkit.org/show_bug.cgi?id=105431
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        This patch changes the check Have to Use.
9
        This would enable us to choose our preferred GL backend during build time.
10
11
        * Source/cmake/OptionsEfl.cmake:
12
1
2012-12-20  Zan Dobersek  <zandobersek@gmail.com>
13
2012-12-20  Zan Dobersek  <zandobersek@gmail.com>
2
14
3
        [GTK] Remove the --enable-unstable-features configuration option
15
        [GTK] Remove the --enable-unstable-features configuration option
- Source/WebCore/ChangeLog +52 lines
Lines 1-3 Source/WebCore/ChangeLog_sec1
1
2012-12-20  Kondapally Kalyan  <kalyan.kondapally@intel.com>
2
3
        [EFL][WebGL][Wk2] Replace HAVE checks with USE
4
        https://bugs.webkit.org/show_bug.cgi?id=105431
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        This patch changes the check Have to Use.
9
        This would enable us to choose our preferred GL backend during build time.
10
        This patch also adds an additional api to query the shared buffer handle.
11
        Buffer handle is not same as gl surface and would depend on how the content is
12
        backed up.
13
14
        * platform/graphics/opengl/GLDefs.h:
15
        (WebCore):
16
        * platform/graphics/opengl/GLPlatformContext.cpp:
17
        (WebCore::GLPlatformContext::createContext):
18
        (WebCore::GLPlatformContext::createOffScreenContext):
19
        (WebCore::GLPlatformContext::createCurrentContextWrapper):
20
        * platform/graphics/opengl/GLPlatformSurface.cpp:
21
        (WebCore::GLPlatformSurface::createOffscreenSurface):
22
        (WebCore::GLPlatformSurface::createTransportSurface):
23
        (WebCore::GLPlatformSurface::GLPlatformSurface):
24
        (WebCore::GLPlatformSurface::handle):
25
        (WebCore):
26
        (WebCore::GLPlatformSurface::drawable):
27
        * platform/graphics/opengl/GLPlatformSurface.h:
28
        (GLPlatformSurface):
29
        * platform/graphics/surfaces/glx/GLXContext.cpp:
30
        * platform/graphics/surfaces/glx/GLXContext.h:
31
        * platform/graphics/surfaces/glx/GLXSurface.cpp:
32
        (WebCore::GLXTransportSurface::GLXTransportSurface):
33
        (WebCore::GLXTransportSurface::destroy):
34
        (WebCore::GLXPBuffer::initialize):
35
        (WebCore::GLXPBuffer::freeResources):
36
        * platform/graphics/surfaces/glx/GLXSurface.h:
37
        * platform/graphics/surfaces/glx/GLXWindowResources.h:
38
        * platform/graphics/surfaces/glx/X11WindowResources.cpp:
39
        (WebCore::X11OffScreenWindow::X11OffScreenWindow):
40
        (WebCore::X11OffScreenWindow::setGeometry):
41
        (WebCore::X11OffScreenWindow::createOffscreenWindow):
42
        (WebCore::X11OffScreenWindow::destroyWindow):
43
        * platform/graphics/surfaces/glx/X11WindowResources.h:
44
        (WebCore):
45
        (DummySharedResources):
46
        (WebCore::DummySharedResources::create):
47
        (WebCore::DummySharedResources::nativeDisplay):
48
        (WebCore::DummySharedResources::pBufferContextConfig):
49
        (WebCore::DummySharedResources::surfaceContextConfig):
50
        (WebCore::DummySharedResources::DummySharedResources):
51
        (WebCore::DummySharedResources::~DummySharedResources):
52
1
2012-12-19  Simon Fraser  <simon.fraser@apple.com>
53
2012-12-19  Simon Fraser  <simon.fraser@apple.com>
2
54
3
        Lots of sticky tests failing in WK2
55
        Lots of sticky tests failing in WK2
- Source/WebCore/platform/graphics/opengl/GLDefs.h -4 / +6 lines
Lines 38-59 Source/WebCore/platform/graphics/opengl/GLDefs.h_sec1
38
#include <GL/glext.h>
38
#include <GL/glext.h>
39
#endif
39
#endif
40
40
41
#if HAVE(GLX)
41
#if USE(GLX)
42
#include <GL/glx.h>
42
#include <GL/glx.h>
43
#endif
43
#endif
44
44
45
namespace WebCore {
45
namespace WebCore {
46
46
47
#if HAVE(GLX)
47
typedef uint32_t PlatformBufferHandle;
48
49
#if USE(GLX)
48
typedef GLXContext PlatformContext;
50
typedef GLXContext PlatformContext;
49
typedef Display* PlatformDisplay;
51
typedef Display* PlatformDisplay;
50
typedef GLXFBConfig PlatformSurfaceConfig;
52
typedef GLXFBConfig PlatformSurfaceConfig;
51
typedef GLXDrawable PlatformSurface;
53
typedef GLXDrawable PlatformDrawable;
52
#else
54
#else
53
typedef void* PlatformContext;
55
typedef void* PlatformContext;
54
typedef void* PlatformDisplay;
56
typedef void* PlatformDisplay;
55
typedef void* PlatformSurfaceConfig;
57
typedef void* PlatformSurfaceConfig;
56
typedef void* PlatformSurface;
58
typedef void* PlatformDrawable;
57
#endif
59
#endif
58
60
59
}
61
}
- Source/WebCore/platform/graphics/opengl/GLPlatformContext.cpp -4 / +4 lines
Lines 28-34 Source/WebCore/platform/graphics/opengl/GLPlatformContext.cpp_sec1
28
28
29
#if USE(ACCELERATED_COMPOSITING)
29
#if USE(ACCELERATED_COMPOSITING)
30
30
31
#if HAVE(GLX)
31
#if USE(GLX)
32
#include "GLXContext.h"
32
#include "GLXContext.h"
33
#endif
33
#endif
34
34
Lines 45-51 PassOwnPtr<GLPlatformContext> GLPlatformContext::createContext(GraphicsContext3D Source/WebCore/platform/graphics/opengl/GLPlatformContext.cpp_sec2
45
        return nullptr;
45
        return nullptr;
46
46
47
    if (!glGetGraphicsResetStatusARB) {
47
    if (!glGetGraphicsResetStatusARB) {
48
#if HAVE(GLX)
48
#if USE(GLX)
49
        glGetGraphicsResetStatusARB = reinterpret_cast<PFNGLGETGRAPHICSRESETSTATUSARBPROC>(glXGetProcAddressARB(reinterpret_cast<const GLubyte*>("glGetGraphicsResetStatusARB")));
49
        glGetGraphicsResetStatusARB = reinterpret_cast<PFNGLGETGRAPHICSRESETSTATUSARBPROC>(glXGetProcAddressARB(reinterpret_cast<const GLubyte*>("glGetGraphicsResetStatusARB")));
50
#endif
50
#endif
51
    }
51
    }
Lines 69-75 PassOwnPtr<GLPlatformContext> GLPlatformContext::createContext(GraphicsContext3D Source/WebCore/platform/graphics/opengl/GLPlatformContext.cpp_sec3
69
69
70
PassOwnPtr<GLPlatformContext> GLPlatformContext::createOffScreenContext()
70
PassOwnPtr<GLPlatformContext> GLPlatformContext::createOffScreenContext()
71
{
71
{
72
#if HAVE(GLX)
72
#if USE(GLX)
73
    OwnPtr<GLPlatformContext> glxContext = adoptPtr(new GLXOffScreenContext());
73
    OwnPtr<GLPlatformContext> glxContext = adoptPtr(new GLXOffScreenContext());
74
    return glxContext.release();
74
    return glxContext.release();
75
#endif
75
#endif
Lines 79-85 PassOwnPtr<GLPlatformContext> GLPlatformContext::createOffScreenContext() Source/WebCore/platform/graphics/opengl/GLPlatformContext.cpp_sec4
79
79
80
PassOwnPtr<GLPlatformContext> GLPlatformContext::createCurrentContextWrapper()
80
PassOwnPtr<GLPlatformContext> GLPlatformContext::createCurrentContextWrapper()
81
{
81
{
82
#if HAVE(GLX)
82
#if USE(GLX)
83
    OwnPtr<GLPlatformContext> glxContext = adoptPtr(new GLXCurrentContextWrapper());
83
    OwnPtr<GLPlatformContext> glxContext = adoptPtr(new GLXCurrentContextWrapper());
84
    return glxContext.release();
84
    return glxContext.release();
85
#endif
85
#endif
- Source/WebCore/platform/graphics/opengl/GLPlatformSurface.cpp -4 / +10 lines
Lines 38-47 namespace WebCore { Source/WebCore/platform/graphics/opengl/GLPlatformSurface.cpp_sec1
38
38
39
PassOwnPtr<GLPlatformSurface> GLPlatformSurface::createOffscreenSurface()
39
PassOwnPtr<GLPlatformSurface> GLPlatformSurface::createOffscreenSurface()
40
{
40
{
41
#if HAVE(GLX)
41
#if USE(GLX)
42
    OwnPtr<GLPlatformSurface> surface = adoptPtr(new GLXPBuffer());
42
    OwnPtr<GLPlatformSurface> surface = adoptPtr(new GLXPBuffer());
43
43
44
    if (surface->handle())
44
    if (surface->handle() && surface->drawable())
45
        return surface.release();
45
        return surface.release();
46
#endif
46
#endif
47
47
Lines 50-56 PassOwnPtr<GLPlatformSurface> GLPlatformSurface::createOffscreenSurface() Source/WebCore/platform/graphics/opengl/GLPlatformSurface.cpp_sec2
50
50
51
PassOwnPtr<GLPlatformSurface> GLPlatformSurface::createTransportSurface()
51
PassOwnPtr<GLPlatformSurface> GLPlatformSurface::createTransportSurface()
52
{
52
{
53
#if HAVE(GLX) && USE(GRAPHICS_SURFACE)
53
#if USE(GLX) && USE(GRAPHICS_SURFACE)
54
    OwnPtr<GLPlatformSurface> surface = adoptPtr(new GLXTransportSurface());
54
    OwnPtr<GLPlatformSurface> surface = adoptPtr(new GLXTransportSurface());
55
55
56
    if (surface->handle())
56
    if (surface->handle())
Lines 65-70 GLPlatformSurface::GLPlatformSurface() Source/WebCore/platform/graphics/opengl/GLPlatformSurface.cpp_sec3
65
    , m_fboId(0)
65
    , m_fboId(0)
66
    , m_sharedDisplay(0)
66
    , m_sharedDisplay(0)
67
    , m_drawable(0)
67
    , m_drawable(0)
68
    , m_bufferHandle(0)
68
{
69
{
69
}
70
}
70
71
Lines 72-78 GLPlatformSurface::~GLPlatformSurface() Source/WebCore/platform/graphics/opengl/GLPlatformSurface.cpp_sec4
72
{
73
{
73
}
74
}
74
75
75
PlatformSurface GLPlatformSurface::handle() const
76
PlatformBufferHandle GLPlatformSurface::handle() const
77
{
78
    return m_bufferHandle;
79
}
80
81
PlatformDrawable GLPlatformSurface::drawable() const
76
{
82
{
77
    return m_drawable;
83
    return m_drawable;
78
}
84
}
- Source/WebCore/platform/graphics/opengl/GLPlatformSurface.h -3 / +6 lines
Lines 52-59 public: Source/WebCore/platform/graphics/opengl/GLPlatformSurface.h_sec1
52
52
53
    const IntRect& geometry() const;
53
    const IntRect& geometry() const;
54
54
55
    // Get the underlying platform specific surface handle.
55
    // Get the underlying platform specific buffer handle.
56
    PlatformSurface handle() const;
56
    PlatformBufferHandle handle() const;
57
58
    PlatformDrawable drawable() const;
57
59
58
    PlatformDisplay sharedDisplay() const;
60
    PlatformDisplay sharedDisplay() const;
59
61
Lines 78-84 protected: Source/WebCore/platform/graphics/opengl/GLPlatformSurface.h_sec2
78
    IntRect m_rect;
80
    IntRect m_rect;
79
    GLuint m_fboId;
81
    GLuint m_fboId;
80
    PlatformDisplay m_sharedDisplay;
82
    PlatformDisplay m_sharedDisplay;
81
    PlatformSurface m_drawable;
83
    PlatformDrawable m_drawable;
84
    PlatformBufferHandle m_bufferHandle;
82
};
85
};
83
86
84
}
87
}
- Source/WebCore/platform/graphics/surfaces/glx/GLXContext.cpp -1 / +1 lines
Lines 26-32 Source/WebCore/platform/graphics/surfaces/glx/GLXContext.cpp_sec1
26
#include "config.h"
26
#include "config.h"
27
#include "GLXContext.h"
27
#include "GLXContext.h"
28
28
29
#if USE(ACCELERATED_COMPOSITING) && HAVE(GLX)
29
#if USE(ACCELERATED_COMPOSITING) && USE(GLX)
30
30
31
namespace WebCore {
31
namespace WebCore {
32
32
- Source/WebCore/platform/graphics/surfaces/glx/GLXContext.h -1 / +1 lines
Lines 26-32 Source/WebCore/platform/graphics/surfaces/glx/GLXContext.h_sec1
26
#ifndef GLXContext_h
26
#ifndef GLXContext_h
27
#define GLXContext_h
27
#define GLXContext_h
28
28
29
#if USE(ACCELERATED_COMPOSITING) && HAVE(GLX)
29
#if USE(ACCELERATED_COMPOSITING) && USE(GLX)
30
30
31
#include "GLPlatformContext.h"
31
#include "GLPlatformContext.h"
32
32
- Source/WebCore/platform/graphics/surfaces/glx/GLXSurface.cpp -1 / +5 lines
Lines 26-32 Source/WebCore/platform/graphics/surfaces/glx/GLXSurface.cpp_sec1
26
#include "config.h"
26
#include "config.h"
27
#include "GLXSurface.h"
27
#include "GLXSurface.h"
28
28
29
#if USE(ACCELERATED_COMPOSITING) && HAVE(GLX)
29
#if USE(ACCELERATED_COMPOSITING) && USE(GLX)
30
30
31
namespace WebCore {
31
namespace WebCore {
32
32
Lines 37-42 GLXTransportSurface::GLXTransportSurface() Source/WebCore/platform/graphics/surfaces/glx/GLXSurface.cpp_sec2
37
    : X11OffScreenWindow()
37
    : X11OffScreenWindow()
38
{
38
{
39
    createOffscreenWindow();
39
    createOffscreenWindow();
40
    m_drawable = m_bufferHandle;
40
}
41
}
41
42
42
GLXTransportSurface::~GLXTransportSurface()
43
GLXTransportSurface::~GLXTransportSurface()
Lines 66-71 void GLXTransportSurface::swapBuffers() Source/WebCore/platform/graphics/surfaces/glx/GLXSurface.cpp_sec3
66
void GLXTransportSurface::destroy()
67
void GLXTransportSurface::destroy()
67
{
68
{
68
    destroyWindow();
69
    destroyWindow();
70
    m_bufferHandle = 0;
69
}
71
}
70
72
71
#endif
73
#endif
Lines 88-93 void GLXPBuffer::initialize() Source/WebCore/platform/graphics/surfaces/glx/GLXSurface.cpp_sec4
88
        return;
90
        return;
89
91
90
    m_drawable = glXCreatePbuffer(display, config, pbufferAttributes);
92
    m_drawable = glXCreatePbuffer(display, config, pbufferAttributes);
93
    m_bufferHandle = m_drawable;
91
}
94
}
92
95
93
PlatformSurfaceConfig GLXPBuffer::configuration()
96
PlatformSurfaceConfig GLXPBuffer::configuration()
Lines 112-117 void GLXPBuffer::freeResources() Source/WebCore/platform/graphics/surfaces/glx/GLXSurface.cpp_sec5
112
115
113
    glXDestroyPbuffer(display, m_drawable);
116
    glXDestroyPbuffer(display, m_drawable);
114
    m_drawable = 0;
117
    m_drawable = 0;
118
    m_bufferHandle = 0;
115
}
119
}
116
120
117
void GLXPBuffer::setGeometry(const IntRect& newRect)
121
void GLXPBuffer::setGeometry(const IntRect& newRect)
- Source/WebCore/platform/graphics/surfaces/glx/GLXSurface.h -1 / +1 lines
Lines 26-32 Source/WebCore/platform/graphics/surfaces/glx/GLXSurface.h_sec1
26
#ifndef GLXSurface_h
26
#ifndef GLXSurface_h
27
#define GLXSurface_h
27
#define GLXSurface_h
28
28
29
#if USE(ACCELERATED_COMPOSITING) && HAVE(GLX)
29
#if USE(ACCELERATED_COMPOSITING) && USE(GLX)
30
30
31
#include "GLXWindowResources.h"
31
#include "GLXWindowResources.h"
32
32
- Source/WebCore/platform/graphics/surfaces/glx/GLXWindowResources.h -1 / +1 lines
Lines 28-34 Source/WebCore/platform/graphics/surfaces/glx/GLXWindowResources.h_sec1
28
28
29
#include "X11WindowResources.h"
29
#include "X11WindowResources.h"
30
30
31
#if USE(ACCELERATED_COMPOSITING) && HAVE(GLX)
31
#if USE(ACCELERATED_COMPOSITING) && USE(GLX)
32
32
33
namespace WebCore {
33
namespace WebCore {
34
34
- Source/WebCore/platform/graphics/surfaces/glx/X11WindowResources.cpp -11 / +19 lines
Lines 36-43 PlatformSharedResources* SharedX11Resources::m_staticSharedResource = 0; Source/WebCore/platform/graphics/surfaces/glx/X11WindowResources.cpp_sec1
36
36
37
X11OffScreenWindow::X11OffScreenWindow()
37
X11OffScreenWindow::X11OffScreenWindow()
38
    : GLPlatformSurface()
38
    : GLPlatformSurface()
39
    , m_sharedResources(0)
39
{
40
{
40
    m_sharedResources = PlatformSharedResources::create();
41
    m_sharedResources = PlatformSharedResources::create();
42
43
    if (!m_sharedResources)
44
        return;
45
41
    m_sharedDisplay = m_sharedResources->nativeDisplay();
46
    m_sharedDisplay = m_sharedResources->nativeDisplay();
42
}
47
}
43
48
Lines 48-63 X11OffScreenWindow::~X11OffScreenWindow() Source/WebCore/platform/graphics/surfaces/glx/X11WindowResources.cpp_sec2
48
void X11OffScreenWindow::setGeometry(const IntRect& newRect)
53
void X11OffScreenWindow::setGeometry(const IntRect& newRect)
49
{
54
{
50
    GLPlatformSurface::setGeometry(newRect);
55
    GLPlatformSurface::setGeometry(newRect);
51
    XResizeWindow(m_sharedResources->x11Display(), m_drawable, newRect.width(), newRect.height());
56
    XResizeWindow(m_sharedResources->x11Display(), m_bufferHandle, newRect.width(), newRect.height());
52
}
57
}
53
58
54
void X11OffScreenWindow::createOffscreenWindow()
59
void X11OffScreenWindow::createOffscreenWindow()
55
{
60
{
61
    if (!m_sharedResources)
62
        return;
63
56
    Display* display = m_sharedResources->x11Display();
64
    Display* display = m_sharedResources->x11Display();
57
    if (!display)
65
    if (!display)
58
        return;
66
        return;
59
67
60
    GLXFBConfig config = m_sharedResources->surfaceContextConfig();
68
    PlatformSurfaceConfig config = m_sharedResources->surfaceContextConfig();
61
69
62
    if (!config) {
70
    if (!config) {
63
        LOG_ERROR("Failed to retrieve a valid configiration.");
71
        LOG_ERROR("Failed to retrieve a valid configiration.");
Lines 80-112 void X11OffScreenWindow::createOffscreenWindow() Source/WebCore/platform/graphics/surfaces/glx/X11WindowResources.cpp_sec3
80
    attribute.background_pixel = WhitePixel(display, 0);
88
    attribute.background_pixel = WhitePixel(display, 0);
81
    attribute.border_pixel = BlackPixel(display, 0);
89
    attribute.border_pixel = BlackPixel(display, 0);
82
    attribute.colormap = cmap;
90
    attribute.colormap = cmap;
83
    m_drawable = XCreateWindow(display, xWindow, 0, 0, 1, 1, 0, visInfo->depth, InputOutput, visInfo->visual, CWBackPixel | CWBorderPixel | CWColormap, &attribute);
91
    m_bufferHandle = XCreateWindow(display, xWindow, 0, 0, 1, 1, 0, visInfo->depth, InputOutput, visInfo->visual, CWBackPixel | CWBorderPixel | CWColormap, &attribute);
84
92
85
    if (!m_drawable) {
93
    if (!m_bufferHandle) {
86
        LOG_ERROR("Failed to create offscreen window");
94
        LOG_ERROR("Failed to create offscreen window");
87
        return;
95
        return;
88
    }
96
    }
89
97
90
    XSetWindowBackgroundPixmap(display, m_drawable, 0);
98
    XSetWindowBackgroundPixmap(display, m_bufferHandle, 0);
91
    XCompositeRedirectWindow(display, m_drawable, CompositeRedirectManual);
99
    XCompositeRedirectWindow(display, m_bufferHandle, CompositeRedirectManual);
92
100
93
    if (m_sharedResources->isXRenderExtensionSupported())
101
    if (m_sharedResources->isXRenderExtensionSupported())
94
        XMapWindow(display, m_drawable);
102
        XMapWindow(display, m_bufferHandle);
95
103
96
}
104
}
97
105
98
void X11OffScreenWindow::destroyWindow()
106
void X11OffScreenWindow::destroyWindow()
99
{
107
{
100
    if (!m_drawable)
108
    if (!m_bufferHandle)
101
        return;
109
        return;
102
110
103
    GLPlatformSurface::destroy();
111
    GLPlatformSurface::destroy();
104
    Display* display = sharedDisplay();
112
    Display* display = m_sharedResources->x11Display();
105
    if (!display)
113
    if (!display)
106
        return;
114
        return;
107
115
108
    XDestroyWindow(display, m_drawable);
116
    XDestroyWindow(display, m_bufferHandle);
109
    m_drawable = 0;
117
    m_bufferHandle = 0;
110
}
118
}
111
119
112
}
120
}
- Source/cmake/OptionsEfl.cmake +2 lines
Lines 169-174 if (ENABLE_WEBGL OR WTF_USE_TILED_BACKING_STORE) Source/cmake/OptionsEfl.cmake_sec1
169
169
170
    if (OPENGLX_FOUND)
170
    if (OPENGLX_FOUND)
171
        add_definitions(-DHAVE_GLX)
171
        add_definitions(-DHAVE_GLX)
172
        add_definitions(-DWTF_USE_GLX=1)
173
172
        if (X11_Xcomposite_FOUND AND X11_Xrender_FOUND)
174
        if (X11_Xcomposite_FOUND AND X11_Xrender_FOUND)
173
           set(USE_GRAPHICS_SURFACE 1)
175
           set(USE_GRAPHICS_SURFACE 1)
174
        endif ()
176
        endif ()

Return to Bug 105431