Commit Graph

259 Commits

Author SHA1 Message Date
Robin Gareus
2177462b73 NO-OP: consistent function and variable naming 2020-04-10 18:06:42 +02:00
Robin Gareus
9bbedcb781 Remove unused function
Cairo::curve_to renders cubic Bézier splines, those are not
generally useful in a DAW context.

Canvas::Curve implements centripetal catmull-rom spline drawing
which can be used for fades and automation interpolation.
2020-04-10 18:06:42 +02:00
Robin Gareus
7bb8ca1e76 Interpolate poly-line with view-point #6481 2020-04-10 18:06:41 +02:00
Robin Gareus
6cc1e5e75d NO-OP: whitespace 2020-04-10 18:06:39 +02:00
André Nusser
0a1ed004f2 Remove unused forward declaration. 2020-02-24 23:01:15 +01:00
Robin Gareus
0b266a54f0 Return of image-surface backed canvas (windows graphics performance)
This partially reverts 2edbda2526.

Using cairo-groups increases performance on MacOS, and retains
retina-resolution.
However it adds a performance regression for MS Windows graphics
rendering. cairo-groups use a "similar" surface, not an image surface.
Empirically this adds significant overhead compared to rendering
using the CPU and using bitblt.
2020-01-04 00:30:07 +01:00
Robin Gareus
2edbda2526 Replace explicit image-surface with cairo pattern/group
For MacOS/X this is equivalent, rendering happens using a
CGBitmapContext + image-surface. Windows and Linux needs profiling
for respective equivalent surfaces.
2019-12-27 19:35:02 +01:00
Robin Gareus
c3ab63a2ea Allow for per-widget image-surface backing
This is an intermediate commit, before replacing image surfaces with
cairo pattern groups.

The eventual goal is to reduce flickering and/or use
CPU + bitblt for specific widgets instead of cairo
graphics-cards accel.

This also removes excessive calls to getenv() for every rendering
operation.
2019-12-27 19:34:56 +01:00
Robin Gareus
ecc2597870 Fix remaining doxygen warnings (!) 2019-09-30 21:03:29 +02:00
Robin Gareus
bfec73b8c3 NO-OP: whitespace, indent 2019-09-30 21:03:20 +02:00
Robin Gareus
cec5ce8f45 Update canvas/UI lib GPL boilerplate and (C) from git log 2019-08-03 15:53:17 +02:00
Paul Davis
bf2f4bd28a method for setting whether or not to show velocity bars 2018-07-03 15:39:08 -04:00
Paul Davis
21582828b7 add a guess at appropriate color management for note velocity display
I think that HSV::opposite() is probably too strong here. HSV::darker() might be better. Experimentation needed.
2018-07-03 11:43:42 -04:00
Paul Davis
ed24e01658 initial implementation of a more specialized canvas item for (sustained) notes 2018-07-03 11:21:25 -04:00
Paul Davis
5102d8fae1 minor code optimization for Rectangle::render() 2018-07-03 09:22:32 -04:00
Paul Davis
36046cccc1 add basic data members and methods for adding an explicit size allocation for Canvas::Item 2017-09-18 11:40:52 -04:00
Robin Gareus
9a0a2a29b5 Fix NSGLView invalidation 2017-07-18 21:34:03 +02:00
Robin Gareus
beb73edf55 Purify libcanvas, remove libardour dependency
A canvas is just a canvas. Move WaveView into its own library.
2017-07-17 21:06:04 +02:00
Robin Gareus
601c317d70 Clean up library inheritance (colors.h, utils.h)
make libwidget independent of libcanvas.
Confine basics to pbd and gtkmm2ext.
2017-07-17 21:06:04 +02:00
Tim Mayberry
a1cd4f8dfe Fix friend declaration in WaveView code for non-c++11 builds 2017-06-26 17:04:18 +10:00
Tim Mayberry
6e91ee071c Reimplementation of large parts of the WaveView class
The drawing itself should be unchanged but much of the rest of the
implementation has changed. The WaveViewThreads and WaveViewDrawingThread
classes were added and allow multiple drawing threads.

The Item::prepare_for_render interface is implemented by WaveView to enable
queuing draw requests for the drawing threads to process as soon as the state
change occurs during Editor::visual_changer, which often means the images will
be finished by the time they are needed in WaveView::render. This can
significantly reduce total render time and also flickering caused by images not
being ready for display.

If the drawing thread/s cannot finish the request by the time it is required in
WaveView::render then cancel it and draw the WaveViewImage in the GUI thread if
it is likely it can be completed in the current render pass/frame.  This change
also helps reduce the flickering caused by images not being ready with threaded
rendering, but with several drawing threads, drawing in the GUI thread may not
often occur (unless explicitly requested).

Allow unfinished images to be returned from the cache in
WaveView::prepare_for_render so that new draw requests aren't queued for
duplicate images. This reduces the amount of drawing for instance in
compositions where there are many instances of the same sample/waveform
displayed on the canvas as only a single image should be drawn.

Use a random width within a certain range for
WaveView::optimal_image_width_samples so that image drawing is less likely to
occur at the same time (which will cause a spike in render/draw time and
increase the chance of flickering waveforms).

Move implementations of the private WaveView classes into wave_view_private.h
and wave_view_private.cc source files.

