mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-05 02:58:02 +02:00
gl: Add describe string
This commit is contained in:
parent
a1c4b001a5
commit
0a7135148a
1 changed files with 25 additions and 4 deletions
|
|
@ -346,6 +346,27 @@ _cairo_boilerplate_gl_synchronize (void *closure)
|
|||
cairo_device_release (gltc->device);
|
||||
}
|
||||
|
||||
static char *
|
||||
_cairo_boilerplate_gl_describe (void *closure)
|
||||
{
|
||||
gl_target_closure_t *gltc = closure;
|
||||
char *s;
|
||||
const GLubyte *vendor, *renderer, *version;
|
||||
|
||||
if (cairo_device_acquire (gltc->device))
|
||||
return NULL;
|
||||
|
||||
vendor = glGetString (GL_VENDOR);
|
||||
renderer = glGetString (GL_RENDERER);
|
||||
version = glGetString (GL_VERSION);
|
||||
|
||||
xasprintf (&s, "%s %s %s", vendor, renderer, version);
|
||||
|
||||
cairo_device_release (gltc->device);
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
static const cairo_boilerplate_target_t targets[] = {
|
||||
{
|
||||
"gl", "gl", NULL, NULL,
|
||||
|
|
@ -357,7 +378,7 @@ static const cairo_boilerplate_target_t targets[] = {
|
|||
cairo_surface_write_to_png,
|
||||
_cairo_boilerplate_gl_cleanup,
|
||||
_cairo_boilerplate_gl_synchronize,
|
||||
NULL,
|
||||
_cairo_boilerplate_gl_describe,
|
||||
TRUE, FALSE, FALSE
|
||||
},
|
||||
{
|
||||
|
|
@ -370,7 +391,7 @@ static const cairo_boilerplate_target_t targets[] = {
|
|||
cairo_surface_write_to_png,
|
||||
_cairo_boilerplate_gl_cleanup,
|
||||
_cairo_boilerplate_gl_synchronize,
|
||||
NULL,
|
||||
_cairo_boilerplate_gl_describe,
|
||||
FALSE, FALSE, FALSE
|
||||
},
|
||||
{
|
||||
|
|
@ -384,7 +405,7 @@ static const cairo_boilerplate_target_t targets[] = {
|
|||
cairo_surface_write_to_png,
|
||||
_cairo_boilerplate_gl_cleanup,
|
||||
_cairo_boilerplate_gl_synchronize,
|
||||
NULL,
|
||||
_cairo_boilerplate_gl_describe,
|
||||
FALSE, FALSE, FALSE
|
||||
},
|
||||
{
|
||||
|
|
@ -398,7 +419,7 @@ static const cairo_boilerplate_target_t targets[] = {
|
|||
cairo_surface_write_to_png,
|
||||
_cairo_boilerplate_gl_cleanup,
|
||||
_cairo_boilerplate_gl_synchronize,
|
||||
NULL,
|
||||
_cairo_boilerplate_gl_describe,
|
||||
FALSE, FALSE, FALSE
|
||||
},
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue