From aa8a0fc91e4c77081efce74172b5e58b2b4ea68c Mon Sep 17 00:00:00 2001 From: Hanspeter Portner Date: Wed, 14 Jul 2021 23:07:18 +0200 Subject: [PATCH] Squashed 'canvas.lv2/' changes from 7b775b4..9312797 9312797 add define to skip nanovg implementation. 0263395 include render_cairo.h in idisp.h. b700b88 Use GLES3, deprecate direct inclusion of render.h. git-subtree-dir: canvas.lv2 git-subtree-split: 93127979df1af3f7e5f8ef4f255ba2d6366d893c --- canvas.lv2/canvas.h | 2 +- canvas.lv2/forge.h | 2 +- canvas.lv2/idisp.h | 5 ++--- canvas.lv2/render.h | 13 ++++--------- canvas.lv2/render_cairo.h | 4 ++-- canvas.lv2/render_nanovg.h | 13 +++++++++++-- 6 files changed, 21 insertions(+), 18 deletions(-) diff --git a/canvas.lv2/canvas.h b/canvas.lv2/canvas.h index 7cca0fa..22e39b2 100644 --- a/canvas.lv2/canvas.h +++ b/canvas.lv2/canvas.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016 Hanspeter Portner (dev@open-music-kontrollers.ch) + * Copyright (c) 2016-2021 Hanspeter Portner (dev@open-music-kontrollers.ch) * * This is free software: you can redistribute it and/or modify * it under the terms of the Artistic License 2.0 as published by diff --git a/canvas.lv2/forge.h b/canvas.lv2/forge.h index c5ce5fe..ae9ab68 100644 --- a/canvas.lv2/forge.h +++ b/canvas.lv2/forge.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016 Hanspeter Portner (dev@open-music-kontrollers.ch) + * Copyright (c) 2016-2021 Hanspeter Portner (dev@open-music-kontrollers.ch) * * This is free software: you can redistribute it and/or modify * it under the terms of the Artistic License 2.0 as published by diff --git a/canvas.lv2/idisp.h b/canvas.lv2/idisp.h index 099ab2c..7ff24fa 100644 --- a/canvas.lv2/idisp.h +++ b/canvas.lv2/idisp.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016 Hanspeter Portner (dev@open-music-kontrollers.ch) + * Copyright (c) 2016-2021 Hanspeter Portner (dev@open-music-kontrollers.ch) * * This is free software: you can redistribute it and/or modify * it under the terms of the Artistic License 2.0 as published by @@ -22,8 +22,7 @@ extern "C" { #endif -#define LV2_CANVAS_RENDER_CAIRO -#include +#include #include typedef struct _LV2_Canvas_Idisp LV2_Canvas_Idisp; diff --git a/canvas.lv2/render.h b/canvas.lv2/render.h index b809804..6d9580c 100644 --- a/canvas.lv2/render.h +++ b/canvas.lv2/render.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016 Hanspeter Portner (dev@open-music-kontrollers.ch) + * Copyright (c) 2016-2021 Hanspeter Portner (dev@open-music-kontrollers.ch) * * This is free software: you can redistribute it and/or modify * it under the terms of the Artistic License 2.0 as published by @@ -18,12 +18,13 @@ #ifndef _LV2_CANVAS_RENDER_H #define _LV2_CANVAS_RENDER_H +// Do NOT use this header directly, use render_{nanovg,cairo}.h instead +#include + #ifdef __cplusplus extern "C" { #endif -#include - #define LV2_CANVAS_NUM_METHODS 26 typedef struct _LV2_Canvas_Meth LV2_Canvas_Meth; @@ -78,10 +79,4 @@ _lv2_canvas_render_get_type(const LV2_Atom *body, LV2_URID type) } #endif -#if defined(LV2_CANVAS_RENDER_NANOVG) -# include -#else -# include -#endif - #endif // _LV2_CANVAS_RENDER_H diff --git a/canvas.lv2/render_cairo.h b/canvas.lv2/render_cairo.h index a41c72c..c251699 100644 --- a/canvas.lv2/render_cairo.h +++ b/canvas.lv2/render_cairo.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016 Hanspeter Portner (dev@open-music-kontrollers.ch) + * Copyright (c) 2016-2021 Hanspeter Portner (dev@open-music-kontrollers.ch) * * This is free software: you can redistribute it and/or modify * it under the terms of the Artistic License 2.0 as published by @@ -20,7 +20,7 @@ #include -#include +#include #include diff --git a/canvas.lv2/render_nanovg.h b/canvas.lv2/render_nanovg.h index a98bc95..3449d4a 100644 --- a/canvas.lv2/render_nanovg.h +++ b/canvas.lv2/render_nanovg.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016 Hanspeter Portner (dev@open-music-kontrollers.ch) + * Copyright (c) 2016-2021 Hanspeter Portner (dev@open-music-kontrollers.ch) * * This is free software: you can redistribute it and/or modify * it under the terms of the Artistic License 2.0 as published by @@ -20,6 +20,8 @@ #include +#include + #include #if defined(__APPLE__) @@ -29,8 +31,15 @@ # include #endif -#define NANOVG_GL2_IMPLEMENTATION +#if !defined(LV2_CANVAS_RENDER_NANOVG_NO_IMPLEMENTATION) +# define NANOVG_GLES3_IMPLEMENTATION +#endif + #include +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wsign-compare" +#include +#pragma GCC diagnostic pop #if defined(NANOVG_GL2_IMPLEMENTATION) # define nvgCreate nvgCreateGL2 -- 2.38.5