[cairo-commit] 2 commits - boilerplate/cairo-boilerplate-beos.cpp boilerplate/cairo-boilerplate.c boilerplate/cairo-boilerplate-directfb.c boilerplate/cairo-boilerplate-drm.c boilerplate/cairo-boilerplate-egl.c boilerplate/cairo-boilerplate-getopt.c boilerplate/cairo-boilerplate-glx.c boilerplate/cairo-boilerplate.h boilerplate/cairo-boilerplate-pdf.c boilerplate/cairo-boilerplate-private.h boilerplate/cairo-boilerplate-ps.c boilerplate/cairo-boilerplate-qt.cpp boilerplate/cairo-boilerplate-quartz.c boilerplate/cairo-boilerplate-scaled-font.h boilerplate/cairo-boilerplate-script.c boilerplate/cairo-boilerplate-skia.c boilerplate/cairo-boilerplate-svg.c boilerplate/cairo-boilerplate-system.c boilerplate/cairo-boilerplate-system.h boilerplate/cairo-boilerplate-test-surfaces.c boilerplate/cairo-boilerplate-vg.c boilerplate/cairo-boilerplate-wgl.c boilerplate/cairo-boilerplate-win32.c boilerplate/cairo-boilerplate-win32-printing.c boilerplate/cairo-boilerplate-xcb.c boilerplate/cairo-b oilerplate-xlib.c perf/cairo-perf-chart.c perf/cairo-perf-compare-backends.c perf/cairo-perf-diff-files.c perf/cairo-perf-graph-files.c perf/cairo-perf-graph.h perf/cairo-perf-graph-widget.c perf/cairo-perf.h perf/cairo-perf-micro.c perf/cairo-perf-os2.c perf/cairo-perf-posix.c perf/cairo-perf-print.c perf/cairo-perf-report.c perf/cairo-perf-trace.c perf/cairo-perf-win32.c perf/cairo-stats.c perf/cairo-stats.h
M. Joonas Pihlaja
joonas at kemper.freedesktop.org
Thu Jun 24 05:03:27 PDT 2010
boilerplate/cairo-boilerplate-beos.cpp | 42 +++++-----
boilerplate/cairo-boilerplate-directfb.c | 86 ++++++++++-----------
boilerplate/cairo-boilerplate-drm.c | 2
boilerplate/cairo-boilerplate-egl.c | 20 ++--
boilerplate/cairo-boilerplate-getopt.c | 12 +-
boilerplate/cairo-boilerplate-glx.c | 60 +++++++-------
boilerplate/cairo-boilerplate-pdf.c | 24 +++--
boilerplate/cairo-boilerplate-private.h | 2
boilerplate/cairo-boilerplate-ps.c | 49 ++++++------
boilerplate/cairo-boilerplate-qt.cpp | 18 ++--
boilerplate/cairo-boilerplate-quartz.c | 18 ++--
boilerplate/cairo-boilerplate-scaled-font.h | 2
boilerplate/cairo-boilerplate-script.c | 30 +++----
boilerplate/cairo-boilerplate-skia.c | 18 ++--
boilerplate/cairo-boilerplate-svg.c | 59 +++++++-------
boilerplate/cairo-boilerplate-system.c | 10 +-
boilerplate/cairo-boilerplate-system.h | 10 +-
boilerplate/cairo-boilerplate-test-surfaces.c | 100 ++++++++++++------------
boilerplate/cairo-boilerplate-vg.c | 36 ++++----
boilerplate/cairo-boilerplate-wgl.c | 58 +++++++-------
boilerplate/cairo-boilerplate-win32-printing.c | 29 +++----
boilerplate/cairo-boilerplate-win32.c | 18 ++--
boilerplate/cairo-boilerplate-xcb.c | 85 ++++++++++----------
boilerplate/cairo-boilerplate-xlib.c | 94 +++++++++++------------
boilerplate/cairo-boilerplate.c | 102 ++++++++++++-------------
boilerplate/cairo-boilerplate.h | 44 +++++-----
perf/cairo-perf-chart.c | 38 ++++++---
perf/cairo-perf-compare-backends.c | 30 ++++---
perf/cairo-perf-diff-files.c | 37 +++++----
perf/cairo-perf-graph-files.c | 73 ++++++++++-------
perf/cairo-perf-graph-widget.c | 60 +++++++++-----
perf/cairo-perf-graph.h | 8 -
perf/cairo-perf-micro.c | 82 ++++++++++----------
perf/cairo-perf-os2.c | 10 +-
perf/cairo-perf-posix.c | 24 ++---
perf/cairo-perf-print.c | 5 -
perf/cairo-perf-report.c | 62 +++++++++------
perf/cairo-perf-trace.c | 82 +++++++++++---------
perf/cairo-perf-win32.c | 6 -
perf/cairo-perf.h | 38 ++++-----
perf/cairo-stats.c | 11 +-
perf/cairo-stats.h | 6 -
42 files changed, 852 insertions(+), 748 deletions(-)
New commits:
commit b036a09972a19e63a85a4661a457525e2abe4026
Author: M Joonas Pihlaja <jpihlaja at cc.helsinki.fi>
Date: Thu Jun 24 14:59:18 2010 +0300
whitespace: Fixup formal arguments and tabs in boilerplate/ and perf/.
Ran a script to align the formal parameters of functions and
collapse spaces to tabs in code.
diff --git a/boilerplate/cairo-boilerplate-beos.cpp b/boilerplate/cairo-boilerplate-beos.cpp
index 5596ac1..8a1b1af 100644
--- a/boilerplate/cairo-boilerplate-beos.cpp
+++ b/boilerplate/cairo-boilerplate-beos.cpp
@@ -90,22 +90,22 @@ public:
void ReadyToRun()
{
- release_sem(init);
+ release_sem(init);
}
static int32 Main(void *args)
{
- nsBeOSApp *app = new nsBeOSApp( (sem_id)args );
- if(app == NULL)
- return B_ERROR;
- return app->Run();
+ nsBeOSApp *app = new nsBeOSApp( (sem_id)args );
+ if(app == NULL)
+ return B_ERROR;
+ return app->Run();
}
private:
const char *GetAppSig()
{
- return "application/x-vnd.cairo-test-app";
+ return "application/x-vnd.cairo-test-app";
}
sem_id init;
@@ -126,7 +126,7 @@ AppRunner::AppRunner()
sem_id initsem = create_sem(0, "Cairo BApplication init");
if (initsem < B_OK) {
fprintf (stderr, "Error creating BeOS initialization semaphore\n");
- return;
+ return;
}
thread_id tid = spawn_thread(nsBeOSApp::Main, "Cairo/BeOS test", B_NORMAL_PRIORITY, (void *)initsem);
@@ -165,12 +165,12 @@ struct beos_boilerplate_closure {
// Test a real window
static cairo_surface_t *
-_cairo_boilerplate_beos_create_surface (const char *name,
- cairo_content_t content,
- double width,
- double height,
- cairo_boilerplate_mode_t mode,
- void **closure)
+_cairo_boilerplate_beos_create_surface (const char *name,
+ cairo_content_t content,
+ double width,
+ double height,
+ cairo_boilerplate_mode_t mode,
+ void **closure)
{
float right = width ? width - 1 : 0;
float bottom = height ? height - 1 : 0;
@@ -188,7 +188,7 @@ _cairo_boilerplate_beos_create_surface (const char *name,
}
static void
-_cairo_boilerplate_beos_cleanup (void* closure)
+_cairo_boilerplate_beos_cleanup (void *closure)
{
beos_boilerplate_closure* bclosure = reinterpret_cast<beos_boilerplate_closure*>(closure);
@@ -200,12 +200,12 @@ _cairo_boilerplate_beos_cleanup (void* closure)
// Test a bitmap
static cairo_surface_t *
-_cairo_boilerplate_beos_create_surface_for_bitmap (const char *name,
- cairo_content_t content,
- double width,
- double height,
- cairo_boilerplate_mode_t mode,
- void **closure)
+_cairo_boilerplate_beos_create_surface_for_bitmap (const char *name,
+ cairo_content_t content,
+ double width,
+ double height,
+ cairo_boilerplate_mode_t mode,
+ void **closure)
{
BRect rect(0.0, 0.0, width - 1, height - 1);
color_space beosformat = (content == CAIRO_CONTENT_COLOR_ALPHA) ? B_RGBA32
@@ -224,7 +224,7 @@ _cairo_boilerplate_beos_create_surface_for_bitmap (const char *name,
}
static void
-_cairo_boilerplate_beos_cleanup_bitmap (void* closure)
+_cairo_boilerplate_beos_cleanup_bitmap (void *closure)
{
beos_boilerplate_closure* bclosure = reinterpret_cast<beos_boilerplate_closure*>(closure);
diff --git a/boilerplate/cairo-boilerplate-directfb.c b/boilerplate/cairo-boilerplate-directfb.c
index 59a77e1..39252ac 100644
--- a/boilerplate/cairo-boilerplate-directfb.c
+++ b/boilerplate/cairo-boilerplate-directfb.c
@@ -21,19 +21,19 @@ make check
D_DEBUG_DOMAIN (CairoDFB_Boiler, "CairoDFB/Boiler", "Cairo DirectFB Boilerplate");
/* macro for a safe call to DirectFB functions */
-#define DFBCHECK(x...) do{ \
- err = x; \
- if (err != DFB_OK) { \
+#define DFBCHECK(x...) do{ \
+ err = x; \
+ if (err != DFB_OK) { \
fprintf (stderr, "%s <%d>:\n\t", __FILE__, __LINE__); \
goto ERROR; \
- } \
+ } \
} while (0)
typedef struct _DFBInfo {
- IDirectFB *dfb;
+ IDirectFB *dfb;
IDirectFBDisplayLayer *layer;
- IDirectFBWindow *window;
- IDirectFBSurface *surface;
+ IDirectFBWindow *window;
+ IDirectFBSurface *surface;
} DFBInfo;
static void
@@ -59,7 +59,7 @@ _cairo_boilerplate_directfb_cleanup (void *closure)
static DFBInfo *
init (void)
{
- DFBDisplayLayerConfig layer_config;
+ DFBDisplayLayerConfig layer_config;
DFBGraphicsDeviceDescription desc;
int err;
DFBInfo *info;
@@ -94,26 +94,26 @@ ERROR:
}
static cairo_surface_t *
-_cairo_boilerplate_directfb_window_create_surface (DFBInfo *info,
- cairo_content_t content,
- int width,
- int height)
+_cairo_boilerplate_directfb_window_create_surface (DFBInfo *info,
+ cairo_content_t content,
+ int width,
+ int height)
{
DFBWindowDescription desc;
int err;
D_DEBUG_AT (CairoDFB_Boiler, "%s (%p, %s, %dx%d)\n", __FUNCTION__, info,
- content == CAIRO_CONTENT_ALPHA ? "ALPHA" :
- content == CAIRO_CONTENT_COLOR ? "RGB" :
+ content == CAIRO_CONTENT_ALPHA ? "ALPHA" :
+ content == CAIRO_CONTENT_COLOR ? "RGB" :
content == CAIRO_CONTENT_COLOR_ALPHA ? "ARGB" : "unknown content!",
width, height);
- desc.flags = DWDESC_POSX | DWDESC_POSY |
- DWDESC_WIDTH | DWDESC_HEIGHT;
- desc.caps = DSCAPS_NONE;
- desc.posx = 0;
- desc.posy = 0;
- desc.width = width;
+ desc.flags = DWDESC_POSX | DWDESC_POSY |
+ DWDESC_WIDTH | DWDESC_HEIGHT;
+ desc.caps = DSCAPS_NONE;
+ desc.posx = 0;
+ desc.posy = 0;
+ desc.width = width;
desc.height = height;
if (content == CAIRO_CONTENT_COLOR_ALPHA) {
desc.flags |= DWDESC_CAPS | DSDESC_PIXELFORMAT;
@@ -136,23 +136,23 @@ ERROR:
}
static cairo_surface_t *
-_cairo_boilerplate_directfb_bitmap_create_surface (DFBInfo *info,
- cairo_content_t content,
- int width,
- int height)
+_cairo_boilerplate_directfb_bitmap_create_surface (DFBInfo *info,
+ cairo_content_t content,
+ int width,
+ int height)
{
int err;
DFBSurfaceDescription desc;
D_DEBUG_AT (CairoDFB_Boiler, "%s (%p, %s, %dx%d)\n", __FUNCTION__, info,
- content == CAIRO_CONTENT_ALPHA ? "ALPHA" :
- content == CAIRO_CONTENT_COLOR ? "RGB" :
+ content == CAIRO_CONTENT_ALPHA ? "ALPHA" :
+ content == CAIRO_CONTENT_COLOR ? "RGB" :
content == CAIRO_CONTENT_COLOR_ALPHA ? "ARGB" : "unknown content!",
width, height);
desc.flags = DSDESC_WIDTH | DSDESC_HEIGHT;
desc.caps = DSCAPS_NONE;
- desc.width = width;
+ desc.width = width;
desc.height = height;
if (content == CAIRO_CONTENT_COLOR_ALPHA) {
desc.flags |= DSDESC_PIXELFORMAT;
@@ -168,33 +168,33 @@ ERROR:
}
static cairo_surface_t *
-_cairo_boilerplate_directfb_create_surface (const char *name,
- cairo_content_t content,
- double width,
- double height,
- double max_width,
- double max_height,
- cairo_boilerplate_mode_t mode,
- int id,
- void **closure)
+_cairo_boilerplate_directfb_create_surface (const char *name,
+ cairo_content_t content,
+ double width,
+ double height,
+ double max_width,
+ double max_height,
+ cairo_boilerplate_mode_t mode,
+ int id,
+ void **closure)
{
DFBInfo *info;
info = init ();
if (info == NULL)
- return NULL;
+ return NULL;
*closure = info;
D_DEBUG_AT (CairoDFB_Boiler, "%s ('%s', %s, %dx%d, %s)\n",
__FUNCTION__, name,
- content == CAIRO_CONTENT_ALPHA ? "ALPHA" :
- content == CAIRO_CONTENT_COLOR ? "RGB" :
- content == CAIRO_CONTENT_COLOR_ALPHA ? "ARGB" : "unknown content!",
- width, height,
- mode == CAIRO_BOILERPLATE_MODE_TEST ? "TEST" :
- mode == CAIRO_BOILERPLATE_MODE_PERF ? "PERF" : "unknown mode!");
+ content == CAIRO_CONTENT_ALPHA ? "ALPHA" :
+ content == CAIRO_CONTENT_COLOR ? "RGB" :
+ content == CAIRO_CONTENT_COLOR_ALPHA ? "ARGB" : "unknown content!",
+ width, height,
+ mode == CAIRO_BOILERPLATE_MODE_TEST ? "TEST" :
+ mode == CAIRO_BOILERPLATE_MODE_PERF ? "PERF" : "unknown mode!");
if (width == 0)
width = 1;
diff --git a/boilerplate/cairo-boilerplate-drm.c b/boilerplate/cairo-boilerplate-drm.c
index 93709af..5d5d17f 100644
--- a/boilerplate/cairo-boilerplate-drm.c
+++ b/boilerplate/cairo-boilerplate-drm.c
@@ -41,7 +41,7 @@ _cairo_boilerplate_drm_create_surface (const char *name,
double height,
double max_width,
double max_height,
- cairo_boilerplate_mode_t mode,
+ cairo_boilerplate_mode_t mode,
int id,
void **closure)
{
diff --git a/boilerplate/cairo-boilerplate-egl.c b/boilerplate/cairo-boilerplate-egl.c
index 71f9c75..0bf2855 100644
--- a/boilerplate/cairo-boilerplate-egl.c
+++ b/boilerplate/cairo-boilerplate-egl.c
@@ -61,14 +61,14 @@ _cairo_boilerplate_egl_cleanup (void *closure)
static cairo_surface_t *
_cairo_boilerplate_egl_create_surface (const char *name,
- cairo_content_t content,
- double width,
- double height,
- double max_width,
- double max_height,
- cairo_boilerplate_mode_t mode,
- int id,
- void **closure)
+ cairo_content_t content,
+ double width,
+ double height,
+ double max_width,
+ double max_height,
+ cairo_boilerplate_mode_t mode,
+ int id,
+ void **closure)
{
egl_target_closure_t *gltc;
cairo_surface_t *surface;
@@ -107,7 +107,7 @@ _cairo_boilerplate_egl_create_surface (const char *name,
gltc->surface = surface = cairo_gl_surface_create (gltc->device,
content,
- ceil (width),
+ ceil (width),
ceil (height));
if (cairo_surface_status (surface))
_cairo_boilerplate_egl_cleanup (gltc);
@@ -121,7 +121,7 @@ _cairo_boilerplate_egl_synchronize (void *closure)
egl_target_closure_t *gltc = closure;
if (cairo_device_acquire (gltc->device))
- return;
+ return;
glFinish ();
diff --git a/boilerplate/cairo-boilerplate-getopt.c b/boilerplate/cairo-boilerplate-getopt.c
index 775d1ef..53b150c 100644
--- a/boilerplate/cairo-boilerplate-getopt.c
+++ b/boilerplate/cairo-boilerplate-getopt.c
@@ -47,12 +47,12 @@ int optopt = '?';
static char** prev_argv = NULL; /* Keep a copy of argv and argc to */
-static int prev_argc = 0; /* tell if getopt params change */
-static int argv_index = 0; /* Option we're checking */
-static int argv_index2 = 0; /* Option argument we're checking */
-static int opt_offset = 0; /* Index into compounded "-option" */
-static int dashdash = 0; /* True if "--" option reached */
-static int nonopt = 0; /* How many nonopts we've found */
+static int prev_argc = 0; /* tell if getopt params change */
+static int argv_index = 0; /* Option we're checking */
+static int argv_index2 = 0; /* Option argument we're checking */
+static int opt_offset = 0; /* Index into compounded "-option" */
+static int dashdash = 0; /* True if "--" option reached */
+static int nonopt = 0; /* How many nonopts we've found */
static void increment_index(void)
{
diff --git a/boilerplate/cairo-boilerplate-glx.c b/boilerplate/cairo-boilerplate-glx.c
index 66a031b..a3e0338 100644
--- a/boilerplate/cairo-boilerplate-glx.c
+++ b/boilerplate/cairo-boilerplate-glx.c
@@ -67,15 +67,15 @@ _cairo_boilerplate_gl_cleanup (void *closure)
}
static cairo_surface_t *
-_cairo_boilerplate_gl_create_surface (const char *name,
- cairo_content_t content,
- double width,
- double height,
- double max_width,
- double max_height,
- cairo_boilerplate_mode_t mode,
- int id,
- void **closure)
+_cairo_boilerplate_gl_create_surface (const char *name,
+ cairo_content_t content,
+ double width,
+ double height,
+ double max_width,
+ double max_height,
+ cairo_boilerplate_mode_t mode,
+ int id,
+ void **closure)
{
int rgba_attribs[] = { GLX_RGBA,
GLX_RED_SIZE, 1,
@@ -135,7 +135,7 @@ _cairo_boilerplate_gl_create_surface (const char *name,
gltc->surface = surface = cairo_gl_surface_create (gltc->device,
content,
- ceil (width),
+ ceil (width),
ceil (height));
if (cairo_surface_status (surface))
_cairo_boilerplate_gl_cleanup (gltc);
@@ -144,15 +144,15 @@ _cairo_boilerplate_gl_create_surface (const char *name,
}
static cairo_surface_t *
-_cairo_boilerplate_gl_create_window (const char *name,
- cairo_content_t content,
- double width,
- double height,
- double max_width,
- double max_height,
- cairo_boilerplate_mode_t mode,
- int id,
- void **closure)
+_cairo_boilerplate_gl_create_window (const char *name,
+ cairo_content_t content,
+ double width,
+ double height,
+ double max_width,
+ double max_height,
+ cairo_boilerplate_mode_t mode,
+ int id,
+ void **closure)
{
int rgba_attribs[] = { GLX_RGBA,
GLX_RED_SIZE, 1,
@@ -225,15 +225,15 @@ _cairo_boilerplate_gl_create_window (const char *name,
}
static cairo_surface_t *
-_cairo_boilerplate_gl_create_window_db (const char *name,
- cairo_content_t content,
- double width,
- double height,
- double max_width,
- double max_height,
- cairo_boilerplate_mode_t mode,
- int id,
- void **closure)
+_cairo_boilerplate_gl_create_window_db (const char *name,
+ cairo_content_t content,
+ double width,
+ double height,
+ double max_width,
+ double max_height,
+ cairo_boilerplate_mode_t mode,
+ int id,
+ void **closure)
{
int rgba_attribs[] = { GLX_RGBA,
GLX_RED_SIZE, 1,
@@ -311,7 +311,7 @@ _cairo_boilerplate_gl_create_window_db (const char *name,
}
static cairo_status_t
-_cairo_boilerplate_gl_finish_window (cairo_surface_t *surface)
+_cairo_boilerplate_gl_finish_window (cairo_surface_t *surface)
{
gl_target_closure_t *gltc = cairo_surface_get_user_data (surface,
&gl_closure_key);
@@ -339,7 +339,7 @@ _cairo_boilerplate_gl_synchronize (void *closure)
gl_target_closure_t *gltc = closure;
if (cairo_device_acquire (gltc->device))
- return;
+ return;
glFinish ();
diff --git a/boilerplate/cairo-boilerplate-pdf.c b/boilerplate/cairo-boilerplate-pdf.c
index 62e2536..9d83b93 100644
--- a/boilerplate/cairo-boilerplate-pdf.c
+++ b/boilerplate/cairo-boilerplate-pdf.c
@@ -45,8 +45,8 @@ static const cairo_user_data_key_t pdf_closure_key;
typedef struct _pdf_target_closure
{
char *filename;
- int width;
- int height;
+ int width;
+ int height;
cairo_surface_t *target;
} pdf_target_closure_t;
@@ -59,8 +59,8 @@ _cairo_boilerplate_pdf_create_surface (const char *name,
double height,
double max_width,
double max_height,
- cairo_boilerplate_mode_t mode,
- int id,
+ cairo_boilerplate_mode_t mode,
+ int id,
void **closure)
{
pdf_target_closure_t *ptc;
@@ -112,7 +112,7 @@ _cairo_boilerplate_pdf_create_surface (const char *name,
}
static cairo_status_t
-_cairo_boilerplate_pdf_finish_surface (cairo_surface_t *surface)
+_cairo_boilerplate_pdf_finish_surface (cairo_surface_t *surface)
{
pdf_target_closure_t *ptc = cairo_surface_get_user_data (surface,
&pdf_closure_key);
@@ -156,7 +156,8 @@ _cairo_boilerplate_pdf_finish_surface (cairo_surface_t *surface)
}
static cairo_status_t
-_cairo_boilerplate_pdf_surface_write_to_png (cairo_surface_t *surface, const char *filename)
+_cairo_boilerplate_pdf_surface_write_to_png (cairo_surface_t *surface,
+ const char *filename)
{
pdf_target_closure_t *ptc = cairo_surface_get_user_data (surface, &pdf_closure_key);
char command[4096];
@@ -177,7 +178,8 @@ _cairo_boilerplate_pdf_surface_write_to_png (cairo_surface_t *surface, const cha
}
static cairo_surface_t *
-_cairo_boilerplate_pdf_convert_to_image (cairo_surface_t *surface, int page)
+_cairo_boilerplate_pdf_convert_to_image (cairo_surface_t *surface,
+ int page)
{
pdf_target_closure_t *ptc = cairo_surface_get_user_data (surface,
&pdf_closure_key);
@@ -187,9 +189,9 @@ _cairo_boilerplate_pdf_convert_to_image (cairo_surface_t *surface, int page)
static cairo_surface_t *
_cairo_boilerplate_pdf_get_image_surface (cairo_surface_t *surface,
- int page,
- int width,
- int height)
+ int page,
+ int width,
+ int height)
{
cairo_surface_t *image;
@@ -217,7 +219,7 @@ _cairo_boilerplate_pdf_cleanup (void *closure)
static void
_cairo_boilerplate_pdf_force_fallbacks (cairo_surface_t *abstract_surface,
- unsigned int flags)
+ unsigned int flags)
{
pdf_target_closure_t *ptc = cairo_surface_get_user_data (abstract_surface,
&pdf_closure_key);
diff --git a/boilerplate/cairo-boilerplate-private.h b/boilerplate/cairo-boilerplate-private.h
index 5ef59c5..a848aa1 100644
--- a/boilerplate/cairo-boilerplate-private.h
+++ b/boilerplate/cairo-boilerplate-private.h
@@ -35,7 +35,7 @@ _cairo_boilerplate_register_all (void);
void
_cairo_boilerplate_register_backend (const cairo_boilerplate_target_t *targets,
- unsigned int count);
+ unsigned int count);
#define CAIRO_BOILERPLATE(name__, targets__) \
void _register_##name__ (void); \
diff --git a/boilerplate/cairo-boilerplate-ps.c b/boilerplate/cairo-boilerplate-ps.c
index 20452d8..de5a6ea 100644
--- a/boilerplate/cairo-boilerplate-ps.c
+++ b/boilerplate/cairo-boilerplate-ps.c
@@ -43,15 +43,15 @@ static const cairo_user_data_key_t ps_closure_key;
typedef struct _ps_target_closure {
char *filename;
- int width;
- int height;
+ int width;
+ int height;
cairo_surface_t *target;
cairo_ps_level_t level;
} ps_target_closure_t;
static cairo_status_t
_cairo_boilerplate_ps_surface_set_creation_date (cairo_surface_t *abstract_surface,
- time_t date)
+ time_t date)
{
cairo_paginated_surface_t *paginated = (cairo_paginated_surface_t*) abstract_surface;
cairo_ps_surface_t *surface;
@@ -68,18 +68,18 @@ _cairo_boilerplate_ps_surface_set_creation_date (cairo_surface_t *abstract_surfa
}
static cairo_surface_t *
-_cairo_boilerplate_ps_create_surface (const char *name,
- cairo_content_t content,
- cairo_ps_level_t level,
- double width,
- double height,
- double max_width,
- double max_height,
- cairo_boilerplate_mode_t mode,
- int id,
- void **closure)
+_cairo_boilerplate_ps_create_surface (const char *name,
+ cairo_content_t content,
+ cairo_ps_level_t level,
+ double width,
+ double height,
+ double max_width,
+ double max_height,
+ cairo_boilerplate_mode_t mode,
+ int id,
+ void **closure)
{
- ps_target_closure_t *ptc;
+ ps_target_closure_t *ptc;
cairo_surface_t *surface;
cairo_status_t status;
@@ -137,8 +137,8 @@ _cairo_boilerplate_ps2_create_surface (const char *name,
double height,
double max_width,
double max_height,
- cairo_boilerplate_mode_t mode,
- int id,
+ cairo_boilerplate_mode_t mode,
+ int id,
void **closure)
{
return _cairo_boilerplate_ps_create_surface (name, content,
@@ -156,8 +156,8 @@ _cairo_boilerplate_ps3_create_surface (const char *name,
double height,
double max_width,
double max_height,
- cairo_boilerplate_mode_t mode,
- int id,
+ cairo_boilerplate_mode_t mode,
+ int id,
void **closure)
{
return _cairo_boilerplate_ps_create_surface (name, content,
@@ -169,7 +169,7 @@ _cairo_boilerplate_ps3_create_surface (const char *name,
}
static cairo_status_t
-_cairo_boilerplate_ps_finish_surface (cairo_surface_t *surface)
+_cairo_boilerplate_ps_finish_surface (cairo_surface_t *surface)
{
ps_target_closure_t *ptc = cairo_surface_get_user_data (surface,
&ps_closure_key);
@@ -210,7 +210,8 @@ _cairo_boilerplate_ps_finish_surface (cairo_surface_t *surface)
}
static cairo_status_t
-_cairo_boilerplate_ps_surface_write_to_png (cairo_surface_t *surface, const char *filename)
+_cairo_boilerplate_ps_surface_write_to_png (cairo_surface_t *surface,
+ const char *filename)
{
ps_target_closure_t *ptc = cairo_surface_get_user_data (surface,
&ps_closure_key);
@@ -234,9 +235,9 @@ _cairo_boilerplate_ps_surface_write_to_png (cairo_surface_t *surface, const char
static cairo_surface_t *
_cairo_boilerplate_ps_get_image_surface (cairo_surface_t *surface,
- int page,
- int width,
- int height)
+ int page,
+ int width,
+ int height)
{
ps_target_closure_t *ptc = cairo_surface_get_user_data (surface,
&ps_closure_key);
@@ -280,7 +281,7 @@ _cairo_boilerplate_ps_cleanup (void *closure)
static void
_cairo_boilerplate_ps_force_fallbacks (cairo_surface_t *abstract_surface,
- unsigned int flags)
+ unsigned int flags)
{
ps_target_closure_t *ptc = cairo_surface_get_user_data (abstract_surface,
&ps_closure_key);
diff --git a/boilerplate/cairo-boilerplate-qt.cpp b/boilerplate/cairo-boilerplate-qt.cpp
index 5afb5c2..bbeea4a 100644
--- a/boilerplate/cairo-boilerplate-qt.cpp
+++ b/boilerplate/cairo-boilerplate-qt.cpp
@@ -53,15 +53,15 @@ _cairo_boilerplate_qt_cleanup (void *closure)
}
static cairo_surface_t *
-_cairo_boilerplate_qt_create_surface (const char *name,
- cairo_content_t content,
- double width,
- double height,
- double max_width,
- double max_height,
- cairo_boilerplate_mode_t mode,
- int id,
- void **closure)
+_cairo_boilerplate_qt_create_surface (const char *name,
+ cairo_content_t content,
+ double width,
+ double height,
+ double max_width,
+ double max_height,
+ cairo_boilerplate_mode_t mode,
+ int id,
+ void **closure)
{
qt_closure_t *qtc;
diff --git a/boilerplate/cairo-boilerplate-quartz.c b/boilerplate/cairo-boilerplate-quartz.c
index 2bba47a..19d5928 100644
--- a/boilerplate/cairo-boilerplate-quartz.c
+++ b/boilerplate/cairo-boilerplate-quartz.c
@@ -29,15 +29,15 @@
#include <cairo-quartz.h>
static cairo_surface_t *
-_cairo_boilerplate_quartz_create_surface (const char *name,
- cairo_content_t content,
- double width,
- double height,
- double max_width,
- double max_height,
- cairo_boilerplate_mode_t mode,
- int id,
- void **closure)
+_cairo_boilerplate_quartz_create_surface (const char *name,
+ cairo_content_t content,
+ double width,
+ double height,
+ double max_width,
+ double max_height,
+ cairo_boilerplate_mode_t mode,
+ int id,
+ void **closure)
{
cairo_format_t format;
diff --git a/boilerplate/cairo-boilerplate-scaled-font.h b/boilerplate/cairo-boilerplate-scaled-font.h
index 4d27cd0..a7ba2fe 100644
--- a/boilerplate/cairo-boilerplate-scaled-font.h
+++ b/boilerplate/cairo-boilerplate-scaled-font.h
@@ -29,6 +29,6 @@
void
cairo_boilerplate_scaled_font_set_max_glyphs_cached (cairo_scaled_font_t *scaled_font,
- int max_glyphs);
+ int max_glyphs);
#endif
diff --git a/boilerplate/cairo-boilerplate-script.c b/boilerplate/cairo-boilerplate-script.c
index 0cd7f9d..535ca54 100644
--- a/boilerplate/cairo-boilerplate-script.c
+++ b/boilerplate/cairo-boilerplate-script.c
@@ -37,15 +37,15 @@ typedef struct _script_target_closure {
} script_target_closure_t;
static cairo_surface_t *
-_cairo_boilerplate_script_create_surface (const char *name,
- cairo_content_t content,
- double width,
- double height,
- double max_width,
- double max_height,
- cairo_boilerplate_mode_t mode,
- int id,
- void **closure)
+_cairo_boilerplate_script_create_surface (const char *name,
+ cairo_content_t content,
+ double width,
+ double height,
+ double max_width,
+ double max_height,
+ cairo_boilerplate_mode_t mode,
+ int id,
+ void **closure)
{
script_target_closure_t *ptc;
cairo_device_t *ctx;
@@ -78,7 +78,7 @@ _cairo_boilerplate_script_create_surface (const char *name,
}
static cairo_status_t
-_cairo_boilerplate_script_finish_surface (cairo_surface_t *surface)
+_cairo_boilerplate_script_finish_surface (cairo_surface_t *surface)
{
cairo_surface_finish (surface);
return cairo_surface_status (surface);
@@ -86,14 +86,14 @@ _cairo_boilerplate_script_finish_surface (cairo_surface_t *surface)
static cairo_status_t
_cairo_boilerplate_script_surface_write_to_png (cairo_surface_t *surface,
- const char *filename)
+ const char *filename)
{
return CAIRO_STATUS_WRITE_ERROR;
}
static cairo_surface_t *
_cairo_boilerplate_script_convert_to_image (cairo_surface_t *surface,
- int page)
+ int page)
{
script_target_closure_t *ptc = cairo_surface_get_user_data (surface,
&script_closure_key);
@@ -102,9 +102,9 @@ _cairo_boilerplate_script_convert_to_image (cairo_surface_t *surface,
static cairo_surface_t *
_cairo_boilerplate_script_get_image_surface (cairo_surface_t *surface,
- int page,
- int width,
- int height)
+ int page,
+ int width,
+ int height)
{
cairo_surface_t *image;
diff --git a/boilerplate/cairo-boilerplate-skia.c b/boilerplate/cairo-boilerplate-skia.c
index f2b8dd7..34c19f1 100644
--- a/boilerplate/cairo-boilerplate-skia.c
+++ b/boilerplate/cairo-boilerplate-skia.c
@@ -4,15 +4,15 @@
#include <cairo-skia.h>
static cairo_surface_t *
-_cairo_boilerplate_skia_create_surface (const char *name,
- cairo_content_t content,
- double width,
- double height,
- double max_width,
- double max_height,
- cairo_boilerplate_mode_t mode,
- int id,
- void **closure)
+_cairo_boilerplate_skia_create_surface (const char *name,
+ cairo_content_t content,
+ double width,
+ double height,
+ double max_width,
+ double max_height,
+ cairo_boilerplate_mode_t mode,
+ int id,
+ void **closure)
{
cairo_format_t format;
diff --git a/boilerplate/cairo-boilerplate-svg.c b/boilerplate/cairo-boilerplate-svg.c
index dbfa0d6..a7d6c79 100644
--- a/boilerplate/cairo-boilerplate-svg.c
+++ b/boilerplate/cairo-boilerplate-svg.c
@@ -43,7 +43,7 @@ static const cairo_user_data_key_t svg_closure_key;
typedef struct _svg_target_closure {
char *filename;
- int width, height;
+ int width, height;
cairo_surface_t *target;
} svg_target_closure_t;
@@ -55,8 +55,8 @@ _cairo_boilerplate_svg_create_surface (const char *name,
double height,
double max_width,
double max_height,
- cairo_boilerplate_mode_t mode,
- int id,
+ cairo_boilerplate_mode_t mode,
+ int id,
void **closure)
{
svg_target_closure_t *ptc;
@@ -104,15 +104,15 @@ _cairo_boilerplate_svg_create_surface (const char *name,
}
static cairo_surface_t *
-_cairo_boilerplate_svg11_create_surface (const char *name,
- cairo_content_t content,
- double width,
- double height,
- double max_width,
- double max_height,
- cairo_boilerplate_mode_t mode,
- int id,
- void **closure)
+_cairo_boilerplate_svg11_create_surface (const char *name,
+ cairo_content_t content,
+ double width,
+ double height,
+ double max_width,
+ double max_height,
+ cairo_boilerplate_mode_t mode,
+ int id,
+ void **closure)
{
/* current default, but be explicit in case the default changes */
return _cairo_boilerplate_svg_create_surface (name, content,
@@ -124,15 +124,15 @@ _cairo_boilerplate_svg11_create_surface (const char *name,
}
static cairo_surface_t *
-_cairo_boilerplate_svg12_create_surface (const char *name,
- cairo_content_t content,
- double width,
- double height,
- double max_width,
- double max_height,
- cairo_boilerplate_mode_t mode,
- int id,
- void **closure)
+_cairo_boilerplate_svg12_create_surface (const char *name,
+ cairo_content_t content,
+ double width,
+ double height,
+ double max_width,
+ double max_height,
+ cairo_boilerplate_mode_t mode,
+ int id,
+ void **closure)
{
return _cairo_boilerplate_svg_create_surface (name, content,
CAIRO_SVG_VERSION_1_2,
@@ -143,10 +143,10 @@ _cairo_boilerplate_svg12_create_surface (const char *name,
}
static cairo_status_t
-_cairo_boilerplate_svg_finish_surface (cairo_surface_t *surface)
+_cairo_boilerplate_svg_finish_surface (cairo_surface_t *surface)
{
svg_target_closure_t *ptc = cairo_surface_get_user_data (surface,
- &svg_closure_key);
+ &svg_closure_key);
cairo_status_t status;
/* Both surface and ptc->target were originally created at the
@@ -187,10 +187,11 @@ _cairo_boilerplate_svg_finish_surface (cairo_surface_t *surface)
}
static cairo_status_t
-_cairo_boilerplate_svg_surface_write_to_png (cairo_surface_t *surface, const char *filename)
+_cairo_boilerplate_svg_surface_write_to_png (cairo_surface_t *surface,
+ const char *filename)
{
svg_target_closure_t *ptc = cairo_surface_get_user_data (surface,
- &svg_closure_key);
+ &svg_closure_key);
char command[4096];
int exitstatus;
@@ -219,9 +220,9 @@ _cairo_boilerplate_svg_convert_to_image (cairo_surface_t *surface)
static cairo_surface_t *
_cairo_boilerplate_svg_get_image_surface (cairo_surface_t *surface,
- int page,
- int width,
- int height)
+ int page,
+ int width,
+ int height)
{
cairo_surface_t *image;
@@ -252,7 +253,7 @@ _cairo_boilerplate_svg_cleanup (void *closure)
static void
_cairo_boilerplate_svg_force_fallbacks (cairo_surface_t *abstract_surface,
- unsigned int flags)
+ unsigned int flags)
{
svg_target_closure_t *ptc = cairo_surface_get_user_data (abstract_surface,
&svg_closure_key);
diff --git a/boilerplate/cairo-boilerplate-system.c b/boilerplate/cairo-boilerplate-system.c
index f13bd14..ec23341 100644
--- a/boilerplate/cairo-boilerplate-system.c
+++ b/boilerplate/cairo-boilerplate-system.c
@@ -54,7 +54,8 @@ xmalloc (size_t size)
}
void *
-xcalloc (size_t nmemb, size_t size)
+xcalloc (size_t nmemb,
+ size_t size)
{
void *buf;
@@ -71,7 +72,8 @@ xcalloc (size_t nmemb, size_t size)
}
void *
-xrealloc (void *buf, size_t size)
+xrealloc (void *buf,
+ size_t size)
{
buf = realloc (buf, size);
if (buf == NULL && size != 0) {
@@ -83,7 +85,9 @@ xrealloc (void *buf, size_t size)
}
void
-xasprintf (char **strp, const char *fmt, ...)
+xasprintf (char **strp,
+ const char *fmt,
+ ...)
{
#ifdef HAVE_VASPRINTF
va_list va;
diff --git a/boilerplate/cairo-boilerplate-system.h b/boilerplate/cairo-boilerplate-system.h
index 8c2dbe8..2816567 100644
--- a/boilerplate/cairo-boilerplate-system.h
+++ b/boilerplate/cairo-boilerplate-system.h
@@ -34,15 +34,19 @@ xmalloc (size_t size);
#define xcalloc cairo_boilerplate_xcalloc
void *
-xcalloc (size_t nmemb, size_t size);
+xcalloc (size_t nmemb,
+ size_t size);
#define xrealloc cairo_boilerplate_xrealloc
void *
-xrealloc (void *buf, size_t size);
+xrealloc (void *buf,
+ size_t size);
#define xasprintf cairo_boilerplate_xasprintf
void
-xasprintf (char **strp, const char *fmt, ...) CAIRO_BOILERPLATE_PRINTF_FORMAT(2, 3);
+xasprintf (char **strp,
+ const char *fmt,
+ ...) CAIRO_BOILERPLATE_PRINTF_FORMAT(2, 3);
#define xunlink cairo_boilerplate_xunlink
void
diff --git a/boilerplate/cairo-boilerplate-test-surfaces.c b/boilerplate/cairo-boilerplate-test-surfaces.c
index ace6dcc..d3572ec 100644
--- a/boilerplate/cairo-boilerplate-test-surfaces.c
+++ b/boilerplate/cairo-boilerplate-test-surfaces.c
@@ -43,15 +43,15 @@
#endif
static cairo_surface_t *
-_cairo_boilerplate_test_fallback_create_surface (const char *name,
- cairo_content_t content,
- double width,
- double height,
- double max_width,
- double max_height,
- cairo_boilerplate_mode_t mode,
- int id,
- void **closure)
+_cairo_boilerplate_test_fallback_create_surface (const char *name,
+ cairo_content_t content,
+ double width,
+ double height,
+ double max_width,
+ double max_height,
+ cairo_boilerplate_mode_t mode,
+ int id,
+ void **closure)
{
*closure = NULL;
return _cairo_test_fallback_surface_create (content,
@@ -59,15 +59,15 @@ _cairo_boilerplate_test_fallback_create_surface (const char *name,
}
static cairo_surface_t *
-_cairo_boilerplate_test_fallback16_create_surface (const char *name,
- cairo_content_t content,
- double width,
- double height,
- double max_width,
- double max_height,
- cairo_boilerplate_mode_t mode,
- int id,
- void **closure)
+_cairo_boilerplate_test_fallback16_create_surface (const char *name,
+ cairo_content_t content,
+ double width,
+ double height,
+ double max_width,
+ double max_height,
+ cairo_boilerplate_mode_t mode,
+ int id,
+ void **closure)
{
*closure = NULL;
return _cairo_test_fallback16_surface_create (content,
@@ -76,15 +76,15 @@ _cairo_boilerplate_test_fallback16_create_surface (const char *name,
#if CAIRO_HAS_TEST_NULL_SURFACE
static cairo_surface_t *
-_cairo_boilerplate_test_null_create_surface (const char *name,
- cairo_content_t content,
- double width,
- double height,
- double max_width,
- double max_height,
- cairo_boilerplate_mode_t mode,
- int id,
- void **closure)
+_cairo_boilerplate_test_null_create_surface (const char *name,
+ cairo_content_t content,
+ double width,
+ double height,
+ double max_width,
+ double max_height,
+ cairo_boilerplate_mode_t mode,
+ int id,
+ void **closure)
{
*closure = NULL;
return _cairo_test_null_surface_create (content);
@@ -99,15 +99,15 @@ typedef struct {
} test_paginated_closure_t;
static cairo_surface_t *
-_cairo_boilerplate_test_paginated_create_surface (const char *name,
- cairo_content_t content,
- double width,
- double height,
- double max_width,
- double max_height,
- cairo_boilerplate_mode_t mode,
- int id,
- void **closure)
+_cairo_boilerplate_test_paginated_create_surface (const char *name,
+ cairo_content_t content,
+ double width,
+ double height,
+ double max_width,
+ double max_height,
+ cairo_boilerplate_mode_t mode,
+ int id,
+ void **closure)
{
test_paginated_closure_t *tpc;
cairo_format_t format;
@@ -152,8 +152,8 @@ _cairo_boilerplate_test_paginated_create_surface (const char *name,
* tested.
*/
static cairo_status_t
-_cairo_boilerplate_test_paginated_surface_write_to_png (cairo_surface_t *surface,
- const char *filename)
+_cairo_boilerplate_test_paginated_surface_write_to_png (cairo_surface_t *surface,
+ const char *filename)
{
test_paginated_closure_t *tpc;
cairo_status_t status;
@@ -170,9 +170,9 @@ _cairo_boilerplate_test_paginated_surface_write_to_png (cairo_surface_t *surface
static cairo_surface_t *
_cairo_boilerplate_test_paginated_get_image_surface (cairo_surface_t *surface,
- int page,
- int width,
- int height)
+ int page,
+ int width,
+ int height)
{
test_paginated_closure_t *tpc;
cairo_status_t status;
@@ -203,15 +203,15 @@ _cairo_boilerplate_test_paginated_cleanup (void *closure)
#if CAIRO_HAS_TEST_WRAPPING_SURFACE
static cairo_surface_t *
-_cairo_boilerplate_test_wrapping_create_surface (const char *name,
- cairo_content_t content,
- double width,
- double height,
- double max_width,
- double max_height,
- cairo_boilerplate_mode_t mode,
- int id,
- void **closure)
+_cairo_boilerplate_test_wrapping_create_surface (const char *name,
+ cairo_content_t content,
+ double width,
+ double height,
+ double max_width,
+ double max_height,
+ cairo_boilerplate_mode_t mode,
+ int id,
+ void **closure)
{
cairo_surface_t *target;
cairo_surface_t *surface;
diff --git a/boilerplate/cairo-boilerplate-vg.c b/boilerplate/cairo-boilerplate-vg.c
index 42a4732..9803dcc 100644
--- a/boilerplate/cairo-boilerplate-vg.c
+++ b/boilerplate/cairo-boilerplate-vg.c
@@ -71,15 +71,15 @@ _cairo_boilerplate_vg_cleanup_glx (void *closure)
}
static cairo_surface_t *
-_cairo_boilerplate_vg_create_surface_glx (const char *name,
- cairo_content_t content,
- double width,
- double height,
- double max_width,
- double max_height,
- cairo_boilerplate_mode_t mode,
- int id,
- void **closure)
+_cairo_boilerplate_vg_create_surface_glx (const char *name,
+ cairo_content_t content,
+ double width,
+ double height,
+ double max_width,
+ double max_height,
+ cairo_boilerplate_mode_t mode,
+ int id,
+ void **closure)
{
int rgba_attribs[] = {
GLX_RGBA,
@@ -200,15 +200,15 @@ _cairo_boilerplate_vg_cleanup_egl (void *closure)
}
static cairo_surface_t *
-_cairo_boilerplate_vg_create_surface_egl (const char *name,
- cairo_content_t content,
- double width,
- double height,
- double max_width,
- double max_height,
- cairo_boilerplate_mode_t mode,
- int id,
- void **closure)
+_cairo_boilerplate_vg_create_surface_egl (const char *name,
+ cairo_content_t content,
+ double width,
+ double height,
+ double max_width,
+ double max_height,
+ cairo_boilerplate_mode_t mode,
+ int id,
+ void **closure)
{
int rgba_attribs[] = {
EGL_RED_SIZE, 8,
diff --git a/boilerplate/cairo-boilerplate-wgl.c b/boilerplate/cairo-boilerplate-wgl.c
index 830fc13..35e317e 100644
--- a/boilerplate/cairo-boilerplate-wgl.c
+++ b/boilerplate/cairo-boilerplate-wgl.c
@@ -64,7 +64,9 @@ _cairo_boilerplate_wgl_cleanup (void *closure)
}
static void
-_cairo_boilerplate_wgl_create_window (int width, int height, wgl_target_closure_t *wgltc)
+_cairo_boilerplate_wgl_create_window (int width,
+ int height,
+ wgl_target_closure_t *wgltc)
{
WNDCLASSEXA wincl;
PIXELFORMATDESCRIPTOR pfd;
@@ -101,14 +103,14 @@ _cairo_boilerplate_wgl_create_window (int width, int height, wgl_target_closure
static cairo_surface_t *
_cairo_boilerplate_wgl_create_surface (const char *name,
- cairo_content_t content,
- double width,
- double height,
- double max_width,
- double max_height,
- cairo_boilerplate_mode_t mode,
- int id,
- void **closure)
+ cairo_content_t content,
+ double width,
+ double height,
+ double max_width,
+ double max_height,
+ cairo_boilerplate_mode_t mode,
+ int id,
+ void **closure)
{
wgl_target_closure_t *wgltc;
cairo_surface_t *surface;
@@ -120,32 +122,32 @@ _cairo_boilerplate_wgl_create_surface (const char *name,
_cairo_boilerplate_wgl_create_window(0, 0, wgltc);
if (width == 0)
- width = 1;
+ width = 1;
if (height == 0)
- height = 1;
+ height = 1;
wgltc->surface = surface = cairo_gl_surface_create (wgltc->device,
content,
- ceil (width),
+ ceil (width),
ceil (height));
if (cairo_surface_status (surface)) {
- _cairo_boilerplate_wgl_cleanup (wgltc);
- return NULL;
+ _cairo_boilerplate_wgl_cleanup (wgltc);
+ return NULL;
}
return surface;
}
static cairo_surface_t *
-_cairo_boilerplate_wgl_for_create_window (const char *name,
- cairo_content_t content,
- double width,
- double height,
- double max_width,
- double max_height,
- cairo_boilerplate_mode_t mode,
- int id,
- void **closure)
+_cairo_boilerplate_wgl_for_create_window (const char *name,
+ cairo_content_t content,
+ double width,
+ double height,
+ double max_width,
+ double max_height,
+ cairo_boilerplate_mode_t mode,
+ int id,
+ void **closure)
{
wgl_target_closure_t *wgltc;
cairo_surface_t *surface;
@@ -158,19 +160,19 @@ _cairo_boilerplate_wgl_for_create_window (const char *name,
wgltc->surface = surface = cairo_gl_surface_create_for_dc (wgltc->device,
wgltc->dc,
- ceil (width),
+ ceil (width),
ceil (height));
if (cairo_surface_status (surface)) {
- _cairo_boilerplate_wgl_cleanup (wgltc);
- return NULL;
+ _cairo_boilerplate_wgl_cleanup (wgltc);
+ return NULL;
}
return surface;
}
static cairo_status_t
-_cairo_boilerplate_wgl_finish_window (cairo_surface_t *surface)
+_cairo_boilerplate_wgl_finish_window (cairo_surface_t *surface)
{
wgl_target_closure_t *wgltc = cairo_surface_get_user_data (surface,
&gl_closure_key);
@@ -198,7 +200,7 @@ _cairo_boilerplate_wgl_synchronize (void *closure)
wgl_target_closure_t *wgltc = closure;
if (cairo_device_acquire (wgltc->device))
- return;
+ return;
glFinish ();
diff --git a/boilerplate/cairo-boilerplate-win32-printing.c b/boilerplate/cairo-boilerplate-win32-printing.c
index 4aeeb24..e150995 100644
--- a/boilerplate/cairo-boilerplate-win32-printing.c
+++ b/boilerplate/cairo-boilerplate-win32-printing.c
@@ -23,7 +23,7 @@
* IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
* Authors: Carl D. Worth <cworth at cworth.org>
- * Adrian Johnson <ajohnson at redneon.com>
+ * Adrian Johnson <ajohnson at redneon.com>
*/
/* We require Windows 2000 features such as GetDefaultPrinter() */
@@ -160,15 +160,15 @@ create_printer_dc (win32_target_closure_t *ptc)
}
static cairo_surface_t *
-_cairo_boilerplate_win32_printing_create_surface (const char *name,
- cairo_content_t content,
- double width,
- double height,
- double max_width,
- double max_height,
- cairo_boilerplate_mode_t mode,
- int id,
- void **closure)
+_cairo_boilerplate_win32_printing_create_surface (const char *name,
+ cairo_content_t content,
+ double width,
+ double height,
+ double max_width,
+ double max_height,
+ cairo_boilerplate_mode_t mode,
+ int id,
+ void **closure)
{
win32_target_closure_t *ptc;
cairo_surface_t *surface;
@@ -232,7 +232,8 @@ _cairo_boilerplate_win32_printing_create_surface (const char *name,
}
static cairo_status_t
-_cairo_boilerplate_win32_printing_surface_write_to_png (cairo_surface_t *surface, const char *filename)
+_cairo_boilerplate_win32_printing_surface_write_to_png (cairo_surface_t *surface,
+ const char *filename)
{
win32_target_closure_t *ptc = cairo_surface_get_user_data (surface, &win32_closure_key);
char command[4096];
@@ -300,9 +301,9 @@ _cairo_boilerplate_win32_printing_surface_write_to_png (cairo_surface_t *surface
static cairo_surface_t *
_cairo_boilerplate_win32_printing_get_image_surface (cairo_surface_t *surface,
- int page,
- int width,
- int height)
+ int page,
+ int width,
+ int height)
{
win32_target_closure_t *ptc = cairo_surface_get_user_data (surface,
&win32_closure_key);
diff --git a/boilerplate/cairo-boilerplate-win32.c b/boilerplate/cairo-boilerplate-win32.c
index 50ec90a..72176c8 100644
--- a/boilerplate/cairo-boilerplate-win32.c
+++ b/boilerplate/cairo-boilerplate-win32.c
@@ -29,15 +29,15 @@
#include <cairo-win32.h>
static cairo_surface_t *
-_cairo_boilerplate_win32_create_surface (const char *name,
- cairo_content_t content,
- double width,
- double height,
- double max_width,
- double max_height,
- cairo_boilerplate_mode_t mode,
- int id,
- void **closure)
+_cairo_boilerplate_win32_create_surface (const char *name,
+ cairo_content_t content,
+ double width,
+ double height,
+ double max_width,
+ double max_height,
+ cairo_boilerplate_mode_t mode,
+ int id,
+ void **closure)
{
cairo_format_t format;
diff --git a/boilerplate/cairo-boilerplate-xcb.c b/boilerplate/cairo-boilerplate-xcb.c
index 7f06a4e..b16b199 100644
--- a/boilerplate/cairo-boilerplate-xcb.c
+++ b/boilerplate/cairo-boilerplate-xcb.c
@@ -70,7 +70,9 @@ _cairo_boilerplate_xcb_synchronize (void *closure)
}
static xcb_render_pictforminfo_t *
-find_depth (xcb_connection_t *connection, int depth, void **formats_out)
+find_depth (xcb_connection_t *connection,
+ int depth,
+ void **formats_out)
{
xcb_render_query_pict_formats_reply_t *formats;
xcb_render_query_pict_formats_cookie_t cookie;
@@ -108,8 +110,8 @@ _cairo_boilerplate_xcb_create_surface (const char *name,
double height,
double max_width,
double max_height,
- cairo_boilerplate_mode_t mode,
- int id,
+ cairo_boilerplate_mode_t mode,
+ int id,
void **closure)
{
xcb_screen_t *root;
@@ -194,7 +196,8 @@ _cairo_boilerplate_xcb_create_surface (const char *name,
}
static xcb_visualtype_t *
-lookup_visual (xcb_screen_t *s, xcb_visualid_t visual)
+lookup_visual (xcb_screen_t *s,
+ xcb_visualid_t visual)
{
xcb_depth_iterator_t d;
@@ -211,15 +214,15 @@ lookup_visual (xcb_screen_t *s, xcb_visualid_t visual)
}
static cairo_surface_t *
-_cairo_boilerplate_xcb_create_window (const char *name,
- cairo_content_t content,
- double width,
- double height,
- double max_width,
- double max_height,
- cairo_boilerplate_mode_t mode,
- int id,
- void **closure)
+_cairo_boilerplate_xcb_create_window (const char *name,
+ cairo_content_t content,
+ double width,
+ double height,
+ double max_width,
+ double max_height,
+ cairo_boilerplate_mode_t mode,
+ int id,
+ void **closure)
{
xcb_target_closure_t *xtc;
xcb_connection_t *c;
@@ -282,15 +285,15 @@ _cairo_boilerplate_xcb_create_window (const char *name,
}
static cairo_surface_t *
-_cairo_boilerplate_xcb_create_window_db (const char *name,
- cairo_content_t content,
- double width,
- double height,
- double max_width,
- double max_height,
- cairo_boilerplate_mode_t mode,
- int id,
- void **closure)
+_cairo_boilerplate_xcb_create_window_db (const char *name,
+ cairo_content_t content,
+ double width,
+ double height,
+ double max_width,
+ double max_height,
+ cairo_boilerplate_mode_t mode,
+ int id,
+ void **closure)
{
xcb_target_closure_t *xtc;
xcb_connection_t *c;
@@ -354,15 +357,15 @@ _cairo_boilerplate_xcb_create_window_db (const char *name,
}
static cairo_surface_t *
-_cairo_boilerplate_xcb_create_render_0_0 (const char *name,
- cairo_content_t content,
- double width,
- double height,
- double max_width,
- double max_height,
- cairo_boilerplate_mode_t mode,
- int id,
- void **closure)
+_cairo_boilerplate_xcb_create_render_0_0 (const char *name,
+ cairo_content_t content,
+ double width,
+ double height,
+ double max_width,
+ double max_height,
+ cairo_boilerplate_mode_t mode,
+ int id,
+ void **closure)
{
xcb_screen_t *root;
xcb_target_closure_t *xtc;
@@ -463,15 +466,15 @@ _cairo_boilerplate_xcb_create_render_0_0 (const char *name,
}
static cairo_surface_t *
-_cairo_boilerplate_xcb_create_fallback (const char *name,
- cairo_content_t content,
- double width,
- double height,
- double max_width,
- double max_height,
- cairo_boilerplate_mode_t mode,
- int id,
- void **closure)
+_cairo_boilerplate_xcb_create_fallback (const char *name,
+ cairo_content_t content,
+ double width,
+ double height,
+ double max_width,
+ double max_height,
+ cairo_boilerplate_mode_t mode,
+ int id,
+ void **closure)
{
xcb_target_closure_t *xtc;
xcb_connection_t *c;
@@ -553,7 +556,7 @@ _cairo_boilerplate_xcb_create_fallback (const char *name,
}
static cairo_status_t
-_cairo_boilerplate_xcb_finish_surface (cairo_surface_t *surface)
+_cairo_boilerplate_xcb_finish_surface (cairo_surface_t *surface)
{
xcb_target_closure_t *xtc = cairo_surface_get_user_data (surface,
&xcb_closure_key);
diff --git a/boilerplate/cairo-boilerplate-xlib.c b/boilerplate/cairo-boilerplate-xlib.c
index 8c41283..906b554 100644
--- a/boilerplate/cairo-boilerplate-xlib.c
+++ b/boilerplate/cairo-boilerplate-xlib.c
@@ -69,10 +69,10 @@ _cairo_boilerplate_xlib_synchronize (void *closure)
}
static cairo_bool_t
-_cairo_boilerplate_xlib_check_screen_size (Display *dpy,
- int screen,
- int width,
- int height)
+_cairo_boilerplate_xlib_check_screen_size (Display *dpy,
+ int screen,
+ int width,
+ int height)
{
Screen *scr = XScreenOfDisplay (dpy, screen);
return width <= WidthOfScreen (scr) && height <= HeightOfScreen (scr);
@@ -91,11 +91,11 @@ _cairo_boilerplate_xlib_check_screen_size (Display *dpy,
* For obvious reasons, we don't use XSynchronize.
*/
static cairo_surface_t *
-_cairo_boilerplate_xlib_test_create_surface (Display *dpy,
- cairo_content_t content,
- int width,
- int height,
- xlib_target_closure_t *xtc)
+_cairo_boilerplate_xlib_test_create_surface (Display *dpy,
+ cairo_content_t content,
+ int width,
+ int height,
+ xlib_target_closure_t *xtc)
{
XRenderPictFormat *xrender_format;
@@ -111,7 +111,7 @@ _cairo_boilerplate_xlib_test_create_surface (Display *dpy,
* for each test even if the server does have the Render
* extension. That would probably be through another
* cairo_boilerplate_target which would use an extended version of
- * cairo_test_xlib_disable_render. */
+ * cairo_test_xlib_disable_render. */
switch (content) {
case CAIRO_CONTENT_COLOR_ALPHA:
xrender_format = XRenderFindStandardFormat (dpy, PictStandardARGB32);
@@ -140,11 +140,11 @@ _cairo_boilerplate_xlib_test_create_surface (Display *dpy,
}
static cairo_surface_t *
-_cairo_boilerplate_xlib_perf_create_surface (Display *dpy,
- cairo_content_t content,
- int width,
- int height,
- xlib_target_closure_t *xtc)
+_cairo_boilerplate_xlib_perf_create_surface (Display *dpy,
+ cairo_content_t content,
+ int width,
+ int height,
+ xlib_target_closure_t *xtc)
{
XSetWindowAttributes attr;
XRenderPictFormat *xrender_format;
@@ -165,8 +165,8 @@ _cairo_boilerplate_xlib_perf_create_surface (Display *dpy,
case CAIRO_CONTENT_COLOR:
if (! _cairo_boilerplate_xlib_check_screen_size (dpy,
- DefaultScreen (dpy),
- width, height)) {
+ DefaultScreen (dpy),
+ width, height)) {
CAIRO_BOILERPLATE_DEBUG (("Surface is larger than the Screen.\n"));
return NULL;
}
@@ -199,15 +199,15 @@ _cairo_boilerplate_xlib_perf_create_surface (Display *dpy,
}
static cairo_surface_t *
-_cairo_boilerplate_xlib_create_surface (const char *name,
- cairo_content_t content,
- double width,
- double height,
- double max_width,
- double max_height,
- cairo_boilerplate_mode_t mode,
- int id,
- void **closure)
+_cairo_boilerplate_xlib_create_surface (const char *name,
+ cairo_content_t content,
+ double width,
+ double height,
+ double max_width,
+ double max_height,
+ cairo_boilerplate_mode_t mode,
+ int id,
+ void **closure)
{
xlib_target_closure_t *xtc;
Display *dpy;
@@ -242,15 +242,15 @@ _cairo_boilerplate_xlib_create_surface (const char *name,
}
static cairo_surface_t *
-_cairo_boilerplate_xlib_window_create_surface (const char *name,
+_cairo_boilerplate_xlib_window_create_surface (const char *name,
cairo_content_t content,
- double width,
- double height,
- double max_width,
- double max_height,
- cairo_boilerplate_mode_t mode,
- int id,
- void **closure)
+ double width,
+ double height,
+ double max_width,
+ double max_height,
+ cairo_boilerplate_mode_t mode,
+ int id,
+ void **closure)
{
xlib_target_closure_t *xtc;
Display *dpy;
@@ -293,7 +293,7 @@ _cairo_boilerplate_xlib_window_create_surface (const char *name,
screen = DefaultScreen (dpy);
if (! _cairo_boilerplate_xlib_check_screen_size (dpy, screen,
- width, height)) {
+ width, height)) {
CAIRO_BOILERPLATE_DEBUG (("Surface is larger than the Screen.\n"));
XCloseDisplay (dpy);
free (xtc);
@@ -384,15 +384,15 @@ cairo_boilerplate_xlib_surface_disable_render (cairo_surface_t *abstract_surface
* cairo-xlib-surface.c
*/
static cairo_surface_t *
-_cairo_boilerplate_xlib_fallback_create_surface (const char *name,
- cairo_content_t content,
- double width,
- double height,
- double max_width,
- double max_height,
- cairo_boilerplate_mode_t mode,
- int id,
- void **closure)
+_cairo_boilerplate_xlib_fallback_create_surface (const char *name,
+ cairo_content_t content,
+ double width,
+ double height,
+ double max_width,
+ double max_height,
+ cairo_boilerplate_mode_t mode,
+ int id,
+ void **closure)
{
xlib_target_closure_t *xtc;
Display *dpy;
@@ -435,7 +435,7 @@ _cairo_boilerplate_xlib_fallback_create_surface (const char *name,
screen = DefaultScreen (dpy);
if (! _cairo_boilerplate_xlib_check_screen_size (dpy, screen,
- width, height)) {
+ width, height)) {
CAIRO_BOILERPLATE_DEBUG (("Surface is larger than the Screen.\n"));
XCloseDisplay (dpy);
free (xtc);
diff --git a/boilerplate/cairo-boilerplate.c b/boilerplate/cairo-boilerplate.c
index 3b97ded..7bbc1e6 100644
--- a/boilerplate/cairo-boilerplate.c
+++ b/boilerplate/cairo-boilerplate.c
@@ -123,15 +123,15 @@ cairo_boilerplate_format_from_content (cairo_content_t content)
}
static cairo_surface_t *
-_cairo_boilerplate_image_create_surface (const char *name,
- cairo_content_t content,
- double width,
- double height,
- double max_width,
- double max_height,
- cairo_boilerplate_mode_t mode,
- int id,
- void **closure)
+_cairo_boilerplate_image_create_surface (const char *name,
+ cairo_content_t content,
+ double width,
+ double height,
+ double max_width,
+ double max_height,
+ cairo_boilerplate_mode_t mode,
+ int id,
+ void **closure)
{
cairo_format_t format;
@@ -150,15 +150,15 @@ _cairo_boilerplate_image_create_surface (const char *name,
}
static cairo_surface_t *
-_cairo_boilerplate_image16_create_surface (const char *name,
- cairo_content_t content,
- double width,
- double height,
- double max_width,
- double max_height,
- cairo_boilerplate_mode_t mode,
- int id,
- void **closure)
+_cairo_boilerplate_image16_create_surface (const char *name,
+ cairo_content_t content,
+ double width,
+ double height,
+ double max_width,
+ double max_height,
+ cairo_boilerplate_mode_t mode,
+ int id,
+ void **closure)
{
*closure = NULL;
@@ -168,15 +168,15 @@ _cairo_boilerplate_image16_create_surface (const char *name,
#if CAIRO_HAS_RECORDING_SURFACE
static cairo_surface_t *
-_cairo_boilerplate_recording_create_surface (const char *name,
- cairo_content_t content,
- double width,
- double height,
- double max_width,
- double max_height,
- cairo_boilerplate_mode_t mode,
- int id,
- void **closure)
+_cairo_boilerplate_recording_create_surface (const char *name,
+ cairo_content_t content,
+ double width,
+ double height,
+ double max_width,
+ double max_height,
+ cairo_boilerplate_mode_t mode,
+ int id,
+ void **closure)
{
cairo_rectangle_t extents;
@@ -199,9 +199,9 @@ const cairo_user_data_key_t cairo_boilerplate_output_basename_key;
cairo_surface_t *
_cairo_boilerplate_get_image_surface (cairo_surface_t *src,
- int page,
- int width,
- int height)
+ int page,
+ int width,
+ int height)
{
cairo_surface_t *surface, *image;
cairo_t *cr;
@@ -228,7 +228,7 @@ _cairo_boilerplate_get_image_surface (cairo_surface_t *src,
cairo_device_t *ctx;
char *filename;
- cairo_surface_destroy (surface);
+ cairo_surface_destroy (surface);
xasprintf (&filename, "%s.out.trace", test_name);
ctx = cairo_script_create (filename);
@@ -257,10 +257,10 @@ _cairo_boilerplate_get_image_surface (cairo_surface_t *src,
}
cairo_surface_t *
-cairo_boilerplate_get_image_surface_from_png (const char *filename,
- int width,
- int height,
- cairo_bool_t flatten)
+cairo_boilerplate_get_image_surface_from_png (const char *filename,
+ int width,
+ int height,
+ cairo_bool_t flatten)
{
cairo_surface_t *surface;
@@ -398,7 +398,7 @@ probe_target (const cairo_boilerplate_target_t *target)
void
_cairo_boilerplate_register_backend (const cairo_boilerplate_target_t *targets,
- unsigned int count)
+ unsigned int count)
{
targets += count;
while (count--) {
@@ -417,8 +417,8 @@ _cairo_boilerplate_register_backend (const cairo_boilerplate_target_t *targets,
static cairo_bool_t
_cairo_boilerplate_target_matches_name (const cairo_boilerplate_target_t *target,
- const char *tname,
- const char *end)
+ const char *tname,
+ const char *end)
{
char const *content_name;
const char *content_start = strpbrk (tname, ".");
@@ -455,7 +455,8 @@ _cairo_boilerplate_target_matches_name (const cairo_boilerplate_target_t *target
}
const cairo_boilerplate_target_t **
-cairo_boilerplate_get_targets (int *pnum_targets, cairo_bool_t *plimited_targets)
+cairo_boilerplate_get_targets (int *pnum_targets,
+ cairo_bool_t *plimited_targets)
{
size_t i, num_targets;
cairo_bool_t limited_targets = FALSE;
@@ -477,7 +478,7 @@ cairo_boilerplate_get_targets (int *pnum_targets, cairo_bool_t *plimited_targets
int found = 0;
const char *end = strpbrk (tname, " \t\r\n;:,");
if (!end)
- end = tname + strlen (tname);
+ end = tname + strlen (tname);
if (end == tname) {
tname = end + 1;
@@ -551,7 +552,7 @@ cairo_boilerplate_get_targets (int *pnum_targets, cairo_bool_t *plimited_targets
int j;
const char *end = strpbrk (tname, " \t\r\n;:,");
if (!end)
- end = tname + strlen (tname);
+ end = tname + strlen (tname);
if (end == tname) {
tname = end + 1;
@@ -604,8 +605,8 @@ cairo_boilerplate_get_image_target (cairo_content_t content)
}
const cairo_boilerplate_target_t *
-cairo_boilerplate_get_target_by_name (const char *name,
- cairo_content_t content)
+cairo_boilerplate_get_target_by_name (const char *name,
+ cairo_content_t content)
{
struct cairo_boilerplate_target_list *list;
@@ -666,7 +667,7 @@ cairo_boilerplate_surface_create_in_error (cairo_status_t status)
void
cairo_boilerplate_scaled_font_set_max_glyphs_cached (cairo_scaled_font_t *scaled_font,
- int max_glyphs)
+ int max_glyphs)
{
/* XXX CAIRO_DEBUG */
}
@@ -701,9 +702,9 @@ any2ppm_daemon_exists (void)
#endif
FILE *
-cairo_boilerplate_open_any2ppm (const char *filename,
- int page,
- unsigned int flags)
+cairo_boilerplate_open_any2ppm (const char *filename,
+ int page,
+ unsigned int flags)
{
char command[4096];
#if HAS_DAEMON
@@ -747,7 +748,9 @@ POPEN:
}
static cairo_bool_t
-freadn (unsigned char *buf, int len, FILE *file)
+freadn (unsigned char *buf,
+ int len,
+ FILE *file)
{
int ret;
@@ -827,7 +830,8 @@ FAIL:
}
cairo_surface_t *
-cairo_boilerplate_convert_to_image (const char *filename, int page)
+cairo_boilerplate_convert_to_image (const char *filename,
+ int page)
{
FILE *file;
unsigned int flags = 0;
diff --git a/boilerplate/cairo-boilerplate.h b/boilerplate/cairo-boilerplate.h
index 12bcd79..38df3b9 100644
--- a/boilerplate/cairo-boilerplate.h
+++ b/boilerplate/cairo-boilerplate.h
@@ -122,20 +122,20 @@ typedef cairo_surface_t *
double height,
double max_width,
double max_height,
- cairo_boilerplate_mode_t mode,
- int id,
+ cairo_boilerplate_mode_t mode,
+ int id,
void **closure);
typedef void
(*cairo_boilerplate_force_fallbacks_t) (cairo_surface_t *surface,
- unsigned int flags);
+ unsigned int flags);
typedef cairo_status_t
(*cairo_boilerplate_finish_surface_t) (cairo_surface_t *surface);
typedef cairo_surface_t *
(*cairo_boilerplate_get_image_surface_t) (cairo_surface_t *surface,
- int page,
+ int page,
int width,
int height);
@@ -153,17 +153,17 @@ typedef struct _cairo_boilerplate_target {
const char *name;
const char *basename;
const char *file_extension;
- const char *reference_target;
+ const char *reference_target;
cairo_surface_type_t expected_type;
cairo_content_t content;
unsigned int error_tolerance;
const char *probe; /* runtime dl check */
cairo_boilerplate_create_surface_t create_surface;
- cairo_boilerplate_force_fallbacks_t force_fallbacks;
+ cairo_boilerplate_force_fallbacks_t force_fallbacks;
cairo_boilerplate_finish_surface_t finish_surface;
cairo_boilerplate_get_image_surface_t get_image_surface;
cairo_boilerplate_write_to_png_t write_to_png;
- cairo_boilerplate_cleanup_t cleanup;
+ cairo_boilerplate_cleanup_t cleanup;
cairo_boilerplate_wait_t synchronize;
cairo_bool_t is_measurable;
cairo_bool_t is_vector;
@@ -174,25 +174,26 @@ const cairo_boilerplate_target_t *
cairo_boilerplate_get_image_target (cairo_content_t content);
const cairo_boilerplate_target_t *
-cairo_boilerplate_get_target_by_name (const char *name,
- cairo_content_t content);
+cairo_boilerplate_get_target_by_name (const char *name,
+ cairo_content_t content);
const cairo_boilerplate_target_t **
-cairo_boilerplate_get_targets (int *num_targets, cairo_bool_t *limited_targets);
+cairo_boilerplate_get_targets (int *num_targets,
+ cairo_bool_t *limited_targets);
void
cairo_boilerplate_free_targets (const cairo_boilerplate_target_t **targets);
cairo_surface_t *
_cairo_boilerplate_get_image_surface (cairo_surface_t *src,
- int page,
- int width,
- int height);
+ int page,
+ int width,
+ int height);
cairo_surface_t *
-cairo_boilerplate_get_image_surface_from_png (const char *filename,
- int width,
- int height,
- cairo_bool_t flatten);
+cairo_boilerplate_get_image_surface_from_png (const char *filename,
+ int width,
+ int height,
+ cairo_bool_t flatten);
cairo_surface_t *
cairo_boilerplate_surface_create_in_error (cairo_status_t status);
@@ -202,14 +203,15 @@ enum {
};
FILE *
-cairo_boilerplate_open_any2ppm (const char *filename,
- int page,
- unsigned int flags);
+cairo_boilerplate_open_any2ppm (const char *filename,
+ int page,
+ unsigned int flags);
cairo_surface_t *
cairo_boilerplate_image_surface_create_from_ppm_stream (FILE *file);
cairo_surface_t *
-cairo_boilerplate_convert_to_image (const char *filename, int page);
+cairo_boilerplate_convert_to_image (const char *filename,
+ int page);
int
cairo_boilerplate_version (void);
diff --git a/perf/cairo-perf-chart.c b/perf/cairo-perf-chart.c
index 433491e..70ff353 100644
--- a/perf/cairo-perf-chart.c
+++ b/perf/cairo-perf-chart.c
@@ -24,7 +24,7 @@
* SOFTWARE.
*
* Authors: Carl Worth <cworth at cworth.org>
- * Chris Wilson <chris at chris-wilson.co.uk>
+ * Chris Wilson <chris at chris-wilson.co.uk>
*/
#include "cairo-perf.h"
@@ -72,7 +72,8 @@ to_factor (double x)
}
static int
-_double_cmp (const void *_a, const void *_b)
+_double_cmp (const void *_a,
+ const void *_b)
{
const double *a = _a;
const double *b = _b;
@@ -85,8 +86,10 @@ _double_cmp (const void *_a, const void *_b)
}
static void
-trim_outliers (double *values, int num_values,
- double *min, double *max)
+trim_outliers (double *values,
+ int num_values,
+ double *min,
+ double *max)
{
double q1, q3, iqr;
double outlier_min, outlier_max;
@@ -231,7 +234,10 @@ find_ranges (struct chart *chart)
#define SET_COLOR(C, R, G, B) (C)->red = (R), (C)->green = (G), (C)->blue = (B)
static void
-hsv_to_rgb (double h, double s, double v, struct color *color)
+hsv_to_rgb (double h,
+ double s,
+ double v,
+ struct color *color)
{
double m, n, f;
int i;
@@ -279,7 +285,8 @@ static void set_report_color (struct chart *chart, int report)
}
static void
-test_background (struct chart *c, int test)
+test_background (struct chart *c,
+ int test)
{
double dx, x;
@@ -292,12 +299,15 @@ test_background (struct chart *c, int test)
cairo_set_source_rgba (c->cr, .8, .8, .8, .2);
cairo_rectangle (c->cr, floor (x), 0,
- floor (dx + x) - floor (x), c->height);
+ floor (dx + x) - floor (x), c->height);
cairo_fill (c->cr);
}
static void
-add_chart (struct chart *c, int test, int report, double value)
+add_chart (struct chart *c,
+ int test,
+ int report,
+ double value)
{
double dx, dy, x;
@@ -371,7 +381,9 @@ add_chart (struct chart *c, int test, int report, double value)
}
static void
-add_label (struct chart *c, int test, const char *label)
+add_label (struct chart *c,
+ int test,
+ const char *label)
{
cairo_text_extents_t extents;
double dx, x;
@@ -585,7 +597,8 @@ add_slower_faster_guide (struct chart *c)
}
static void
-cairo_perf_reports_compare (struct chart *chart, cairo_bool_t print)
+cairo_perf_reports_compare (struct chart *chart,
+ cairo_bool_t print)
{
test_report_t **tests, *min_test;
double test_time, best_time;
@@ -797,7 +810,8 @@ add_legend (struct chart *chart)
}
int
-main (int argc, const char *argv[])
+main (int argc,
+ const char *argv[])
{
cairo_surface_t *surface;
struct chart chart;
@@ -826,7 +840,7 @@ main (int argc, const char *argv[])
chart.names[chart.num_reports] = argv[i] + 7;
} else {
cairo_perf_report_load (&chart.reports[chart.num_reports++],
- argv[i],
+ argv[i],
test_report_cmp_name);
}
}
diff --git a/perf/cairo-perf-compare-backends.c b/perf/cairo-perf-compare-backends.c
index 277536e..6d8de26 100644
--- a/perf/cairo-perf-compare-backends.c
+++ b/perf/cairo-perf-compare-backends.c
@@ -24,7 +24,7 @@
* SOFTWARE.
*
* Authors: Carl Worth <cworth at cworth.org>
- * Chris Wilson <chris at chris-wilson.co.uk>
+ * Chris Wilson <chris at chris-wilson.co.uk>
*/
#include "cairo-perf.h"
@@ -50,7 +50,8 @@ typedef struct _cairo_perf_diff_files_args {
} cairo_perf_diff_files_args_t;
static int
-test_diff_cmp (const void *a, const void *b)
+test_diff_cmp (const void *a,
+ const void *b)
{
const test_diff_t *a_diff = a;
const test_diff_t *b_diff = b;
@@ -68,7 +69,9 @@ test_diff_cmp (const void *a, const void *b)
#define CHANGE_BAR_WIDTH 70
static void
-print_change_bar (double change, double max_change, int use_utf)
+print_change_bar (double change,
+ double max_change,
+ int use_utf)
{
int units_per_cell = (int) ceil (max_change / CHANGE_BAR_WIDTH);
static char const *ascii_boxes[8] = {
@@ -113,9 +116,9 @@ print_change_bar (double change, double max_change, int use_utf)
}
static void
-test_diff_print (test_diff_t *diff,
- double max_change,
- cairo_perf_report_options_t *options)
+test_diff_print (test_diff_t *diff,
+ double max_change,
+ cairo_perf_report_options_t *options)
{
int i;
double test_time;
@@ -149,9 +152,9 @@ test_diff_print (test_diff_t *diff,
#define MAX(a,b) ((a) > (b) ? (a) : (b))
static void
-cairo_perf_reports_compare (cairo_perf_report_t *reports,
- int num_reports,
- cairo_perf_report_options_t *options)
+cairo_perf_reports_compare (cairo_perf_report_t *reports,
+ int num_reports,
+ cairo_perf_report_options_t *options)
{
int i;
test_report_t **tests, *min_test;
@@ -309,9 +312,9 @@ usage (const char *argv0)
}
static void
-parse_args(int argc,
- char const **argv,
- cairo_perf_diff_files_args_t *args)
+parse_args (int argc,
+ char const **argv,
+ cairo_perf_diff_files_args_t *args)
{
int i;
@@ -346,7 +349,8 @@ parse_args(int argc,
}
int
-main (int argc, const char *argv[])
+main (int argc,
+ const char *argv[])
{
cairo_perf_diff_files_args_t args = {
NULL, /* filenames */
diff --git a/perf/cairo-perf-diff-files.c b/perf/cairo-perf-diff-files.c
index 056d7ec..43bf9ba 100644
--- a/perf/cairo-perf-diff-files.c
+++ b/perf/cairo-perf-diff-files.c
@@ -49,7 +49,8 @@ typedef struct _cairo_perf_diff_files_args {
} cairo_perf_diff_files_args_t;
static int
-test_diff_cmp_speedup_before_slowdown (const void *a, const void *b)
+test_diff_cmp_speedup_before_slowdown (const void *a,
+ const void *b)
{
const test_diff_t *a_diff = a;
const test_diff_t *b_diff = b;
@@ -83,7 +84,8 @@ test_diff_cmp_speedup_before_slowdown (const void *a, const void *b)
}
static int
-test_diff_cmp (const void *a, const void *b)
+test_diff_cmp (const void *a,
+ const void *b)
{
const test_diff_t *a_diff = a;
const test_diff_t *b_diff = b;
@@ -101,7 +103,9 @@ test_diff_cmp (const void *a, const void *b)
#define CHANGE_BAR_WIDTH 70
static void
-print_change_bar (double change, double max_change, int use_utf)
+print_change_bar (double change,
+ double max_change,
+ int use_utf)
{
int units_per_cell = ceil (max_change / CHANGE_BAR_WIDTH);
static char const *ascii_boxes[8] = {
@@ -146,9 +150,9 @@ print_change_bar (double change, double max_change, int use_utf)
}
static void
-test_diff_print_binary (test_diff_t *diff,
- double max_change,
- cairo_perf_report_options_t *options)
+test_diff_print_binary (test_diff_t *diff,
+ double max_change,
+ cairo_perf_report_options_t *options)
{
printf ("%5s-%-4s %26s-%-3d %6.2f (%.2f %4.2f%%) -> %6.2f (%.2f %4.2f%%): %5.2fx ",
diff->tests[0]->backend, diff->tests[0]->content,
@@ -172,9 +176,9 @@ test_diff_print_binary (test_diff_t *diff,
}
static void
-test_diff_print_multi (test_diff_t *diff,
- double max_change,
- cairo_perf_report_options_t *options)
+test_diff_print_multi (test_diff_t *diff,
+ double max_change,
+ cairo_perf_report_options_t *options)
{
int i;
double test_time;
@@ -205,9 +209,9 @@ test_diff_print_multi (test_diff_t *diff,
#define MAX(a,b) ((a) > (b) ? (a) : (b))
static void
-cairo_perf_reports_compare (cairo_perf_report_t *reports,
- int num_reports,
- cairo_perf_report_options_t *options)
+cairo_perf_reports_compare (cairo_perf_report_t *reports,
+ int num_reports,
+ cairo_perf_report_options_t *options)
{
int i;
test_report_t **tests, *min_test;
@@ -399,9 +403,9 @@ usage (const char *argv0)
}
static void
-parse_args(int argc,
- char const **argv,
- cairo_perf_diff_files_args_t *args)
+parse_args (int argc,
+ char const **argv,
+ cairo_perf_diff_files_args_t *args)
{
int i;
@@ -442,7 +446,8 @@ parse_args(int argc,
}
int
-main (int argc, const char *argv[])
+main (int argc,
+ const char *argv[])
{
cairo_perf_diff_files_args_t args = {
NULL, /* filenames */
diff --git a/perf/cairo-perf-graph-files.c b/perf/cairo-perf-graph-files.c
index 0adfabd..0ac4b7c 100644
--- a/perf/cairo-perf-graph-files.c
+++ b/perf/cairo-perf-graph-files.c
@@ -68,8 +68,8 @@ cases_to_store (test_case_t *cases)
const char *content = NULL;
store = gtk_tree_store_new (CASE_NCOLS,
- G_TYPE_BOOLEAN, /* shown */
- G_TYPE_BOOLEAN, /* inconsistent */
+ G_TYPE_BOOLEAN, /* shown */
+ G_TYPE_BOOLEAN, /* inconsistent */
G_TYPE_STRING, /* backend */
G_TYPE_STRING, /* content */
G_TYPE_STRING, /* name */
@@ -82,7 +82,7 @@ cases_to_store (test_case_t *cases)
if (backend == NULL || strcmp (backend, cases->backend)) {
gtk_tree_store_append (store, &backend_iter, NULL);
gtk_tree_store_set (store, &backend_iter,
- CASE_SHOWN, TRUE,
+ CASE_SHOWN, TRUE,
CASE_BACKEND, cases->backend,
-1);
backend = cases->backend;
@@ -91,7 +91,7 @@ cases_to_store (test_case_t *cases)
if (content == NULL || strcmp (content, cases->content)) {
gtk_tree_store_append (store, &content_iter, &backend_iter);
gtk_tree_store_set (store, &content_iter,
- CASE_SHOWN, TRUE,
+ CASE_SHOWN, TRUE,
CASE_BACKEND, cases->backend,
CASE_CONTENT, cases->content,
-1);
@@ -130,7 +130,9 @@ struct _app_data {
};
static void
-recurse_set_shown (GtkTreeModel *model, GtkTreeIter *parent, gboolean shown)
+recurse_set_shown (GtkTreeModel *model,
+ GtkTreeIter *parent,
+ gboolean shown)
{
GtkTreeIter iter;
@@ -143,7 +145,7 @@ recurse_set_shown (GtkTreeModel *model, GtkTreeIter *parent, gboolean shown)
} else if (shown != c->shown) {
c->shown = shown;
gtk_tree_store_set (GTK_TREE_STORE (model), &iter,
- CASE_SHOWN, shown,
+ CASE_SHOWN, shown,
CASE_INCONSISTENT, FALSE,
-1);
}
@@ -151,7 +153,8 @@ recurse_set_shown (GtkTreeModel *model, GtkTreeIter *parent, gboolean shown)
}
static gboolean
-children_consistent (GtkTreeModel *model, GtkTreeIter *parent)
+children_consistent (GtkTreeModel *model,
+ GtkTreeIter *parent)
{
GtkTreeIter iter;
gboolean first = TRUE;
@@ -161,7 +164,7 @@ children_consistent (GtkTreeModel *model, GtkTreeIter *parent)
gboolean active, inconsistent;
gtk_tree_model_get (model, &iter,
- CASE_INCONSISTENT, &inconsistent,
+ CASE_INCONSISTENT, &inconsistent,
CASE_SHOWN, &active,
-1);
if (inconsistent)
@@ -178,13 +181,14 @@ children_consistent (GtkTreeModel *model, GtkTreeIter *parent)
}
static void
-check_consistent (GtkTreeModel *model, GtkTreeIter *child)
+check_consistent (GtkTreeModel *model,
+ GtkTreeIter *child)
{
GtkTreeIter parent;
if (gtk_tree_model_iter_parent (model, &parent, child)) {
gtk_tree_store_set (GTK_TREE_STORE (model), &parent,
- CASE_INCONSISTENT,
+ CASE_INCONSISTENT,
! children_consistent (model, &parent),
-1);
check_consistent (model, &parent);
@@ -193,8 +197,8 @@ check_consistent (GtkTreeModel *model, GtkTreeIter *child)
static void
show_case_toggled (GtkCellRendererToggle *cell,
- gchar *str,
- struct _app_data *app)
+ gchar *str,
+ struct _app_data *app)
{
GtkTreeModel *model;
GtkTreePath *path;
@@ -229,7 +233,9 @@ show_case_toggled (GtkCellRendererToggle *cell,
}
static gboolean
-git_read (GIOChannel *io, GIOCondition cond, struct _app_data *app)
+git_read (GIOChannel *io,
+ GIOCondition cond,
+ struct _app_data *app)
{
int fd;
@@ -259,7 +265,8 @@ git_read (GIOChannel *io, GIOCondition cond, struct _app_data *app)
}
static void
-do_git (struct _app_data *app, char **argv)
+do_git (struct _app_data *app,
+ char **argv)
{
gint output;
GError *error = NULL;
@@ -294,7 +301,9 @@ do_git (struct _app_data *app, char **argv)
}
static void
-gv_report_selected (GraphView *gv, int i, struct _app_data *app)
+gv_report_selected (GraphView *gv,
+ int i,
+ struct _app_data *app)
{
cairo_perf_report_t *report;
char *hyphen;
@@ -324,9 +333,9 @@ gv_report_selected (GraphView *gv, int i, struct _app_data *app)
}
static GtkWidget *
-window_create (test_case_t *cases,
+window_create (test_case_t *cases,
cairo_perf_report_t *reports,
- int num_reports)
+ int num_reports)
{
GtkWidget *window, *table, *w;
GtkWidget *tv, *sw;
@@ -344,7 +353,7 @@ window_create (test_case_t *cases,
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_title (GTK_WINDOW (window), "Cairo Performance Graph");
g_object_set_data_full (G_OBJECT (window),
- "app-data", data, (GDestroyNotify)g_free);
+ "app-data", data, (GDestroyNotify)g_free);
data->window = window;
@@ -364,7 +373,7 @@ window_create (test_case_t *cases,
NULL);
gtk_tree_view_append_column (GTK_TREE_VIEW (tv), column);
g_signal_connect (renderer, "toggled",
- G_CALLBACK (show_case_toggled), data);
+ G_CALLBACK (show_case_toggled), data);
renderer = gtk_cell_renderer_text_new ();
column = gtk_tree_view_column_new_with_attributes ("Backend",
@@ -400,12 +409,12 @@ window_create (test_case_t *cases,
sw = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
- GTK_POLICY_NEVER,
- GTK_POLICY_AUTOMATIC);
+ GTK_POLICY_NEVER,
+ GTK_POLICY_AUTOMATIC);
gtk_container_add (GTK_CONTAINER (sw), tv);
gtk_widget_show (tv);
gtk_table_attach (GTK_TABLE (table), sw,
- 0, 1, 0, 2,
+ 0, 1, 0, 2,
GTK_FILL, GTK_FILL,
4, 4);
gtk_widget_show (sw);
@@ -414,10 +423,10 @@ window_create (test_case_t *cases,
w = graph_view_new ();
data->gv = w;
g_signal_connect (w, "report-selected",
- G_CALLBACK (gv_report_selected), data);
+ G_CALLBACK (gv_report_selected), data);
graph_view_set_reports ((GraphView *)w, cases, reports, num_reports);
gtk_table_attach (GTK_TABLE (table), w,
- 1, 2, 0, 1,
+ 1, 2, 0, 1,
GTK_FILL | GTK_EXPAND, GTK_FILL | GTK_EXPAND,
4, 4);
gtk_widget_show (w);
@@ -427,12 +436,12 @@ window_create (test_case_t *cases,
data->git_buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (w));
sw = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
- GTK_POLICY_NEVER,
- GTK_POLICY_AUTOMATIC);
+ GTK_POLICY_NEVER,
+ GTK_POLICY_AUTOMATIC);
gtk_container_add (GTK_CONTAINER (sw), w);
gtk_widget_show (w);
gtk_table_attach (GTK_TABLE (table), sw,
- 1, 2, 1, 2,
+ 1, 2, 1, 2,
GTK_FILL, GTK_FILL | GTK_EXPAND,
4, 4);
gtk_widget_show (sw);
@@ -444,7 +453,8 @@ window_create (test_case_t *cases,
}
static void
-name_to_color (const char *name, GdkColor *color)
+name_to_color (const char *name,
+ GdkColor *color)
{
gint v = g_str_hash (name);
@@ -455,7 +465,7 @@ name_to_color (const char *name, GdkColor *color)
static test_case_t *
test_cases_from_reports (cairo_perf_report_t *reports,
- int num_reports)
+ int num_reports)
{
test_case_t *cases, *c;
test_report_t **tests;
@@ -550,7 +560,8 @@ test_cases_from_reports (cairo_perf_report_t *reports,
return cases;
}
int
-main (int argc, char *argv[])
+main (int argc,
+ char *argv[])
{
cairo_perf_report_t *reports;
test_case_t *cases;
@@ -571,7 +582,7 @@ main (int argc, char *argv[])
window = window_create (cases, reports, argc-1);
g_signal_connect (window, "delete-event",
- G_CALLBACK (gtk_main_quit), NULL);
+ G_CALLBACK (gtk_main_quit), NULL);
gtk_widget_show (window);
gtk_main ();
diff --git a/perf/cairo-perf-graph-widget.c b/perf/cairo-perf-graph-widget.c
index 85a5126..41311f7 100644
--- a/perf/cairo-perf-graph-widget.c
+++ b/perf/cairo-perf-graph-widget.c
@@ -57,10 +57,10 @@ static guint signals[LAST_SIGNAL];
G_DEFINE_TYPE (GraphView, graph_view, GTK_TYPE_WIDGET)
static void
-draw_baseline_performance (test_case_t *cases,
- cairo_perf_report_t *reports,
- int num_reports,
- cairo_t *cr,
+draw_baseline_performance (test_case_t *cases,
+ cairo_perf_report_t *reports,
+ int num_reports,
+ cairo_t *cr,
const cairo_matrix_t *m)
{
test_report_t **tests;
@@ -203,7 +203,11 @@ draw_baseline_performance (test_case_t *cases,
}
static void
-draw_hline (cairo_t *cr, const cairo_matrix_t *m, double y0, double xmin, double xmax)
+draw_hline (cairo_t *cr,
+ const cairo_matrix_t *m,
+ double y0,
+ double xmin,
+ double xmax)
{
double x, y;
double py_offset;
@@ -222,8 +226,11 @@ draw_hline (cairo_t *cr, const cairo_matrix_t *m, double y0, double xmin, double
}
static void
-draw_label (cairo_t *cr, const cairo_matrix_t *m,
- double y0, double xmin, double xmax)
+draw_label (cairo_t *cr,
+ const cairo_matrix_t *m,
+ double y0,
+ double xmin,
+ double xmax)
{
double x, y;
char buf[80];
@@ -254,9 +261,12 @@ draw_label (cairo_t *cr, const cairo_matrix_t *m,
#define ALIGN_X(v) ((v)<<0)
#define ALIGN_Y(v) ((v)<<2)
static void
-draw_rotated_label (cairo_t *cr, const char *text,
- double x, double y, double angle,
- int align)
+draw_rotated_label (cairo_t *cr,
+ const char *text,
+ double x,
+ double y,
+ double angle,
+ int align)
{
cairo_text_extents_t extents;
@@ -320,7 +330,8 @@ draw_rotated_label (cairo_t *cr, const char *text,
#define PAD 36
static void
-graph_view_draw (GraphView *self, cairo_t *cr)
+graph_view_draw (GraphView *self,
+ cairo_t *cr)
{
cairo_matrix_t m;
const double dash[2] = {4, 4};
@@ -413,7 +424,7 @@ graph_view_draw (GraphView *self, cairo_t *cr)
} cairo_restore (cr);
draw_baseline_performance (self->cases,
- self->reports, self->num_reports,
+ self->reports, self->num_reports,
cr, &m);
cairo_save (cr); {
@@ -425,7 +436,8 @@ graph_view_draw (GraphView *self, cairo_t *cr)
}
static gboolean
-graph_view_expose (GtkWidget *w, GdkEventExpose *ev)
+graph_view_expose (GtkWidget *w,
+ GdkEventExpose *ev)
{
GraphView *self = (GraphView *) w;
cairo_t *cr;
@@ -442,7 +454,8 @@ graph_view_expose (GtkWidget *w, GdkEventExpose *ev)
}
static gboolean
-graph_view_button_press (GtkWidget *w, GdkEventButton *ev)
+graph_view_button_press (GtkWidget *w,
+ GdkEventButton *ev)
{
GraphView *self = (GraphView *) w;
cairo_matrix_t m;
@@ -473,7 +486,8 @@ graph_view_button_press (GtkWidget *w, GdkEventButton *ev)
}
static gboolean
-graph_view_button_release (GtkWidget *w, GdkEventButton *ev)
+graph_view_button_release (GtkWidget *w,
+ GdkEventButton *ev)
{
GraphView *self = (GraphView *) w;
@@ -496,9 +510,9 @@ graph_view_realize (GtkWidget *widget)
attributes.visual = gtk_widget_get_visual (widget);
attributes.colormap = gtk_widget_get_colormap (widget);
attributes.event_mask = gtk_widget_get_events (widget) |
- GDK_BUTTON_PRESS_MASK |
- GDK_BUTTON_RELEASE_MASK |
- GDK_EXPOSURE_MASK;
+ GDK_BUTTON_PRESS_MASK |
+ GDK_BUTTON_RELEASE_MASK |
+ GDK_EXPOSURE_MASK;
widget->window = gdk_window_new (gtk_widget_get_parent_window (widget),
&attributes,
@@ -531,7 +545,7 @@ graph_view_class_init (GraphViewClass *klass)
signals[REPORT_SELECTED] =
g_signal_new ("report-selected",
- G_TYPE_FROM_CLASS (object_class),
+ G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_FIRST,
0,//G_STRUCT_OFFSET (GraphView, report_selected),
NULL, NULL,
@@ -576,10 +590,10 @@ graph_view_update_visible (GraphView *gv)
}
void
-graph_view_set_reports (GraphView *gv,
- test_case_t *cases,
- cairo_perf_report_t *reports,
- int num_reports)
+graph_view_set_reports (GraphView *gv,
+ test_case_t *cases,
+ cairo_perf_report_t *reports,
+ int num_reports)
{
/* XXX ownership? */
gv->cases = cases;
diff --git a/perf/cairo-perf-graph.h b/perf/cairo-perf-graph.h
index 62bf30f..4cb6216 100644
--- a/perf/cairo-perf-graph.h
+++ b/perf/cairo-perf-graph.h
@@ -52,10 +52,10 @@ GtkWidget *
graph_view_new (void);
void
-graph_view_set_reports (GraphView *gv,
- test_case_t *tests,
- cairo_perf_report_t *reports,
- int num_reports);
+graph_view_set_reports (GraphView *gv,
+ test_case_t *tests,
+ cairo_perf_report_t *reports,
+ int num_reports);
void
graph_view_update_visible (GraphView *gv);
diff --git a/perf/cairo-perf-micro.c b/perf/cairo-perf-micro.c
index e8b2820..a12911f 100644
--- a/perf/cairo-perf-micro.c
+++ b/perf/cairo-perf-micro.c
@@ -23,7 +23,7 @@
* IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
* Authors: Vladimir Vukicevic <vladimir at pobox.com>
- * Carl Worth <cworth at cworth.org>
+ * Carl Worth <cworth at cworth.org>
*/
#define _GNU_SOURCE 1 /* for sched_getaffinity() */
@@ -50,8 +50,8 @@
#define CAIRO_PERF_ITERATIONS_DEFAULT 100
#define CAIRO_PERF_LOW_STD_DEV 0.03
-#define CAIRO_PERF_STABLE_STD_DEV_COUNT 5
-#define CAIRO_PERF_ITERATION_MS_DEFAULT 2000
+#define CAIRO_PERF_STABLE_STD_DEV_COUNT 5
+#define CAIRO_PERF_ITERATION_MS_DEFAULT 2000
#define CAIRO_PERF_ITERATION_MS_FAST 5
typedef struct _cairo_perf_case {
@@ -63,7 +63,8 @@ typedef struct _cairo_perf_case {
const cairo_perf_case_t perf_cases[];
static const char *
-_content_to_string (cairo_content_t content, cairo_bool_t similar)
+_content_to_string (cairo_content_t content,
+ cairo_bool_t similar)
{
switch (content|similar) {
case CAIRO_CONTENT_COLOR:
@@ -100,9 +101,9 @@ cairo_perf_has_similar (cairo_perf_t *perf)
}
cairo_bool_t
-cairo_perf_can_run (cairo_perf_t *perf,
- const char *name,
- cairo_bool_t *is_explicit)
+cairo_perf_can_run (cairo_perf_t *perf,
+ const char *name,
+ cairo_bool_t *is_explicit)
{
unsigned int i;
@@ -124,8 +125,8 @@ cairo_perf_can_run (cairo_perf_t *perf,
}
static unsigned
-cairo_perf_calibrate (cairo_perf_t *perf,
- cairo_perf_func_t perf_func)
+cairo_perf_calibrate (cairo_perf_t *perf,
+ cairo_perf_func_t perf_func)
{
cairo_perf_ticks_t calibration0, calibration;
unsigned loops, min_loops;
@@ -162,10 +163,10 @@ cairo_perf_calibrate (cairo_perf_t *perf,
}
void
-cairo_perf_run (cairo_perf_t *perf,
- const char *name,
- cairo_perf_func_t perf_func,
- cairo_count_func_t count_func)
+cairo_perf_run (cairo_perf_t *perf,
+ const char *name,
+ cairo_perf_func_t perf_func,
+ cairo_count_func_t count_func)
{
static cairo_bool_t first_run = TRUE;
unsigned int i, similar, has_similar;
@@ -231,7 +232,7 @@ cairo_perf_run (cairo_perf_t *perf,
cairo_perf_yield ();
if (similar)
cairo_push_group_with_content (perf->cr,
- cairo_boilerplate_content (perf->target->content));
+ cairo_boilerplate_content (perf->target->content));
perf_func (perf->cr, perf->size, perf->size, 1);
loops = cairo_perf_calibrate (perf, perf_func);
if (similar)
@@ -242,7 +243,7 @@ cairo_perf_run (cairo_perf_t *perf,
cairo_perf_yield ();
if (similar)
cairo_push_group_with_content (perf->cr,
- cairo_boilerplate_content (perf->target->content));
+ cairo_boilerplate_content (perf->target->content));
times[i] = perf_func (perf->cr, perf->size, perf->size, loops) / loops;
if (similar)
cairo_pattern_destroy (cairo_pop_group (perf->cr));
@@ -320,7 +321,9 @@ usage (const char *argv0)
}
static void
-parse_options (cairo_perf_t *perf, int argc, char *argv[])
+parse_options (cairo_perf_t *perf,
+ int argc,
+ char *argv[])
{
int c;
const char *iters;
@@ -395,7 +398,7 @@ parse_options (cairo_perf_t *perf, int argc, char *argv[])
}
static int
-check_cpu_affinity(void)
+check_cpu_affinity (void)
{
#ifdef HAVE_SCHED_GETAFFINITY
@@ -403,27 +406,27 @@ check_cpu_affinity(void)
int i, cpu_count;
if (sched_getaffinity(0, sizeof(affinity), &affinity)) {
- perror("sched_getaffinity");
- return -1;
+ perror("sched_getaffinity");
+ return -1;
}
for(i = 0, cpu_count = 0; i < CPU_SETSIZE; ++i) {
- if (CPU_ISSET(i, &affinity))
- ++cpu_count;
+ if (CPU_ISSET(i, &affinity))
+ ++cpu_count;
}
if (cpu_count > 1) {
- fputs(
- "WARNING: cairo-perf has not been bound to a single CPU.\n",
- stderr);
- return -1;
+ fputs(
+ "WARNING: cairo-perf has not been bound to a single CPU.\n",
+ stderr);
+ return -1;
}
return 0;
#else
fputs(
- "WARNING: Cannot check CPU affinity for this platform.\n",
- stderr);
+ "WARNING: Cannot check CPU affinity for this platform.\n",
+ stderr);
return -1;
#endif
}
@@ -443,7 +446,8 @@ cairo_perf_fini (cairo_perf_t *perf)
int
-main (int argc, char *argv[])
+main (int argc,
+ char *argv[])
{
int i, j;
cairo_perf_t perf;
@@ -452,23 +456,23 @@ main (int argc, char *argv[])
parse_options (&perf, argc, argv);
if (check_cpu_affinity()) {
- fputs(
- "NOTICE: cairo-perf and the X server should be bound to CPUs (either the same\n"
- "or separate) on SMP systems. Not doing so causes random results when the X\n"
- "server is moved to or from cairo-perf's CPU during the benchmarks:\n"
- "\n"
- " $ sudo taskset -cp 0 $(pidof X)\n"
- " $ taskset -cp 1 $$\n"
- "\n"
- "See taskset(1) for information about changing CPU affinity.\n",
- stderr);
+ fputs(
+ "NOTICE: cairo-perf and the X server should be bound to CPUs (either the same\n"
+ "or separate) on SMP systems. Not doing so causes random results when the X\n"
+ "server is moved to or from cairo-perf's CPU during the benchmarks:\n"
+ "\n"
+ " $ sudo taskset -cp 0 $(pidof X)\n"
+ " $ taskset -cp 1 $$\n"
+ "\n"
+ "See taskset(1) for information about changing CPU affinity.\n",
+ stderr);
}
perf.targets = cairo_boilerplate_get_targets (&perf.num_targets, NULL);
perf.times = xmalloc (perf.iterations * sizeof (cairo_perf_ticks_t));
for (i = 0; i < perf.num_targets; i++) {
- const cairo_boilerplate_target_t *target = perf.targets[i];
+ const cairo_boilerplate_target_t *target = perf.targets[i];
if (! target->is_measurable)
continue;
diff --git a/perf/cairo-perf-os2.c b/perf/cairo-perf-os2.c
index 4cb6447..5f4f078 100644
--- a/perf/cairo-perf-os2.c
+++ b/perf/cairo-perf-os2.c
@@ -23,8 +23,8 @@
* IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
* Authors: Peter Weilbacher <mozilla at weilbacher.org>
- * Vladimir Vukicevic <vladimir at pobox.com> (win32/linux code)
- * Carl Worth <cworth at cworth.org> (win32/linux code)
+ * Vladimir Vukicevic <vladimir at pobox.com> (win32/linux code)
+ * Carl Worth <cworth at cworth.org> (win32/linux code)
*/
#define INCL_BASE
@@ -46,7 +46,7 @@ static cairo_perf_timer_synchronize_t cairo_perf_timer_synchronize = NULL;
static void *cairo_perf_timer_synchronize_closure = NULL;
void
cairo_perf_timer_set_synchronize (cairo_perf_timer_synchronize_t synchronize,
- void *closure)
+ void *closure)
{
cairo_perf_timer_synchronize = synchronize;
cairo_perf_timer_synchronize_closure = closure;
@@ -57,7 +57,7 @@ cairo_perf_timer_start (void) {
QWORD time;
if (cairo_perf_timer_synchronize)
- cairo_perf_timer_synchronize (cairo_perf_timer_synchronize_closure);
+ cairo_perf_timer_synchronize (cairo_perf_timer_synchronize_closure);
DosTmrQueryTime(&time);
timer.start = (time.ulHi*4294967296.0 + time.ulLo);
}
@@ -67,7 +67,7 @@ cairo_perf_timer_stop (void) {
QWORD time;
if (cairo_perf_timer_synchronize)
- cairo_perf_timer_synchronize (cairo_perf_timer_synchronize_closure);
+ cairo_perf_timer_synchronize (cairo_perf_timer_synchronize_closure);
DosTmrQueryTime(&time);
timer.stop = (time.ulHi*4294967296.0 + time.ulLo);
}
diff --git a/perf/cairo-perf-posix.c b/perf/cairo-perf-posix.c
index 50a415d..84064b0 100644
--- a/perf/cairo-perf-posix.c
+++ b/perf/cairo-perf-posix.c
@@ -22,7 +22,7 @@
* IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
* Authors: Vladimir Vukicevic <vladimir at pobox.com>
- * Carl Worth <cworth at cworth.org>
+ * Carl Worth <cworth at cworth.org>
*/
/* Portions of this file come from liboil:
@@ -91,18 +91,18 @@ oil_profile_stamp_rdtsc (void)
#if defined(__powerpc__) || defined(__PPC__) || defined(__ppc__)
static inline cairo_perf_ticks_t
-oil_profile_stamp_tb(void)
+oil_profile_stamp_tb (void)
{
uint32_t junk;
uint64_t ts;
__asm__ __volatile__ (
- "1: mftbu %1;"
- " mftb %0+1;"
- " mftbu %0;"
- " cmpw %0,%1;"
- " bne 1b" :
- "=r" (ts), "=r" (junk));
+ "1: mftbu %1;"
+ " mftb %0+1;"
+ " mftbu %0;"
+ " cmpw %0,%1;"
+ " bne 1b" :
+ "=r" (ts), "=r" (junk));
return ts;
}
@@ -111,7 +111,7 @@ oil_profile_stamp_tb(void)
#if defined(__alpha__)
static inline cairo_perf_ticks_t
-oil_profile_stamp_alpha(void)
+oil_profile_stamp_alpha (void)
{
unsigned int ts;
__asm__ __volatile__ ("rpcc %0\n" : "=r"(ts));
@@ -122,7 +122,7 @@ oil_profile_stamp_alpha(void)
#if defined(__s390__)
static cairo_perf_ticks_t
-oil_profile_stamp_s390(void)
+oil_profile_stamp_s390 (void)
{
uint64_t ts;
__asm__ __volatile__ ("STCK %0\n" : : "m" (ts));
@@ -157,8 +157,8 @@ static cairo_perf_timer_t timer;
static cairo_perf_timer_synchronize_t cairo_perf_timer_synchronize = NULL;
static void *cairo_perf_timer_synchronize_closure = NULL;
void
-cairo_perf_timer_set_synchronize (cairo_perf_timer_synchronize_t synchronize,
- void *closure)
+cairo_perf_timer_set_synchronize (cairo_perf_timer_synchronize_t synchronize,
+ void *closure)
{
cairo_perf_timer_synchronize = synchronize;
cairo_perf_timer_synchronize_closure = closure;
diff --git a/perf/cairo-perf-print.c b/perf/cairo-perf-print.c
index 05bf5bd..146f79b 100644
--- a/perf/cairo-perf-print.c
+++ b/perf/cairo-perf-print.c
@@ -24,7 +24,7 @@
* SOFTWARE.
*
* Authors: Carl Worth <cworth at cworth.org>
- * Chris Wilson <chris at chris-wilson.co.uk>
+ * Chris Wilson <chris at chris-wilson.co.uk>
*/
#include "cairo-perf.h"
@@ -57,7 +57,8 @@ report_print (const cairo_perf_report_t *report)
}
int
-main (int argc, const char *argv[])
+main (int argc,
+ const char *argv[])
{
int i;
diff --git a/perf/cairo-perf-report.c b/perf/cairo-perf-report.c
index 2029a88..8ab8090 100644
--- a/perf/cairo-perf-report.c
+++ b/perf/cairo-perf-report.c
@@ -51,18 +51,23 @@ typedef ptrdiff_t ssize_t;
#if !defined (__USE_GNU) && !defined(__USE_XOPEN2K8)
static ssize_t
-getline (char **lineptr, size_t *n, FILE *stream);
+getline (char **lineptr,
+ size_t *n,
+ FILE *stream);
static char *
-strndup (const char *s, size_t n);
+strndup (const char *s,
+ size_t n);
#endif
#ifdef _MSC_VER
static long long
-strtoll(const char *nptr, char **endptr, int base);
+strtoll (const char *nptr,
+ char **endptr,
+ int base);
static char *
-basename(char *path);
+basename (char *path);
#endif
/* Ad-hoc parsing, macros with a strong dependence on the calling
@@ -87,7 +92,7 @@ do { \
parse_error("expected integer but found %s", s); \
} \
} while (0)
-#define parse_long_long(result) \
+#define parse_long_long(result) \
do { \
(result) = strtoll (s, &end, 10); \
if (*s && end != s) { \
@@ -120,7 +125,9 @@ do { \
} while (0)
static test_report_status_t
-test_report_parse (test_report_t *report, char *line, char *configuration)
+test_report_parse (test_report_t *report,
+ char *line,
+ char *configuration)
{
char *end;
char *s = line;
@@ -230,23 +237,25 @@ test_report_parse (test_report_t *report, char *line, char *configuration)
#if !defined (__USE_GNU) && !defined(__USE_XOPEN2K8)
#define POORMANS_GETLINE_BUFFER_SIZE (65536)
static ssize_t
-getline (char **lineptr, size_t *n, FILE *stream)
+getline (char **lineptr,
+ size_t *n,
+ FILE *stream)
{
if (!*lineptr)
{
- *n = POORMANS_GETLINE_BUFFER_SIZE;
- *lineptr = (char *) malloc (*n);
+ *n = POORMANS_GETLINE_BUFFER_SIZE;
+ *lineptr = (char *) malloc (*n);
}
if (!fgets (*lineptr, *n, stream))
- return -1;
+ return -1;
if (!feof (stream) && !strchr (*lineptr, '\n'))
{
- fprintf (stderr, "The poor man's implementation of getline in "
- __FILE__ " needs a bigger buffer. Perhaps it's "
- "time for a complete implementation of getline.\n");
- exit (0);
+ fprintf (stderr, "The poor man's implementation of getline in "
+ __FILE__ " needs a bigger buffer. Perhaps it's "
+ "time for a complete implementation of getline.\n");
+ exit (0);
}
return strlen (*lineptr);
@@ -254,21 +263,22 @@ getline (char **lineptr, size_t *n, FILE *stream)
#undef POORMANS_GETLINE_BUFFER_SIZE
static char *
-strndup (const char *s, size_t n)
+strndup (const char *s,
+ size_t n)
{
size_t len;
char *sdup;
if (!s)
- return NULL;
+ return NULL;
len = strlen (s);
len = (n < len ? n : len);
sdup = (char *) malloc (len + 1);
if (sdup)
{
- memcpy (sdup, s, len);
- sdup[len] = '\0';
+ memcpy (sdup, s, len);
+ sdup[len] = '\0';
}
return sdup;
@@ -281,13 +291,15 @@ strndup (const char *s, size_t n)
*/
#ifdef _MSC_VER
long long
-strtoll(const char *nptr, char **endptr, int base)
+strtoll (const char *nptr,
+ char **endptr,
+ int base)
{
return _atoi64(nptr);
}
static char *
-basename(char *path)
+basename (char *path)
{
char *end, *s;
@@ -311,7 +323,8 @@ basename(char *path)
#endif /* ifndef _MSC_VER */
int
-test_report_cmp_backend_then_name (const void *a, const void *b)
+test_report_cmp_backend_then_name (const void *a,
+ const void *b)
{
const test_report_t *a_test = a;
const test_report_t *b_test = b;
@@ -348,7 +361,8 @@ test_report_cmp_backend_then_name (const void *a, const void *b)
}
int
-test_report_cmp_name (const void *a, const void *b)
+test_report_cmp_name (const void *a,
+ const void *b)
{
const test_report_t *a_test = a;
const test_report_t *b_test = b;
@@ -378,7 +392,7 @@ test_report_cmp_name (const void *a, const void *b)
void
cairo_perf_report_sort_and_compute_stats (cairo_perf_report_t *report,
- int (*cmp) (const void*, const void*))
+ int (*cmp) (const void*, const void*))
{
test_report_t *base, *next, *last, *t;
@@ -426,7 +440,7 @@ cairo_perf_report_sort_and_compute_stats (cairo_perf_report_t *report,
void
cairo_perf_report_load (cairo_perf_report_t *report,
- const char *filename,
+ const char *filename,
int (*cmp) (const void *, const void *))
{
FILE *file;
diff --git a/perf/cairo-perf-trace.c b/perf/cairo-perf-trace.c
index a87ef33..5afe9e7 100644
--- a/perf/cairo-perf-trace.c
+++ b/perf/cairo-perf-trace.c
@@ -24,8 +24,8 @@
* IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
* Authors: Vladimir Vukicevic <vladimir at pobox.com>
- * Carl Worth <cworth at cworth.org>
- * Chris Wilson <chris at chris-wilson.co.uk>
+ * Carl Worth <cworth at cworth.org>
+ * Chris Wilson <chris at chris-wilson.co.uk>
*/
#define _GNU_SOURCE 1 /* for sched_getaffinity() and getline() */
@@ -66,12 +66,12 @@
#define CAIRO_PERF_ITERATIONS_DEFAULT 15
#define CAIRO_PERF_LOW_STD_DEV 0.05
#define CAIRO_PERF_MIN_STD_DEV_COUNT 3
-#define CAIRO_PERF_STABLE_STD_DEV_COUNT 3
+#define CAIRO_PERF_STABLE_STD_DEV_COUNT 3
cairo_bool_t
-cairo_perf_can_run (cairo_perf_t *perf,
- const char *name,
- cairo_bool_t *is_explicit)
+cairo_perf_can_run (cairo_perf_t *perf,
+ const char *name,
+ cairo_bool_t *is_explicit)
{
unsigned int i;
char *copy, *dot;
@@ -147,7 +147,8 @@ static cairo_hash_table_t *surface_cache;
static cairo_surface_t *surface_holdovers[16];
static cairo_bool_t
-scache_equal (const void *A, const void *B)
+scache_equal (const void *A,
+ const void *B)
{
const struct scache *a = A, *b = B;
return a->entry.hash == b->entry.hash;
@@ -200,10 +201,11 @@ scache_remove (void *closure)
}
static cairo_surface_t *
-_similar_surface_create (void *closure,
- cairo_content_t content,
- double width, double height,
- long uid)
+_similar_surface_create (void *closure,
+ cairo_content_t content,
+ double width,
+ double height,
+ long uid)
{
cairo_surface_t *surface;
struct scache skey, *s;
@@ -250,7 +252,7 @@ _similar_surface_create (void *closure,
}
static cairo_t *
-_context_create (void *closure,
+_context_create (void *closure,
cairo_surface_t *surface)
{
scache_mark_active (surface);
@@ -271,9 +273,9 @@ interrupt (int sig)
}
static void
-execute (cairo_perf_t *perf,
- cairo_surface_t *target,
- const char *trace)
+execute (cairo_perf_t *perf,
+ cairo_surface_t *target,
+ const char *trace)
{
static cairo_bool_t first_run = TRUE;
unsigned int i;
@@ -452,23 +454,25 @@ usage (const char *argv0)
#ifndef __USE_GNU
#define POORMANS_GETLINE_BUFFER_SIZE (65536)
static ssize_t
-getline (char **lineptr, size_t *n, FILE *stream)
+getline (char **lineptr,
+ size_t *n,
+ FILE *stream)
{
if (!*lineptr)
{
- *n = POORMANS_GETLINE_BUFFER_SIZE;
- *lineptr = (char *) malloc (*n);
+ *n = POORMANS_GETLINE_BUFFER_SIZE;
+ *lineptr = (char *) malloc (*n);
}
if (!fgets (*lineptr, *n, stream))
- return -1;
+ return -1;
if (!feof (stream) && !strchr (*lineptr, '\n'))
{
- fprintf (stderr, "The poor man's implementation of getline in "
- __FILE__ " needs a bigger buffer. Perhaps it's "
- "time for a complete implementation of getline.\n");
- exit (0);
+ fprintf (stderr, "The poor man's implementation of getline in "
+ __FILE__ " needs a bigger buffer. Perhaps it's "
+ "time for a complete implementation of getline.\n");
+ exit (0);
}
return strlen (*lineptr);
@@ -476,21 +480,22 @@ getline (char **lineptr, size_t *n, FILE *stream)
#undef POORMANS_GETLINE_BUFFER_SIZE
static char *
-strndup (const char *s, size_t n)
+strndup (const char *s,
+ size_t n)
{
size_t len;
char *sdup;
if (!s)
- return NULL;
+ return NULL;
len = strlen (s);
len = (n < len ? n : len);
sdup = (char *) malloc (len + 1);
if (sdup)
{
- memcpy (sdup, s, len);
- sdup[len] = '\0';
+ memcpy (sdup, s, len);
+ sdup[len] = '\0';
}
return sdup;
@@ -498,7 +503,8 @@ strndup (const char *s, size_t n)
#endif /* ifndef __USE_GNU */
static cairo_bool_t
-read_excludes (cairo_perf_t *perf, const char *filename)
+read_excludes (cairo_perf_t *perf,
+ const char *filename)
{
FILE *file;
char *line = NULL;
@@ -541,7 +547,9 @@ read_excludes (cairo_perf_t *perf, const char *filename)
}
static void
-parse_options (cairo_perf_t *perf, int argc, char *argv[])
+parse_options (cairo_perf_t *perf,
+ int argc,
+ char *argv[])
{
int c;
const char *iters;
@@ -655,9 +663,9 @@ have_trace_filenames (cairo_perf_t *perf)
}
static void
-cairo_perf_trace (cairo_perf_t *perf,
+cairo_perf_trace (cairo_perf_t *perf,
const cairo_boilerplate_target_t *target,
- const char *trace)
+ const char *trace)
{
cairo_surface_t *surface;
void *closure;
@@ -692,7 +700,8 @@ cairo_perf_trace (cairo_perf_t *perf,
}
static void
-warn_no_traces (const char *message, const char *trace_dir)
+warn_no_traces (const char *message,
+ const char *trace_dir)
{
fprintf (stderr,
"Error: %s '%s'.\n"
@@ -704,9 +713,9 @@ warn_no_traces (const char *message, const char *trace_dir)
}
static int
-cairo_perf_trace_dir (cairo_perf_t *perf,
+cairo_perf_trace_dir (cairo_perf_t *perf,
const cairo_boilerplate_target_t *target,
- const char *dirname)
+ const char *dirname)
{
DIR *dir;
struct dirent *de;
@@ -760,7 +769,8 @@ next:
}
int
-main (int argc, char *argv[])
+main (int argc,
+ char *argv[])
{
cairo_perf_t perf;
const char *trace_dir = "cairo-traces:/usr/src/cairo-traces:/usr/share/cairo-traces";
@@ -781,7 +791,7 @@ main (int argc, char *argv[])
perf.exact_names = have_trace_filenames (&perf);
for (i = 0; i < perf.num_targets; i++) {
- const cairo_boilerplate_target_t *target = perf.targets[i];
+ const cairo_boilerplate_target_t *target = perf.targets[i];
if (! perf.list_only && ! target->is_measurable)
continue;
diff --git a/perf/cairo-perf-win32.c b/perf/cairo-perf-win32.c
index c63ca75..9a09679 100644
--- a/perf/cairo-perf-win32.c
+++ b/perf/cairo-perf-win32.c
@@ -22,7 +22,7 @@
* IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
* Authors: Vladimir Vukicevic <vladimir at pobox.com>
- * Carl Worth <cworth at cworth.org>
+ * Carl Worth <cworth at cworth.org>
*/
#define USE_WINAPI
@@ -45,8 +45,8 @@ static cairo_perf_timer_t timer;
static cairo_perf_timer_synchronize_t cairo_perf_timer_synchronize = NULL;
static void *cairo_perf_timer_synchronize_closure = NULL;
void
-cairo_perf_timer_set_synchronize (cairo_perf_timer_synchronize_t synchronize,
- void *closure)
+cairo_perf_timer_set_synchronize (cairo_perf_timer_synchronize_t synchronize,
+ void *closure)
{
cairo_perf_timer_synchronize = synchronize;
cairo_perf_timer_synchronize_closure = closure;
diff --git a/perf/cairo-perf.h b/perf/cairo-perf.h
index c4eeb16..ff177c4 100644
--- a/perf/cairo-perf.h
+++ b/perf/cairo-perf.h
@@ -22,7 +22,7 @@
* IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
* Authors: Vladimir Vukicevic <vladimir at pobox.com>
- * Carl Worth <cworth at cworth.org>
+ * Carl Worth <cworth at cworth.org>
*/
#ifndef _CAIRO_PERF_H_
@@ -53,8 +53,8 @@ typedef void
(*cairo_perf_timer_synchronize_t) (void *closure);
void
-cairo_perf_timer_set_synchronize (cairo_perf_timer_synchronize_t synchronize,
- void *closure);
+cairo_perf_timer_set_synchronize (cairo_perf_timer_synchronize_t synchronize,
+ void *closure);
cairo_perf_ticks_t
cairo_perf_timer_elapsed (void);
@@ -103,21 +103,21 @@ typedef double
(*cairo_count_func_t) (cairo_t *cr, int width, int height);
cairo_bool_t
-cairo_perf_can_run (cairo_perf_t *perf,
- const char *name,
- cairo_bool_t *is_explicit);
+cairo_perf_can_run (cairo_perf_t *perf,
+ const char *name,
+ cairo_bool_t *is_explicit);
void
-cairo_perf_run (cairo_perf_t *perf,
- const char *name,
- cairo_perf_func_t perf_func,
- cairo_count_func_t count_func);
+cairo_perf_run (cairo_perf_t *perf,
+ const char *name,
+ cairo_perf_func_t perf_func,
+ cairo_count_func_t count_func);
void
-cairo_perf_cover_sources_and_operators (cairo_perf_t *perf,
- const char *name,
- cairo_perf_func_t perf_func,
- cairo_count_func_t count_func);
+cairo_perf_cover_sources_and_operators (cairo_perf_t *perf,
+ const char *name,
+ cairo_perf_func_t perf_func,
+ cairo_count_func_t count_func);
/* reporter convenience routines */
@@ -164,18 +164,20 @@ typedef enum {
void
cairo_perf_report_load (cairo_perf_report_t *report,
- const char *filename,
+ const char *filename,
int (*cmp) (const void *, const void *));
void
cairo_perf_report_sort_and_compute_stats (cairo_perf_report_t *report,
- int (*cmp) (const void *, const void *));
+ int (*cmp) (const void *, const void *));
int
-test_report_cmp_backend_then_name (const void *a, const void *b);
+test_report_cmp_backend_then_name (const void *a,
+ const void *b);
int
-test_report_cmp_name (const void *a, const void *b);
+test_report_cmp_name (const void *a,
+ const void *b);
#define CAIRO_PERF_DECL(func) void (func) (cairo_perf_t *perf, cairo_t *cr, int width, int height)
diff --git a/perf/cairo-stats.c b/perf/cairo-stats.c
index 43711a9..fbe16e7 100644
--- a/perf/cairo-stats.c
+++ b/perf/cairo-stats.c
@@ -26,7 +26,8 @@
#include "cairo-stats.h"
static int
-_cairo_perf_ticks_cmp (const void *_a, const void *_b)
+_cairo_perf_ticks_cmp (const void *_a,
+ const void *_b)
{
const cairo_perf_ticks_t *a = _a;
const cairo_perf_ticks_t *b = _b;
@@ -39,9 +40,9 @@ _cairo_perf_ticks_cmp (const void *_a, const void *_b)
}
void
-_cairo_stats_compute (cairo_stats_t *stats,
- cairo_perf_ticks_t *values,
- int num_values)
+_cairo_stats_compute (cairo_stats_t *stats,
+ cairo_perf_ticks_t *values,
+ int num_values)
{
int i;
double sum, mean, delta, q1, q3, iqr;
@@ -61,7 +62,7 @@ _cairo_stats_compute (cairo_stats_t *stats,
qsort (values, num_values,
sizeof (cairo_perf_ticks_t), _cairo_perf_ticks_cmp);
- q1 = values[(1*num_values)/4];
+ q1 = values[(1*num_values)/4];
q3 = values[(3*num_values)/4];
iqr = q3 - q1;
diff --git a/perf/cairo-stats.h b/perf/cairo-stats.h
index 58ff0b6..5b5b064 100644
--- a/perf/cairo-stats.h
+++ b/perf/cairo-stats.h
@@ -29,8 +29,8 @@
#include "cairo-perf.h"
void
-_cairo_stats_compute (cairo_stats_t *stats,
- cairo_perf_ticks_t *values,
- int num_values);
+_cairo_stats_compute (cairo_stats_t *stats,
+ cairo_perf_ticks_t *values,
+ int num_values);
#endif /* _CAIRO_STATS_H_ */
commit 616e35d1fae703dc118ce503d25d4f57cfd16dfd
Author: M Joonas Pihlaja <jpihlaja at cc.helsinki.fi>
Date: Thu Jun 24 09:44:07 2010 +0300
boilerplate: Remove the xlib-window target from Renderless builds.
I don't know why _cairo_boilerplate_xlib_window_create_surface()
is in the Render-only section of the code, but since it is, this
patch makes the boilerplate at least compile if we don't have
Render support built in.
diff --git a/boilerplate/cairo-boilerplate-xlib.c b/boilerplate/cairo-boilerplate-xlib.c
index 17de2ad..8c41283 100644
--- a/boilerplate/cairo-boilerplate-xlib.c
+++ b/boilerplate/cairo-boilerplate-xlib.c
@@ -509,8 +509,6 @@ static const cairo_boilerplate_target_t targets[] = {
_cairo_boilerplate_xlib_synchronize,
FALSE, FALSE, FALSE
},
-#endif
-#if CAIRO_HAS_XLIB_SURFACE
{
"xlib-window", "xlib", NULL, NULL,
CAIRO_SURFACE_TYPE_XLIB, CAIRO_CONTENT_COLOR, 1,
@@ -523,6 +521,8 @@ static const cairo_boilerplate_target_t targets[] = {
_cairo_boilerplate_xlib_synchronize,
FALSE, FALSE, FALSE
},
+#endif
+#if CAIRO_HAS_XLIB_SURFACE
/* This is a fallback surface which uses xlib fallbacks instead of
* the Render extension. */
{
More information about the cairo-commit
mailing list