Incorporate a fix for limiting the waveview image size to the cairo image size
limit.

Should hopefully Resolve: #6478
2017-06-26 08:40:47 +10:00
Tim Mayberry
4ddf97f5a2 Add Canvas::get_microseconds_since_render_start() method
Initial use is for the WaveView class to determine whether on not to draw the
waveform in the GUI thread.
2017-06-26 08:40:47 +10:00
Tim Mayberry
ab13e87ec2 Add Canvas::get_last_render_start_timestamp method 2017-06-26 08:40:47 +10:00
Tim Mayberry
c4e31fc322 Add an optional ArdourCanvas::Item::prepare_for_render interface
Called when an item has requested a redraw and intersects with visible
canvas area.

Also add Canvas::prepare_for_render that will call Item::prepare_for_render for
items visible on the canvas.
2017-06-26 08:40:47 +10:00
Tim Mayberry
dac25b8db9 Add PreRender signal to the canvas
Emitted by the canvas immediately before rendering.
2017-06-26 08:40:47 +10:00
Tim Mayberry
9618b6dcbb Whitespace fixes in canvas.h 2017-06-26 08:40:47 +10:00
Tim Mayberry
90f169881f Remove unused ArdourCanvas::HSV constructor
Using stringstream for this is not locale independant. If this constructor is
needed at a later stage it should be reimplemented.
2017-06-22 10:48:38 +10:00
Robin Gareus
aff92a019d Stop tooltip timeout when a canvas-widget or item is hidden. 2017-04-17 01:45:25 +02:00
Robin Gareus
85b5741081 Allow to selectively use NSGLView Canvas
Various GdkEvents are not yet handled correctly, eg. unpacking a widget
from its container does not unmap it, nor are remaining widgets in the
contained re-positioned (size allocation does not change, nor does the
mapping). This affects eg. Mixbus Strips
2017-03-21 05:37:44 +01:00
Robin Gareus
60a0b8f645 Forward un/map events to NSGLView 2017-03-20 17:12:08 +01:00
Robin Gareus
b5e613d453 Move NSGlView into libgtkmm2ext
This allows to re-use the concept with CairoWidget
2017-03-20 04:35:05 +01:00
Robin Gareus
c371fc5115 Prepare NSView/OpenGL Canvas (to speed up rendering on [mac]OS[X]
This avoids Coregraphics (cairo_quartz_surface..) competely.
The openGL texture bypasses CG's slow argb_image and CGSColorMask
methods.
2017-03-19 22:49:17 +01:00
Paul Davis
f5d6c908ac canvas::grid - more tweaks and improvements 2017-02-01 21:58:20 +01:00
Paul Davis
94443bab7e basics of row/col span for Canvas::Grid 2017-02-01 21:58:20 +01:00
Paul Davis
2c9b0796a3 change Grid API to avoid unnecessary Duple and open door for row/col span 2017-02-01 21:58:20 +01:00
Paul Davis
91908dde7e clear up some CSS padding/margin confusion, and add row/col spacing 2017-02-01 21:58:20 +01:00
Paul Davis
14cb9ec795 canvas::grid starts being able to do its job a little 2017-02-01 21:58:20 +01:00
Paul Davis
e616324683 add basic data members and methods for adding an explicit size allocation for Canvas::Item 2017-02-01 21:58:20 +01:00
Paul Davis
cce1c58198 This wasn't supposed to be pushed to master.
Revert "add basic data members and methods for adding an explicit size allocation for Canvas::Item"

This reverts commit d1c1d8df61.
2017-01-24 23:17:38 +01:00
Paul Davis
d1c1d8df61 add basic data members and methods for adding an explicit size allocation for Canvas::Item 2017-01-24 22:45:22 +01:00
Paul Davis
4fa4b9a135 remove use of boost::optional to define "undefined" Canvas::Rect, and use Rect::empty instead.
This commit includes Rect::operator bool() which might be a candidate for removal in a future commit, in an attempt
to make the meaning clearer
2017-01-19 20:54:54 +01:00
Paul Davis
b4cf8cfc49 fix up Canvas::Grid child layout 2017-01-19 00:24:54 +01:00
Paul Davis
c91c028c37 do not add items twice to their canvas parent! 2017-01-19 00:24:54 +01:00
Paul Davis
99b86f0f05 basic (and probably wrong) Canvas::Grid child placement 2017-01-15 12:13:03 +00:00
Paul Davis
9ed87f6693 initial skeleton for a Grid canvas item 2017-01-15 12:13:03 +00:00
nick_m
3129370bc5 add ArdourCanvas::Flag::width() 2016-12-29 04:16:09 +11:00
Robin Gareus
004431426d Towards packing CairoWidgets on ArdourCanvas. 2016-12-19 13:36:42 +01:00
Paul Davis
1552547f65 stop using gkd_pango_context_get() in ArdourCanvas::Canvas and require concrete instances to supply a Pango::Context; do this for GtkCanvas and Push2Canvas 2016-10-13 17:18:54 -04:00
Paul Davis
81f2ed452b provide ArdourCanvas::Text::{width,height}() 2016-09-27 14:59:32 -05:00
Paul Davis
29b8072555 add canvas-based Meter object 2016-09-27 14:59:32 -05:00