egl-gdl: Provide defaults to be able to initialize a "dummy" context

If we are being called without any GDL specific call (either the plane
we want to render to or the swap chain length) we can provide sane
defaults to still be able to create a context and a surface.

https://bugzilla.gnome.org/show_bug.cgi?id=655355
This commit is contained in:
Damien Lespiau 2011-07-26 17:32:47 +03:00
parent 303305173b
commit 2c3827aced
2 changed files with 10 additions and 2 deletions

View File

@ -97,6 +97,10 @@ cogl_display_new (CoglRenderer *renderer,
display->setup = FALSE;
#ifdef COGL_HAS_EGL_PLATFORM_GDL_SUPPORT
display->gdl_plane = GDL_PLANE_ID_UPP_C;
#endif
return _cogl_display_object_new (display);
}

View File

@ -1091,9 +1091,13 @@ gdl_plane_init (CoglDisplay *display, GError **error)
if (rc == GDL_SUCCESS)
rc = gdl_plane_set_attr (GDL_PLANE_DST_RECT, &dstRect);
/* Default to triple buffering if we don't have an onscreen template */
if (rc == GDL_SUCCESS)
rc = gdl_plane_set_uint (GDL_PLANE_NUM_GFX_SURFACES,
display->swap_chain->length);
if (display->onscreen_template)
rc = gdl_plane_set_uint (GDL_PLANE_NUM_GFX_SURFACES,
display->onscreen_template->swap_chain->length);
else
rc = gdl_plane_set_uint (GDL_PLANE_NUM_GFX_SURFACES, 3);
if (rc == GDL_SUCCESS)
rc = gdl_plane_config_end (GDL_FALSE);