12015-05-06 Carlos Garcia Campos <cgarcia@igalia.com>
2
3 [EGL] Move EGLDisplay handling to PlatformDisplay
4 https://bugs.webkit.org/show_bug.cgi?id=144685
5
6 Reviewed by NOBODY (OOPS!).
7
8 The EGL display is also initialized in multiple places, and could
9 be unified in PlatformDisplay. Remove the PlatformDisplay
10 definition from platform/graphics/opengl/GLDefs.h to avoid conflicts.
11
12 * platform/graphics/PlatformDisplay.cpp:
13 (WebCore::PlatformDisplay::PlatformDisplay): Initialize m_eglDisplay.
14 (WebCore::PlatformDisplay::~PlatformDisplay): Call terminateEGLDisplay().
15 (WebCore::PlatformDisplay::eglDisplay): Lazy intialize the EGL
16 display and return it.
17 (WebCore::PlatformDisplay::initializeEGLDisplay):
18 (WebCore::PlatformDisplay::terminateEGLDisplay):
19 * platform/graphics/PlatformDisplay.h:
20 * platform/graphics/egl/GLContextEGL.cpp:
21 (WebCore::sharedEGLDisplay): Use PlatformDisplay::eglDisplay().
22 * platform/graphics/opengl/GLDefs.h: Remove unneeded definitions.
23 * platform/graphics/opengl/GLPlatformSurface.cpp:
24 (WebCore::GLPlatformSurface::GLPlatformSurface): Remove
25 m_sharedDisplay member, PlatformDisplay::sharedDisplay() can be used instead.
26 (WebCore::GLPlatformSurface::sharedDisplay): Deleted.
27 * platform/graphics/opengl/GLPlatformSurface.h:
28 * platform/graphics/surfaces/egl/EGLConfigSelector.h: Use
29 EGLDisplay instead of PlatformDisplay.
30 * platform/graphics/surfaces/egl/EGLContext.cpp:
31 (WebCore::EGLOffScreenContext::initialize): Use PlatformDisplay::eglDisplay().
32 * platform/graphics/surfaces/egl/EGLHelper.cpp: Remove the
33 EGLDisplayConnection clas and use PlatformDisplay instead.
34 (WebCore::EGLHelper::eglDisplay):
35 (WebCore::EGLHelper::currentDisplay):
36 (WebCore::EGLDisplayConnection::EGLDisplayConnection): Deleted.
37 (WebCore::EGLDisplayConnection::~EGLDisplayConnection): Deleted.
38 (WebCore::EGLDisplayConnection::display): Deleted.
39 (WebCore::EGLDisplayConnection::terminate): Deleted.
40 * platform/graphics/surfaces/egl/EGLHelper.h:
41 * platform/graphics/surfaces/egl/EGLSurface.cpp:
42 (WebCore::EGLTransportSurface::EGLTransportSurface): Use EGLHelper::eglDisplay().
43 (WebCore::EGLTransportSurface::destroy): Ditto.
44 (WebCore::EGLOffScreenSurface::EGLOffScreenSurface): Ditto.
45 (WebCore::EGLOffScreenSurface::destroy): Ditto.
46 * platform/graphics/surfaces/egl/EGLXSurface.cpp:
47 (WebCore::EGLWindowTransportSurface::EGLWindowTransportSurface):
48 Use PlatformDisplay::eglDisplay().
49 (WebCore::EGLWindowTransportSurface::swapBuffers): Ditto.
50 (WebCore::EGLPixmapSurface::EGLPixmapSurface): Ditto.
51 * platform/graphics/surfaces/glx/GLXSurface.cpp:
52 (WebCore::GLXTransportSurface::GLXTransportSurface): Do not use m_sharedDisplay.
53 (WebCore::GLXOffScreenSurface::initialize): Ditto.
54 * platform/graphics/wayland/PlatformDisplayWayland.cpp:
55 (WebCore::PlatformDisplayWayland::PlatformDisplayWayland): Call
56 PlatformDisplay::initializeEGLDisplay() to insialize the EGL display.
57 * platform/graphics/wayland/PlatformDisplayWayland.h:
58 * platform/graphics/x11/PlatformDisplayX11.cpp:
59 (WebCore::PlatformDisplayX11::initializeEGLDisplay): Override
60 PlatformDisplay::initializeEGLDisplay() to initialize the
61 m_eglDisplay member.
62 * platform/graphics/x11/PlatformDisplayX11.h:
63