aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Hanspeter Portner <dev@open-music-kontrollers.ch>2017-09-10 23:23:48 +0200
committerGravatar Hanspeter Portner <dev@open-music-kontrollers.ch>2017-09-10 23:23:48 +0200
commit7bb62715125ee4f562d9407ff124b2a6a7666be4 (patch)
tree152f5930eab5ae11779860fc51b096b2056cc913
parentbb122d00a658ab242d4eea88d20da87bff959b22 (diff)
downloadcanvas.lv2-7bb62715125ee4f562d9407ff124b2a6a7666be4.zip
canvas.lv2-7bb62715125ee4f562d9407ff124b2a6a7666be4.tar.gz
canvas.lv2-7bb62715125ee4f562d9407ff124b2a6a7666be4.tar.bz2
canvas.lv2-7bb62715125ee4f562d9407ff124b2a6a7666be4.tar.xz
move initial draw into run function.
-rw-r--r--CMakeLists.txt12
-rw-r--r--VERSION2
-rw-r--r--test/canvas.c12
3 files changed, 17 insertions, 9 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b785aba..21be30d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -12,17 +12,19 @@ set(CMAKE_C_FLAGS "-fdata-sections -ffunction-sections ${CMAKE_C_FLAGS}")
set(CMAKE_C_FLAGS "-std=gnu11 -Wextra -Wno-unused-parameter -ffast-math -fvisibility=hidden ${CMAKE_C_FLAGS}")
set(CMAKE_C_FLAGS "-Wshadow -Wimplicit-function-declaration -Wredundant-decls -Wmissing-prototypes -Wstrict-prototypes ${CMAKE_C_FLAGS}")
-if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
+if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(CMAKE_MODULE_LINKER_FLAGS "-Wl,-z,defs ${CMAKE_MODULE_LINKER_FLAGS}")
set(CMAKE_MODULE_LINKER_FLAGS "-Wl,-z,nodelete ${CMAKE_MODULE_LINKER_FLAGS}")
elseif(WIN32)
set(CMAKE_C_FLAGS "-mstackrealign ${CMAKE_C_FLAGS}")
endif()
-if(APPLE)
- set(CMAKE_MODULE_LINKER_FLAGS "-Wl,-dead_strip ${CMAKE_MODULE_LINKER_FLAGS}")
-else()
- set(CMAKE_MODULE_LINKER_FLAGS "-Wl,--gc-sections -Wl,-s ${CMAKE_MODULE_LINKER_FLAGS}")
+if(CMAKE_BUILD_TYPE STREQUAL "Release")
+ if(APPLE)
+ set(CMAKE_MODULE_LINKER_FLAGS "-Wl,-dead_strip ${CMAKE_MODULE_LINKER_FLAGS}")
+ else()
+ set(CMAKE_MODULE_LINKER_FLAGS "-Wl,--gc-sections -Wl,-s ${CMAKE_MODULE_LINKER_FLAGS}")
+ endif()
endif()
add_definitions("-D_GNU_SOURCE=1") # asprintf
diff --git a/VERSION b/VERSION
index 0d8cb7f..9ec8136 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-0.1.333
+0.3.19
diff --git a/test/canvas.c b/test/canvas.c
index 7a53e76..4885a0c 100644
--- a/test/canvas.c
+++ b/test/canvas.c
@@ -63,6 +63,7 @@ struct _plughandle_t {
} cairo;
LV2_Canvas canvas;
+ bool dirty;
union {
LV2_Atom_Tuple graph;
@@ -198,8 +199,7 @@ instantiate(const LV2_Descriptor* descriptor, double rate,
if(ref)
lv2_atom_forge_pop(&handle->forge, &frame);
- if(handle->queue_draw)
- handle->queue_draw->queue_draw(handle->queue_draw->handle);
+ handle->dirty = true;
return handle;
}
@@ -228,6 +228,12 @@ run(LV2_Handle instance, uint32_t nsamples)
{
plughandle_t *handle = instance;
+ if(handle->dirty && handle->queue_draw)
+ {
+ handle->queue_draw->queue_draw(handle->queue_draw->handle);
+ handle->dirty = false;
+ }
+
const uint32_t capacity = handle->notify->atom.size;
lv2_atom_forge_set_buffer(&handle->forge, (uint8_t *)handle->notify, capacity);
LV2_Atom_Forge_Frame frame;
@@ -528,7 +534,7 @@ _render(LV2_Handle instance, uint32_t w, uint32_t h)
plughandle_t *handle = instance;
LV2_Inline_Display_Image_Surface *surf = &handle->image_surface;
- if( (surf->width != (int)w) || (surf->height > (int)h) || !surf->data)
+ if( (surf->width != (int)w) || (surf->height != (int)h) || !surf->data)
{
_cairo_deinit(handle);
surf = _cairo_init(handle, w, h);