Commit graph

334 commits

Author SHA1 Message Date
Paul Davis
03e32a22d0 make Item::add() virtual 2021-08-13 12:51:26 -06:00
Paul Davis
9869b0266b add support for rounded corners to Canvas::Rectangle 2021-08-13 12:51:26 -06:00
Paul Davis
e35e5ff3e5 step button for Canvas (used by BeatBox GUI) 2021-08-13 12:51:26 -06:00
Paul Davis
ff6fe51d76 Canvas: improve implementation/design of ConstraintPacker::preferred_size() 2021-08-13 12:51:26 -06:00
Paul Davis
502a9e80dc Canvas: add a nice new syntax for constraint packing 2021-08-13 12:51:26 -06:00
Paul Davis
aa62460081 Canvas: re-use Solver as much as possible, with possible (but not substantive) speedup; remove debug output 2021-08-13 12:51:26 -06:00
Paul Davis
be481ec266 Canvas: fix fill/outline area for a cBox 2021-08-13 12:51:26 -06:00
Paul Davis
7153544b52 Canvas: many changes to cBox implementation 2021-08-13 12:51:26 -06:00
Paul Davis
240cb7b98f Canvas: make Rectangle work with layouts 2021-08-13 12:51:26 -06:00
Paul Davis
e0c58a2736 Canvas: add aliases to Canvas::Rect for comprehension 2021-08-13 12:51:26 -06:00
Paul Davis
2423994029 Canvas: add aliases to Canvas::Rect for comprehension 2021-08-13 12:51:26 -06:00
Paul Davis
f47deb717c Canvas: add layout-related methods and members to Item 2021-08-13 12:51:25 -06:00
Paul Davis
6d89d3afef Canvas: add Item::whoami() for debugging output 2021-08-13 12:51:25 -06:00
Paul Davis
f17160ee0e Canvas: modify Arc to work with layout 2021-08-13 12:51:25 -06:00
Paul Davis
ad39faeb3e Canvas: alter RootGroup to work with layout 2021-08-13 12:51:25 -06:00
Paul Davis
84afcb62c4 Canvas: child_changed() API fix for Box 2021-08-13 12:51:25 -06:00
Paul Davis
fc9840f2a9 Canvas: change API of Item::child_changed() to include bool indicate bounding_box change 2021-08-13 12:51:25 -06:00
Paul Davis
a3039d3895 add/update constraint packing containers, test code 2021-08-13 12:51:25 -06:00
Paul Davis
1c3e743d2a Canvas: continued work on constraint packer 2021-08-13 12:51:25 -06:00
Paul Davis
01137cbbf3 Canvas: change container-related methods in Item to be virtual 2021-08-13 12:51:25 -06:00
Paul Davis
b90332b439 Canvas: change LineSet::add() to ::add_line()
Preparation for virtualization of Item::add()
2021-08-13 12:51:25 -06:00
Paul Davis
539e1a1f1b stub constraint-based packer for canvas 2021-08-13 12:51:25 -06:00
Robin Gareus
d04713c0ab
Add missing class to canvas forward declarations 2021-02-14 00:54:17 +01:00
Paul Davis
20029ec7e6 canvas/ruler: provide option for a second font to be used for "major" marks 2021-01-03 16:50:18 -07:00
Robin Gareus
d741f01ad0
NO-OP: whitespace 2020-12-30 03:25:57 +01:00
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