CVSROOT:        /cvsroot/lilypond
Module name:    lilypond
Branch:         
Changes by:     Han-Wen Nienhuys <[EMAIL PROTECTED]>    05/07/19 10:37:52

Modified files:
        .              : ChangeLog 
        lily           : fingering-engraver.cc key-engraver.cc 
                         note-head.cc rest-engraver.cc 
                         separating-line-group-engraver.cc 
                         slash-repeat-engraver.cc 
Added files:
        lily           : default-bar-line-engraver.cc 
Removed files:
        lily           : timing-engraver.cc 

Log message:
        (internal_print): only call
        glyph-name-procedure if  style != default. 3 %  speed increase 
(wtk2-fugue1).

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/ChangeLog.diff?tr1=1.3892&tr2=1.3893&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/lily/default-bar-line-engraver.cc?rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/lily/fingering-engraver.cc.diff?tr1=1.45&tr2=1.46&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/lily/key-engraver.cc.diff?tr1=1.112&tr2=1.113&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/lily/note-head.cc.diff?tr1=1.145&tr2=1.146&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/lily/rest-engraver.cc.diff?tr1=1.67&tr2=1.68&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/lily/separating-line-group-engraver.cc.diff?tr1=1.79&tr2=1.80&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/lily/slash-repeat-engraver.cc.diff?tr1=1.21&tr2=1.22&r1=text&r2=text

Patches:
Index: lilypond/ChangeLog
diff -u lilypond/ChangeLog:1.3892 lilypond/ChangeLog:1.3893
--- lilypond/ChangeLog:1.3892   Tue Jul 19 10:20:21 2005
+++ lilypond/ChangeLog  Tue Jul 19 10:37:51 2005
@@ -1,5 +1,10 @@
 2005-07-19  Han-Wen Nienhuys  <[EMAIL PROTECTED]>
 
+       * lily/*-engraver.cc (various): remove double use of
+       PRECOMPUTED_VIRTUAL function: only use
+       start_translation_timestep() and stop_translation_timestep(), not
+       both.
+
        * lily/break-substitution.cc (fast_substitute_grob_array): do
        fast_substitute_grob_array for all unordered grob_arrays.
        (substitute_grob): return Grob *. Saves packing/unpacking SCMs.
Index: lilypond/lily/fingering-engraver.cc
diff -u lilypond/lily/fingering-engraver.cc:1.45 
lilypond/lily/fingering-engraver.cc:1.46
--- lilypond/lily/fingering-engraver.cc:1.45    Mon Jul 18 23:37:24 2005
+++ lilypond/lily/fingering-engraver.cc Tue Jul 19 10:37:52 2005
@@ -16,7 +16,7 @@
 
 class Fingering_engraver : public Engraver
 {
-  Link_array<Music> reqs_;
+  Link_array<Music> events_;
   Link_array<Item> fingerings_;
 
 public:
@@ -24,7 +24,6 @@
 protected:
   virtual bool try_music (Music *m);
   PRECOMPUTED_VIRTUAL void stop_translation_timestep ();
-  PRECOMPUTED_VIRTUAL void start_translation_timestep ();
   PRECOMPUTED_VIRTUAL void process_music ();
   virtual void acknowledge_grob (Grob_info);
 
@@ -37,7 +36,7 @@
 {
   if (m->is_mus_type ("fingering-event"))
     {
-      reqs_.push (m);
+      events_.push (m);
       return true;
     }
   return false;
@@ -68,10 +67,10 @@
 void
 Fingering_engraver::process_music ()
 {
-  for (int i = reqs_.size (); i--;)
+  for (int i = events_.size (); i--;)
     {
-      SCM dir = reqs_[i]->get_property ("direction");
-      make_script (to_dir (dir), reqs_[i], i);
+      SCM dir = events_[i]->get_property ("direction");
+      make_script (to_dir (dir), events_[i], i);
     }
 }
 
@@ -131,12 +130,7 @@
     return;
 
   fingerings_.clear ();
-}
-
-void
-Fingering_engraver::start_translation_timestep ()
-{
-  reqs_.clear ();
+  events_.clear ();
 }
 
 Fingering_engraver::Fingering_engraver ()
Index: lilypond/lily/key-engraver.cc
diff -u lilypond/lily/key-engraver.cc:1.112 lilypond/lily/key-engraver.cc:1.113
--- lilypond/lily/key-engraver.cc:1.112 Mon Jul 18 23:37:24 2005
+++ lilypond/lily/key-engraver.cc       Tue Jul 19 10:37:52 2005
@@ -38,7 +38,6 @@
   virtual void finalize ();
   virtual bool try_music (Music *ev);
   PRECOMPUTED_VIRTUAL void stop_translation_timestep ();
-  PRECOMPUTED_VIRTUAL void start_translation_timestep ();
   PRECOMPUTED_VIRTUAL void process_music ();
   virtual void acknowledge_grob (Grob_info);
 };
@@ -134,6 +133,7 @@
   item_ = 0;
   context ()->set_property ("lastKeySignature", get_property ("keySignature"));
   cancellation_ = 0;
+  key_ev_ = 0;
 }
 
 void
@@ -162,12 +162,6 @@
   context ()->set_property ("keySignature", accs);
   context ()->set_property ("tonic",
                            r->get_property ("tonic"));
-}
-
-void
-Key_engraver::start_translation_timestep ()
-{
-  key_ev_ = 0;
 }
 
 void
Index: lilypond/lily/note-head.cc
diff -u lilypond/lily/note-head.cc:1.145 lilypond/lily/note-head.cc:1.146
--- lilypond/lily/note-head.cc:1.145    Tue Jul 19 00:41:14 2005
+++ lilypond/lily/note-head.cc  Tue Jul 19 10:37:52 2005
@@ -39,13 +39,13 @@
     }
 
   SCM log = scm_int2num (Note_head::get_balltype (me));
-  SCM proc = me->get_property ("glyph-name-procedure");
-
   String suffix =  to_string (min (robust_scm2int (me->get_property 
("duration-log"), 2), 2));
-  if (style != ly_symbol2scm ("default")
-      && ly_is_procedure (proc))
-    suffix = ly_scm2string (scm_call_2 (proc, log, style));
-  
+  if (style != ly_symbol2scm ("default"))
+    {
+      SCM proc = me->get_property ("glyph-name-procedure");
+      if (ly_is_procedure (proc))
+       suffix = ly_scm2string (scm_call_2 (proc, log, style));
+    }  
   Font_metric *fm = Font_interface::get_default_font (me);
 
   String idx = "noteheads.s" + suffix;
Index: lilypond/lily/rest-engraver.cc
diff -u lilypond/lily/rest-engraver.cc:1.67 lilypond/lily/rest-engraver.cc:1.68
--- lilypond/lily/rest-engraver.cc:1.67 Mon Jul 18 23:37:25 2005
+++ lilypond/lily/rest-engraver.cc      Tue Jul 19 10:37:52 2005
@@ -18,12 +18,11 @@
 
 class Rest_engraver : public Engraver
 {
-  Music *rest_req_;
+  Music *rest_event_;
   Item *dot_;
   Grob *rest_;
 protected:
   virtual bool try_music (Music *);
-  PRECOMPUTED_VIRTUAL void stop_translation_timestep ();
   PRECOMPUTED_VIRTUAL void start_translation_timestep ();
   PRECOMPUTED_VIRTUAL void process_music ();
 
@@ -36,7 +35,7 @@
 */
 Rest_engraver::Rest_engraver ()
 {
-  rest_req_ = 0;
+  rest_event_ = 0;
   rest_ = 0;
   dot_ = 0;
 }
