The Birdfont Source Code


All Repositories / birdfont.git / commit – RSS feed

Single threaded overview

These changes was commited to the Birdfont repository Wed, 16 Dec 2015 12:40:30 +0000.

Contributing

Send patches or pull requests to johan.mattsson.m@gmail.com.
Clone this repository: git clone https://github.com/johanmattssonm/birdfont.git
author Johan Mattsson <johan.mattsson.m@gmail.com>
Wed, 16 Dec 2015 12:40:30 +0000 (13:40 +0100)
committer Johan Mattsson <johan.mattsson.m@gmail.com>
Wed, 16 Dec 2015 12:40:30 +0000 (13:40 +0100)
commit 8928962902af44e60817e531d67f8e01d81ee45f
tree 883de2e9310a32f5ee1e7b7a29456f2f6f262060
parent 1bfca0be082e97fe9ab196f947312bf873c1df22
Single threaded overview

libbirdfont/OverViewItem.vala
--- a/libbirdfont/OverViewItem.vala +++ b/libbirdfont/OverViewItem.vala @@ -65,6 +65,8 @@ label = new Text ((!) character.to_string (), 17); truncate_label (); } + + draw_background (); } public void set_glyphs (GlyphCollection? gc) { @@ -84,18 +86,20 @@ }); } + /* thumbnail_mutex.lock (); if (!is_null (thumbnail_queue)) { thumbnail_queue.offer (this); has_thumnail_task.signal (); } thumbnail_mutex.unlock (); + */ } public static void start_thumbnail_processing () { - thumbnail_task = new Task (process_thumbnails, true); + //thumbnail_task = new Task (process_thumbnails, true); thumbnail_queue = new Gee.PriorityQueue<OverViewItem> (); - MainWindow.native_window.run_non_blocking_background_thread (thumbnail_task); + //MainWindow.native_window.run_non_blocking_background_thread (thumbnail_task); } public void cancel_thumbnail_rendering () { @@ -179,7 +183,7 @@ GlyphCanvas.redraw (); } - public void draw_background () { // FIXME: LOCK for Text and thread exit + public void draw_background () { Glyph g; Font font; double gx, gy; @@ -200,12 +204,7 @@ c = new Context (s); if (glyphs != null) { // FIXME: lock - IdleSource idle_glyph = new IdleSource (); - idle_glyph.set_callback (() => { - draw_glyph_from_font (); - return false; - }); - idle_glyph.attach (null); + draw_glyph_from_font (); } else { c.scale (Screen.get_scale (), Screen.get_scale ()); @@ -221,15 +220,9 @@ fallback.draw_at_baseline (c, gx, gy); c.restore (); - IdleSource idle = new IdleSource (); - idle.set_callback (() => { - cache = s; - GlyphCanvas.redraw (); - return false; - }); - idle.attach (null); - - } + cache = s; + GlyphCanvas.redraw (); + } } public static void reset_label () {