/* * multiple contexts in separate thread on temp surface for each thread * guarded blit on final surface. */ #include "test.h" #include "tinycthread.h" #define THREAD_COUNT 16 static int finishedThreadCount = 0; static mtx_t* pmutex; void drawRandomRect (VkvgContext ctx, float s) { float w = (float)test_width; float h = (float)test_height; randomize_color(ctx); float x = truncf(w*rndf()); float y = truncf(h*rndf()); vkvg_rectangle(ctx, x, y, s, s); } int _single_font_and_size () { VkvgSurface s = vkvg_surface_create(device, test_width, test_height); VkvgContext ctx = vkvg_create(s); vkvg_clear(ctx); for (uint32_t i=0; i