diff options
author | Drew DeVault <sir@cmpwn.com> | 2017-08-11 09:00:26 -0400 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2017-08-11 09:00:26 -0400 |
commit | a6efb9038219562f65c20c997996b74dffed3910 (patch) | |
tree | e7339626d362849cce5cacd235b2b90f74215841 | |
parent | 33753816106a2da390973491260137dd5ddb24cd (diff) |
s/gen/ensure/ fixes #47
-rw-r--r-- | render/gles2/texture.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/render/gles2/texture.c b/render/gles2/texture.c index f2c88af5..5a28edbd 100644 --- a/render/gles2/texture.c +++ b/render/gles2/texture.c @@ -21,11 +21,10 @@ static struct pixel_format external_pixel_format = { .shader = &shaders.external }; -static void gles2_texture_gen_texture(struct wlr_texture_state *surface) { +static void gles2_texture_ensure_texture(struct wlr_texture_state *surface) { if (surface->tex_id) { return; } - GL_CALL(glGenTextures(1, &surface->tex_id)); GL_CALL(glBindTexture(GL_TEXTURE_2D, surface->tex_id)); GL_CALL(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE)); @@ -46,7 +45,7 @@ static bool gles2_texture_upload_pixels(struct wlr_texture_state *texture, texture->wlr_texture->format = format; texture->pixel_format = fmt; - gles2_texture_gen_texture(texture); + gles2_texture_ensure_texture(texture); GL_CALL(glBindTexture(GL_TEXTURE_2D, texture->tex_id)); GL_CALL(glPixelStorei(GL_UNPACK_ROW_LENGTH_EXT, stride)); GL_CALL(glTexImage2D(GL_TEXTURE_2D, 0, fmt->gl_format, width, height, 0, @@ -96,7 +95,7 @@ static bool gles2_texture_upload_shm(struct wlr_texture_state *texture, texture->wlr_texture->format = format; texture->pixel_format = fmt; - gles2_texture_gen_texture(texture); + gles2_texture_ensure_texture(texture); GL_CALL(glBindTexture(GL_TEXTURE_2D, texture->tex_id)); GL_CALL(glPixelStorei(GL_UNPACK_ROW_LENGTH_EXT, pitch)); GL_CALL(glPixelStorei(GL_UNPACK_SKIP_PIXELS_EXT, 0)); @@ -176,7 +175,7 @@ static bool gles2_texture_upload_drm(struct wlr_texture_state *tex, return false; } - gles2_texture_gen_texture(tex); + gles2_texture_ensure_texture(tex); GL_CALL(glBindTexture(GL_TEXTURE_2D, tex->tex_id)); EGLint attribs[] = { EGL_WAYLAND_PLANE_WL, 0, EGL_NONE }; |