[vlc-commits] opengl: setup coords once for all
Romain Vimont
git at videolan.org
Mon Mar 23 11:37:33 CET 2020
vlc | branch: master | Romain Vimont <rom1v at videolabs.io> | Fri Jan 31 13:01:52 2020 +0100| [d23e8e33fab5be576d805d124acb5a8ccdf839a2] | committer: Jean-Baptiste Kempf
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 <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d23e8e33fab5be576d805d124acb5a8ccdf839a2
---
modules/video_output/opengl/renderer.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/modules/video_output/opengl/renderer.c b/modules/video_output/opengl/renderer.c
index bfe1d77c65..53f6d4c342 100644
--- a/modules/video_output/opengl/renderer.c
+++ b/modules/video_output/opengl/renderer.c
@@ -311,6 +311,8 @@ vlc_gl_renderer_Delete(struct vlc_gl_renderer *renderer)
free(renderer);
}
+static int SetupCoords(struct vlc_gl_renderer *renderer);
+
struct vlc_gl_renderer *
vlc_gl_renderer_New(vlc_gl_t *gl, const struct vlc_gl_api *api,
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,
vt->GenBuffers(1, &renderer->index_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;
}
@@ -978,10 +987,6 @@ vlc_gl_renderer_Draw(struct vlc_gl_renderer *renderer,
#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_y_offset = source->i_y_offset;
renderer->last_source.i_visible_width = source->i_visible_width;
More information about the vlc-commits
mailing list