@@ -44,29 +43,25 @@
 void
 Rest_engraver::start_translation_timestep ()
 {
-  rest_req_ = 0;
-}
-
-void
-Rest_engraver::stop_translation_timestep ()
-{
+  rest_event_ = 0;
   rest_ = 0;
   dot_ = 0;
 }
 
+
 void
 Rest_engraver::process_music ()
 {
-  if (rest_req_ && !rest_)
+  if (rest_event_ && !rest_)
     {
-      rest_ = make_item ("Rest", rest_req_->self_scm ());
+      rest_ = make_item ("Rest", rest_event_->self_scm ());
 
-      int durlog = unsmob_duration (rest_req_->get_property 
("duration"))->duration_log ();
+      int durlog = unsmob_duration (rest_event_->get_property 
("duration"))->duration_log ();
 
       rest_->set_property ("duration-log",
                           scm_int2num (durlog));
 
-      int dots = unsmob_duration (rest_req_->get_property 
("duration"))->dot_count ();
+      int dots = unsmob_duration (rest_event_->get_property 
("duration"))->dot_count ();
 
       if (dots)
        {
@@ -77,7 +72,7 @@
          dot_->set_property ("dot-count", scm_int2num (dots));
        }
 
-      Pitch *p = unsmob_pitch (rest_req_->get_property ("pitch"));
+      Pitch *p = unsmob_pitch (rest_event_->get_property ("pitch"));
 
       /*
        This is ridiculous -- rests don't have pitch, but we act as if
@@ -100,7 +95,7 @@
 {
   if (m->is_mus_type ("rest-event"))
     {
-      rest_req_ = m;
+      rest_event_ = m;
       return true;
     }
   return false;
Index: lilypond/lily/separating-line-group-engraver.cc
diff -u lilypond/lily/separating-line-group-engraver.cc:1.79 
lilypond/lily/separating-line-group-engraver.cc:1.80
--- lilypond/lily/separating-line-group-engraver.cc:1.79        Mon Jul 18 
23:37:25 2005
+++ lilypond/lily/separating-line-group-engraver.cc     Tue Jul 19 10:37:52 2005
@@ -181,8 +181,10 @@
 Separating_line_group_engraver::start_translation_timestep ()
 {
   if (break_item_)
-    context ()->unset_property (ly_symbol2scm ("breakableSeparationItem"));
-  break_item_ = 0;
+    {
+      context ()->unset_property (ly_symbol2scm ("breakableSeparationItem"));
+      break_item_ = 0;
+    }
 }
 
 void
Index: lilypond/lily/slash-repeat-engraver.cc
diff -u lilypond/lily/slash-repeat-engraver.cc:1.21 
lilypond/lily/slash-repeat-engraver.cc:1.22
--- lilypond/lily/slash-repeat-engraver.cc:1.21 Mon Jul 18 23:37:25 2005
+++ lilypond/lily/slash-repeat-engraver.cc      Tue Jul 19 10:37:52 2005
@@ -46,7 +46,6 @@
   Item *double_percent_;
 protected:
   virtual bool try_music (Music *);
-  PRECOMPUTED_VIRTUAL void stop_translation_timestep ();
   PRECOMPUTED_VIRTUAL void start_translation_timestep ();
   PRECOMPUTED_VIRTUAL void process_music ();
 };
@@ -111,13 +110,9 @@
     {
       repeat_ = 0;
     }
-}
-
-void
-Slash_repeat_engraver::stop_translation_timestep ()
-{
   beat_slash_ = 0;
 }
+
 
 #include "translator.icc"
 


_______________________________________________
Lilypond-cvs mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/lilypond-cvs

Reply via email to