Commit 53978ae3 authored by Hanspeter Portner's avatar Hanspeter Portner

idisp: add optional cairo dependency.

parent 8e2cfed9
Pipeline #4529145 passed with stages
in 5 minutes and 38 seconds
......@@ -62,9 +62,22 @@ set(LIBS ${LIBS} ${LV2_LDFLAGS})
include(CMakeDependentOption)
option(BUILD_SIMPLE_UI "Build simple external UI" OFF)
option(BUILD_WEB_UI "Build web-based external UI" ON)
option(BUILD_INLINE_DISPLAY "Build inline display" OFF)
option(USE_MANUAL_GC "Use manual garbage collection" OFF)
option(USE_VERBOSE_LOG "Use verbose log for websocket" OFF)
if(BUILD_INLINE_DISPLAY)
add_definitions("-DBUILD_INLINE_DISPLAY")
pkg_search_module(CAIRO REQUIRED cairo>=1.14.0)
include_directories(${CAIRO_INCLUDE_DIRS})
if(DEFINED STATIC_CAIRO)
set(LIBS ${STATIC_PIXMAN} ${STATIC_CAIRO} ${LIBS})
else()
set(LIBS ${LIBS} ${CAIRO_LDFLAGS})
endif()
endif()
if(USE_MANUAL_GC)
add_definitions("-DUSE_MANUAL_GC")
endif()
......
......@@ -25,6 +25,10 @@
#include <aes.h>
#include <osc.lv2/endian.h>
#ifdef BUILD_INLINE_DISPLAY
# include <cairo.h>
#endif
#include <api_atom.h>
#include <api_forge.h>
#include <api_stash.h>
......@@ -960,6 +964,7 @@ static const LV2_Worker_Interface work_iface = {
.end_run = _end_run
};
#ifdef BUILD_INLINE_DISPLAY
// Xiaolin Wu's line algorithm
static inline void
_wu_plot(uint32_t *surf, uint32_t stride, int x, int y, float c, uint32_t col)
......@@ -1081,6 +1086,7 @@ _wu_line(uint32_t *surf, uint32_t stride, float x0, float y0, float x1, float y1
}
}
}
#endif
// non-rt
static LV2_Inline_Display_Image_Surface *
......@@ -1088,6 +1094,7 @@ _render(LV2_Handle instance, uint32_t w, uint32_t h)
{
moony_t *moony = instance;
#ifdef BUILD_INLINE_DISPLAY
// prepare pixel surface in all cases
LV2_Inline_Display_Image_Surface *surf = &moony->image_surface;
......@@ -1146,6 +1153,9 @@ _render(LV2_Handle instance, uint32_t w, uint32_t h)
_unlock(&moony->lock.render);
return surf;
#else
return NULL;
#endif
}
static const LV2_Inline_Display_Interface inlinedisplay_iface = {
......
......@@ -20,5 +20,7 @@ set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(STATIC_LWS "/opt/${TOOLCHAIN}/lib/libwebsockets.a")
set(STATIC_SERD "/opt/${TOOLCHAIN}/lib/libserd-0.a")
set(STATIC_SORD "/opt/${TOOLCHAIN}/lib/libsord-0.a")
set(STATIC_CAIRO "/opt/${TOOLCHAIN}/lib/libcairo.a")
set(STATIC_PIXMAN "/opt/${TOOLCHAIN}/lib/libpixman-1.a")
set(QEMU qemu-arm)
......@@ -9,3 +9,5 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32" CACHE STRING "c flags")
set(STATIC_LWS "/opt/${TOOLCHAIN}/lib/libwebsockets.a")
set(STATIC_SERD "/opt/${TOOLCHAIN}/lib/libserd-0.a")
set(STATIC_SORD "/opt/${TOOLCHAIN}/lib/libsord-0.a")
set(STATIC_CAIRO "/opt/${TOOLCHAIN}/lib/libcairo.a")
set(STATIC_PIXMAN "/opt/${TOOLCHAIN}/lib/libpixman-1.a")
......@@ -21,6 +21,9 @@ set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(STATIC_LWS "/opt/${TOOLCHAIN}/lib/libwebsockets_static.a")
set(STATIC_SERD "/opt/${TOOLCHAIN}/lib/libserd-0.a")
set(STATIC_SORD "/opt/${TOOLCHAIN}/lib/libsord-0.a")
set(STATIC_CAIRO "/opt/${TOOLCHAIN}/lib/libcairo.a")
set(STATIC_PIXMAN "/opt/${TOOLCHAIN}/lib/libpixman-1.a")
set(LIBS ${LIBS} "-static-libgcc -lws2_32")
set(LIBS_WEB ${LIBS_WEB} "-static-libgcc -lws2_32")
......
......@@ -22,3 +22,5 @@ set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(STATIC_LWS "/opt/${TOOLCHAIN}/lib/libwebsockets.a")
set(STATIC_SERD "/opt/${TOOLCHAIN}/lib/libserd-0.a")
set(STATIC_SORD "/opt/${TOOLCHAIN}/lib/libsord-0.a")
set(STATIC_CAIRO "/opt/${TOOLCHAIN}/lib/libcairo.a")
set(STATIC_PIXMAN "/opt/${TOOLCHAIN}/lib/libpixman-1.a")
......@@ -6,3 +6,5 @@ set(TOOLCHAIN "x86_64-linux-gnu")
set(STATIC_LWS "/opt/${TOOLCHAIN}/lib/libwebsockets.a")
set(STATIC_SERD "/opt/${TOOLCHAIN}/lib/libserd-0.a")
set(STATIC_SORD "/opt/${TOOLCHAIN}/lib/libsord-0.a")
set(STATIC_CAIRO "/opt/${TOOLCHAIN}/lib/libcairo.a")
set(STATIC_PIXMAN "/opt/${TOOLCHAIN}/lib/libpixman-1.a")
......@@ -21,6 +21,9 @@ set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(STATIC_LWS "/opt/${TOOLCHAIN}/lib/libwebsockets_static.a")
set(STATIC_SERD "/opt/${TOOLCHAIN}/lib/libserd-0.a")
set(STATIC_SORD "/opt/${TOOLCHAIN}/lib/libsord-0.a")
set(STATIC_CAIRO "/opt/${TOOLCHAIN}/lib/libcairo.a")
set(STATIC_PIXMAN "/opt/${TOOLCHAIN}/lib/libpixman-1.a")
set(LIBS ${LIBS} "-static-libgcc -lws2_32")
set(LIBS_WEB ${LIBS_WEB} "-static-libgcc -lws2_32")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment