Title: [88267] trunk/Source/WebKit2
- Revision
- 88267
- Author
- [email protected]
- Date
- 2011-06-07 14:21:30 -0700 (Tue, 07 Jun 2011)
Log Message
2011-06-07 Zalan Bujtas <[email protected]>
Reviewed by Andreas Kling.
TiledDrawingArea: Delay serving tile requests when the drawing area is suspended.
Do not paint tiles when painting is disabled (suspended) on the web process side.
Buffer up the tile requests and paint them, when the drawing area gets resumed.
On the UI process side, do not block on tile updates, when the tiled area is
not visible (painting is disabled on the web process side).
* UIProcess/TiledDrawingAreaProxy.cpp:
(WebKit::TiledDrawingAreaProxy::waitUntilUpdatesComplete):
* WebProcess/WebPage/TiledDrawingArea.cpp:
(WebKit::TiledDrawingArea::suspendPainting):
(WebKit::TiledDrawingArea::resumePainting):
(WebKit::TiledDrawingArea::scheduleTileUpdate):
(WebKit::TiledDrawingArea::tileUpdateTimerFired):
(WebKit::TiledDrawingArea::didReceiveMessage):
* WebProcess/WebPage/TiledDrawingArea.h:
Modified Paths
Diff
Modified: trunk/Source/WebKit2/ChangeLog (88266 => 88267)
--- trunk/Source/WebKit2/ChangeLog 2011-06-07 21:15:30 UTC (rev 88266)
+++ trunk/Source/WebKit2/ChangeLog 2011-06-07 21:21:30 UTC (rev 88267)
@@ -1,3 +1,24 @@
+2011-06-07 Zalan Bujtas <[email protected]>
+
+ Reviewed by Andreas Kling.
+
+ TiledDrawingArea: Delay serving tile requests when the drawing area is suspended.
+
+ Do not paint tiles when painting is disabled (suspended) on the web process side.
+ Buffer up the tile requests and paint them, when the drawing area gets resumed.
+ On the UI process side, do not block on tile updates, when the tiled area is
+ not visible (painting is disabled on the web process side).
+
+ * UIProcess/TiledDrawingAreaProxy.cpp:
+ (WebKit::TiledDrawingAreaProxy::waitUntilUpdatesComplete):
+ * WebProcess/WebPage/TiledDrawingArea.cpp:
+ (WebKit::TiledDrawingArea::suspendPainting):
+ (WebKit::TiledDrawingArea::resumePainting):
+ (WebKit::TiledDrawingArea::scheduleTileUpdate):
+ (WebKit::TiledDrawingArea::tileUpdateTimerFired):
+ (WebKit::TiledDrawingArea::didReceiveMessage):
+ * WebProcess/WebPage/TiledDrawingArea.h:
+
2011-06-07 Sheriff Bot <[email protected]>
Unreviewed, rolling out r88259 and r88263.
Modified: trunk/Source/WebKit2/UIProcess/TiledDrawingAreaProxy.cpp (88266 => 88267)
--- trunk/Source/WebKit2/UIProcess/TiledDrawingAreaProxy.cpp 2011-06-07 21:15:30 UTC (rev 88266)
+++ trunk/Source/WebKit2/UIProcess/TiledDrawingAreaProxy.cpp 2011-06-07 21:21:30 UTC (rev 88267)
@@ -179,6 +179,12 @@
void TiledDrawingAreaProxy::waitUntilUpdatesComplete()
{
+ // Do not block when the drawing area is not visible.
+ // The web process side is not going to send tile updates
+ // because the painting is suspended.
+ if (!m_isVisible)
+ return;
+
while (hasPendingUpdates()) {
int tileID;
UpdateInfo updateInfo;
Modified: trunk/Source/WebKit2/WebProcess/WebPage/TiledDrawingArea.cpp (88266 => 88267)
--- trunk/Source/WebKit2/WebProcess/WebPage/TiledDrawingArea.cpp 2011-06-07 21:15:30 UTC (rev 88266)
+++ trunk/Source/WebKit2/WebProcess/WebPage/TiledDrawingArea.cpp 2011-06-07 21:21:30 UTC (rev 88267)
@@ -116,6 +116,7 @@
m_shouldPaint = false;
m_displayTimer.stop();
+ m_tileUpdateTimer.stop();
}
void TiledDrawingArea::resumePainting()
@@ -126,6 +127,8 @@
// Display if needed.
display();
+ if (!m_pendingUpdates.isEmpty())
+ scheduleTileUpdate();
}
void TiledDrawingArea::didUpdate()
@@ -148,6 +151,17 @@
WebProcess::shared().connection()->deprecatedSend(DrawingAreaProxyLegacyMessage::TileUpdated, m_webPage->pageID(), CoreIPC::In(tileID, updateInfo, scale, pendingUpdateCount));
}
+void TiledDrawingArea::scheduleTileUpdate()
+{
+ if (!m_shouldPaint)
+ return;
+
+ if (m_tileUpdateTimer.isActive())
+ return;
+
+ m_tileUpdateTimer.startOneShot(0);
+}
+
void TiledDrawingArea::tileUpdateTimerFired()
{
ASSERT(!m_pendingUpdates.isEmpty());
@@ -161,7 +175,7 @@
if (m_pendingUpdates.isEmpty())
WebProcess::shared().connection()->deprecatedSend(DrawingAreaProxyLegacyMessage::AllTileUpdatesProcessed, m_webPage->pageID(), CoreIPC::In());
else
- m_tileUpdateTimer.startOneShot(0.001);
+ scheduleTileUpdate();
}
void TiledDrawingArea::didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments)
@@ -204,8 +218,7 @@
it->second.dirtyRect.unite(update.dirtyRect);
else {
m_pendingUpdates.add(update.tileID, update);
- if (!m_tileUpdateTimer.isActive())
- m_tileUpdateTimer.startOneShot(0);
+ scheduleTileUpdate();
}
break;
}
Modified: trunk/Source/WebKit2/WebProcess/WebPage/TiledDrawingArea.h (88266 => 88267)
--- trunk/Source/WebKit2/WebProcess/WebPage/TiledDrawingArea.h 2011-06-07 21:15:30 UTC (rev 88266)
+++ trunk/Source/WebKit2/WebProcess/WebPage/TiledDrawingArea.h 2011-06-07 21:21:30 UTC (rev 88267)
@@ -69,6 +69,7 @@
// Platform overrides
void paintIntoBitmap(ShareableBitmap*, const WebCore::IntRect& tileRect, float scale);
+ void scheduleTileUpdate();
void tileUpdateTimerFired();
WebCore::IntRect m_dirtyRect;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes