Hello,

One more brick to the wall: 16/17 seconds for UserGuide now.

Abdel.

Log:

This patch reduce the number of calls to BufferView::updateScrollbar() to the bare minimum, that is in GuiWorkArea::paintEvent(). All other calls are useless since we make sure that the scrollbar is updated if and when anything is painted on screen.
Index: BufferView_pimpl.C
===================================================================
--- BufferView_pimpl.C  (revision 14178)
+++ BufferView_pimpl.C  (working copy)
@@ -458,7 +458,7 @@
        // Reset the "Formatting..." message
        owner_->clearMessage();
 
-       updateScrollbar();
+       //updateScrollbar();
 }
 
 
@@ -673,7 +673,7 @@
                update();
 
        // Always make sure that the scrollbar is sane.
-       updateScrollbar();
+       //updateScrollbar();
        owner_->updateLayoutChoice();
 }
 
@@ -750,7 +750,7 @@
                workArea_->greyOut();
 
        // And the scrollbar
-       updateScrollbar();
+       //updateScrollbar();
        owner_->view_state_changed();
 }
 
Index: frontends/qt4/GuiWorkArea.C
===================================================================
--- frontends/qt4/GuiWorkArea.C (revision 14178)
+++ frontends/qt4/GuiWorkArea.C (working copy)
@@ -461,15 +461,6 @@
        //q.drawImage(x, y, paint_device_.copy(x, y, w, h));
 
        viewport()->update(x, y, w, h);
-
-       buffer_view_->updateScrollbar();
-
-       ScrollbarParameters const & scroll_ = 
buffer_view_->scrollbarParameters();
-
-       verticalScrollBar()->setTracking(false);
-       setScrollbarParams(scroll_.height, scroll_.position,
-               scroll_.lineScrollHeight);
-       verticalScrollBar()->setTracking(true);
 }
 
 
@@ -497,6 +488,15 @@
 
        if (show_hcursor_)
                q.drawPixmap(cursor_x_, cursor_y_ + cursor_h_ - 1, hcursor_);
+
+       buffer_view_->updateScrollbar();
+
+       ScrollbarParameters const & scroll_ = 
buffer_view_->scrollbarParameters();
+
+       verticalScrollBar()->setTracking(false);
+       setScrollbarParams(scroll_.height, scroll_.position,
+               scroll_.lineScrollHeight);
+       verticalScrollBar()->setTracking(true);
 }
 
 
Index: lyxfunc.C
===================================================================
--- lyxfunc.C   (revision 14173)
+++ lyxfunc.C   (working copy)
@@ -1157,7 +1157,7 @@
 
                        view()->center();
                        // see BufferView_pimpl::center()
-                       view()->updateScrollbar();
+                       //view()->updateScrollbar();
                        break;
                }
 
Index: text3.C
===================================================================
--- text3.C     (revision 14165)
+++ text3.C     (working copy)
@@ -213,7 +213,7 @@
                updated |= cursorUp(cur);
        }
 
-       cur.bv().updateScrollbar();
+       //cur.bv().updateScrollbar();
        finishUndo();
        return updated;
 }
@@ -236,7 +236,7 @@
                updated |= cursorDown(cur);
        }
 
-       cur.bv().updateScrollbar();
+       //cur.bv().updateScrollbar();
        finishUndo();
        return updated;
 }
@@ -1167,7 +1167,7 @@
 
                cur.resetAnchor();
                moveCursor(cur, false);
-               bv->updateScrollbar();
+               //bv->updateScrollbar();
                break;
        }
 

Reply via email to