summaryrefslogtreecommitdiffstatsci
path: root/src/caskbench.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/caskbench.cpp')
-rw-r--r--src/caskbench.cpp67
1 files changed, 2 insertions, 65 deletions
diff --git a/src/caskbench.cpp b/src/caskbench.cpp
index acde1b7..2b1f430 100644
--- a/src/caskbench.cpp
+++ b/src/caskbench.cpp
@@ -8,35 +8,19 @@
#include <stdlib.h>
#include <stdio.h>
+#include <math.h>
#include <string.h>
#include <assert.h>
#include <sys/time.h>
#include <popt.h>
#include <err.h>
-#include <cairo.h>
-#ifdef HAVE_CAIRO_GL_H
-# include <cairo-gl.h>
-#endif
-
-#ifdef USE_SKIA
-# include <SkBitmap.h>
-# include <SkBitmapDevice.h>
-# include <SkPaint.h>
-# include <SkCanvas.h>
-#endif
-
#include "caskbench.h"
+#include "caskbench_context.h"
#include "caskbench_result.h"
#include "device_config.h"
#include "tests.h"
-#ifndef SkToS32
-int32_t SkToS32(intmax_t x) { return (int32_t)x; }
-#endif
-
-bool gPrintInstCount = false;
-
typedef struct _caskbench_options {
int dry_run;
int iterations;
@@ -77,25 +61,6 @@ typedef struct _caskbench_options {
int canvas_height;
} caskbench_options_t;
-const char *gShapes[] = {
- "circle",
- "rectangle",
- "triangle",
- "star",
- "roundedrectangle",
- NULL
-};
-
-const char *gFillTypes[] = {
- "none",
- "solid",
- "linear-gradient",
- "radial-gradient",
- "image-pattern",
- "herringbone-pattern",
- NULL
-};
-
typedef enum {
CB_STATUS_PASS,
CB_STATUS_FAIL,
@@ -298,34 +263,6 @@ get_tick (void)
return (double)now.tv_sec + (double)now.tv_usec / 1000000.0;
}
-shape_type_t
-convertToShapeType(const char* shape_name)
-{
- int i =0;
- if (shape_name == NULL)
- return (shape_type_t) 0;
- while (gShapes[i] != NULL) {
- if (strcmp(gShapes[i], shape_name) == 0)
- return (shape_type_t)(i + 1);
- i++;
- }
- return (shape_type_t) 0;
-}
-
-fill_type_t
-convertToFillType(const char *fill_name)
-{
- int i =0;
- if (fill_name == NULL)
- return (fill_type_t) 0;
- while (gFillTypes[i] != NULL) {
- if (strcmp(gFillTypes[i], fill_name) == 0)
- return (fill_type_t) i ;
- i++;
- }
- return (fill_type_t) 0;
-}
-
void
shape_defaults_init(shapes *shape_defaults, caskbench_options_t *opt)
{