+static void
+render_inline_only_bars (cairo_t* cr, const AComp* self)
+{
+ draw_inline_bars (cr, self->w, self->h,
+ self->v_thresdb, self->v_ratio,
+ self->v_peakdb, self->v_gainr,
+ self->v_lvl_in, self->v_lvl_out);
+}
+
+static LV2_Inline_Display_Image_Surface *
+render_inline (LV2_Handle instance, uint32_t w, uint32_t max_h)
+{
+ AComp* self = (AComp*)instance;
+
+ uint32_t h = MIN (w, max_h);
+ if (w < 200 && !self->v_full_inline_display) {
+ h = MIN (40, max_h);
+ }
+
+ if (!self->display || self->w != w || self->h != h) {
+ if (self->display) cairo_surface_destroy(self->display);
+ self->display = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, w, h);
+ self->w = w;
+ self->h = h;
+ }
+
+ cairo_t* cr = cairo_create (self->display);
+
+ if (w >= 200 || self->v_full_inline_display) {
+ render_inline_full (cr, self);
+ } else {
+ render_inline_only_bars (cr, self);
+ }