| Differences between
and this patch
- a/Source/WebCore/ChangeLog +37 lines
Lines 1-3 a/Source/WebCore/ChangeLog_sec1
1
2014-12-14  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
2
3
        Move WebCore/platform/graphics/surfaces to std::unique_ptr
4
        https://bugs.webkit.org/show_bug.cgi?id=139641
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        Replace OwnPtr|PassOwnPtr with std::make_unique<>|std::unique_ptr<>.
9
10
        * platform/graphics/GLContext.cpp:
11
        (WebCore::GLContext::createContextForWindow):
12
        (WebCore::GLContext::createOffscreenContext):
13
        * platform/graphics/GLContext.h:
14
        * platform/graphics/egl/GLContextEGL.cpp:
15
        (WebCore::GLContextEGL::createContext):
16
        * platform/graphics/egl/GLContextEGL.h:
17
        * platform/graphics/glx/GLContextGLX.h:
18
        * platform/graphics/surfaces/GLTransportSurface.cpp:
19
        (WebCore::GLTransportSurface::createTransportSurface):
20
        (WebCore::GLTransportSurfaceClient::createTransportSurfaceClient):
21
        * platform/graphics/surfaces/GLTransportSurface.h:
22
        * platform/graphics/surfaces/GraphicsSurface.h:
23
        * platform/graphics/surfaces/GraphicsSurfaceToken.h:
24
        * platform/graphics/surfaces/efl/GraphicsSurfaceCommon.cpp:
25
        * platform/graphics/surfaces/egl/EGLSurface.cpp:
26
        (WebCore::EGLTransportSurface::createTransportSurface):
27
        (WebCore::EGLTransportSurface::createTransportSurfaceClient):
28
        (WebCore::EGLTransportSurface::EGLTransportSurface):
29
        * platform/graphics/surfaces/egl/EGLSurface.h:
30
        * platform/graphics/surfaces/egl/EGLXSurface.cpp:
31
        (WebCore::EGLXTransportSurfaceClient::EGLXTransportSurfaceClient):
32
        * platform/graphics/surfaces/egl/EGLXSurface.h:
33
        * platform/graphics/surfaces/glx/GLXSurface.cpp:
34
        (WebCore::GLXTransportSurface::GLXTransportSurface):
35
        (WebCore::GLXOffScreenSurface::initialize):
36
        * platform/graphics/surfaces/glx/GLXSurface.h:
37
1
2014-12-14  Andreas Kling  <akling@apple.com>
38
2014-12-14  Andreas Kling  <akling@apple.com>
2
39
3
        Event construction helpers should return Ref instead of PassRefPtr.
40
        Event construction helpers should return Ref instead of PassRefPtr.
