Bug 1187048 - Code clean up around nsScreenGonk's EGLSurface handling r=mwu

This commit is contained in:
Sotaro Ikeda
2015-07-24 10:56:05 -07:00
parent 9826e44a6a
commit 94c1a83c68
8 changed files with 48 additions and 31 deletions

View File

@@ -546,8 +546,13 @@ nsWindow::SetNativeData(uint32_t aDataType, uintptr_t aVal)
{
switch (aDataType) {
case NS_NATIVE_OPENGL_CONTEXT:
// Called after primary display's GLContextEGL creation.
GLContext* context = reinterpret_cast<GLContext*>(aVal);
if (!context) {
mScreen->SetEGLInfo(EGL_NO_DISPLAY,
EGL_NO_SURFACE,
nullptr);
return;
}
mScreen->SetEGLInfo(GLContextEGL::Cast(context)->GetEGLDisplay(),
GLContextEGL::Cast(context)->GetEGLSurface(),
context);