diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2013-04-12 18:01:44 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2013-04-12 18:01:44 -0400 |
commit | 4e9108cd1e21b4a96aeaf6978c037f5d789da8a2 (patch) | |
tree | 80a60eb349eae43762372917c9fabb0fd3332b72 | |
parent | 41f63fc61aa74d36db10da3bfce7333502f75b4d (diff) |
remove TimeAxisView::clip_to_viewport() and Editor::update_canvas_now() and Editor::flush_canvas() which should no longer be necessary with a sane canvas design
-rw-r--r-- | gtk2_ardour/editor.cc | 1 | ||||
-rw-r--r-- | gtk2_ardour/editor.h | 4 | ||||
-rw-r--r-- | gtk2_ardour/editor_canvas.cc | 54 | ||||
-rw-r--r-- | gtk2_ardour/editor_drag.cc | 29 | ||||
-rw-r--r-- | gtk2_ardour/editor_mouse.cc | 3 | ||||
-rw-r--r-- | gtk2_ardour/editor_routes.cc | 3 | ||||
-rw-r--r-- | gtk2_ardour/time_axis_view.cc | 10 | ||||
-rw-r--r-- | gtk2_ardour/time_axis_view.h | 2 |
8 files changed, 2 insertions, 104 deletions
diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc index 4e372188ba..9050797216 100644 --- a/gtk2_ardour/editor.cc +++ b/gtk2_ardour/editor.cc @@ -4780,7 +4780,6 @@ Editor::idle_resize () } _pending_resize_amount = 0; - flush_canvas (); _group_tabs->set_dirty (); resize_idle_id = -1; diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h index eabfa49984..6158aac5e8 100644 --- a/gtk2_ardour/editor.h +++ b/gtk2_ardour/editor.h @@ -248,8 +248,6 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD return sample / samples_per_pixel; } - void flush_canvas (); - /* selection */ Selection& get_selection() const { return *selection; } @@ -2084,8 +2082,6 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void region_view_added (RegionView *); void region_view_removed (); - void update_canvas_now (); - EditorGroupTabs* _group_tabs; void fit_route_group (ARDOUR::RouteGroup *); diff --git a/gtk2_ardour/editor_canvas.cc b/gtk2_ardour/editor_canvas.cc index 27d51bb9f7..0b133cea19 100644 --- a/gtk2_ardour/editor_canvas.cc +++ b/gtk2_ardour/editor_canvas.cc @@ -261,15 +261,7 @@ Editor::track_canvas_viewport_size_allocated () _visible_canvas_width = _canvas_viewport_allocation.get_width (); _visible_canvas_height = _canvas_viewport_allocation.get_height (); - cerr << "VISIBLE CANVAS now: " << _visible_canvas_width << " x " << _visible_canvas_height << endl; - - if (_session) { - TrackViewList::iterator i; - - for (i = track_views.begin(); i != track_views.end(); ++i) { - (*i)->clip_to_viewport (); - } - } + // SHOWTRACKS if (height_changed) { @@ -744,19 +736,8 @@ Editor::ensure_time_axis_view_is_visible (const TimeAxisView& tav) void Editor::tie_vertical_scrolling () { - _track_canvas_vadj->set_value (vertical_adjustment.get_value ()); - for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) { - (*i)->clip_to_viewport (); - } - - /* required to keep the controls_layout in lock step with the canvas group */ - - update_canvas_now (); - - /* this will do an immediate redraw */ - controls_layout.get_vadjustment()->set_value (vertical_adjustment.get_value()); if (pending_visual_change.idle_handler_id < 0) { @@ -806,12 +787,7 @@ Editor::scroll_canvas_vertically () _trackview_group->move (0, y_delta); _background_group->move (0, y_delta); - for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) { - (*i)->clip_to_viewport (); - } last_trackview_group_vertical_offset = get_trackview_group_vertical_offset (); - /* required to keep the controls_layout in lock step with the canvas group */ - update_canvas_now (); } #endif @@ -881,34 +857,6 @@ Editor::color_handler() */ } -void -Editor::flush_canvas () -{ - if (is_mapped()) { - update_canvas_now (); - // gdk_window_process_updates (GTK_LAYOUT(track_canvas->gobj())->bin_window, true); - } -} - -void -Editor::update_canvas_now () -{ - /* GnomeCanvas has a bug whereby if its idle handler is not scheduled between - two calls to update_now, an assert will trip. This wrapper works around - that problem by only calling update_now if the assert will not trip. - - I think the GC bug is due to the fact that its code will reset need_update - and need_redraw to FALSE without checking to see if an idle handler is scheduled. - If one is scheduled, GC should probably remove it. - */ - - /* XXX: CANVAS */ -// GnomeCanvas* c = track_canvas->gobj (); -// if (c->need_update || c->need_redraw) { -// track_canvas->update_now (); -// } -} - double Editor::horizontal_position () const { diff --git a/gtk2_ardour/editor_drag.cc b/gtk2_ardour/editor_drag.cc index 707a0884f0..dab2112edb 100644 --- a/gtk2_ardour/editor_drag.cc +++ b/gtk2_ardour/editor_drag.cc @@ -667,11 +667,6 @@ RegionMotionDrag::motion (GdkEvent* event, bool first_move) rv->drag_start (); - /* Absolutely no idea why this is necessary, but it is; without - it, the region view disappears after the reparent. - */ - _editor->update_canvas_now (); - /* Reparent to a non scrolling group so that we can keep the region selection above all time axis views. Reparenting means that we will have to move the region view @@ -815,15 +810,6 @@ RegionMoveDrag::motion (GdkEvent* event, bool first_move) _views = new_regionviews; swap_grab (new_regionviews.front().view->get_canvas_group (), 0, event ? event->motion.time : 0); - - /* - sync the canvas to what we think is its current state - without it, the canvas seems to - "forget" to update properly after the upcoming reparent() - ..only if the mouse is in rapid motion at the time of the grab. - something to do with regionview creation taking so long? - */ - _editor->update_canvas_now(); } } @@ -876,8 +862,6 @@ RegionMoveDrag::finished (GdkEvent* ev, bool movement_occurred) bool const changed_tracks = (_time_axis_views[_views.front().time_axis_view] != &_views.front().view->get_time_axis_view()); framecnt_t const drag_delta = _primary->region()->position() - _last_frame_position; - _editor->update_canvas_now (); - if (_copy) { finished_copy ( @@ -1278,8 +1262,6 @@ RegionMotionDrag::aborted (bool) rv->move (-_total_x_delta, 0); rv->set_height (rtv->view()->child_height ()); } - - _editor->update_canvas_now (); } /** @param b true to brush, otherwise false. @@ -1328,8 +1310,6 @@ RegionInsertDrag::RegionInsertDrag (Editor* e, boost::shared_ptr<Region> r, Rout void RegionInsertDrag::finished (GdkEvent *, bool) { - _editor->update_canvas_now (); - RouteTimeAxisView* dest_rtv = dynamic_cast<RouteTimeAxisView*> (_time_axis_views[_views.front().time_axis_view]); _primary->get_canvas_group()->reparent (dest_rtv->view()->canvas_item()); @@ -1680,7 +1660,6 @@ VideoTimeLineDrag::motion (GdkEvent* event, bool first_move) DEBUG_TRACE (DEBUG::Drags, string_compose("SHIFT REGION at %1 by %2\n", i->initial_position, dt)); if (first_move) { rv->drag_start (); - _editor->update_canvas_now (); rv->fake_set_opaque (true); rv->region()->clear_changes (); rv->region()->suspend_property_changes(); @@ -1742,7 +1721,6 @@ VideoTimeLineDrag::finished (GdkEvent * /*event*/, bool movement_occurred) _editor->commit_reversible_command (); - _editor->update_canvas_now (); } void @@ -2429,9 +2407,6 @@ CursorDrag::motion (GdkEvent* event, bool) framepos_t const adjusted_frame = adjusted_current_frame (event); if (adjusted_frame != last_pointer_frame()) { fake_locate (adjusted_frame); -#ifdef GTKOSX - _editor->update_canvas_now (); -#endif } } @@ -2976,10 +2951,6 @@ MarkerDrag::motion (GdkEvent* event, bool) assert (!_copied_locations.empty()); show_verbose_cursor_time (newframe); - -#ifdef GTKOSX - _editor->update_canvas_now (); -#endif } void diff --git a/gtk2_ardour/editor_mouse.cc b/gtk2_ardour/editor_mouse.cc index 276b4b583e..c838f16f44 100644 --- a/gtk2_ardour/editor_mouse.cc +++ b/gtk2_ardour/editor_mouse.cc @@ -2680,9 +2680,6 @@ Editor::add_region_drag (ArdourCanvas::Item* item, GdkEvent*, RegionView* region RegionSelection s = get_equivalent_regions (selection->regions, ARDOUR::Properties::select.property_id); _drags->add (new RegionMoveDrag (this, item, region_view, s.by_layer(), false, false)); } - - /* sync the canvas to what we think is its current state */ - update_canvas_now(); } void diff --git a/gtk2_ardour/editor_routes.cc b/gtk2_ardour/editor_routes.cc index bf629ea27d..b700556402 100644 --- a/gtk2_ardour/editor_routes.cc +++ b/gtk2_ardour/editor_routes.cc @@ -518,7 +518,7 @@ EditorRoutes::redisplay () /* show or hide the TimeAxisView */ if (visible) { position += tv->show_at (position, n, &_editor->edit_controls_vbox); - tv->clip_to_viewport (); + // SHOWTRACKS } else { tv->hide (); } @@ -687,7 +687,6 @@ EditorRoutes::handle_gui_changes (string const & what, void*) /* Optional :make tracks change height while it happens, instead of on first-idle */ - //update_canvas_now (); redisplay (); } diff --git a/gtk2_ardour/time_axis_view.cc b/gtk2_ardour/time_axis_view.cc index f8127b1172..433eee350d 100644 --- a/gtk2_ardour/time_axis_view.cc +++ b/gtk2_ardour/time_axis_view.cc @@ -284,16 +284,6 @@ TimeAxisView::show_at (double y, int& nth, VBox *parent) return _effective_height; } -void -TimeAxisView::clip_to_viewport () -{ - if (marked_for_display()) { - _canvas_background->show (); - _canvas_display->show (); - } - return; -} - bool TimeAxisView::controls_ebox_scroll (GdkEventScroll* ev) { diff --git a/gtk2_ardour/time_axis_view.h b/gtk2_ardour/time_axis_view.h index 86fd6ae67b..17b702ec38 100644 --- a/gtk2_ardour/time_axis_view.h +++ b/gtk2_ardour/time_axis_view.h @@ -125,8 +125,6 @@ class TimeAxisView : public virtual AxisView virtual guint32 show_at (double y, int& nth, Gtk::VBox *parent); virtual void hide (); - void clip_to_viewport (); - bool touched (double top, double bot); /** @return true if hidden, otherwise false */ |