- a/Source/WebCore/platform/graphics/GLContext.cpp -8 / +8 lines
Lines 142-166 void GLContext::cleanupActiveContextsAtExit() a/Source/WebCore/platform/graphics/GLContext.cpp_sec1
142
#endif // PLATFORM(X11)
142
#endif // PLATFORM(X11)
143
143
144
144
145
PassOwnPtr<GLContext> GLContext::createContextForWindow(GLNativeWindowType windowHandle, GLContext* sharingContext)
145
std::unique_ptr<GLContext> GLContext::createContextForWindow(GLNativeWindowType windowHandle, GLContext* sharingContext)
146
{
146
{
147
#if PLATFORM(GTK) && PLATFORM(WAYLAND) && !defined(GTK_API_VERSION_2) && defined(GDK_WINDOWING_WAYLAND) && USE(EGL)
147
#if PLATFORM(GTK) && PLATFORM(WAYLAND) && !defined(GTK_API_VERSION_2) && defined(GDK_WINDOWING_WAYLAND) && USE(EGL)
148
    GdkDisplay* display = gdk_display_manager_get_default_display(gdk_display_manager_get());
148
    GdkDisplay* display = gdk_display_manager_get_default_display(gdk_display_manager_get());
149
149
150
    if (GDK_IS_WAYLAND_DISPLAY(display)) {
150
    if (GDK_IS_WAYLAND_DISPLAY(display)) {
151
        if (OwnPtr<GLContext> eglContext = GLContextEGL::createContext(windowHandle, sharingContext))
151
        if (auto eglContext = GLContextEGL::createContext(windowHandle, sharingContext))
152
            return eglContext.release();
152
            return WTF::move(eglContext);
153
        return nullptr;
153
        return nullptr;
154
    }
154
    }
155
#endif
155
#endif
156
156
157
#if USE(GLX)
157
#if USE(GLX)
158
    if (OwnPtr<GLContext> glxContext = GLContextGLX::createContext(windowHandle, sharingContext))
158
    if (auto glxContext = GLContextGLX::createContext(windowHandle, sharingContext))
159
        return glxContext.release();
159
        return WTF::move(glxContext);
160
#endif
160
#endif
161
#if USE(EGL)
161
#if USE(EGL)
162
    if (OwnPtr<GLContext> eglContext = GLContextEGL::createContext(windowHandle, sharingContext))
162
    if (auto eglContext = GLContextEGL::createContext(windowHandle, sharingContext))
163
        return eglContext.release();
163
        return WTF::move(eglContext);
164
#endif
164
#endif
165
    return nullptr;
165
    return nullptr;
166
}
166
}
Lines 172-178 GLContext::GLContext() a/Source/WebCore/platform/graphics/GLContext.cpp_sec2
172
#endif
172
#endif
173
}
173
}
174
174
175
PassOwnPtr<GLContext> GLContext::createOffscreenContext(GLContext* sharingContext)
175
std::unique_ptr<GLContext> GLContext::createOffscreenContext(GLContext* sharingContext)
176
{
176
{
177
    return createContextForWindow(0, sharingContext);
177
    return createContextForWindow(0, sharingContext);
178
}
178
}
- a/Source/WebCore/platform/graphics/GLContext.h -3 / +2 lines
Lines 23-29 a/Source/WebCore/platform/graphics/GLContext.h_sec1
23
#include "GraphicsContext3D.h"
23
#include "GraphicsContext3D.h"
24
#include "Widget.h"
24
#include "Widget.h"
25
#include <wtf/Noncopyable.h>
25
#include <wtf/Noncopyable.h>
26
#include <wtf/PassOwnPtr.h>
27
26
28
#if USE(EGL) && !PLATFORM(GTK)
27
#if USE(EGL) && !PLATFORM(GTK)
29
#include "eglplatform.h"
28
#include "eglplatform.h"
Lines 45-52 namespace WebCore { a/Source/WebCore/platform/graphics/GLContext.h_sec2
45
class GLContext {
44
class GLContext {
46
    WTF_MAKE_NONCOPYABLE(GLContext);
45
    WTF_MAKE_NONCOPYABLE(GLContext);
47
public:
46
public:
48
    static PassOwnPtr<GLContext> createContextForWindow(GLNativeWindowType windowHandle, GLContext* sharingContext);
47
    static std::unique_ptr<GLContext> createContextForWindow(GLNativeWindowType windowHandle, GLContext* sharingContext);
49
    static PassOwnPtr<GLContext> createOffscreenContext(GLContext* sharing = 0);
48
    static std::unique_ptr<GLContext> createOffscreenContext(GLContext* sharing = 0);
50
    static GLContext* getCurrent();
49
    static GLContext* getCurrent();
51
    static GLContext* sharingContext();
50
    static GLContext* sharingContext();
52
51
- a/Source/WebCore/platform/graphics/egl/GLContextEGL.cpp -3 / +3 lines
Lines 202-208 PassOwnPtr<GLContextEGL> GLContextEGL::createPixmapContext(EGLContext sharingCon a/Source/WebCore/platform/graphics/egl/GLContextEGL.cpp_sec1
202
#endif
202
#endif
203
}
203
}
204
204
205
PassOwnPtr<GLContextEGL> GLContextEGL::createContext(EGLNativeWindowType window, GLContext* sharingContext)
205
std::unique_ptr<GLContextEGL> GLContextEGL::createContext(EGLNativeWindowType window, GLContext* sharingContext)
206
{
206
{
207
    if (!sharedEGLDisplay())
207
    if (!sharedEGLDisplay())
208
        return nullptr;
208
        return nullptr;
Lines 219-232 PassOwnPtr<GLContextEGL> GLContextEGL::createContext(EGLNativeWindowType window, a/Source/WebCore/platform/graphics/egl/GLContextEGL.cpp_sec2
219
        return nullptr;
219
        return nullptr;
220
220
221
    EGLContext eglSharingContext = sharingContext ? static_cast<GLContextEGL*>(sharingContext)->m_context : 0;
221
    EGLContext eglSharingContext = sharingContext ? static_cast<GLContextEGL*>(sharingContext)->m_context : 0;
222
    OwnPtr<GLContextEGL> context = window ? createWindowContext(window, sharingContext) : nullptr;
222
    auto context = window ? createWindowContext(window, sharingContext) : nullptr;
223
    if (!context)
223
    if (!context)
224
        context = createPixmapContext(eglSharingContext);
224
        context = createPixmapContext(eglSharingContext);
225
225
226
    if (!context)
226
    if (!context)
227
        context = createPbufferContext(eglSharingContext);
227
        context = createPbufferContext(eglSharingContext);
228
    
228
    
229
    return context.release();
229
    return WTF::move(context);
230
}
230
}
231
231
232
GLContextEGL::GLContextEGL(EGLContext context, EGLSurface surface, EGLSurfaceType type)
232
GLContextEGL::GLContextEGL(EGLContext context, EGLSurface surface, EGLSurfaceType type)
- a/Source/WebCore/platform/graphics/egl/GLContextEGL.h -2 / +2 lines
Lines 32-39 class GLContextEGL : public GLContext { a/Source/WebCore/platform/graphics/egl/GLContextEGL.h_sec1
32
    WTF_MAKE_NONCOPYABLE(GLContextEGL);
32
    WTF_MAKE_NONCOPYABLE(GLContextEGL);
33
public:
33
public:
34
    enum EGLSurfaceType { PbufferSurface, WindowSurface, PixmapSurface };
34
    enum EGLSurfaceType { PbufferSurface, WindowSurface, PixmapSurface };
35
    static PassOwnPtr<GLContextEGL> createContext(EGLNativeWindowType, GLContext* sharingContext = 0);
35
    static std::unique_ptr<GLContextEGL> createContext(EGLNativeWindowType, GLContext* sharingContext = 0);
36
    static PassOwnPtr<GLContextEGL> createWindowContext(EGLNativeWindowType, GLContext* sharingContext);
36
    static std::unique_ptr<GLContextEGL> createWindowContext(EGLNativeWindowType, GLContext* sharingContext);
37
37
38
    virtual ~GLContextEGL();
38
    virtual ~GLContextEGL();
39
    virtual bool makeContextCurrent();
39
    virtual bool makeContextCurrent();
- a/Source/WebCore/platform/graphics/glx/GLContextGLX.h -2 / +2 lines
Lines 37-44 namespace WebCore { a/Source/WebCore/platform/graphics/glx/GLContextGLX.h_sec1
37
class GLContextGLX : public GLContext {
37
class GLContextGLX : public GLContext {
38
    WTF_MAKE_NONCOPYABLE(GLContextGLX);
38
    WTF_MAKE_NONCOPYABLE(GLContextGLX);
39
public:
39
public:
40
    static PassOwnPtr<GLContextGLX> createContext(XID window, GLContext* sharingContext);
40
    static std::unique_ptr<GLContextGLX> createContext(XID window, GLContext* sharingContext);
41
    static PassOwnPtr<GLContextGLX> createWindowContext(XID window, GLContext* sharingContext);
41
    static std::unique_ptr<GLContextGLX> createWindowContext(XID window, GLContext* sharingContext);
42
42
43
    virtual ~GLContextGLX();
43
    virtual ~GLContextGLX();
44
    virtual bool makeContextCurrent();
44
    virtual bool makeContextCurrent();
- a/Source/WebCore/platform/graphics/surfaces/GLTransportSurface.cpp -8 / +8 lines
Lines 43-59 namespace WebCore { a/Source/WebCore/platform/graphics/surfaces/GLTransportSurface.cpp_sec1
43
static const GLfloat vertices[] = { 0, 0, 1, 0, 1, 1, 0, 1 };
43
static const GLfloat vertices[] = { 0, 0, 1, 0, 1, 1, 0, 1 };
44
static bool vertexArrayObjectSupported = false;
44
static bool vertexArrayObjectSupported = false;
45
45
46
PassOwnPtr<GLTransportSurface> GLTransportSurface::createTransportSurface(const IntSize& size, SurfaceAttributes attributes)
46
std::unique_ptr<GLTransportSurface> GLTransportSurface::createTransportSurface(const IntSize& size, SurfaceAttributes attributes)
47
{
47
{
48
    OwnPtr<GLTransportSurface> surface;
48
    std::unique_ptr<GLTransportSurface> surface;
49
#if USE(GLX)
49
#if USE(GLX)
50
    surface = adoptPtr(new GLXTransportSurface(size, attributes));
50
    surface = std::make_unique<GLXTransportSurface>(size, attributes);
51
#elif USE(EGL)
51
#elif USE(EGL)
52
    surface = EGLTransportSurface::createTransportSurface(size, attributes);
52
    surface = EGLTransportSurface::createTransportSurface(size, attributes);
53
#endif
53
#endif
54
54
55
    if (surface && surface->handle() && surface->drawable())
55
    if (surface && surface->handle() && surface->drawable())
56
        return surface.release();
56
        return WTF::move(surface);
57
57
58
    return nullptr;
58
    return nullptr;
59
}
59
}
Lines 205-215 void GLTransportSurface::initializeShaderProgram() a/Source/WebCore/platform/graphics/surfaces/GLTransportSurface.cpp_sec2
205
    updateTransformationMatrix();
205
    updateTransformationMatrix();
206
}
206
}
207
207
208
PassOwnPtr<GLTransportSurfaceClient> GLTransportSurfaceClient::createTransportSurfaceClient(const PlatformBufferHandle handle, const IntSize& size, bool hasAlpha)
208
std::unique_ptr<GLTransportSurfaceClient> GLTransportSurfaceClient::createTransportSurfaceClient(const PlatformBufferHandle handle, const IntSize& size, bool hasAlpha)
209
{
209
{
210
    OwnPtr<GLTransportSurfaceClient> client;
210
    std::unique_ptr<GLTransportSurfaceClient> client;
211
#if USE(GLX)
211
#if USE(GLX)
212
    client = adoptPtr(new GLXTransportSurfaceClient(handle, hasAlpha));
212
    client = std::make_unique<GLXTransportSurfaceClient>(handle, hasAlpha);
213
    UNUSED_PARAM(size);
213
    UNUSED_PARAM(size);
214
#else
214
#else
215
    client = EGLTransportSurface::createTransportSurfaceClient(handle, size, hasAlpha);
215
    client = EGLTransportSurface::createTransportSurfaceClient(handle, size, hasAlpha);
Lines 220-226 PassOwnPtr<GLTransportSurfaceClient> GLTransportSurfaceClient::createTransportSu a/Source/WebCore/platform/graphics/surfaces/GLTransportSurface.cpp_sec3
220
        return nullptr;
220
        return nullptr;
221
    }
221
    }
222
222
223
    return client.release();
223
    return WTF::move(client);
224
}
224
}
225
225
226
226
- a/Source/WebCore/platform/graphics/surfaces/GLTransportSurface.h -3 / +2 lines
Lines 27-33 a/Source/WebCore/platform/graphics/surfaces/GLTransportSurface.h_sec1
27
#define GLTransportSurface_h
27
#define GLTransportSurface_h
28
28
29
#include "GLPlatformSurface.h"
29
#include "GLPlatformSurface.h"
30
#include <wtf/PassOwnPtr.h>
31
30
32
namespace WebCore {
31
namespace WebCore {
33
32
Lines 37-43 class GLTransportSurface : public GLPlatformSurface { a/Source/WebCore/platform/graphics/surfaces/GLTransportSurface.h_sec2
37
36
38
public:
37
public:
39
    // Creates a GL surface whose results can be transported to the UI process for display.
38
    // Creates a GL surface whose results can be transported to the UI process for display.
40
    static PassOwnPtr<GLTransportSurface> createTransportSurface(const IntSize&, SurfaceAttributes = GLPlatformSurface::Default);
39
    static std::unique_ptr<GLTransportSurface> createTransportSurface(const IntSize&, SurfaceAttributes = GLPlatformSurface::Default);
41
    virtual ~GLTransportSurface();
40
    virtual ~GLTransportSurface();
42
    virtual void updateContents(const uint32_t) override;
41
    virtual void updateContents(const uint32_t) override;
43
    virtual void setGeometry(const IntRect&) override;
42
    virtual void setGeometry(const IntRect&) override;
Lines 60-66 protected: a/Source/WebCore/platform/graphics/surfaces/GLTransportSurface.h_sec3
60
class GLTransportSurfaceClient {
59
class GLTransportSurfaceClient {
61
60
62
public:
61
public:
63
    static PassOwnPtr<GLTransportSurfaceClient> createTransportSurfaceClient(const PlatformBufferHandle, const IntSize&, bool);
62
    static std::unique_ptr<GLTransportSurfaceClient> createTransportSurfaceClient(const PlatformBufferHandle, const IntSize&, bool);
64
    virtual ~GLTransportSurfaceClient();
63
    virtual ~GLTransportSurfaceClient();
65
    virtual void prepareTexture();
64
    virtual void prepareTexture();
66
    virtual void destroy();
65
    virtual void destroy();
- a/Source/WebCore/platform/graphics/surfaces/GraphicsSurface.h -1 lines
Lines 26-32 a/Source/WebCore/platform/graphics/surfaces/GraphicsSurface.h_sec1
26
#include "GraphicsContext3D.h"
26
#include "GraphicsContext3D.h"
27
#include "GraphicsSurfaceToken.h"
27
#include "GraphicsSurfaceToken.h"
28
#include "IntRect.h"
28
#include "IntRect.h"
29
#include <wtf/OwnPtr.h>
30
#include <wtf/RefCounted.h>
29
#include <wtf/RefCounted.h>
31
#include <wtf/RefPtr.h>
30
#include <wtf/RefPtr.h>
32
31
- a/Source/WebCore/platform/graphics/surfaces/GraphicsSurfaceToken.h -1 lines
Lines 22-28 a/Source/WebCore/platform/graphics/surfaces/GraphicsSurfaceToken.h_sec1
22
22
23
#include "GraphicsContext.h"
23
#include "GraphicsContext.h"
24
#include "IntRect.h"
24
#include "IntRect.h"
25
#include <wtf/OwnPtr.h>
26
#include <wtf/RefCounted.h>
25
#include <wtf/RefCounted.h>
27
#include <wtf/RefPtr.h>
26
#include <wtf/RefPtr.h>
28
27
- a/Source/WebCore/platform/graphics/surfaces/efl/GraphicsSurfaceCommon.cpp -2 / +2 lines
Lines 147-155 private: a/Source/WebCore/platform/graphics/surfaces/efl/GraphicsSurfaceCommon.cpp_sec1
147
    FloatRect m_rect;
147
    FloatRect m_rect;
148
    IntSize m_size;
148
    IntSize m_size;
149
    PlatformBufferHandle m_sharedHandle;
149
    PlatformBufferHandle m_sharedHandle;
150
    OwnPtr<GLTransportSurfaceClient> m_client;
150
    std::unique_ptr<GLTransportSurfaceClient> m_client;
151
    std::unique_ptr<GLPlatformContext> m_sharedContext;
151
    std::unique_ptr<GLPlatformContext> m_sharedContext;
152
    OwnPtr<GLTransportSurface> m_sharedSurface;
152
    std::unique_ptr<GLTransportSurface> m_sharedSurface;
153
};
153
};
154
154
155
GraphicsSurfaceToken GraphicsSurface::platformExport()
155
GraphicsSurfaceToken GraphicsSurface::platformExport()
- a/Source/WebCore/platform/graphics/surfaces/egl/EGLSurface.cpp -9 / +9 lines
Lines 38-65 a/Source/WebCore/platform/graphics/surfaces/egl/EGLSurface.cpp_sec1
38
38
39
namespace WebCore {
39
namespace WebCore {
40
40
41
PassOwnPtr<GLTransportSurface> EGLTransportSurface::createTransportSurface(const IntSize& size, SurfaceAttributes attributes)
41
std::unique_ptr<GLTransportSurface> EGLTransportSurface::createTransportSurface(const IntSize& size, SurfaceAttributes attributes)
42
{
42
{
43
    OwnPtr<GLTransportSurface> surface;
43
    std::unique_ptr<GLTransportSurface> surface;
44
#if PLATFORM(X11)
44
#if PLATFORM(X11)
45
    surface = adoptPtr(new EGLWindowTransportSurface(size, attributes));
45
    surface = std::make_unique<EGLWindowTransportSurface>(size, attributes);
46
#else
46
#else
47
    UNUSED_PARAM(size);
47
    UNUSED_PARAM(size);
48
    UNUSED_PARAM(attributes);
48
    UNUSED_PARAM(attributes);
49
#endif
49
#endif
50
50
51
    if (surface)
51
    if (surface)
52
        return surface.release();
52
        return WTF::move(surface);
53
53
54
    return nullptr;
54
    return nullptr;
55
}
55
}
56
56
57
PassOwnPtr<GLTransportSurfaceClient> EGLTransportSurface::createTransportSurfaceClient(const PlatformBufferHandle handle, const IntSize& size, bool hasAlpha)
57
std::unique_ptr<GLTransportSurfaceClient> EGLTransportSurface::createTransportSurfaceClient(const PlatformBufferHandle handle, const IntSize& size, bool hasAlpha)
58
{
58
{
59
    EGLHelper::resolveEGLBindings();
59
    EGLHelper::resolveEGLBindings();
60
    OwnPtr<GLTransportSurfaceClient> client;
60
    std::unique_ptr<GLTransportSurfaceClient> client;
61
#if PLATFORM(X11)
61
#if PLATFORM(X11)
62
    client = adoptPtr(new EGLXTransportSurfaceClient(handle, size, hasAlpha));
62
    client = std::make_unique<EGLXTransportSurfaceClient>(handle, size, hasAlpha);
63
#else
63
#else
64
    UNUSED_PARAM(handle);
64
    UNUSED_PARAM(handle);
65
    UNUSED_PARAM(size);
65
    UNUSED_PARAM(size);
Lines 67-73 PassOwnPtr<GLTransportSurfaceClient> EGLTransportSurface::createTransportSurface a/Source/WebCore/platform/graphics/surfaces/egl/EGLSurface.cpp_sec2
67
#endif
67
#endif
68
68
69
    if (client)
69
    if (client)
70
        return client.release();
70
        return WTF::move(client);
71
71
72
    return nullptr;
72
    return nullptr;
73
}
73
}
Lines 80-86 EGLTransportSurface::EGLTransportSurface(const IntSize& size, SurfaceAttributes a/Source/WebCore/platform/graphics/surfaces/egl/EGLSurface.cpp_sec3
80
    if (m_sharedDisplay == EGL_NO_DISPLAY)
80
    if (m_sharedDisplay == EGL_NO_DISPLAY)
81
        return;
81
        return;
82
82
83
    m_configSelector = adoptPtr(new EGLConfigSelector(attributes));
83
    m_configSelector = std::make_unique<EGLConfigSelector>(attributes);
84
}
84
}
85
85
86
GLPlatformSurface::SurfaceAttributes EGLTransportSurface::attributes() const
86
GLPlatformSurface::SurfaceAttributes EGLTransportSurface::attributes() const
- a/Source/WebCore/platform/graphics/surfaces/egl/EGLSurface.h -5 / +4 lines
Lines 31-37 a/Source/WebCore/platform/graphics/surfaces/egl/EGLSurface.h_sec1
31
#include "GLTransportSurface.h"
31
#include "GLTransportSurface.h"
32
32
33
#include <wtf/Noncopyable.h>
33
#include <wtf/Noncopyable.h>
34
#include <wtf/PassOwnPtr.h>
35
34
36
namespace WebCore {
35
namespace WebCore {
37
36
Lines 39-46 class EGLConfigSelector; a/Source/WebCore/platform/graphics/surfaces/egl/EGLSurface.h_sec2
39
38
40
class EGLTransportSurface : public GLTransportSurface {
39
class EGLTransportSurface : public GLTransportSurface {
41
public:
40
public:
42
    static PassOwnPtr<GLTransportSurface> createTransportSurface(const IntSize&, SurfaceAttributes);
41
    static std::unique_ptr<GLTransportSurface> createTransportSurface(const IntSize&, SurfaceAttributes);
43
    static PassOwnPtr<GLTransportSurfaceClient> createTransportSurfaceClient(const PlatformBufferHandle, const IntSize&, bool);
42
    static std::unique_ptr<GLTransportSurfaceClient> createTransportSurfaceClient(const PlatformBufferHandle, const IntSize&, bool);
44
    virtual ~EGLTransportSurface();
43
    virtual ~EGLTransportSurface();
45
    virtual PlatformSurfaceConfig configuration() override;
44
    virtual PlatformSurfaceConfig configuration() override;
46
    virtual void destroy() override;
45
    virtual void destroy() override;
Lines 48-54 public: a/Source/WebCore/platform/graphics/surfaces/egl/EGLSurface.h_sec3
48
47
49
protected:
48
protected:
50
    EGLTransportSurface(const IntSize&, SurfaceAttributes);
49
    EGLTransportSurface(const IntSize&, SurfaceAttributes);
51
    OwnPtr<EGLConfigSelector> m_configSelector;
50
    std::unique_ptr<EGLConfigSelector> m_configSelector;
52
};
51
};
53
52
54
class EGLOffScreenSurface : public GLPlatformSurface {
53
class EGLOffScreenSurface : public GLPlatformSurface {
Lines 61-67 public: a/Source/WebCore/platform/graphics/surfaces/egl/EGLSurface.h_sec4
61
60
62
protected:
61
protected:
63
    EGLOffScreenSurface(SurfaceAttributes);
62
    EGLOffScreenSurface(SurfaceAttributes);
64
    OwnPtr<EGLConfigSelector> m_configSelector;
63
    std::unique_ptr<EGLConfigSelector> m_configSelector;
65
};
64
};
66
65
67
}
66
}
- a/Source/WebCore/platform/graphics/surfaces/egl/EGLXSurface.cpp -1 / +1 lines
Lines 161-167 EGLXTransportSurfaceClient::EGLXTransportSurfaceClient(const PlatformBufferHandl a/Source/WebCore/platform/graphics/surfaces/egl/EGLXSurface.cpp_sec1
161
161
162
    EGLConfigSelector configSelector(sharedSurfaceAttributes);
162
    EGLConfigSelector configSelector(sharedSurfaceAttributes);
163
    EGLConfig config = configSelector.surfaceClientConfig(XVisualIDFromVisual(attr.visual));
163
    EGLConfig config = configSelector.surfaceClientConfig(XVisualIDFromVisual(attr.visual));
164
    m_eglImage = adoptPtr(new EGLTextureFromPixmap(m_handle, hasAlpha, config));
164
    m_eglImage = std::make_unique<EGLTextureFromPixmap>(m_handle, hasAlpha, config);
165
165
166
    if (!m_eglImage->isValid() || eglGetError() != EGL_SUCCESS)
166
    if (!m_eglImage->isValid() || eglGetError() != EGL_SUCCESS)
167
        destroy();
167
        destroy();
- a/Source/WebCore/platform/graphics/surfaces/egl/EGLXSurface.h -1 / +1 lines
Lines 79-85 private: a/Source/WebCore/platform/graphics/surfaces/egl/EGLXSurface.h_sec1
79
    PlatformBufferHandle m_handle;
79
    PlatformBufferHandle m_handle;
80
    GLuint m_format;
80
    GLuint m_format;
81
    unsigned m_totalBytes;
81
    unsigned m_totalBytes;
82
    OwnPtr<EGLTextureFromPixmap> m_eglImage;
82
    std::unique_ptr<EGLTextureFromPixmap> m_eglImage;
83
};
83
};
84
84
85
}
85
}
- a/Source/WebCore/platform/graphics/surfaces/glx/GLXSurface.cpp -2 / +2 lines
Lines 66-72 GLXTransportSurface::GLXTransportSurface(const IntSize& size, SurfaceAttributes a/Source/WebCore/platform/graphics/surfaces/glx/GLXSurface.cpp_sec1
66
{
66
{
67
    m_sharedDisplay = X11Helper::nativeDisplay();
67
    m_sharedDisplay = X11Helper::nativeDisplay();
68
    attributes |= GLPlatformSurface::DoubleBuffered;
68
    attributes |= GLPlatformSurface::DoubleBuffered;
69
    m_configSelector = adoptPtr(new GLXConfigSelector(attributes));
69
    m_configSelector = std::make_unique<GLXConfigSelector>(attributes);
70
    OwnPtrX11<XVisualInfo> visInfo(m_configSelector->visualInfo(m_configSelector->surfaceContextConfig()));
70
    OwnPtrX11<XVisualInfo> visInfo(m_configSelector->visualInfo(m_configSelector->surfaceContextConfig()));
71
71
72
    if (!visInfo.get()) {
72
    if (!visInfo.get()) {
Lines 143-149 void GLXOffScreenSurface::initialize(SurfaceAttributes attributes) a/Source/WebCore/platform/graphics/surfaces/glx/GLXSurface.cpp_sec2
143
{
143
{
144
    m_sharedDisplay = X11Helper::nativeDisplay();
144
    m_sharedDisplay = X11Helper::nativeDisplay();
145
145
146
    m_configSelector = adoptPtr(new GLXConfigSelector(attributes));
146
    m_configSelector = std::make_unique<GLXConfigSelector>(attributes);
147
147
148
    OwnPtrX11<XVisualInfo> visualInfo(m_configSelector->visualInfo(m_configSelector->pixmapContextConfig()));
148
    OwnPtrX11<XVisualInfo> visualInfo(m_configSelector->visualInfo(m_configSelector->pixmapContextConfig()));
149
    X11Helper::createPixmap(&m_pixmap, *visualInfo.get());
149
    X11Helper::createPixmap(&m_pixmap, *visualInfo.get());
- a/Source/WebCore/platform/graphics/surfaces/glx/GLXSurface.h -2 / +2 lines
Lines 46-52 public: a/Source/WebCore/platform/graphics/surfaces/glx/GLXSurface.h_sec1
46
    virtual void destroy() override;
46
    virtual void destroy() override;
47
47
48
private:
48
private:
49
    OwnPtr<GLXConfigSelector> m_configSelector;
49
    std::unique_ptr<GLXConfigSelector> m_configSelector;
50
};
50
};
51
51
52
class GLXOffScreenSurface : public GLPlatformSurface {
52
class GLXOffScreenSurface : public GLPlatformSurface {
Lines 60-66 public: a/Source/WebCore/platform/graphics/surfaces/glx/GLXSurface.h_sec2
60
private:
60
private:
61
    void initialize(SurfaceAttributes);
61
    void initialize(SurfaceAttributes);
62
    void freeResources();
62
    void freeResources();
63
    OwnPtr<GLXConfigSelector> m_configSelector;
63
    std::unique_ptr<GLXConfigSelector> m_configSelector;
64
    Pixmap m_pixmap;
64
    Pixmap m_pixmap;
65
    GLXPixmap m_glxPixmap;
65
    GLXPixmap m_glxPixmap;
66
};
66
};
- a/Source/WebKit2/WebProcess/WebPage/gtk/LayerTreeHostGtk.h -2 / +1 lines
Lines 36-42 a/Source/WebKit2/WebProcess/WebPage/gtk/LayerTreeHostGtk.h_sec1
36
#include <WebCore/GraphicsLayerClient.h>
36
#include <WebCore/GraphicsLayerClient.h>
37
#include <WebCore/PageOverlay.h>
37
#include <WebCore/PageOverlay.h>
38
#include <wtf/HashMap.h>
38
#include <wtf/HashMap.h>
39
#include <wtf/OwnPtr.h>
40
#include <wtf/gobject/GMainLoopSource.h>
39
#include <wtf/gobject/GMainLoopSource.h>
41
40
42
namespace WebKit {
41
namespace WebKit {
Lines 99-105 private: a/Source/WebKit2/WebProcess/WebPage/gtk/LayerTreeHostGtk.h_sec2
99
    typedef HashMap<WebCore::PageOverlay*, std::unique_ptr<WebCore::GraphicsLayer>> PageOverlayLayerMap;
98
    typedef HashMap<WebCore::PageOverlay*, std::unique_ptr<WebCore::GraphicsLayer>> PageOverlayLayerMap;
100
    PageOverlayLayerMap m_pageOverlayLayers;
99
    PageOverlayLayerMap m_pageOverlayLayers;
101
    std::unique_ptr<WebCore::TextureMapper> m_textureMapper;
100
    std::unique_ptr<WebCore::TextureMapper> m_textureMapper;
102
    OwnPtr<WebCore::GLContext> m_context;
101
    std::unique_ptr<WebCore::GLContext> m_context;
103
    double m_lastImmediateFlushTime;
102
    double m_lastImmediateFlushTime;
104
    bool m_layerFlushSchedulingEnabled;
103
    bool m_layerFlushSchedulingEnabled;
105
    GMainLoopSource m_layerFlushTimerCallback;
104
    GMainLoopSource m_layerFlushTimerCallback;

Return to Bug 139641