summaryrefslogtreecommitdiffstatsci
path: root/src/caskbench.cpp
diff options
context:
space:
mode:
authorBryce Harrington <b.harrington@samsung.com>2013-11-14 17:17:09 -0800
committerBryce Harrington <b.harrington@samsung.com>2013-11-14 17:17:09 -0800
commit22256defef76a122fb254c993bb9fd9314f4bb6c (patch)
treeb90d00e27ce02a158985c3408b563bd8a395ec39 /src/caskbench.cpp
parent20097d8b646f0f341c02e704b6046e63b7fc608f (diff)
Add egl / gles3 surface support
Diffstat (limited to 'src/caskbench.cpp')
-rw-r--r--src/caskbench.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/caskbench.cpp b/src/caskbench.cpp
index 29ed6c5..364c07b 100644
--- a/src/caskbench.cpp
+++ b/src/caskbench.cpp
@@ -44,6 +44,8 @@ typedef struct _caskbench_result {
cairo_surface_t *
create_source_surface_glx (int width, int height);
+cairo_surface_t *
+create_source_surface_egl (int width, int height);
void
@@ -143,7 +145,7 @@ process_options(caskbench_options_t *opt, int argc, char *argv[])
"Controls the complexity of the tests, such as number of drawn elements",
NULL},
{"cairo-surface-type", 't', POPT_ARG_STRING, &opt->cairo_surface_type, 0,
- "Type of Cairo surface to use (image, glx)",
+ "Type of Cairo surface to use (image, glx, or egl)",
NULL},
POPT_AUTOHELP
{NULL}
@@ -231,13 +233,18 @@ main (int argc, char *argv[])
context.canvas_width = 800;
context.canvas_height = 400;
- if (opt.cairo_surface_type == NULL || !strcmp(opt.cairo_surface_type, "image"))
+ if (opt.cairo_surface_type == NULL || !strncmp(opt.cairo_surface_type, "image", 5))
cairo_surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32,
context.canvas_width,
context.canvas_height);
- else
+ else if (!strncmp(opt.cairo_surface_type, "glx", 3))
cairo_surface = create_source_surface_glx ( context.canvas_width,
context.canvas_height);
+ else if (!strncmp(opt.cairo_surface_type, "egl", 3))
+ cairo_surface = create_source_surface_egl ( context.canvas_width,
+ context.canvas_height);
+
+
if (!cairo_surface)
errx(2, "Error: Could not create a cairo surface\n");