allow runtime control over cairo save/restore around item rendering
This is to allow easier debugging of whether a given item's render method fails to leave a cairo context in the same state it received it in
This commit is contained in:
parent
d57ce0eba1
commit
adfba3d39d
@ -68,6 +68,13 @@ Canvas::Canvas ()
|
||||
#else
|
||||
_use_intermediate_surface = NULL != g_getenv("ARDOUR_INTERMEDIATE_SURFACE");
|
||||
#endif
|
||||
|
||||
if (g_getenv ("ARDOUR_ITEM_CAIRO_SAVE_RESTORE")) {
|
||||
item_save_restore = true;
|
||||
} else {
|
||||
item_save_restore = false;
|
||||
}
|
||||
|
||||
set_epoch ();
|
||||
}
|
||||
|
||||
|
@ -188,6 +188,9 @@ public:
|
||||
|
||||
void set_debug_render (bool yn) { _debug_render = yn; }
|
||||
bool debug_render() const { return _debug_render; }
|
||||
|
||||
bool item_save_restore;
|
||||
|
||||
protected:
|
||||
Root _root;
|
||||
uint32_t _queue_draw_frozen;
|
||||
|
@ -941,8 +941,13 @@ Item::render_children (Rect const & area, Cairo::RefPtr<Cairo::Context> context)
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (_canvas->item_save_restore) {
|
||||
context->save();
|
||||
}
|
||||
(*i)->render (area, context);
|
||||
if (_canvas->item_save_restore) {
|
||||
context->restore();
|
||||
}
|
||||
++render_count;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user