summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Lespiau <damien.lespiau@intel.com>2011-07-26 17:32:47 +0300
committerDamien Lespiau <damien.lespiau@intel.com>2011-07-29 11:50:15 +0100
commit2c3827aced46547c8e8ab441e1ff2ebf3e02b624 (patch)
treef97537839636f63ac6f10ed18c0ad2bafde37505
parent303305173b15a84872191a46fd5ea54063c839ff (diff)
downloadcogl-2c3827aced46547c8e8ab441e1ff2ebf3e02b624.tar.gz
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
-rw-r--r--cogl/cogl-display.c4
-rw-r--r--cogl/winsys/cogl-winsys-egl.c8
2 files changed, 10 insertions, 2 deletions
diff --git a/cogl/cogl-display.c b/cogl/cogl-display.c
index 86692530..ec13aa45 100644
--- a/cogl/cogl-display.c
+++ b/cogl/cogl-display.c
@@ -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);
}
diff --git a/cogl/winsys/cogl-winsys-egl.c b/cogl/winsys/cogl-winsys-egl.c
index db01709b..4ee208a6 100644
--- a/cogl/winsys/cogl-winsys-egl.c
+++ b/cogl/winsys/cogl-winsys-egl.c
@@ -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);