13
0
livetrax/libs/canvas/wscript

170 lines
5.9 KiB
Plaintext
Raw Normal View History

#!/usr/bin/env python
from waflib.extras import autowaf as autowaf
from waflib import Options
from waflib import TaskGen
import os
# Version of this package (even if built as a child)
MAJOR = '0'
MINOR = '0'
MICRO = '0'
CANVAS_VERSION = "%s.%s.%s" % (MAJOR, MINOR, MICRO)
# Library version (UNIX style major, minor, micro)
# major increment <=> incompatible changes
# minor increment <=> compatible changes (additions)
# micro increment <=> no interface changes
CANVAS_LIB_VERSION = '0.0.0'
# Variables for 'waf dist'
APPNAME = 'canvas'
VERSION = CANVAS_VERSION
I18N_PACKAGE = 'libcanvas'
# Mandatory variables
top = '.'
out = 'build'
path_prefix = 'libs/canvas/'
canvas_sources = [
'arc.cc',
2013-07-14 13:38:52 -04:00
'arrow.cc',
'box.cc',
2013-07-14 13:38:52 -04:00
'canvas.cc',
2013-04-18 15:47:30 -04:00
'circle.cc',
'colors.cc',
'colorspace.cc',
'container.cc',
'curve.cc',
2013-07-14 13:38:52 -04:00
'debug.cc',
'item.cc',
'fill.cc',
'flag.cc',
'framed_curve.cc',
2017-01-14 07:56:04 -05:00
'grid.cc',
'image.cc',
2013-07-14 13:38:52 -04:00
'line.cc',
'line_set.cc',
2013-07-14 13:38:52 -04:00
'lookup_table.cc',
2016-09-25 16:01:26 -04:00
'meter.cc',
2013-07-14 13:38:52 -04:00
'outline.cc',
'pixbuf.cc',
'poly_item.cc',
'poly_line.cc',
'polygon.cc',
'rectangle.cc',
'root_group.cc',
2014-06-11 23:51:59 -04:00
'ruler.cc',
'scroll_group.cc',
'stateful_image.cc',
'text.cc',
2014-06-26 15:05:21 -04:00
'tracking_text.cc',
2013-07-14 13:38:52 -04:00
'types.cc',
'utils.cc',
'wave_view.cc',
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-03-16 00:12:05 -04:00
'wave_view_private.cc',
'widget.cc',
'xfade_curve.cc',
]
def options(opt):
autowaf.set_options(opt)
def configure(conf):
2013-07-14 13:38:52 -04:00
conf.load ('compiler_cxx')
autowaf.configure(conf)
autowaf.check_pkg(conf, 'cairomm-1.0', uselib_store='CAIROMM', atleast_version='1.8.4')
def build(bld):
# Library
if bld.is_defined ('INTERNAL_SHARED_LIBS'):
2013-07-14 13:38:52 -04:00
obj = bld.shlib(features = 'cxx cxxshlib', source=canvas_sources)
obj.defines = [ 'LIBCANVAS_DLL_EXPORTS=1' ]
else:
2013-07-14 13:38:52 -04:00
obj = bld.stlib(features = 'cxx cxxstlib', source=canvas_sources)
obj.cxxflags = [ '-fPIC' ]
obj.cflags = [ '-fPIC' ]
2015-05-06 14:11:55 -04:00
obj.defines = [ ]
obj.export_includes = ['.']
obj.includes = ['.']
obj.uselib = 'SIGCPP CAIROMM GTKMM BOOST XML'
obj.use = [ 'libpbd', 'libevoral', 'libardour', 'libgtkmm2ext', 'libevoral' ]
obj.name = 'libcanvas'
obj.target = 'canvas'
obj.vnum = CANVAS_LIB_VERSION
obj.install_path = bld.env['LIBDIR']
obj.defines += [ 'PACKAGE="' + I18N_PACKAGE + '"' ]
# canvas unit-tests are outdated
if False and bld.env['BUILD_TESTS'] and bld.is_defined('HAVE_CPPUNIT'):
unit_testobj = bld(features = 'cxx cxxprogram')
unit_testobj.source = '''
test/group.cc
test/arrow.cc
test/optimizing_lookup_table.cc
test/polygon.cc
test/types.cc
test/render.cc
test/xml.cc
test/wave_view.cc
test/item.cc
test/testrunner.cpp
'''.split()
unit_testobj.includes = obj.includes + ['test', '../pbd']
unit_testobj.uselib = 'CPPUNIT SIGCPP CAIROMM GTKMM'
unit_testobj.uselib_local = 'libcanvas libevoral libardour libgtkmm2ext'
unit_testobj.name = 'libcanvas-unit-tests'
unit_testobj.target = 'run-tests'
unit_testobj.install_path = ''
unit_testobj.cxxflags = ['-DPACKAGE="libcanvastest"']
unit_testobj.cxxflags += ['-DDATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"']
unit_testobj.cxxflags += ['-DCONFIG_DIR="' + os.path.normpath(bld.env['CONFDIR']) + '"']
unit_testobj.cxxflags += ['-DMODULE_DIR="' + os.path.normpath(bld.env['LIBDIR']) + '"']
2013-07-14 13:38:52 -04:00
manual_tests = '''
2013-07-14 13:38:52 -04:00
test/hello_world.cc
test/gtk_many.cc
test/gtk_scene.cc
test/gtk_movement.cc
test/gtk_viewport.cc
test/gtk_drag.cc
'''.split()
for t in manual_tests:
target = t[:-3]
name = t[t.find('/')+1:-3]
manual_testobj = bld(features = 'cxx cxxprogram')
manual_testobj.source = t
manual_testobj.includes = obj.includes + ['test', '../pbd']
manual_testobj.uselib = 'CPPUNIT SIGCPP CAIROMM GTKMM'
manual_testobj.uselib_local = 'libcanvas libevoral libardour libgtkmm2ext'
manual_testobj.name = 'libcanvas-manual-test-%s' % name
manual_testobj.target = target
manual_testobj.install_path = ''
benchmarks = '''
2013-07-14 13:38:52 -04:00
benchmark/items_at_point.cc
benchmark/render_parts.cc
benchmark/render_from_log.cc
benchmark/render_whole.cc
'''.split()
for t in benchmarks:
target = t[:-3]
name = t[t.find('/')+1:-3]
manual_testobj = bld(features = 'cxx cxxprogram')
manual_testobj.source = [ t, 'benchmark/benchmark.cc' ]
manual_testobj.includes = obj.includes + ['test', '../pbd']
manual_testobj.uselib = 'CPPUNIT SIGCPP CAIROMM GTKMM'
manual_testobj.uselib_local = 'libcanvas libevoral libardour libgtkmm2ext'
manual_testobj.name = 'libcanvas-benchmark-%s' % name
manual_testobj.target = target
manual_testobj.install_path = ''
def shutdown():
2013-07-14 13:38:52 -04:00
autowaf.shutdown()