WebCore: Refactor the HostWindow methods for repaint, scroll, invalidate and blit
of backingstore and window by eliminating the three bools that currently
exist as params of the repaint method.
https://bugs.webkit.org/show_bug.cgi?id=34214

Patch by Adam Treat <atreat@rim.com> on 2010-03-02
Reviewed by Dave Hyatt.

I've added extra methods to provide the hosts with more semantic
information of what is being requested thus eliminating the need for
these bools.

No tests as this change should not introduce any behavior changes in any
of the ports.

https://bugs.webkit.org/show_bug.cgi?id=34214

* loader/EmptyClients.h:
(WebCore::EmptyChromeClient::invalidateContents):
(WebCore::EmptyChromeClient::invalidateWindow):
(WebCore::EmptyChromeClient::invalidateContentsAndWindow):
(WebCore::EmptyChromeClient::invalidateContentsForSlowScroll):
* page/Chrome.cpp:
(WebCore::Chrome::invalidateContents):
(WebCore::Chrome::invalidateWindow):
(WebCore::Chrome::invalidateContentsAndWindow):
(WebCore::Chrome::invalidateContentsForSlowScroll):
* page/Chrome.h:
* page/ChromeClient.h:
* page/FrameView.cpp:
(WebCore::FrameView::invalidateRect):
* platform/HostWindow.h:
* platform/ScrollView.cpp:
(WebCore::ScrollView::scrollContents):
(WebCore::ScrollView::wheelEvent):

WebKit/chromium: Adapt the chromium port to the refactoring of repaint methods.

Patch by Adam Treat <atreat@rim.com> on 2010-03-02
Reviewed by Dave Hyatt.

https://bugs.webkit.org/show_bug.cgi?id=34214

* src/ChromeClientImpl.cpp:
(WebKit::ChromeClientImpl::invalidateContents):
(WebKit::ChromeClientImpl::invalidateWindow):
(WebKit::ChromeClientImpl::invalidateContentsAndWindow):
(WebKit::ChromeClient::invalidateContentsForSlowScroll):
* src/ChromeClientImpl.h:

WebKit/gtk: Adapt the gtk port to the refactoring of repaint methods.

Patch by Adam Treat <atreat@rim.com> on 2010-03-02
Reviewed by Dave Hyatt.

https://bugs.webkit.org/show_bug.cgi?id=34214

* WebCoreSupport/ChromeClientGtk.cpp:
* WebCoreSupport/ChromeClientGtk.h:

WebKit/haiku: Adapt the haiku port to the refactoring of repaint methods.

Patch by Adam Treat <atreat@rim.com> on 2010-03-02
Reviewed by Dave Hyatt.

https://bugs.webkit.org/show_bug.cgi?id=34214

* WebCoreSupport/ChromeClientHaiku.cpp:
(WebCore::ChromeClientHaiku::invalidateContents):
(WebCore::ChromeClientHaiku::invalidateWindow):
(WebCore::ChromeClientHaiku::invalidateContentsAndWindow):
(WebCore::ChromeClient::invalidateContentsForSlowScroll):
* WebCoreSupport/ChromeClientHaiku.h:

WebKit/mac: Adapt the mac port to the refactoring of repaint methods.

Patch by Adam Treat <atreat@rim.com> on 2010-03-02
Reviewed by Dave Hyatt.

https://bugs.webkit.org/show_bug.cgi?id=34214

* WebCoreSupport/WebChromeClient.h:
* WebCoreSupport/WebChromeClient.mm:
(WebChromeClient::invalidateContents):
(WebChromeClient::invalidateWindow):
(WebChromeClient::invalidateContentsAndWindow):
(WebChromeClient::invalidateContentsForSlowScroll):

WebKit/qt: Adapt the qt port to the refactoring of repaint methods.

Patch by Adam Treat <atreat@rim.com> on 2010-03-02
Reviewed by Dave Hyatt.

https://bugs.webkit.org/show_bug.cgi?id=34214

* WebCoreSupport/ChromeClientQt.cpp:
(WebCore::ChromeClientQt::invalidateContents):
(WebCore::ChromeClientQt::invalidateWindow):
(WebCore::ChromeClientQt::invalidateContentsAndWindow):
(WebCore::ChromeClientQt::invalidateContentsForSlowScroll):
* WebCoreSupport/ChromeClientQt.h:

WebKit/win: Adapt the win port to the refactoring of repaint methods.

Patch by Adam Treat <atreat@rim.com> on 2010-03-02
Reviewed by Dave Hyatt.

https://bugs.webkit.org/show_bug.cgi?id=34214

* WebCoreSupport/WebChromeClient.cpp:
(WebChromeClient::invalidateContents):
(WebChromeClient::invalidateWindow):
(WebChromeClient::invalidateContentsAndWindow):
(WebChromeClient::invalidateContentsForSlowScroll):
* WebCoreSupport/WebChromeClient.h:

