From: Sebastian Dröge Date: Mon, 7 Aug 2017 05:58:58 +0000 (+0300) Subject: basic-tutorial-5: expose_cb() is now draw_cb() and gets a cairo_t directly X-Git-Tag: 1.19.3~489^2~278 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bc810ef40ffd231b39059c85595907fd2fb1cd9f;p=platform%2Fupstream%2Fgstreamer.git basic-tutorial-5: expose_cb() is now draw_cb() and gets a cairo_t directly --- diff --git a/markdown/tutorials/basic/toolkit-integration.md b/markdown/tutorials/basic/toolkit-integration.md index c545df5..228c626 100644 --- a/markdown/tutorials/basic/toolkit-integration.md +++ b/markdown/tutorials/basic/toolkit-integration.md @@ -676,16 +676,13 @@ we call it when the main window is closed, after stopping the pipeline /* This function is called everytime the video window needs to be redrawn (due to damage/exposure, * rescaling, etc). GStreamer takes care of this in the PAUSED and PLAYING states, otherwise, * we simply draw a black rectangle to avoid garbage showing up. */ -static gboolean expose_cb (GtkWidget *widget, GdkEventExpose *event, CustomData *data) { +static gboolean draw_cb (GtkWidget *widget, cairo_t *cr, CustomData *data) { if (data->state < GST_STATE_PAUSED) { GtkAllocation allocation; - GdkWindow *window = gtk_widget_get_window (widget); - cairo_t *cr; /* Cairo is a 2D graphics library which we use here to clean the video window. * It is used by GStreamer for other reasons, so it will always be available to us. */ gtk_widget_get_allocation (widget, &allocation); - cr = gdk_cairo_create (window); cairo_set_source_rgb (cr, 0, 0, 0); cairo_rectangle (cr, 0, 0, allocation.width, allocation.height); cairo_fill (cr);