diff options
Diffstat (limited to 'gtk2_ardour/time_axis_view_item.cc')
-rw-r--r-- | gtk2_ardour/time_axis_view_item.cc | 38 |
1 files changed, 3 insertions, 35 deletions
diff --git a/gtk2_ardour/time_axis_view_item.cc b/gtk2_ardour/time_axis_view_item.cc index 013a04054c..722b939f57 100644 --- a/gtk2_ardour/time_axis_view_item.cc +++ b/gtk2_ardour/time_axis_view_item.cc @@ -54,38 +54,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 @@ -561,8 +529,6 @@ TimeAxisViewItem::set_name_text(const ustring& new_name) uint32_t pb_width, it_width; double font_size; - if (!name_pixbuf) return; - font_size = NAME_FONT->get_size() / Pango::SCALE; it_width = trackview.editor().frame_to_pixel(item_duration); pb_width = new_name.length() * font_size; @@ -572,7 +538,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(); |