summaryrefslogtreecommitdiff
path: root/gtk2_ardour/time_axis_view_item.cc
diff options
context:
space:
mode:
authorNick Mainsbridge <beatroute@iprimus.com.au>2009-05-19 14:38:37 +0000
committerNick Mainsbridge <beatroute@iprimus.com.au>2009-05-19 14:38:37 +0000
commit337fae8183800ecd4967206507e16f285b34e88d (patch)
tree7f30c96ce03ce25dd13270d1193dd7a0d1b21535 /gtk2_ardour/time_axis_view_item.cc
parentc04d9d1975402c514d2feb44d997f0941d1f34c3 (diff)
Fix record crash, use pixfufs instead of canvas text in markers, use leftmost_frame instead of querying canvas coords when scrolling (speeds up canvas scrolling somewhat).
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@5101 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/time_axis_view_item.cc')
-rw-r--r--gtk2_ardour/time_axis_view_item.cc37
1 files changed, 4 insertions, 33 deletions
diff --git a/gtk2_ardour/time_axis_view_item.cc b/gtk2_ardour/time_axis_view_item.cc
index f8387f5fce..725a6c05bf 100644
--- a/gtk2_ardour/time_axis_view_item.cc
+++ b/gtk2_ardour/time_axis_view_item.cc
@@ -53,38 +53,6 @@ double TimeAxisViewItem::NAME_Y_OFFSET;
double TimeAxisViewItem::NAME_HIGHLIGHT_SIZE;
double TimeAxisViewItem::NAME_HIGHLIGHT_THRESH;
-inline guint8
-convert_color_channel (guint8 src,
- guint8 alpha)
-{
- return alpha ? ((guint (src) << 8) - src) / alpha : 0;
-}
-
-void
-convert_bgra_to_rgba (guint8 const* src,
- guint8* dst,
- int width,
- int height)
-{
- guint8 const* src_pixel = src;
- guint8* dst_pixel = dst;
-
- for (int y = 0; y < height; y++)
- for (int x = 0; x < width; x++)
- {
- dst_pixel[0] = convert_color_channel (src_pixel[2],
- src_pixel[3]);
- dst_pixel[1] = convert_color_channel (src_pixel[1],
- src_pixel[3]);
- dst_pixel[2] = convert_color_channel (src_pixel[0],
- src_pixel[3]);
- dst_pixel[3] = src_pixel[3];
-
- dst_pixel += 4;
- src_pixel += 4;
- }
-}
-
//---------------------------------------------------------------------------------------//
// Constructor / Desctructor
@@ -169,6 +137,7 @@ TimeAxisViewItem::init (const string& it_name, double spu, Gdk::Color& base_colo
show_vestigial = true;
visibility = vis;
_sensitive = true;
+ name_pixbuf = 0;
if (duration == 0) {
warning << "Time Axis Item Duration == 0" << endl ;
@@ -584,7 +553,9 @@ TimeAxisViewItem::set_name_text(const ustring& new_name)
}
if (pb_width <= 0 || it_width < NAME_X_OFFSET) {
- name_pixbuf->hide();
+ if (name_pixbuf) {
+ name_pixbuf->hide();
+ }
return;
} else {
name_pixbuf->show();