gl: pass large structure by const pointer, not value

Avoids large pointless memcpy.

Coverity 206236, 206237
This commit is contained in:
Vincent Penquerc'h 2014-04-09 10:28:46 +01:00
parent 0450e8f53f
commit 9eab659d1d
4 changed files with 12 additions and 12 deletions

View file

@ -26,7 +26,7 @@
void
gst_gl_effects_luma_to_curve (GstGLEffects * effects,
GstGLEffectsCurve curve,
const GstGLEffectsCurve * curve,
gint curve_index, gint width, gint height, GLuint texture)
{
GstGLShader *shader;
@ -65,8 +65,8 @@ gst_gl_effects_luma_to_curve (GstGLEffects * effects,
gl->TexParameteri (GL_TEXTURE_1D, GL_TEXTURE_WRAP_S, GL_CLAMP);
gl->TexParameteri (GL_TEXTURE_1D, GL_TEXTURE_WRAP_T, GL_CLAMP);
gl->TexImage1D (GL_TEXTURE_1D, 0, curve.bytes_per_pixel,
curve.width, 0, GL_RGB, GL_UNSIGNED_BYTE, curve.pixel_data);
gl->TexImage1D (GL_TEXTURE_1D, 0, curve->bytes_per_pixel,
curve->width, 0, GL_RGB, GL_UNSIGNED_BYTE, curve->pixel_data);
gl->Disable (GL_TEXTURE_1D);
}
@ -96,7 +96,7 @@ gst_gl_effects_heat_callback (gint width, gint height, guint texture,
{
GstGLEffects *effects = GST_GL_EFFECTS (data);
gst_gl_effects_luma_to_curve (effects, heat_curve, GST_GL_EFFECTS_CURVE_HEAT,
gst_gl_effects_luma_to_curve (effects, &heat_curve, GST_GL_EFFECTS_CURVE_HEAT,
width, height, texture);
}
@ -115,7 +115,7 @@ gst_gl_effects_sepia_callback (gint width, gint height, guint texture,
{
GstGLEffects *effects = GST_GL_EFFECTS (data);
gst_gl_effects_luma_to_curve (effects, sepia_curve,
gst_gl_effects_luma_to_curve (effects, &sepia_curve,
GST_GL_EFFECTS_CURVE_SEPIA, width, height, texture);
}
@ -134,7 +134,7 @@ gst_gl_effects_luma_xpro_callback (gint width, gint height, guint texture,
{
GstGLEffects *effects = GST_GL_EFFECTS (data);
gst_gl_effects_luma_to_curve (effects, luma_xpro_curve,
gst_gl_effects_luma_to_curve (effects, &luma_xpro_curve,
GST_GL_EFFECTS_CURVE_LUMA_XPRO, width, height, texture);
}

View file

@ -26,7 +26,7 @@
G_BEGIN_DECLS
void gst_gl_effects_luma_to_curve (GstGLEffects *effects,
GstGLEffectsCurve curve,
const GstGLEffectsCurve *curve,
gint curve_index,
gint width, gint height,
GLuint texture);

View file

@ -26,7 +26,7 @@
static void
gst_gl_effects_rgb_to_curve (GstGLEffects * effects,
GstGLEffectsCurve curve,
const GstGLEffectsCurve * curve,
gint curve_index, gint width, gint height, GLuint texture)
{
GstGLShader *shader;
@ -65,8 +65,8 @@ gst_gl_effects_rgb_to_curve (GstGLEffects * effects,
gl->TexParameteri (GL_TEXTURE_1D, GL_TEXTURE_WRAP_S, GL_CLAMP);
gl->TexParameteri (GL_TEXTURE_1D, GL_TEXTURE_WRAP_T, GL_CLAMP);
gl->TexImage1D (GL_TEXTURE_1D, 0, curve.bytes_per_pixel,
curve.width, 0, GL_RGB, GL_UNSIGNED_BYTE, curve.pixel_data);
gl->TexImage1D (GL_TEXTURE_1D, 0, curve->bytes_per_pixel,
curve->width, 0, GL_RGB, GL_UNSIGNED_BYTE, curve->pixel_data);
gl->Disable (GL_TEXTURE_1D);
}
@ -96,7 +96,7 @@ gst_gl_effects_xpro_callback (gint width, gint height, guint texture,
{
GstGLEffects *effects = GST_GL_EFFECTS (data);
gst_gl_effects_rgb_to_curve (effects, xpro_curve, GST_GL_EFFECTS_CURVE_XPRO,
gst_gl_effects_rgb_to_curve (effects, &xpro_curve, GST_GL_EFFECTS_CURVE_XPRO,
width, height, texture);
}

View file

@ -34,7 +34,7 @@ gst_gl_effects_xray_step_one (gint width, gint height, guint texture,
{
GstGLEffects *effects = GST_GL_EFFECTS (data);
gst_gl_effects_luma_to_curve (effects, xray_curve, GST_GL_EFFECTS_CURVE_XRAY,
gst_gl_effects_luma_to_curve (effects, &xray_curve, GST_GL_EFFECTS_CURVE_XRAY,
width, height, texture);
}