aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHanspeter Portner <dev@open-music-kontrollers.ch>2020-03-24 21:05:26 +0100
committerHanspeter Portner <dev@open-music-kontrollers.ch>2020-03-24 21:05:26 +0100
commit6a9c35a6c5c7f732cc7ad67b8ec0cc76447a25f5 (patch)
treecec3df56e3f2bacfdde44d1fd2619e9bebc52d30
parent1c921bb1cc54586ed799db453e8d7b56e7aedcb4 (diff)
downloadd2tk-6a9c35a6c5c7f732cc7ad67b8ec0cc76447a25f5.tar.xz
initial fixes for updated pugl.
-rw-r--r--VERSION2
-rw-r--r--d2tk/base.h4
-rw-r--r--d2tk/core.h4
-rw-r--r--src/backend_cairo.c26
-rw-r--r--src/backend_nanovg.c12
-rw-r--r--src/base.c6
-rw-r--r--src/core.c6
-rw-r--r--src/core_internal.h4
-rw-r--r--src/frontend_fbdev.c12
-rw-r--r--src/frontend_pugl.c135
-rw-r--r--test/base.c28
-rw-r--r--test/core.c52
12 files changed, 162 insertions, 129 deletions
diff --git a/VERSION b/VERSION
index 3ae4c0a..8a2ea59 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-0.1.1021
+0.1.1027
diff --git a/d2tk/base.h b/d2tk/base.h
index 99e0dc8..4e4238c 100644
--- a/d2tk/base.h
+++ b/d2tk/base.h
@@ -683,8 +683,8 @@ d2tk_base_set_ttls(d2tk_base_t *base, uint32_t sprites, uint32_t memcaches);
D2TK_API void
d2tk_base_free(d2tk_base_t *base);
-D2TK_API void
-d2tk_base_pre(d2tk_base_t *base);
+D2TK_API int
+d2tk_base_pre(d2tk_base_t *base, void *pctx);
D2TK_API void
d2tk_base_post(d2tk_base_t *base);
diff --git a/d2tk/core.h b/d2tk/core.h
index 8de5cc5..0b8049b 100644
--- a/d2tk/core.h
+++ b/d2tk/core.h
@@ -186,8 +186,8 @@ d2tk_core_custom(d2tk_core_t *core, const d2tk_rect_t *rect, uint32_t size,
D2TK_API void
d2tk_core_stroke_width(d2tk_core_t *core, d2tk_coord_t width);
-D2TK_API void
-d2tk_core_pre(d2tk_core_t *core);
+D2TK_API int
+d2tk_core_pre(d2tk_core_t *core, void *pctx);
D2TK_API void
d2tk_core_post(d2tk_core_t *core);
diff --git a/src/backend_cairo.c b/src/backend_cairo.c
index 95db476..d91c85f 100644
--- a/src/backend_cairo.c
+++ b/src/backend_cairo.c
@@ -63,14 +63,8 @@ d2tk_cairo_free(void *data)
}
static void *
-d2tk_cairo_new(const char *bundle_path, void *pctx)
+d2tk_cairo_new(const char *bundle_path)
{
- if(!pctx)
- {
- fprintf(stderr, "invalid cairo context\n");
- return NULL;
- }
-
d2tk_backend_cairo_t *backend = calloc(1, sizeof(d2tk_backend_cairo_t));
if(!backend)
{
@@ -78,13 +72,28 @@ d2tk_cairo_new(const char *bundle_path, void *pctx)
return NULL;
}
- backend->ctx = pctx;
backend->bundle_path = strdup(bundle_path);
FT_Init_FreeType(&backend->library);
return backend;
}
+static int
+d2tk_cairo_context(void *data, void *pctx)
+{
+ d2tk_backend_cairo_t *backend = data;
+
+ if(!pctx)
+ {
+ fprintf(stderr, "invalid cairo context\n");
+ return 1;
+ }
+
+ backend->ctx = pctx;
+
+ return 0;
+}
+
static inline void
d2tk_cairo_pre(void *data, d2tk_core_t *core __attribute((unused)),
d2tk_coord_t w, d2tk_coord_t h, unsigned pass)
@@ -770,6 +779,7 @@ d2tk_cairo_process(void *data, d2tk_core_t *core, const d2tk_com_t *com,
const d2tk_core_driver_t d2tk_core_driver = {
.new = d2tk_cairo_new,
.free = d2tk_cairo_free,
+ .context = d2tk_cairo_context,
.pre = d2tk_cairo_pre,
.process = d2tk_cairo_process,
.post = d2tk_cairo_post,
diff --git a/src/backend_nanovg.c b/src/backend_nanovg.c
index 4e4dbb6..a1e9fb2 100644
--- a/src/backend_nanovg.c
+++ b/src/backend_nanovg.c
@@ -106,7 +106,7 @@ d2tk_nanovg_free(void *data)
}
static void *
-d2tk_nanovg_new(const char *bundle_path, void *pctx __attribute__((unused)))
+d2tk_nanovg_new(const char *bundle_path)
{
#if defined(__APPLE__)
//FIXME
@@ -141,6 +141,15 @@ d2tk_nanovg_new(const char *bundle_path, void *pctx __attribute__((unused)))
return backend;
}
+static int
+d2tk_nanovg_context(void *data __attribute__((unused)),
+ void *pctx __attribute__((unused)))
+{
+ // nothing to do
+
+ return 0;
+}
+
static inline void
d2tk_nanovg_pre(void *data, d2tk_core_t *core, d2tk_coord_t w, d2tk_coord_t h,
unsigned pass)
@@ -854,6 +863,7 @@ d2tk_nanovg_process(void *data, d2tk_core_t *core, const d2tk_com_t *com,
const d2tk_core_driver_t d2tk_core_driver = {
.new = d2tk_nanovg_new,
.free = d2tk_nanovg_free,
+ .context = d2tk_nanovg_context,
.pre = d2tk_nanovg_pre,
.process = d2tk_nanovg_process,
.post = d2tk_nanovg_post,
diff --git a/src/base.c b/src/base.c
index c12e9be..3ee2586 100644
--- a/src/base.c
+++ b/src/base.c
@@ -776,8 +776,8 @@ d2tk_base_free(d2tk_base_t *base)
free(base);
}
-D2TK_API void
-d2tk_base_pre(d2tk_base_t *base)
+D2TK_API int
+d2tk_base_pre(d2tk_base_t *base, void *pctx)
{
// reset hot item
_d2tk_flip_clear(&base->hotitem);
@@ -792,7 +792,7 @@ d2tk_base_pre(d2tk_base_t *base)
const d2tk_style_t *style = d2tk_base_get_style(base);
d2tk_core_set_bg_color(base->core, style->bg_color);
- d2tk_core_pre(base->core);
+ return d2tk_core_pre(base->core, pctx);
}
D2TK_API void
diff --git a/src/core.c b/src/core.c
index b4781ef..4ea6770 100644
--- a/src/core.c
+++ b/src/core.c
@@ -1233,8 +1233,8 @@ d2tk_core_stroke_width(d2tk_core_t *core, d2tk_coord_t width)
}
}
-D2TK_API void
-d2tk_core_pre(d2tk_core_t *core)
+D2TK_API int
+d2tk_core_pre(d2tk_core_t *core, void *pctx)
{
d2tk_mem_t *curmem = &core->mem[core->curmem];
@@ -1242,6 +1242,8 @@ d2tk_core_pre(d2tk_core_t *core)
core->parent = d2tk_core_bbox_container_push(core, 0,
&D2TK_RECT(0, 0, core->w, core->h));
+
+ return core->driver->context(core->data, pctx);
}
static inline bool
diff --git a/src/core_internal.h b/src/core_internal.h
index d46af9e..57416a3 100644
--- a/src/core_internal.h
+++ b/src/core_internal.h
@@ -29,8 +29,9 @@ extern "C" {
typedef struct _d2tk_clip_t d2tk_clip_t;
typedef struct _d2tk_com_t d2tk_com_t;
-typedef void *(*d2tk_core_new_t)(const char *bundle_path, void *pctx);
+typedef void *(*d2tk_core_new_t)(const char *bundle_path);
typedef void (*d2tk_core_free_t)(void *data);
+typedef int (*d2tk_core_context_t)(void *data, void *pctx);
typedef void (*d2tk_core_pre_t)(void *data, d2tk_core_t *core,
d2tk_coord_t w, d2tk_coord_t h, unsigned pass);
typedef bool (*d2tk_core_post_t)(void *data, d2tk_core_t *core,
@@ -73,6 +74,7 @@ struct _d2tk_clip_t {
struct _d2tk_core_driver_t {
d2tk_core_new_t new;
d2tk_core_free_t free;
+ d2tk_core_context_t context;
d2tk_core_pre_t pre;
d2tk_core_process_t process;
d2tk_core_post_t post;
diff --git a/src/frontend_fbdev.c b/src/frontend_fbdev.c
index e21dd91..f71dde6 100644
--- a/src/frontend_fbdev.c
+++ b/src/frontend_fbdev.c
@@ -198,12 +198,12 @@ _d2tk_frontend_expose(d2tk_frontend_t *fbdev)
do
{
- d2tk_base_pre(base);
-
- fbdev->config->expose(fbdev->config->data, w, h);
-
- d2tk_base_post(base);
+ if(d2tk_base_pre(base, NULL) == 0)
+ {
+ fbdev->config->expose(fbdev->config->data, w, h);
+ d2tk_base_post(base);
+ }
} while(d2tk_base_get_again(base));
_d2tk_frontend_sync(fbdev);
@@ -731,7 +731,7 @@ d2tk_fbdev_new(const d2tk_fbdev_config_t *config)
//cairo_destroy(ctx);
//cairo_surface_destroy(surf);
- fbdev->ctx = d2tk_core_driver.new(config->bundle_path, ctx);
+ fbdev->ctx = d2tk_core_driver.new(config->bundle_path);
if(!fbdev->ctx)
{
diff --git a/src/frontend_pugl.c b/src/frontend_pugl.c
index d89839e..125aa75 100644
--- a/src/frontend_pugl.c
+++ b/src/frontend_pugl.c
@@ -29,9 +29,9 @@
#include <pugl/pugl.h>
#if defined(PUGL_HAVE_CAIRO)
-# include <pugl/pugl_cairo_backend.h>
+# include <pugl/pugl_cairo.h>
#else
-# include <pugl/pugl_gl_backend.h>
+# include <pugl/pugl_gl.h>
#endif
#include "core_internal.h"
@@ -63,11 +63,12 @@ _d2tk_frontend_expose(d2tk_frontend_t *dpugl)
d2tk_coord_t h;
d2tk_base_get_dimensions(base, &w, &h);
- d2tk_base_pre(base);
-
- dpugl->config->expose(dpugl->config->data, w, h);
+ if(d2tk_base_pre(base, puglGetContext(dpugl->view)) == 0)
+ {
+ dpugl->config->expose(dpugl->config->data, w, h);
- d2tk_base_post(base);
+ d2tk_base_post(base);
+ }
}
static void
@@ -103,7 +104,7 @@ _d2tk_frontend_event_func(PuglView *view, const PuglEvent *e)
}
d2tk_base_set_dimensions(base, e->configure.width, e->configure.height);
- puglPostRedisplay(dpugl->view);
+ //puglPostRedisplay(dpugl->view);
} break;
case PUGL_EXPOSE:
{
@@ -123,8 +124,8 @@ _d2tk_frontend_event_func(PuglView *view, const PuglEvent *e)
puglPostRedisplay(dpugl->view);
} break;
- case PUGL_ENTER_NOTIFY:
- case PUGL_LEAVE_NOTIFY:
+ case PUGL_POINTER_IN:
+ case PUGL_POINTER_OUT:
{
_d2tk_frontend_modifiers(dpugl, e->crossing.state);
d2tk_base_set_mouse_pos(base, e->crossing.x, e->crossing.y);
@@ -163,7 +164,7 @@ _d2tk_frontend_event_func(PuglView *view, const PuglEvent *e)
puglPostRedisplay(dpugl->view);
} break;
- case PUGL_MOTION_NOTIFY:
+ case PUGL_MOTION:
{
_d2tk_frontend_modifiers(dpugl, e->motion.state);
d2tk_base_set_mouse_pos(base, e->motion.x, e->motion.y);
@@ -193,6 +194,7 @@ _d2tk_frontend_event_func(PuglView *view, const PuglEvent *e)
d2tk_base_set_keymask(base, D2TK_KEYMASK_BACKSPACE, true);
handled = true;
} break;
+/* XXX
case PUGL_KEY_TAB:
{
d2tk_base_set_keymask(base, D2TK_KEYMASK_TAB, true);
@@ -203,6 +205,7 @@ _d2tk_frontend_event_func(PuglView *view, const PuglEvent *e)
d2tk_base_set_keymask(base, D2TK_KEYMASK_ENTER, true);
handled = true;
} break;
+*/
case PUGL_KEY_ESCAPE:
{
d2tk_base_set_keymask(base, D2TK_KEYMASK_ESCAPE, true);
@@ -300,6 +303,7 @@ _d2tk_frontend_event_func(PuglView *view, const PuglEvent *e)
d2tk_base_set_keymask(base, D2TK_KEYMASK_BACKSPACE, false);
handled = true;
} break;
+/* XXX
case PUGL_KEY_TAB:
{
d2tk_base_set_keymask(base, D2TK_KEYMASK_TAB, false);
@@ -310,6 +314,7 @@ _d2tk_frontend_event_func(PuglView *view, const PuglEvent *e)
d2tk_base_set_keymask(base, D2TK_KEYMASK_ENTER, false);
handled = true;
} break;
+*/
case PUGL_KEY_ESCAPE:
{
d2tk_base_set_keymask(base, D2TK_KEYMASK_ESCAPE, false);
@@ -400,6 +405,54 @@ _d2tk_frontend_event_func(PuglView *view, const PuglEvent *e)
puglPostRedisplay(dpugl->view);
} break;
+ case PUGL_CREATE:
+ {
+ dpugl->ctx = d2tk_core_driver.new(dpugl->config->bundle_path);
+
+ if(!dpugl->ctx)
+ {
+ return PUGL_FAILURE;
+ }
+
+ dpugl->base = d2tk_base_new(&d2tk_core_driver, dpugl->ctx);
+ if(!dpugl->base)
+ {
+ return PUGL_FAILURE;
+ }
+
+ d2tk_base_set_dimensions(dpugl->base, dpugl->config->w, dpugl->config->h);
+ } break;
+ case PUGL_DESTROY:
+ {
+ if(dpugl->ctx)
+ {
+ if(dpugl->base)
+ {
+ d2tk_base_free(dpugl->base);
+ }
+ d2tk_core_driver.free(dpugl->ctx);
+ }
+ } break;
+ case PUGL_MAP:
+ {
+ // FIXME
+ } break;
+ case PUGL_UNMAP:
+ {
+ // FIXME
+ } break;
+ case PUGL_UPDATE:
+ {
+ puglPostRedisplay(dpugl->view);
+ } break;
+ case PUGL_CLIENT:
+ {
+ // FIXME
+ } break;
+ case PUGL_TIMER:
+ {
+ // FIXME
+ } break;
case PUGL_NOTHING:
{
// nothing
@@ -410,7 +463,7 @@ _d2tk_frontend_event_func(PuglView *view, const PuglEvent *e)
}
D2TK_API int
-d2tk_frontend_step(d2tk_frontend_t *dpugl)
+d2tk_frontend_poll(d2tk_frontend_t *dpugl, double timeout)
{
d2tk_base_probe(dpugl->base);
@@ -419,35 +472,24 @@ d2tk_frontend_step(d2tk_frontend_t *dpugl)
puglPostRedisplay(dpugl->view);
}
- const PuglStatus stat = puglDispatchEvents(dpugl->world);
+ const PuglStatus stat = puglUpdate(dpugl->world, timeout);
(void)stat;
return dpugl->done;
}
D2TK_API int
-d2tk_frontend_poll(d2tk_frontend_t *dpugl, double timeout)
+d2tk_frontend_step(d2tk_frontend_t *dpugl)
{
- const PuglStatus stat = puglPollEvents(dpugl->world, timeout);
- (void)stat;
-
- return dpugl->done;
+ return d2tk_frontend_poll(dpugl, 0.0);
}
D2TK_API void
d2tk_frontend_run(d2tk_frontend_t *dpugl, const sig_atomic_t *done)
{
- const unsigned fps = 25;
- const double timeout = 1.0 / fps;
-
while(!*done)
{
- if(d2tk_frontend_poll(dpugl, timeout))
- {
- break;
- }
-
- if(d2tk_frontend_step(dpugl))
+ if(d2tk_frontend_poll(dpugl, -1.0))
{
break;
}
@@ -457,17 +499,6 @@ d2tk_frontend_run(d2tk_frontend_t *dpugl, const sig_atomic_t *done)
D2TK_API void
d2tk_frontend_free(d2tk_frontend_t *dpugl)
{
- if(dpugl->ctx)
- {
- puglEnterContext(dpugl->view, false);
- if(dpugl->base)
- {
- d2tk_base_free(dpugl->base);
- }
- d2tk_core_driver.free(dpugl->ctx);
- puglLeaveContext(dpugl->view, false);
- }
-
if(dpugl->world)
{
if(dpugl->view)
@@ -543,7 +574,8 @@ d2tk_pugl_new(const d2tk_pugl_config_t *config, uintptr_t *widget)
dpugl->config = config;
- dpugl->world = puglNewWorld();
+ dpugl->world = puglNewWorld(config->parent ? PUGL_MODULE : PUGL_PROGRAM,
+ PUGL_WORLD_THREADS);
if(!dpugl->world)
{
fprintf(stderr, "puglNewWorld failed\n");
@@ -584,6 +616,8 @@ d2tk_pugl_new(const d2tk_pugl_config_t *config, uintptr_t *widget)
config->w, config->h);
}
puglSetViewHint(dpugl->view, PUGL_RESIZABLE, !config->fixed_size);
+ puglSetViewHint(dpugl->view, PUGL_DOUBLE_BUFFER, false);
+ puglSetViewHint(dpugl->view, PUGL_SWAP_INTERVAL, 1);
puglSetHandle(dpugl->view, dpugl);
puglSetEventFunc(dpugl->view, _d2tk_frontend_event_func);
@@ -606,24 +640,6 @@ d2tk_pugl_new(const d2tk_pugl_config_t *config, uintptr_t *widget)
*widget = puglGetNativeWindow(dpugl->view);
}
- puglEnterContext(dpugl->view, false);
- void *ctx = puglGetContext(dpugl->view);
- dpugl->ctx = d2tk_core_driver.new(config->bundle_path, ctx);
- puglLeaveContext(dpugl->view, false);
-
- if(!dpugl->ctx)
- {
- goto fail;
- }
-
- dpugl->base = d2tk_base_new(&d2tk_core_driver, dpugl->ctx);
- if(!dpugl->base)
- {
- goto fail;
- }
-
- d2tk_base_set_dimensions(dpugl->base, config->w, config->h);
-
return dpugl;
fail:
@@ -633,13 +649,6 @@ fail:
{
if(dpugl->view)
{
- if(dpugl->ctx)
- {
- puglEnterContext(dpugl->view, false);
- d2tk_core_driver.free(dpugl->ctx);
- puglLeaveContext(dpugl->view, false);
- }
-
puglFreeView(dpugl->view);
}
puglFreeWorld(dpugl->world);
diff --git a/test/base.c b/test/base.c
index 7405a31..4826216 100644
--- a/test/base.c
+++ b/test/base.c
@@ -82,7 +82,7 @@ _test_hot()
d2tk_base_set_mouse_pos(base, mx, my);
- d2tk_base_pre(base);
+ d2tk_base_pre(base, NULL);
_expose_hot(base, &rect, N, p);
@@ -93,7 +93,7 @@ _test_hot()
// trigger garbage collector
for(unsigned i = 0; i < 0x400; i++)
{
- d2tk_base_pre(base);
+ d2tk_base_pre(base, NULL);
d2tk_base_post(base);
assert(!d2tk_base_get_again(base));
}
@@ -199,7 +199,7 @@ _test_mouse_fwd_focus()
d2tk_base_set_mouse_pos(base, mx, my);
d2tk_base_set_butmask(base, D2TK_BUTMASK_LEFT, true);
- d2tk_base_pre(base);
+ d2tk_base_pre(base, NULL);
_expose_mouse_fwd_focus(base, &rect, N, p, true);
@@ -210,7 +210,7 @@ _test_mouse_fwd_focus()
{
d2tk_base_set_butmask(base, D2TK_BUTMASK_LEFT, false);
- d2tk_base_pre(base);
+ d2tk_base_pre(base, NULL);
_expose_mouse_fwd_focus(base, &rect, N, p, false);
@@ -222,7 +222,7 @@ _test_mouse_fwd_focus()
// trigger garbage collector
for(unsigned i = 0; i < 0x400; i++)
{
- d2tk_base_pre(base);
+ d2tk_base_pre(base, NULL);
d2tk_base_post(base);
assert(!d2tk_base_get_again(base));
}
@@ -327,7 +327,7 @@ _test_mouse_bwd_focus()
d2tk_base_set_mouse_pos(base, mx, my);
d2tk_base_set_butmask(base, D2TK_BUTMASK_LEFT, true);
- d2tk_base_pre(base);
+ d2tk_base_pre(base, NULL);
_expose_mouse_bwd_focus(base, &rect, N, p, true);
@@ -338,7 +338,7 @@ _test_mouse_bwd_focus()
{
d2tk_base_set_butmask(base, D2TK_BUTMASK_LEFT, false);
- d2tk_base_pre(base);
+ d2tk_base_pre(base, NULL);
_expose_mouse_bwd_focus(base, &rect, N, p, false);
@@ -350,7 +350,7 @@ _test_mouse_bwd_focus()
// trigger garbage collector
for(unsigned i = 0; i < 0x400; i++)
{
- d2tk_base_pre(base);
+ d2tk_base_pre(base, NULL);
d2tk_base_post(base);
assert(!d2tk_base_get_again(base));
}
@@ -440,7 +440,7 @@ _test_key_fwd_focus()
d2tk_base_set_modmask(base, D2TK_MODMASK_CTRL, true);
d2tk_base_set_keymask(base, D2TK_KEYMASK_RIGHT, true);
- d2tk_base_pre(base);
+ d2tk_base_pre(base, NULL);
_expose_key_fwd_focus(base, &rect, N, p, true);
@@ -452,7 +452,7 @@ _test_key_fwd_focus()
d2tk_base_set_keymask(base, D2TK_KEYMASK_RIGHT, false);
d2tk_base_set_modmask(base, D2TK_MODMASK_CTRL, false);
- d2tk_base_pre(base);
+ d2tk_base_pre(base, NULL);
_expose_key_fwd_focus(base, &rect, N, p, false);
@@ -464,7 +464,7 @@ _test_key_fwd_focus()
// trigger garbage collector
for(unsigned i = 0; i < 0x400; i++)
{
- d2tk_base_pre(base);
+ d2tk_base_pre(base, NULL);
d2tk_base_post(base);
assert(!d2tk_base_get_again(base));
}
@@ -546,7 +546,7 @@ _test_key_bwd_focus()
d2tk_base_set_modmask(base, D2TK_MODMASK_CTRL, true);
d2tk_base_set_keymask(base, D2TK_KEYMASK_LEFT, true);
- d2tk_base_pre(base);
+ d2tk_base_pre(base, NULL);
_expose_key_bwd_focus(base, &rect, N, p, true);
@@ -558,7 +558,7 @@ _test_key_bwd_focus()
d2tk_base_set_keymask(base, D2TK_KEYMASK_LEFT, false);
d2tk_base_set_modmask(base, D2TK_MODMASK_CTRL, false);
- d2tk_base_pre(base);
+ d2tk_base_pre(base, NULL);
_expose_key_bwd_focus(base, &rect, N, p, false);
@@ -570,7 +570,7 @@ _test_key_bwd_focus()
// trigger garbage collector
for(unsigned i = 0; i < 0x400; i++)
{
- d2tk_base_pre(base);
+ d2tk_base_pre(base, NULL);
d2tk_base_post(base);
assert(!d2tk_base_get_again(base));
}
diff --git a/test/core.c b/test/core.c
index 0cbaa25..a7dc40b 100644
--- a/test/core.c
+++ b/test/core.c
@@ -178,7 +178,7 @@ _test_move_to()
d2tk_core_set_dimensions(core, DIM_W, DIM_H);
- d2tk_core_pre(core);
+ d2tk_core_pre(core, NULL);
const ssize_t ref = d2tk_core_bbox_push(core, true,
&D2TK_RECT(CLIP_X, CLIP_Y, CLIP_W, CLIP_H));
assert(ref >= 0);
@@ -191,7 +191,7 @@ _test_move_to()
// trigger garbage collector
for(unsigned i = 0; i < 0x400; i++)
{
- d2tk_core_pre(core);
+ d2tk_core_pre(core, NULL);
d2tk_core_post(core);
}
@@ -232,7 +232,7 @@ _test_line_to()
d2tk_core_set_dimensions(core, DIM_W, DIM_H);
- d2tk_core_pre(core);
+ d2tk_core_pre(core, NULL);
const ssize_t ref = d2tk_core_bbox_push(core, true,
&D2TK_RECT(CLIP_X, CLIP_Y, CLIP_W, CLIP_H));
assert(ref >= 0);
@@ -282,7 +282,7 @@ _test_rect()
d2tk_core_set_dimensions(core, DIM_W, DIM_H);
- d2tk_core_pre(core);
+ d2tk_core_pre(core, NULL);
const ssize_t ref = d2tk_core_bbox_push(core, true,
&D2TK_RECT(CLIP_X, CLIP_Y, CLIP_W, CLIP_H));
assert(ref >= 0);
@@ -336,7 +336,7 @@ _test_rounded_rect()
d2tk_core_set_dimensions(core, DIM_W, DIM_H);
- d2tk_core_pre(core);
+ d2tk_core_pre(core, NULL);
const ssize_t ref = d2tk_core_bbox_push(core, true,
&D2TK_RECT(CLIP_X, CLIP_Y, CLIP_W, CLIP_H));
assert(ref >= 0);
@@ -395,7 +395,7 @@ _test_arc()
d2tk_core_set_dimensions(core, DIM_W, DIM_H);
- d2tk_core_pre(core);
+ d2tk_core_pre(core, NULL);
const ssize_t ref = d2tk_core_bbox_push(core, true,
&D2TK_RECT(CLIP_X, CLIP_Y, CLIP_W, CLIP_H));
assert(ref >= 0);
@@ -453,7 +453,7 @@ _test_curve_to()
d2tk_core_set_dimensions(core, DIM_W, DIM_H);
- d2tk_core_pre(core);
+ d2tk_core_pre(core, NULL);
const ssize_t ref = d2tk_core_bbox_push(core, true,
&D2TK_RECT(CLIP_X, CLIP_Y, CLIP_W, CLIP_H));
assert(ref >= 0);
@@ -502,7 +502,7 @@ _test_color()
d2tk_core_set_dimensions(core, DIM_W, DIM_H);
- d2tk_core_pre(core);
+ d2tk_core_pre(core, NULL);
const ssize_t ref = d2tk_core_bbox_push(core, true,
&D2TK_RECT(CLIP_X, CLIP_Y, CLIP_W, CLIP_H));
assert(ref >= 0);
@@ -555,7 +555,7 @@ _test_linear_gradient()
d2tk_core_set_dimensions(core, DIM_W, DIM_H);
- d2tk_core_pre(core);
+ d2tk_core_pre(core, NULL);
const ssize_t ref = d2tk_core_bbox_push(core, true,
&D2TK_RECT(CLIP_X, CLIP_Y, CLIP_W, CLIP_H));
assert(ref >= 0);
@@ -608,7 +608,7 @@ _test_stroke()
d2tk_core_set_dimensions(core, DIM_W, DIM_H);
- d2tk_core_pre(core);
+ d2tk_core_pre(core, NULL);
const ssize_t ref = d2tk_core_bbox_push(core, true,
&D2TK_RECT(CLIP_X, CLIP_Y, CLIP_W, CLIP_H));
assert(ref >= 0);
@@ -646,7 +646,7 @@ _test_fill()
d2tk_core_set_dimensions(core, DIM_W, DIM_H);
- d2tk_core_pre(core);
+ d2tk_core_pre(core, NULL);
const ssize_t ref = d2tk_core_bbox_push(core, true,
&D2TK_RECT(CLIP_X, CLIP_Y, CLIP_W, CLIP_H));
assert(ref >= 0);
@@ -684,7 +684,7 @@ _test_save()
d2tk_core_set_dimensions(core, DIM_W, DIM_H);
- d2tk_core_pre(core);
+ d2tk_core_pre(core, NULL);
const ssize_t ref = d2tk_core_bbox_push(core, true,
&D2TK_RECT(CLIP_X, CLIP_Y, CLIP_W, CLIP_H));
assert(ref >= 0);
@@ -722,7 +722,7 @@ _test_restore()
d2tk_core_set_dimensions(core, DIM_W, DIM_H);
- d2tk_core_pre(core);
+ d2tk_core_pre(core, NULL);
const ssize_t ref = d2tk_core_bbox_push(core, true,
&D2TK_RECT(CLIP_X, CLIP_Y, CLIP_W, CLIP_H));
assert(ref >= 0);
@@ -763,7 +763,7 @@ _test_rotate()
d2tk_core_set_dimensions(core, DIM_W, DIM_H);
- d2tk_core_pre(core);
+ d2tk_core_pre(core, NULL);
const ssize_t ref = d2tk_core_bbox_push(core, true,
&D2TK_RECT(CLIP_X, CLIP_Y, CLIP_W, CLIP_H));
assert(ref >= 0);
@@ -803,7 +803,7 @@ _test_begin_path()
d2tk_core_set_dimensions(core, DIM_W, DIM_H);
- d2tk_core_pre(core);
+ d2tk_core_pre(core, NULL);
const ssize_t ref = d2tk_core_bbox_push(core, true,
&D2TK_RECT(CLIP_X, CLIP_Y, CLIP_W, CLIP_H));
assert(ref >= 0);
@@ -841,7 +841,7 @@ _test_close_path()
d2tk_core_set_dimensions(core, DIM_W, DIM_H);
- d2tk_core_pre(core);
+ d2tk_core_pre(core, NULL);
const ssize_t ref = d2tk_core_bbox_push(core, true,
&D2TK_RECT(CLIP_X, CLIP_Y, CLIP_W, CLIP_H));
assert(ref >= 0);
@@ -888,7 +888,7 @@ _test_scissor()
d2tk_core_set_dimensions(core, DIM_W, DIM_H);
- d2tk_core_pre(core);
+ d2tk_core_pre(core, NULL);
const ssize_t ref = d2tk_core_bbox_push(core, true,
&D2TK_RECT(CLIP_X, CLIP_Y, CLIP_W, CLIP_H));
assert(ref >= 0);
@@ -931,7 +931,7 @@ _test_reset_scissor()
d2tk_core_set_dimensions(core, DIM_W, DIM_H);
- d2tk_core_pre(core);
+ d2tk_core_pre(core, NULL);
const ssize_t ref = d2tk_core_bbox_push(core, true,
&D2TK_RECT(CLIP_X, CLIP_Y, CLIP_W, CLIP_H));
assert(ref >= 0);
@@ -972,7 +972,7 @@ _test_font_size()
d2tk_core_set_dimensions(core, DIM_W, DIM_H);
- d2tk_core_pre(core);
+ d2tk_core_pre(core, NULL);
const ssize_t ref = d2tk_core_bbox_push(core, true,
&D2TK_RECT(CLIP_X, CLIP_Y, CLIP_W, CLIP_H));
assert(ref >= 0);
@@ -1015,7 +1015,7 @@ _test_font_face()
d2tk_core_set_dimensions(core, DIM_W, DIM_H);
- d2tk_core_pre(core);
+ d2tk_core_pre(core, NULL);
const ssize_t ref = d2tk_core_bbox_push(core, true,
&D2TK_RECT(CLIP_X, CLIP_Y, CLIP_W, CLIP_H));
assert(ref >= 0);
@@ -1068,7 +1068,7 @@ _test_text()
d2tk_core_set_dimensions(core, DIM_W, DIM_H);
- d2tk_core_pre(core);
+ d2tk_core_pre(core, NULL);
const ssize_t ref = d2tk_core_bbox_push(core, true,
&D2TK_RECT(CLIP_X, CLIP_Y, CLIP_W, CLIP_H));
assert(ref >= 0);
@@ -1127,7 +1127,7 @@ _test_image()
d2tk_core_set_dimensions(core, DIM_W, DIM_H);
- d2tk_core_pre(core);
+ d2tk_core_pre(core, NULL);
const ssize_t ref = d2tk_core_bbox_push(core, true,
&D2TK_RECT(CLIP_X, CLIP_Y, CLIP_W, CLIP_H));
assert(ref >= 0);
@@ -1201,7 +1201,7 @@ _test_bitmap()
d2tk_core_set_dimensions(core, DIM_W, DIM_H);
- d2tk_core_pre(core);
+ d2tk_core_pre(core, NULL);
const ssize_t ref = d2tk_core_bbox_push(core, true,
&D2TK_RECT(CLIP_X, CLIP_Y, CLIP_W, CLIP_H));
assert(ref >= 0);
@@ -1286,7 +1286,7 @@ _test_custom()
d2tk_core_set_dimensions(core, DIM_W, DIM_H);
- d2tk_core_pre(core);
+ d2tk_core_pre(core, NULL);
const ssize_t ref = d2tk_core_bbox_push(core, true,
&D2TK_RECT(CLIP_X, CLIP_Y, CLIP_W, CLIP_H));
assert(ref >= 0);
@@ -1335,7 +1335,7 @@ _test_stroke_width()
d2tk_core_set_dimensions(core, DIM_W, DIM_H);
- d2tk_core_pre(core);
+ d2tk_core_pre(core, NULL);
const ssize_t ref = d2tk_core_bbox_push(core, true,
&D2TK_RECT(CLIP_X, CLIP_Y, CLIP_W, CLIP_H));
assert(ref >= 0);
@@ -1376,7 +1376,7 @@ _test_triple()
for(unsigned i = 0; i < 3; i++)
{
- d2tk_core_pre(core);
+ d2tk_core_pre(core, NULL);
if(i != 0)
{