2007-07-16 Holger Hans Peter Freyther <zecke@selfish.org>
authorzecke <zecke@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 16 Jul 2007 20:21:22 +0000 (20:21 +0000)
committerzecke <zecke@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 16 Jul 2007 20:21:22 +0000 (20:21 +0000)
        Reviewed by Maciej.

        Lazily update the scrollbars (e.g. on loading a page) to
        generate less expose events, which will lead to laying out less often
        and will fix http://bugs.webkit.org/show_bug.cgi?id=14020.

        * platform/gdk/ScrollViewGdk.cpp:
        (WebCore::ScrollView::ScrollViewPrivate::ScrollViewPrivate):
        (WebCore::ScrollView::update):
        (WebCore::ScrollView::resizeContents):
        (WebCore::ScrollView::updateScrollbars):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@24321 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/platform/gdk/ScrollViewGdk.cpp

index 7b87a3acfe5a6c225c7a680b6e73c0a273180c55..d8d956b7a077995b1efde784aa2256a21f3d5441 100644 (file)
@@ -1,3 +1,17 @@
+2007-07-16  Holger Hans Peter Freyther  <zecke@selfish.org>
+
+        Reviewed by Maciej.
+
+        Lazily update the scrollbars (e.g. on loading a page) to
+        generate less expose events, which will lead to laying out less often
+         and will fix http://bugs.webkit.org/show_bug.cgi?id=14020.
+
+        * platform/gdk/ScrollViewGdk.cpp:
+        (WebCore::ScrollView::ScrollViewPrivate::ScrollViewPrivate):
+        (WebCore::ScrollView::update):
+        (WebCore::ScrollView::resizeContents):
+        (WebCore::ScrollView::updateScrollbars):
+
 2007-07-16  Rob Buis  <buis@kde.org>
 
         Reviewed by Maciej.
index c5abd58d30e6c65fa2bdf8a767cb4d9ac88fa726..d58f3a1c50b20cd2e2832ff1b9a95ae9903be8ad 100644 (file)
@@ -56,6 +56,7 @@ public:
         , layout(0)
         , horizontalAdjustment(0)
         , verticalAdjustment(0)
+        , scrollBarsNeedUpdate(false)
     { }
 
     bool hasStaticBackground;
@@ -67,6 +68,7 @@ public:
     GtkAdjustment *verticalAdjustment;
     IntSize contentsSize;
     IntSize viewPortSize;
+    bool scrollBarsNeedUpdate;
 };
 
 ScrollView::ScrollView()
@@ -97,7 +99,11 @@ void ScrollView::updateContents(const IntRect& updateRect, bool now)
 
 void ScrollView::update()
 {
-    notImplemented();
+    ASSERT(gtkWidget());
+    gtk_widget_queue_draw(gtkWidget());
+
+    if (m_data->scrollBarsNeedUpdate)
+        updateScrollbars();
 }
 
 int ScrollView::visibleWidth() const
@@ -139,7 +145,7 @@ void ScrollView::resizeContents(int w, int h)
     
     if (m_data->layout) {
         gtk_layout_set_size(m_data->layout, w, h);
-        updateScrollbars(); 
+        m_data->scrollBarsNeedUpdate = true;
     }
 }
 
@@ -302,6 +308,8 @@ void ScrollView::updateScrollbars()
     
     gtk_adjustment_changed(m_data->verticalAdjustment);
     gtk_adjustment_value_changed(m_data->verticalAdjustment);
+
+    m_data->scrollBarsNeedUpdate = false;
 }
 
 IntPoint ScrollView::windowToContents(const IntPoint& point) const