summaryrefslogtreecommitdiffstatsci
path: root/src/caskbench.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/caskbench.cpp')
-rw-r--r--src/caskbench.cpp135
1 files changed, 135 insertions, 0 deletions
diff --git a/src/caskbench.cpp b/src/caskbench.cpp
index da53713..fd05e2e 100644
--- a/src/caskbench.cpp
+++ b/src/caskbench.cpp
@@ -39,6 +39,31 @@ typedef struct _caskbench_options {
int version;
unsigned int enable_egl_sample_buffers;
+ int shape_id;
+ int x_position;
+ int y_position;
+ int width;
+ int height;
+ char* fill_type;
+ double red;
+ double green;
+ double blue;
+ double alpha;
+ int animation;
+ char *image_path;
+ int stroke_width;
+ int multi_shapes;
+
+ double stroke_red;
+ double stroke_green;
+ double stroke_blue;
+
+ int cap_style;
+ int join_style;
+ int dash_style;
+
+
+
} caskbench_options_t;
typedef struct _caskbench_result {
@@ -209,6 +234,68 @@ process_options(caskbench_options_t *opt, int argc, char *argv[])
{"enable-egl-sample-buffers", '\0', POPT_ARG_NONE, &opt->enable_egl_sample_buffers, 0,
"Sets EGL_SAMPLES=4 and EGL_SAMPLE_BUFFERS=1 in the EGL attribute list",
NULL},
+ {"shape_id", 'S', POPT_ARG_INT, &opt->shape_id, 0,
+ "Controls which shape to be drawn ",
+ NULL},
+ {"x_position", 'X', POPT_ARG_INT, &opt->x_position, 0,
+ "x_position of the object where it to be drawn ",
+ NULL},
+ {"y_position", 'Y', POPT_ARG_INT, &opt->y_position, 0,
+ "y_position of the object where it to be drawn ",
+ NULL},
+ {"width", 'W', POPT_ARG_INT, &opt->width, 0,
+ "Width of the shape bject ",
+ NULL},
+ {"height", 'H', POPT_ARG_INT, &opt->height, 0,
+ "Height of the shape object ",
+ NULL},
+ {"fill-type", 'f', POPT_ARG_STRING, &opt->fill_type, 0,
+ "Controls the fill type of the objects draw either solid, gradient, image pattern type",
+ NULL},
+ {"red", 'R', POPT_ARG_DOUBLE, &opt->red, 0,
+ "R Color Value",
+ NULL},
+ {"green", 'G', POPT_ARG_DOUBLE, &opt->green, 0,
+ "g Color Value",
+ NULL},
+ {"blue", 'B', POPT_ARG_DOUBLE, &opt->blue, 0,
+ "B Color Value",
+ NULL},
+ {"alpha", 'A', POPT_ARG_DOUBLE, &opt->alpha, 0,
+ "Transparency value for the solid fill",
+ NULL},
+ {"animation", 'g', POPT_ARG_INT, &opt->animation, 0,
+ "Controls the kinematics of the objects drawn",
+ NULL},
+ {"image-path", 'I', POPT_ARG_STRING, &opt->image_path, 0,
+ "Image path to refer the image for setting source, clipping, patterns",
+ NULL},
+ {"stroke_width", 'w', POPT_ARG_INT, &opt->stroke_width, 0,
+ "represents stroke width of the object",
+ NULL},
+ {"multi_shapes", 'm', POPT_ARG_INT, &opt->multi_shapes, 0,
+ "represents stroke width of the object",
+ NULL},
+#if 0
+ {"stroke_red", "SR", POPT_ARG_INT, &opt->multi_shapes, 0,
+ "represents r value for stroke color",
+ NULL},
+ {"stroke_green", "SG", POPT_ARG_INT, &opt->multi_shapes, 0,
+ "represents represents g value for stroke color",
+ NULL},
+ {"stroke_blue", "SB", POPT_ARG_INT, &opt->multi_shapes, 0,
+ "represents represents b value for stroke color",
+ NULL},
+#endif
+ {"cap_style", 'C', POPT_ARG_INT, &opt->cap_style, 0,
+ "represents r value for stroke color",
+ NULL},
+ {"join_style", 'J', POPT_ARG_INT, &opt->join_style, 0,
+ "represents r value for stroke color",
+ NULL},
+ {"dash_style", 'D', POPT_ARG_INT, &opt->dash_style, 0,
+ "represents r value for stroke color",
+ NULL},
POPT_AUTOHELP
{NULL}
};
@@ -222,7 +309,31 @@ process_options(caskbench_options_t *opt, int argc, char *argv[])
opt->surface_type = NULL;
opt->version = 0;
+
opt->enable_egl_sample_buffers = 0;
+ opt->shape_id = 0;
+ opt->x_position = 0;
+ opt->y_position = 0;
+ opt->width = 0;
+ opt->height = 0;
+ opt->fill_type = NULL;
+ opt->red = 0;
+ opt->green = 0;
+ opt->blue = 0;
+ opt->alpha = 0;
+ opt->animation = 0;
+ opt->image_path = NULL;
+ opt->multi_shapes = 0;
+ opt->stroke_width = 0;
+ opt->stroke_red = 0;
+ opt->stroke_green = 0;
+ opt->stroke_blue = 0;
+ opt->cap_style = 0;
+ opt->join_style = 0;
+ opt->dash_style = 0;
+
+
+
// Process the command line
pc = poptGetContext(NULL, argc, (const char **)argv, po, 0);
@@ -473,6 +584,30 @@ main (int argc, char *argv[])
srand(0xdeadbeef);
context_init(&context, opt.size);
+
+//Command line setup for shapes
+ context.shape_args.centre_x = opt.x_position;
+ context.shape_args.centre_y = opt.y_position;
+ context.shape_args.width = opt.width;
+ context.shape_args.height = opt.height;
+ context.shape_args.shape_id = opt.shape_id;
+ context.shape_args.fill_type = opt.fill_type;
+ context.shape_args.red = opt.red;
+ context.shape_args.green = opt.green;
+ context.shape_args.blue = opt.blue;
+ context.shape_args.alpha = opt.alpha;
+ context.shape_args.image_path = opt.image_path;
+ context.shape_args.stroke_width = opt.stroke_width;
+ context.shape_args.multi_shapes = opt.multi_shapes;
+ context.shape_args.animation = opt.animation;
+ context.shape_args.stroke_width = opt.stroke_width;
+ context.shape_args.stroke_red = opt.stroke_red;
+ context.shape_args.stroke_green = opt.stroke_green;
+ context.shape_args.stroke_blue = opt.stroke_blue;
+ context.shape_args.cap_style = opt.cap_style;
+ context.shape_args.join_style = opt.join_style;
+ context.shape_args.dash_style = opt.dash_style;
+
result_init(&result, perf_tests[c].name);
config.width = context.canvas_width;
config.height = context.canvas_height;