Commit d23e8e33 authored by Romain Vimont's avatar Romain Vimont Committed by Jean-Baptiste Kempf
Browse files

opengl: setup coords once for all



Now that the coordinates are independant of paddings (which are
transmitted via a separate transform matrix), there is no need to
recompute them when the paddings change.

Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent bf4f21b5
...@@ -311,6 +311,8 @@ vlc_gl_renderer_Delete(struct vlc_gl_renderer *renderer) ...@@ -311,6 +311,8 @@ vlc_gl_renderer_Delete(struct vlc_gl_renderer *renderer)
free(renderer); free(renderer);
} }
static int SetupCoords(struct vlc_gl_renderer *renderer);
struct vlc_gl_renderer * struct vlc_gl_renderer *
vlc_gl_renderer_New(vlc_gl_t *gl, const struct vlc_gl_api *api, vlc_gl_renderer_New(vlc_gl_t *gl, const struct vlc_gl_api *api,
vlc_video_context *context, const video_format_t *fmt, vlc_video_context *context, const video_format_t *fmt,
...@@ -413,6 +415,13 @@ vlc_gl_renderer_New(vlc_gl_t *gl, const struct vlc_gl_api *api, ...@@ -413,6 +415,13 @@ vlc_gl_renderer_New(vlc_gl_t *gl, const struct vlc_gl_api *api,
vt->GenBuffers(1, &renderer->index_buffer_object); vt->GenBuffers(1, &renderer->index_buffer_object);
vt->GenBuffers(1, &renderer->texture_buffer_object); vt->GenBuffers(1, &renderer->texture_buffer_object);
ret = SetupCoords(renderer);
if (ret != VLC_SUCCESS)
{
vlc_gl_renderer_Delete(renderer);
return NULL;
}
return renderer; return renderer;
} }
...@@ -978,10 +987,6 @@ vlc_gl_renderer_Draw(struct vlc_gl_renderer *renderer, ...@@ -978,10 +987,6 @@ vlc_gl_renderer_Draw(struct vlc_gl_renderer *renderer,
#undef ROW #undef ROW
} }
int ret = SetupCoords(renderer);
if (ret != VLC_SUCCESS)
return ret;
renderer->last_source.i_x_offset = source->i_x_offset; renderer->last_source.i_x_offset = source->i_x_offset;
renderer->last_source.i_y_offset = source->i_y_offset; renderer->last_source.i_y_offset = source->i_y_offset;
renderer->last_source.i_visible_width = source->i_visible_width; renderer->last_source.i_visible_width = source->i_visible_width;
......
Supports Markdown
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