WebKit/wx: Adapt the wx port to the refactoring of repaint methods.

Patch by Adam Treat <atreat@rim.com> on 2010-03-02
Reviewed by Dave Hyatt.

https://bugs.webkit.org/show_bug.cgi?id=34214

* WebKitSupport/ChromeClientWx.cpp:
(WebCore::ChromeClientWx::invalidateContents):
(WebCore::ChromeClientWx::invalidateWindow):
(WebCore::ChromeClientWx::invalidateContentsForSlowScroll):
(WebCore::ChromeClientWx::invalidateContentsAndWindow):
* WebKitSupport/ChromeClientWx.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55675 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/platform/ScrollView.cpp b/WebCore/platform/ScrollView.cpp
index e52815a..4fd5cfd 100644
--- a/WebCore/platform/ScrollView.cpp
+++ b/WebCore/platform/ScrollView.cpp
@@ -499,31 +499,30 @@
     updateRect.intersect(scrollViewRect);
 
     // Invalidate the window (not the backing store).
-    hostWindow()->repaint(updateRect, false);
+    hostWindow()->invalidateWindow(updateRect, false /*immediate*/);
 
     if (m_drawPanScrollIcon) {
         int panIconDirtySquareSizeLength = 2 * (panIconSizeLength + max(abs(scrollDelta.width()), abs(scrollDelta.height()))); // We only want to repaint what's necessary
         IntPoint panIconDirtySquareLocation = IntPoint(m_panScrollIconPoint.x() - (panIconDirtySquareSizeLength / 2), m_panScrollIconPoint.y() - (panIconDirtySquareSizeLength / 2));
         IntRect panScrollIconDirtyRect = IntRect(panIconDirtySquareLocation , IntSize(panIconDirtySquareSizeLength, panIconDirtySquareSizeLength));
         panScrollIconDirtyRect.intersect(clipRect);
-        hostWindow()->repaint(panScrollIconDirtyRect, true);
+        hostWindow()->invalidateContentsAndWindow(panScrollIconDirtyRect, false /*immediate*/);
     }
 
     if (canBlitOnScroll()) { // The main frame can just blit the WebView window
-       // FIXME: Find a way to blit subframes without blitting overlapping content
+       // FIXME: Find a way to scroll subframes with this faster path
        hostWindow()->scroll(-scrollDelta, scrollViewRect, clipRect);
     } else { 
        // We need to go ahead and repaint the entire backing store.  Do it now before moving the
        // windowed plugins.
-       hostWindow()->repaint(updateRect, true, false, true); // Invalidate the backing store and repaint it synchronously
+       hostWindow()->invalidateContentsForSlowScroll(updateRect, false);
     }
 
     // This call will move children with native widgets (plugins) and invalidate them as well.
     frameRectsChanged();
 
-    // Now update the window (which should do nothing but a blit of the backing store's updateRect and so should
-    // be very fast).
-    hostWindow()->paint();
+    // Now blit the backingstore into the window which should be very fast.
+    hostWindow()->invalidateWindow(IntRect(), true);
 }
 
 IntPoint ScrollView::windowToContents(const IntPoint& windowPoint) const
@@ -713,7 +712,7 @@
     }
 
     if (hostWindow())
-        hostWindow()->repaint(contentsToWindow(paintRect), true, now);
+        hostWindow()->invalidateContentsAndWindow(contentsToWindow(paintRect), now /*immediate*/);
 }
 
 IntRect ScrollView::scrollCornerRect() const
@@ -931,7 +930,7 @@
         return;
     m_drawPanScrollIcon = true;    
     m_panScrollIconPoint = IntPoint(iconPosition.x() - panIconSizeLength / 2 , iconPosition.y() - panIconSizeLength / 2) ;
-    hostWindow()->repaint(IntRect(m_panScrollIconPoint, IntSize(panIconSizeLength,panIconSizeLength)), true, true);    
+    hostWindow()->invalidateContentsAndWindow(IntRect(m_panScrollIconPoint, IntSize(panIconSizeLength, panIconSizeLength)), true /*immediate*/);
 }
 
 void ScrollView::removePanScrollIcon()
@@ -939,7 +938,7 @@
     if (!hostWindow())
         return;
     m_drawPanScrollIcon = false; 
-    hostWindow()->repaint(IntRect(m_panScrollIconPoint, IntSize(panIconSizeLength, panIconSizeLength)), true, true);
+    hostWindow()->invalidateContentsAndWindow(IntRect(m_panScrollIconPoint, IntSize(panIconSizeLength, panIconSizeLength)), true /*immediate*/);
 }
 
 #if !PLATFORM(WX) && !PLATFORM(GTK) && !PLATFORM(QT)