no need to update regions that are not visible on the webpage.
authorlars <lars@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 13 Aug 2007 12:06:11 +0000 (12:06 +0000)
committerlars <lars@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 13 Aug 2007 12:06:11 +0000 (12:06 +0000)
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@25054 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/platform/qt/ScrollViewQt.cpp

index d3b55470987480adbddeb916a37084370e7369f3..daf300646e2061c701f2e249f9a31114bcd20382 100644 (file)
@@ -1,3 +1,12 @@
+2007-08-13  Lars Knoll  <lars@trolltech.com>
+
+        Reviewed by Simon.
+
+        no need to update regions that are not visible on the webpage.
+
+        * platform/qt/ScrollViewQt.cpp:
+        (WebCore::ScrollView::updateContents):
+
 2007-08-12  Maciej Stachowiak  <mjs@apple.com>
 
         Reviewed by Darin and Sam.
index f3b8325dc3093d8a921b9f3ca25c5adb535389fa..f4dddbf48aed182fd61a4f459ad79727b788a69a 100644 (file)
@@ -210,11 +210,16 @@ void ScrollView::updateContents(const IntRect& rect, bool now)
     //and send the bound along to QWebPage.  The cache is cleared everytime
     //an actual paint occurs in ScrollView::paint...
 
+    QRect r(containingWindowRect);
+    QWidget *container = containingWindow();
+    r = r.intersect(container->rect());
+    if (r.isEmpty())
+        return;
     // Cache the dirty spot.
     if (!m_data->m_dirtyRegion.isEmpty())
-        m_data->m_dirtyRegion = m_data->m_dirtyRegion.united(QRegion(containingWindowRect));
+        m_data->m_dirtyRegion = m_data->m_dirtyRegion.united(QRegion(r));
     else
-        m_data->m_dirtyRegion = QRegion(containingWindowRect);
+        m_data->m_dirtyRegion = QRegion(r);
 
     bool painting = containingWindow()->testAttribute(Qt::WA_WState_InPaintEvent);
     if (painting && now) {