[Spice-devel] [spice-gtk PATCH v4] spice-widget: init egl only after first gl_scanout
Lukas Venhoda
lvenhoda at redhat.com
Thu Jul 28 13:50:48 UTC 2016
On Thu, Jul 28, 2016 at 3:40 PM, Marc-André Lureau <mlureau at redhat.com>
wrote:
> Hi
>
> ----- Original Message -----
> > When using GtkDrawingArea and EGL was not used, it was still initialized.
> > This produced warning messages on systems where EGL is not supported.
> >
> > Move spice_egl_init from drawing_area_realize to gl_scanout.
> ...
> >
> > @@ -2662,8 +2653,28 @@ G_GNUC_INTERNAL
> > void spice_display_widget_gl_scanout(SpiceDisplay *display)
> > {
> > SpiceDisplayPrivate *d = display->priv;
> > + GError *err = NULL;
> >
>
> To avoid unused variables, you should move it...
>
> > SPICE_DEBUG("%s: got scanout", __FUNCTION__);
> > +
> > +#ifdef GDK_WINDOWING_X11
> > + GtkWidget *area = gtk_stack_get_child_by_name(d->stack,
> "draw-area");
> > +
> > + if (GDK_IS_X11_DISPLAY(gdk_display_get_default()) &&
> > + !d->egl.context_ready &&
> > + gtk_widget_get_realized(area)) {
>
> here
>
> > + if (!spice_egl_init(display, &err)) {
> > + g_critical("egl init failed: %s", err->message);
> > + g_clear_error(&err);
> > + }
> > +
> > + if (!spice_egl_realize_display(display,
> gtk_widget_get_window(area),
> > &err)) {
> > + g_critical("egl realize failed: %s", err->message);
> > + g_clear_error(&err);
> > + }
> > + }
> > +#endif
> > +
> > set_egl_enabled(display, true);
> >
> > if (d->egl.context_ready) {
> > --
>
> other than that, looks good, ack
>
aah there's a second "GError *err = NULL;", in the "if
(d->egl.context_ready)" block
that was supposed to be deleted. I guess I missed it
I'll send a fixup as v4.
--
Lukas Venhoda
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20160728/299c0153/attachment.html>
More information about the Spice-devel
mailing list