From 168db53bf471394ca9381b903d3e32d79664d8e5 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Tue, 23 Jan 2007 17:27:39 +0000 Subject: gst/smpte/: constify some static structs. Original commit message from CVS: * gst/smpte/barboxwipes.c: (gst_wipe_boxes_draw), (gst_wipe_triangles_clock_draw), (gst_wipe_triangles_draw): * gst/smpte/gstmask.c: (_gst_mask_register): * gst/smpte/gstmask.h: * gst/smpte/gstsmpte.c: (gst_smpte_update_mask): * gst/smpte/paint.c: (gst_smpte_paint_hbox), (draw_bresenham_line), (gst_smpte_paint_triangle_clock): constify some static structs. Don't update the mask if nothing changed to the params. Make sure we never draw outside of the picture. Fixes #398325. --- gst/smpte/paint.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'gst/smpte/paint.c') diff --git a/gst/smpte/paint.c b/gst/smpte/paint.c index 9b60de37..25f82ea4 100644 --- a/gst/smpte/paint.c +++ b/gst/smpte/paint.c @@ -65,8 +65,6 @@ gst_smpte_paint_hbox (guint32 * dest, gint stride, g_assert (width > 0); g_assert (height > 0); - g_print ("vbox: %d %d %d %d %d %d\n", x0, y0, c0, x1, y1, c1); - dest = dest + y0 * stride + x0; for (i = 0; i < height; i++) { @@ -219,11 +217,13 @@ static void draw_bresenham_line (guint32 * dest, gint stride, gint x0, gint y0, gint x1, gint y1, guint32 col) { - gint dx = abs (x1 - x0); - gint dy = abs (y1 - y0); + gint dx, dy; gint x_incr, y_incr; gint i, dpr, dpru, P, indep; + dx = abs (x1 - x0); + dy = abs (y1 - y0); + dest = dest + y0 * stride + x0; x_incr = SIGN (x1 - x0); @@ -301,6 +301,9 @@ gst_smpte_paint_triangle_clock (guint32 * dest, gint stride, draw_bresenham_line (dest, stride, x0, y0, i, y1, (c2 * angle + c1 * (1.0 - angle))); } + } else { + g_warning ("paint triangle clock: not supported"); + return; } } -- cgit