Commit 4804d439 authored by Laurent Aimar's avatar Laurent Aimar

No functionnal changes (opengl).

parent 6c3b791a
...@@ -122,6 +122,14 @@ vout_display_opengl_t *vout_display_opengl_New(video_format_t *fmt, ...@@ -122,6 +122,14 @@ vout_display_opengl_t *vout_display_opengl_New(video_format_t *fmt,
return NULL; return NULL;
vgl->gl = gl; vgl->gl = gl;
if (vlc_gl_Lock(vgl->gl)) {
free(vgl);
return NULL;
}
const char *extensions = (const char *)glGetString(GL_EXTENSIONS);
if (!extensions)
extensions = "";
/* Find the chroma we will use and update fmt */ /* Find the chroma we will use and update fmt */
vgl->fmt = *fmt; vgl->fmt = *fmt;
...@@ -185,15 +193,7 @@ vout_display_opengl_t *vout_display_opengl_New(video_format_t *fmt, ...@@ -185,15 +193,7 @@ vout_display_opengl_t *vout_display_opengl_New(video_format_t *fmt,
#endif #endif
#if defined(__APPLE__) && USE_OPENGL_ES == 1 #if defined(__APPLE__) && USE_OPENGL_ES == 1
if (!vlc_gl_Lock(vgl->gl)) { supports_npot |= strstr(extensions, "GL_APPLE_texture_2D_limited_npot") != NULL;
const char* extensions = (char*) glGetString(GL_EXTENSIONS);
if (extensions) {
bool npot = strstr(extensions, "GL_APPLE_texture_2D_limited_npot") != 0;
if (npot)
supports_npot = true;
}
vlc_gl_Unlock(vgl->gl);
}
#endif #endif
/* Texture size */ /* Texture size */
...@@ -207,19 +207,15 @@ vout_display_opengl_t *vout_display_opengl_New(video_format_t *fmt, ...@@ -207,19 +207,15 @@ vout_display_opengl_t *vout_display_opengl_New(video_format_t *fmt,
vgl->tex_height = GetAlignedSize(fmt->i_height); vgl->tex_height = GetAlignedSize(fmt->i_height);
} }
/* */ /* */
if (!vlc_gl_Lock(vgl->gl)) { glDisable(GL_BLEND);
glDisable(GL_DEPTH_TEST);
glDisable(GL_BLEND); glDepthMask(GL_FALSE);
glDisable(GL_DEPTH_TEST); glDisable(GL_CULL_FACE);
glDepthMask(GL_FALSE); glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
glDisable(GL_CULL_FACE); glClear(GL_COLOR_BUFFER_BIT);
glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
glClear(GL_COLOR_BUFFER_BIT);
vlc_gl_Unlock(vgl->gl); vlc_gl_Unlock(vgl->gl);
}
return vgl; return vgl;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment