[vlc-commits] opengl: merge DrawWithShaders() into _Draw()

Romain Vimont git at videolan.org
Mon Jun 15 17:39:01 CEST 2020


vlc | branch: master | Romain Vimont <rom1v at videolabs.io> | Thu Jun  4 11:52:09 2020 +0200| [90e784dcf2fe5f84601786b5b029af2d58a873d2] | committer: Alexandre Janniaux

opengl: merge DrawWithShaders() into _Draw()

The function vlc_gl_renderer_Draw() (almost) just called
DrawWithShaders(). There is no need for a separate function.

Signed-off-by: Alexandre Janniaux <ajanni at videolabs.io>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=90e784dcf2fe5f84601786b5b029af2d58a873d2
---

 modules/video_output/opengl/renderer.c | 22 +++++++---------------
 1 file changed, 7 insertions(+), 15 deletions(-)

diff --git a/modules/video_output/opengl/renderer.c b/modules/video_output/opengl/renderer.c
index a8986cdd05..70e05338c7 100644
--- a/modules/video_output/opengl/renderer.c
+++ b/modules/video_output/opengl/renderer.c
@@ -735,12 +735,16 @@ static int SetupCoords(struct vlc_gl_renderer *renderer)
     return VLC_SUCCESS;
 }
 
-static void DrawWithShaders(struct vlc_gl_renderer *renderer)
+int
+vlc_gl_renderer_Draw(struct vlc_gl_renderer *renderer)
 {
-    struct vlc_gl_sampler *sampler = renderer->sampler;
     const opengl_vtable_t *vt = renderer->vt;
 
-    vlc_gl_sampler_PrepareShader(sampler);
+    vt->Clear(GL_COLOR_BUFFER_BIT);
+
+    vt->UseProgram(renderer->program_id);
+
+    vlc_gl_sampler_PrepareShader(renderer->sampler);
 
     vt->BindBuffer(GL_ARRAY_BUFFER, renderer->texture_buffer_object);
     assert(renderer->aloc.PicCoordsIn != -1);
@@ -762,18 +766,6 @@ static void DrawWithShaders(struct vlc_gl_renderer *renderer)
                          renderer->var.ZoomMatrix);
 
     vt->DrawElements(GL_TRIANGLES, renderer->nb_indices, GL_UNSIGNED_SHORT, 0);
-}
-
-int
-vlc_gl_renderer_Draw(struct vlc_gl_renderer *renderer)
-{
-    const opengl_vtable_t *vt = renderer->vt;
-
-    vt->Clear(GL_COLOR_BUFFER_BIT);
-
-    vt->UseProgram(renderer->program_id);
-
-    DrawWithShaders(renderer);
 
     return VLC_SUCCESS;
 }



More information about the vlc-commits mailing list