author | Francesco Abbate <francesco.bbt@gmail.com> | 2010年08月26日 00:17:54 +0200 |
---|---|---|
committer | Francesco Abbate <francesco.bbt@gmail.com> | 2010年08月26日 00:17:54 +0200 |
commit | f462145565a4a97f749c08239767e98f4b1ba9ab (patch) | |
tree | 3dddc4b7a9979729b36c375b8a42bd0759e1ce95 /agg-plot/window.cpp | |
parent | d323e179f46d19488afa5001c1725d7e3268a806 (diff) | |
download | gsl-shell-f462145565a4a97f749c08239767e98f4b1ba9ab.tar.gz |
-rw-r--r-- | agg-plot/window.cpp | 32 |
diff --git a/agg-plot/window.cpp b/agg-plot/window.cpp index 7c4f7edc..c45d3bc8 100644 --- a/agg-plot/window.cpp +++ b/agg-plot/window.cpp @@ -129,7 +129,9 @@ void window::draw_slot_by_ref(window::ref& ref, bool dirty) { agg::rect_base<int> r = rect_of_slot_matrix(mtx); m_canvas->clear_box(r); + AGG_LOCK(); ref.plot->draw(*m_canvas, mtx); + AGG_UNLOCK(); platform_support_update_region (this, r); } else @@ -149,7 +151,7 @@ window::draw_slot(int slot_id, bool update_req) } void -window::on_draw_unprotected() +window::on_draw() { if (! m_canvas) return; @@ -158,14 +160,6 @@ window::on_draw_unprotected() draw_rec(m_tree); } -void -window::on_draw() -{ - AGG_LOCK(); - on_draw_unprotected(); - AGG_UNLOCK(); -} - window * window::check (lua_State *L, int index) { @@ -316,26 +310,16 @@ window_attach (lua_State *L) } int -window_slot_update_unprotected (lua_State *L) +window_slot_update (lua_State *L) { window *win = window::check (L, 1); int slot_id = luaL_checkinteger (L, 2); win->lock(); - win->draw_slot(slot_id, true); - win->unlock(); - - return 0; -} - -int -window_update_unprotected (lua_State *L) -{ - window *win = window::check (L, 1); - - win->lock(); - win->on_draw_unprotected(); - win->update_window(); + if (win->status == canvas_window::running) + { + win->draw_slot(slot_id, true); + } win->unlock(); return 0; |