From: Matthew Waters Date: Mon, 11 Jul 2016 12:44:16 +0000 (+1000) Subject: glfilter: rename draw_texture to draw_fullscreen_quad X-Git-Tag: 1.19.3~511^2~1989^2~289 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c7dd43f21a75eaee7056dac39ee8254529953c5d;p=platform%2Fupstream%2Fgstreamer.git glfilter: rename draw_texture to draw_fullscreen_quad And remove unused arguments. --- diff --git a/ext/gl/effects/gstgleffectblur.c b/ext/gl/effects/gstgleffectblur.c index f03af37..550b2b0 100644 --- a/ext/gl/effects/gstgleffectblur.c +++ b/ext/gl/effects/gstgleffectblur.c @@ -69,7 +69,7 @@ gst_gl_effects_blur_callback_hconv (gint width, gint height, guint texture, gst_gl_shader_set_uniform_1fv (shader, "kernel", 7, gst_gl_effects_blur_kernel ()); - gst_gl_filter_draw_texture (filter, texture, width, height); + gst_gl_filter_draw_fullscreen_quad (filter); } } @@ -102,7 +102,7 @@ gst_gl_effects_blur_callback_vconv (gint width, gint height, guint texture, gst_gl_shader_set_uniform_1fv (shader, "kernel", 7, gst_gl_effects_blur_kernel ()); - gst_gl_filter_draw_texture (filter, texture, width, height); + gst_gl_filter_draw_fullscreen_quad (filter); } } diff --git a/ext/gl/effects/gstgleffectbulge.c b/ext/gl/effects/gstgleffectbulge.c index 9856321..67ba668 100644 --- a/ext/gl/effects/gstgleffectbulge.c +++ b/ext/gl/effects/gstgleffectbulge.c @@ -53,7 +53,7 @@ gst_gl_effects_bulge_callback (gint width, gint height, guint texture, gst_gl_shader_set_uniform_1i (shader, "tex", 0); - gst_gl_filter_draw_texture (filter, texture, width, height); + gst_gl_filter_draw_fullscreen_quad (filter); } void diff --git a/ext/gl/effects/gstgleffectfisheye.c b/ext/gl/effects/gstgleffectfisheye.c index 285deb3..b2f0747 100644 --- a/ext/gl/effects/gstgleffectfisheye.c +++ b/ext/gl/effects/gstgleffectfisheye.c @@ -53,7 +53,7 @@ gst_gl_effects_fisheye_callback (gint width, gint height, guint texture, gst_gl_shader_set_uniform_1i (shader, "tex", 0); - gst_gl_filter_draw_texture (filter, texture, width, height); + gst_gl_filter_draw_fullscreen_quad (filter); } void diff --git a/ext/gl/effects/gstgleffectglow.c b/ext/gl/effects/gstgleffectglow.c index 9fc09e0..4b911d2 100644 --- a/ext/gl/effects/gstgleffectglow.c +++ b/ext/gl/effects/gstgleffectglow.c @@ -56,7 +56,7 @@ gst_gl_effects_glow_step_one (gint width, gint height, guint texture, gst_gl_shader_set_uniform_1i (shader, "tex", 0); - gst_gl_filter_draw_texture (filter, texture, width, height); + gst_gl_filter_draw_fullscreen_quad (filter); } static void @@ -95,7 +95,7 @@ gst_gl_effects_glow_step_two (gint width, gint height, guint texture, gst_gl_shader_set_uniform_1fv (shader, "kernel", 7, gauss_kernel); gst_gl_shader_set_uniform_1f (shader, "gauss_width", width); - gst_gl_filter_draw_texture (filter, texture, width, height); + gst_gl_filter_draw_fullscreen_quad (filter); } static void @@ -130,7 +130,7 @@ gst_gl_effects_glow_step_three (gint width, gint height, guint texture, gst_gl_shader_set_uniform_1fv (shader, "kernel", 7, gauss_kernel); gst_gl_shader_set_uniform_1f (shader, "gauss_height", height); - gst_gl_filter_draw_texture (filter, texture, width, height); + gst_gl_filter_draw_fullscreen_quad (filter); } static void @@ -159,7 +159,7 @@ gst_gl_effects_glow_step_four (gint width, gint height, guint texture, gst_gl_shader_use (shader); gl->ActiveTexture (GL_TEXTURE2); - gl->BindTexture (GL_TEXTURE_2D, effects->intexture); + gl->BindTexture (GL_TEXTURE_2D, effects->intexture->tex_id); gst_gl_shader_set_uniform_1f (shader, "alpha", 1.0f); gst_gl_shader_set_uniform_1i (shader, "base", 2); @@ -170,7 +170,7 @@ gst_gl_effects_glow_step_four (gint width, gint height, guint texture, gst_gl_shader_set_uniform_1f (shader, "beta", (gfloat) 1 / 3.5f); gst_gl_shader_set_uniform_1i (shader, "blend", 1); - gst_gl_filter_draw_texture (filter, texture, width, height); + gst_gl_filter_draw_fullscreen_quad (filter); } void diff --git a/ext/gl/effects/gstgleffectidentity.c b/ext/gl/effects/gstgleffectidentity.c index 5687d64..08def50 100644 --- a/ext/gl/effects/gstgleffectidentity.c +++ b/ext/gl/effects/gstgleffectidentity.c @@ -64,7 +64,7 @@ gst_gl_effects_identity_callback (gint width, gint height, guint texture, gst_gl_shader_set_uniform_1i (shader, "tex", 0); - gst_gl_filter_draw_texture (filter, texture, width, height); + gst_gl_filter_draw_fullscreen_quad (filter); } void diff --git a/ext/gl/effects/gstgleffectlaplacian.c b/ext/gl/effects/gstgleffectlaplacian.c index ca5b88c..a66f5fa 100644 --- a/ext/gl/effects/gstgleffectlaplacian.c +++ b/ext/gl/effects/gstgleffectlaplacian.c @@ -59,7 +59,7 @@ gst_gl_effects_laplacian_callback (gint width, gint height, guint texture, gst_gl_shader_set_uniform_1fv (shader, "kernel", 9, kernel); gst_gl_shader_set_uniform_1i (shader, "invert", effects->invert); - gst_gl_filter_draw_texture (filter, texture, width, height); + gst_gl_filter_draw_fullscreen_quad (filter); } } diff --git a/ext/gl/effects/gstgleffectlumatocurve.c b/ext/gl/effects/gstgleffectlumatocurve.c index 158fda0..b4669be 100644 --- a/ext/gl/effects/gstgleffectlumatocurve.c +++ b/ext/gl/effects/gstgleffectlumatocurve.c @@ -97,7 +97,7 @@ gst_gl_effects_luma_to_curve (GstGLEffects * effects, gst_gl_shader_set_uniform_1i (shader, "curve", 1); } - gst_gl_filter_draw_texture (filter, texture, width, height); + gst_gl_filter_draw_fullscreen_quad (filter); } static void diff --git a/ext/gl/effects/gstgleffectmirror.c b/ext/gl/effects/gstgleffectmirror.c index 5080099..3728ab6 100644 --- a/ext/gl/effects/gstgleffectmirror.c +++ b/ext/gl/effects/gstgleffectmirror.c @@ -53,7 +53,7 @@ gst_gl_effects_mirror_callback (gint width, gint height, guint texture, gst_gl_shader_set_uniform_1i (shader, "tex", 0); - gst_gl_filter_draw_texture (filter, texture, width, height); + gst_gl_filter_draw_fullscreen_quad (filter); } void diff --git a/ext/gl/effects/gstgleffectrgbtocurve.c b/ext/gl/effects/gstgleffectrgbtocurve.c index e2b6bdb..dc661dd 100644 --- a/ext/gl/effects/gstgleffectrgbtocurve.c +++ b/ext/gl/effects/gstgleffectrgbtocurve.c @@ -96,7 +96,7 @@ gst_gl_effects_rgb_to_curve (GstGLEffects * effects, gst_gl_shader_set_uniform_1i (shader, "curve", 1); } - gst_gl_filter_draw_texture (filter, texture, width, height); + gst_gl_filter_draw_fullscreen_quad (filter); } static void diff --git a/ext/gl/effects/gstgleffectsin.c b/ext/gl/effects/gstgleffectsin.c index 5c09e8b..78c22f1 100644 --- a/ext/gl/effects/gstgleffectsin.c +++ b/ext/gl/effects/gstgleffectsin.c @@ -53,7 +53,7 @@ gst_gl_effects_sin_callback (gint width, gint height, guint texture, gst_gl_shader_set_uniform_1i (shader, "tex", 0); - gst_gl_filter_draw_texture (filter, texture, width, height); + gst_gl_filter_draw_fullscreen_quad (filter); } void diff --git a/ext/gl/effects/gstgleffectsobel.c b/ext/gl/effects/gstgleffectsobel.c index 8996b93..40ffc80 100644 --- a/ext/gl/effects/gstgleffectsobel.c +++ b/ext/gl/effects/gstgleffectsobel.c @@ -51,7 +51,7 @@ gst_gl_effects_sobel_callback_desaturate (gint width, gint height, gst_gl_shader_set_uniform_1i (shader, "tex", 0); - gst_gl_filter_draw_texture (filter, texture, width, height); + gst_gl_filter_draw_fullscreen_quad (filter); } } @@ -82,7 +82,7 @@ gst_gl_effects_sobel_callback_hconv (gint width, gint height, guint texture, gst_gl_shader_set_uniform_1i (shader, "tex", 0); gst_gl_shader_set_uniform_1f (shader, "width", width); - gst_gl_filter_draw_texture (filter, texture, width, height); + gst_gl_filter_draw_fullscreen_quad (filter); } } @@ -113,7 +113,7 @@ gst_gl_effects_sobel_callback_vconv (gint width, gint height, guint texture, gst_gl_shader_set_uniform_1i (shader, "tex", 0); gst_gl_shader_set_uniform_1f (shader, "height", height); - gst_gl_filter_draw_texture (filter, texture, width, height); + gst_gl_filter_draw_fullscreen_quad (filter); } } @@ -144,7 +144,7 @@ gst_gl_effects_sobel_callback_length (gint width, gint height, guint texture, gst_gl_shader_set_uniform_1i (shader, "tex", 0); gst_gl_shader_set_uniform_1i (shader, "invert", effects->invert); - gst_gl_filter_draw_texture (filter, texture, width, height); + gst_gl_filter_draw_fullscreen_quad (filter); } } diff --git a/ext/gl/effects/gstgleffectsquare.c b/ext/gl/effects/gstgleffectsquare.c index e74c943..e8e86b5 100644 --- a/ext/gl/effects/gstgleffectsquare.c +++ b/ext/gl/effects/gstgleffectsquare.c @@ -53,7 +53,7 @@ gst_gl_effects_square_callback (gint width, gint height, guint texture, gst_gl_shader_set_uniform_1i (shader, "tex", 0); - gst_gl_filter_draw_texture (filter, texture, width, height); + gst_gl_filter_draw_fullscreen_quad (filter); } void diff --git a/ext/gl/effects/gstgleffectsqueeze.c b/ext/gl/effects/gstgleffectsqueeze.c index 2dbded5..8923ea7 100644 --- a/ext/gl/effects/gstgleffectsqueeze.c +++ b/ext/gl/effects/gstgleffectsqueeze.c @@ -53,7 +53,7 @@ gst_gl_effects_squeeze_callback (gint width, gint height, guint texture, gst_gl_shader_set_uniform_1i (shader, "tex", 0); - gst_gl_filter_draw_texture (filter, texture, width, height); + gst_gl_filter_draw_fullscreen_quad (filter); } void diff --git a/ext/gl/effects/gstgleffectstretch.c b/ext/gl/effects/gstgleffectstretch.c index d132bd0..15654ab 100644 --- a/ext/gl/effects/gstgleffectstretch.c +++ b/ext/gl/effects/gstgleffectstretch.c @@ -52,7 +52,7 @@ gst_gl_effects_stretch_callback (gint width, gint height, guint texture, gst_gl_shader_set_uniform_1i (shader, "tex", 0); - gst_gl_filter_draw_texture (filter, texture, width, height); + gst_gl_filter_draw_fullscreen_quad (filter); } void diff --git a/ext/gl/effects/gstgleffecttunnel.c b/ext/gl/effects/gstgleffecttunnel.c index 5029c51..6342d1c 100644 --- a/ext/gl/effects/gstgleffecttunnel.c +++ b/ext/gl/effects/gstgleffecttunnel.c @@ -53,7 +53,7 @@ gst_gl_effects_tunnel_callback (gint width, gint height, guint texture, gst_gl_shader_set_uniform_1i (shader, "tex", 0); - gst_gl_filter_draw_texture (filter, texture, width, height); + gst_gl_filter_draw_fullscreen_quad (filter); } void diff --git a/ext/gl/effects/gstgleffecttwirl.c b/ext/gl/effects/gstgleffecttwirl.c index 6c73f19..5b3b9fa 100644 --- a/ext/gl/effects/gstgleffecttwirl.c +++ b/ext/gl/effects/gstgleffecttwirl.c @@ -53,7 +53,7 @@ gst_gl_effects_twirl_callback (gint width, gint height, guint texture, gst_gl_shader_set_uniform_1i (shader, "tex", 0); - gst_gl_filter_draw_texture (filter, texture, width, height); + gst_gl_filter_draw_fullscreen_quad (filter); } void diff --git a/ext/gl/effects/gstgleffectxray.c b/ext/gl/effects/gstgleffectxray.c index c045cb6..12c95f8 100644 --- a/ext/gl/effects/gstgleffectxray.c +++ b/ext/gl/effects/gstgleffectxray.c @@ -74,7 +74,7 @@ gst_gl_effects_xray_step_two (gint width, gint height, guint texture, gst_gl_shader_set_uniform_1fv (shader, "kernel", 9, gauss_kernel); gst_gl_shader_set_uniform_1f (shader, "gauss_width", width); - gst_gl_filter_draw_texture (filter, texture, width, height); + gst_gl_filter_draw_fullscreen_quad (filter); } static void @@ -109,7 +109,7 @@ gst_gl_effects_xray_step_three (gint width, gint height, guint texture, gst_gl_shader_set_uniform_1fv (shader, "kernel", 9, gauss_kernel); gst_gl_shader_set_uniform_1f (shader, "gauss_height", height); - gst_gl_filter_draw_texture (filter, texture, width, height); + gst_gl_filter_draw_fullscreen_quad (filter); } /* multipass separable sobel */ @@ -142,7 +142,7 @@ gst_gl_effects_xray_desaturate (gint width, gint height, guint texture, gl->BindTexture (GL_TEXTURE_2D, texture); gst_gl_shader_set_uniform_1i (shader, "tex", 1); - gst_gl_filter_draw_texture (filter, texture, width, height); + gst_gl_filter_draw_fullscreen_quad (filter); } static void @@ -176,7 +176,7 @@ gst_gl_effects_xray_sobel_hconv (gint width, gint height, guint texture, gst_gl_shader_set_uniform_1i (shader, "tex", 1); gst_gl_shader_set_uniform_1f (shader, "width", width); - gst_gl_filter_draw_texture (filter, texture, width, height); + gst_gl_filter_draw_fullscreen_quad (filter); } static void @@ -210,7 +210,7 @@ gst_gl_effects_xray_sobel_vconv (gint width, gint height, guint texture, gst_gl_shader_set_uniform_1i (shader, "tex", 1); gst_gl_shader_set_uniform_1f (shader, "height", height); - gst_gl_filter_draw_texture (filter, texture, width, height); + gst_gl_filter_draw_fullscreen_quad (filter); } static void @@ -243,7 +243,7 @@ gst_gl_effects_xray_sobel_length (gint width, gint height, guint texture, gst_gl_shader_set_uniform_1i (shader, "tex", 1); gst_gl_shader_set_uniform_1i (shader, "invert", TRUE); - gst_gl_filter_draw_texture (filter, texture, width, height); + gst_gl_filter_draw_fullscreen_quad (filter); } /* end of sobel passes */ @@ -274,7 +274,7 @@ gst_gl_effects_xray_step_five (gint width, gint height, guint texture, gst_gl_shader_use (shader); gl->ActiveTexture (GL_TEXTURE2); - gl->BindTexture (GL_TEXTURE_2D, effects->midtexture[2]); + gl->BindTexture (GL_TEXTURE_2D, effects->midtexture[2]->tex_id); gst_gl_shader_set_uniform_1i (shader, "base", 2); @@ -284,7 +284,7 @@ gst_gl_effects_xray_step_five (gint width, gint height, guint texture, gst_gl_shader_set_uniform_1f (shader, "alpha", (gfloat) 0.5f); gst_gl_shader_set_uniform_1i (shader, "blend", 1); - gst_gl_filter_draw_texture (filter, texture, width, height); + gst_gl_filter_draw_fullscreen_quad (filter); } void diff --git a/ext/gl/gstglcolorbalance.c b/ext/gl/gstglcolorbalance.c index 27dcb00..1a546ed 100644 --- a/ext/gl/gstglcolorbalance.c +++ b/ext/gl/gstglcolorbalance.c @@ -254,7 +254,7 @@ gst_gl_color_balance_callback (gint width, gint height, guint tex_id, gl->BindTexture (GL_TEXTURE_2D, tex_id); - gst_gl_filter_draw_texture (filter, tex_id, width, height); + gst_gl_filter_draw_fullscreen_quad (filter); } static gboolean diff --git a/ext/gl/gstgldeinterlace.c b/ext/gl/gstgldeinterlace.c index c1429a9..a1deb6a 100644 --- a/ext/gl/gstgldeinterlace.c +++ b/ext/gl/gstgldeinterlace.c @@ -457,7 +457,7 @@ gst_gl_deinterlace_vfir_callback (gint width, gint height, guint texture, gst_gl_shader_set_uniform_1f (shader, "height", GST_VIDEO_INFO_HEIGHT (&filter->out_info)); - gst_gl_filter_draw_texture (filter, texture, width, height); + gst_gl_filter_draw_fullscreen_quad (filter); } static void @@ -505,7 +505,7 @@ gst_gl_deinterlace_greedyh_callback (gint width, gint height, guint texture, gst_gl_shader_set_uniform_1f (shader, "height", GST_VIDEO_INFO_HEIGHT (&filter->out_info)); - gst_gl_filter_draw_texture (filter, texture, width, height); + gst_gl_filter_draw_fullscreen_quad (filter); /* we keep the previous buffer around so this is safe */ deinterlace_filter->prev_tex = texture; diff --git a/ext/gl/gstgldifferencematte.c b/ext/gl/gstgldifferencematte.c index d6c35cb..974f719 100644 --- a/ext/gl/gstgldifferencematte.c +++ b/ext/gl/gstgldifferencematte.c @@ -331,7 +331,7 @@ gst_gl_differencematte_diff (gint width, gint height, guint texture, gst_gl_shader_set_uniform_1i (differencematte->shader[0], "saved", 1); - gst_gl_filter_draw_texture (filter, texture, width, height); + gst_gl_filter_draw_fullscreen_quad (filter); } static void @@ -354,7 +354,7 @@ gst_gl_differencematte_hblur (gint width, gint height, guint texture, gst_gl_shader_set_uniform_1f (differencematte->shader[1], "gauss_width", width); - gst_gl_filter_draw_texture (filter, texture, width, height); + gst_gl_filter_draw_fullscreen_quad (filter); } static void @@ -377,7 +377,7 @@ gst_gl_differencematte_vblur (gint width, gint height, guint texture, gst_gl_shader_set_uniform_1f (differencematte->shader[2], "gauss_height", height); - gst_gl_filter_draw_texture (filter, texture, width, height); + gst_gl_filter_draw_fullscreen_quad (filter); } static void @@ -405,7 +405,7 @@ gst_gl_differencematte_interp (gint width, gint height, guint texture, gst_gl_shader_set_uniform_1i (differencematte->shader[3], "alpha", 2); - gst_gl_filter_draw_texture (filter, texture, width, height); + gst_gl_filter_draw_fullscreen_quad (filter); } static void @@ -423,7 +423,7 @@ gst_gl_differencematte_identity (gint width, gint height, guint texture, gst_gl_shader_set_uniform_1i (differencematte->identity_shader, "tex", 0); - gst_gl_filter_draw_texture (filter, texture, width, height); + gst_gl_filter_draw_fullscreen_quad (filter); } static gboolean diff --git a/ext/gl/gstglfiltershader.c b/ext/gl/gstglfiltershader.c index 2117388..4a3ff1d 100644 --- a/ext/gl/gstglfiltershader.c +++ b/ext/gl/gstglfiltershader.c @@ -525,7 +525,7 @@ gst_gl_filtershader_hcallback (gint width, gint height, guint texture, gl->ActiveTexture (GL_TEXTURE0); gl->BindTexture (GL_TEXTURE_2D, texture); - gst_gl_filter_draw_texture (filter, texture, width, height); + gst_gl_filter_draw_fullscreen_quad (filter); gst_object_unref (shader); } diff --git a/gst-libs/gst/gl/gstglfilter.c b/gst-libs/gst/gl/gstglfilter.c index 7c4e254..c2751b3 100644 --- a/gst-libs/gst/gl/gstglfilter.c +++ b/gst-libs/gst/gl/gstglfilter.c @@ -1040,7 +1040,7 @@ gst_gl_filter_render_to_target (GstGLFilter * filter, gboolean resize, cb.height = in_height; gst_gl_context_use_fbo_v2 (context, out_width, out_height, - filter->fbo, filter->depthbuffer, target, _glcb2, &cb); + filter->fbo, filter->depthbuffer, output->tex_id, _glcb2, &cb); } static void @@ -1089,7 +1089,7 @@ _draw_with_shader_cb (gint width, gint height, guint texture, gpointer stuff) gst_gl_shader_set_uniform_1f (filter->default_shader, "width", width); gst_gl_shader_set_uniform_1f (filter->default_shader, "height", height); - gst_gl_filter_draw_texture (filter, texture, width, height); + gst_gl_filter_draw_fullscreen_quad (filter); } /** @@ -1168,23 +1168,20 @@ _unbind_buffer (GstGLFilter * filter) } /** - * gst_gl_filter_draw_texture: + * gst_gl_filter_draw_fullscreen_quad: * @filter: a #GstGLFilter - * @texture: the texture to draw - * @width: width of @texture - * @height: height of texture * - * Draws @texture into the OpenGL scene at the specified @width and @height. + * Render a fullscreen quad using the current GL state. The only GL state this + * modifies is the necessary vertex/index buffers and, if necessary, a + * Vertex Array Object for drawing a fullscreen quad. Framebuffer state, + * any shaders, viewport state, etc must be setup by the caller. */ void -gst_gl_filter_draw_texture (GstGLFilter * filter, GLuint texture, - guint width, guint height) +gst_gl_filter_draw_fullscreen_quad (GstGLFilter * filter) { GstGLContext *context = GST_GL_BASE_FILTER (filter)->context; GstGLFuncs *gl = context->gl_vtable; - GST_DEBUG ("drawing texture:%u dimensions:%ux%u", texture, width, height); - { if (!filter->vertex_buffer) { if (gl->GenVertexArrays) { diff --git a/gst-libs/gst/gl/gstglfilter.h b/gst-libs/gst/gl/gstglfilter.h index 5025bde..19fef0b 100644 --- a/gst-libs/gst/gl/gstglfilter.h +++ b/gst-libs/gst/gl/gstglfilter.h @@ -119,7 +119,7 @@ void gst_gl_filter_render_to_target (GstGLFilter *filter, gboolean resize, GLuin void gst_gl_filter_render_to_target_with_shader (GstGLFilter * filter, gboolean resize, GLuint input, GLuint target, GstGLShader *shader); -void gst_gl_filter_draw_texture (GstGLFilter *filter, GLuint texture, guint width, guint height); +void gst_gl_filter_draw_fullscreen_quad (GstGLFilter *filter); G_END_DECLS