#define GLchar char
#endif
+static Display* g_nativeDisplay = 0;
+static int g_nativeWindow = 0;
namespace WebCore {
PassOwnPtr<GraphicsContext3DOffscreen> GraphicsContext3DOffscreen::create(GraphicsContext3D::Attributes attrs, HostWindow* hostWindow)
, m_display(EGL_NO_DISPLAY)
, m_context(EGL_NO_CONTEXT)
, m_surface(EGL_NO_SURFACE)
+ , m_pixmapID(0)
#endif
{
}
eglDestroyContext(m_display, m_context);
m_context = EGL_NO_CONTEXT;
}
+ if (m_pixmapID) {
+ XFreePixmap(g_nativeDisplay, m_pixmapID);
+ m_pixmapID = 0;
+ }
m_display = 0;
#endif
#if USE(ACCELERATED_COMPOSITING) && !USE(TIZEN_TEXTURE_MAPPER)
if (!GraphicsContext3DInternal::initialize(hostWindow))
return false;
#if ENABLE(TIZEN_WEBKIT2)
- Display* nativeDisplay = XOpenDisplay(0);
- int nativeWindow = XCreateSimpleWindow(nativeDisplay, XDefaultRootWindow(nativeDisplay),
+ g_nativeDisplay = XOpenDisplay(0);
+ g_nativeWindow = XCreateSimpleWindow(g_nativeDisplay, XDefaultRootWindow(g_nativeDisplay),
0, 0, 1, 1, 0,
- BlackPixel(nativeDisplay, 0), WhitePixel(nativeDisplay, 0));
- XFlush(nativeDisplay);
+ BlackPixel(g_nativeDisplay, 0), WhitePixel(g_nativeDisplay, 0));
+ XFlush(g_nativeDisplay);
EGLint major, minor;
EGLint contextAttribs[] = { EGL_CONTEXT_CLIENT_VERSION, 2, EGL_NONE };
- m_display = eglGetDisplay(nativeDisplay);
+ m_display = eglGetDisplay(g_nativeDisplay);
if (m_display == EGL_NO_DISPLAY)
return false;
m_context = eglCreateContext(m_display, surfaceConfig, EGL_NO_CONTEXT, contextAttribs);
if( m_context == EGL_NO_CONTEXT)
return false;
-
- EGLint surfaceAttribs[] = { EGL_WIDTH, 1, EGL_HEIGHT, 1, EGL_NONE };
- m_surface = eglCreatePbufferSurface(m_display, surfaceConfig, surfaceAttribs);
+ m_pixmapID = XCreatePixmap(g_nativeDisplay, g_nativeWindow, 1, 1, 32);
+ m_surface = eglCreatePixmapSurface(m_display, surfaceConfig, m_pixmapID, NULL);
if (m_surface == EGL_NO_SURFACE)
return false;
m_acceleratedCompositingEnabled = true;