[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
andersca at apple.com
andersca at apple.com
Wed Dec 22 14:46:35 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 2c611fea6d4d0e653f7d828993c1db09bd333278
Author: andersca at apple.com <andersca at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue Oct 19 22:48:18 2010 +0000
Coalesce plug-in drawing
https://bugs.webkit.org/show_bug.cgi?id=47939
Reviewed by Sam Weinig.
Coalesce plug-in drawing in the same manner as we do it in the chunked update drawing area.
* PluginProcess/PluginControllerProxy.cpp:
(WebKit::PluginControllerProxy::PluginControllerProxy):
Initialize m_waitingForDidUpdate to false.
(WebKit::PluginControllerProxy::startPaintTimer):
Move code from invalidate out to here. Don't start the paint timer if m_waitingForDidUpdate is true.
(WebKit::PluginControllerProxy::invalidate):
Call startPaintTimer.
(WebKit::PluginControllerProxy::didUpdate):
Set m_waitingForDidUpdate to false and start the paint timer.
* PluginProcess/PluginControllerProxy.messages.in:
Add DidUpdate message.
* WebProcess/Plugins/PluginProxy.cpp:
(WebKit::PluginProxy::PluginProxy):
Initialize m_waitingForPaintInResponseToUpdate to false.
(WebKit::PluginProxy::paint):
If m_waitingForPaintInResponseToUpdate is true, send a DidUpdate message.
(WebKit::PluginProxy::update):
Set m_waitingForPaintInResponseToUpdate to true.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@70098 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index 170c5d4..8051f89 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,3 +1,38 @@
+2010-10-19 Anders Carlsson <andersca at apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Coalesce plug-in drawing
+ https://bugs.webkit.org/show_bug.cgi?id=47939
+
+ Coalesce plug-in drawing in the same manner as we do it in the chunked update drawing area.
+
+ * PluginProcess/PluginControllerProxy.cpp:
+ (WebKit::PluginControllerProxy::PluginControllerProxy):
+ Initialize m_waitingForDidUpdate to false.
+
+ (WebKit::PluginControllerProxy::startPaintTimer):
+ Move code from invalidate out to here. Don't start the paint timer if m_waitingForDidUpdate is true.
+
+ (WebKit::PluginControllerProxy::invalidate):
+ Call startPaintTimer.
+
+ (WebKit::PluginControllerProxy::didUpdate):
+ Set m_waitingForDidUpdate to false and start the paint timer.
+
+ * PluginProcess/PluginControllerProxy.messages.in:
+ Add DidUpdate message.
+
+ * WebProcess/Plugins/PluginProxy.cpp:
+ (WebKit::PluginProxy::PluginProxy):
+ Initialize m_waitingForPaintInResponseToUpdate to false.
+
+ (WebKit::PluginProxy::paint):
+ If m_waitingForPaintInResponseToUpdate is true, send a DidUpdate message.
+
+ (WebKit::PluginProxy::update):
+ Set m_waitingForPaintInResponseToUpdate to true.
+
2010-10-19 Sam Weinig <sam at webkit.org>
Reviewed by Anders Carlsson.
diff --git a/WebKit2/PluginProcess/PluginControllerProxy.cpp b/WebKit2/PluginProcess/PluginControllerProxy.cpp
index 30eb60e..07381e9 100644
--- a/WebKit2/PluginProcess/PluginControllerProxy.cpp
+++ b/WebKit2/PluginProcess/PluginControllerProxy.cpp
@@ -53,6 +53,7 @@ PluginControllerProxy::PluginControllerProxy(WebProcessConnection* connection, u
, m_userAgent(userAgent)
, m_isPrivateBrowsingEnabled(isPrivateBrowsingEnabled)
, m_paintTimer(RunLoop::main(), this, &PluginControllerProxy::paint)
+ , m_waitingForDidUpdate(false)
{
}
@@ -102,29 +103,39 @@ void PluginControllerProxy::paint()
m_connection->connection()->send(Messages::PluginProxy::Update(dirtyRect), m_pluginInstanceID);
}
-void PluginControllerProxy::invalidate(const IntRect& rect)
+void PluginControllerProxy::startPaintTimer()
{
- // Convert the dirty rect to window coordinates.
- IntRect dirtyRect = rect;
- dirtyRect.move(m_frameRect.x(), m_frameRect.y());
-
- // Make sure that the dirty rect is not greater than the plug-in itself.
- dirtyRect.intersect(m_frameRect);
-
- m_dirtyRect.unite(dirtyRect);
-
// Check if we should start the timer.
if (m_dirtyRect.isEmpty())
return;
-
+
// FIXME: Check clip rect.
if (m_paintTimer.isActive())
return;
+ if (m_waitingForDidUpdate)
+ return;
+
// Start the timer.
m_paintTimer.startOneShot(0);
+
+ m_waitingForDidUpdate = true;
+}
+
+void PluginControllerProxy::invalidate(const IntRect& rect)
+{
+ // Convert the dirty rect to window coordinates.
+ IntRect dirtyRect = rect;
+ dirtyRect.move(m_frameRect.x(), m_frameRect.y());
+
+ // Make sure that the dirty rect is not greater than the plug-in itself.
+ dirtyRect.intersect(m_frameRect);
+
+ m_dirtyRect.unite(dirtyRect);
+
+ startPaintTimer();
}
String PluginControllerProxy::userAgent()
@@ -285,6 +296,12 @@ void PluginControllerProxy::setFocus(bool hasFocus)
m_plugin->setFocus(hasFocus);
}
+void PluginControllerProxy::didUpdate()
+{
+ m_waitingForDidUpdate = false;
+ startPaintTimer();
+}
+
#if PLATFORM(MAC)
void PluginControllerProxy::windowFocusChanged(bool hasFocus)
{
diff --git a/WebKit2/PluginProcess/PluginControllerProxy.h b/WebKit2/PluginProcess/PluginControllerProxy.h
index b6f59ea..e23090e 100644
--- a/WebKit2/PluginProcess/PluginControllerProxy.h
+++ b/WebKit2/PluginProcess/PluginControllerProxy.h
@@ -62,6 +62,7 @@ public:
private:
PluginControllerProxy(WebProcessConnection* connection, uint64_t pluginInstanceID, const String& userAgent, bool isPrivateBrowsingEnabled);
+ void startPaintTimer();
void paint();
// PluginController
@@ -94,6 +95,7 @@ private:
void handleMouseLeaveEvent(const WebMouseEvent&, bool& handled);
void handleKeyboardEvent(const WebKeyboardEvent&, bool& handled);
void setFocus(bool);
+ void didUpdate();
#if PLATFORM(MAC)
void windowFocusChanged(bool);
void windowFrameChanged(const WebCore::IntRect&);
@@ -119,6 +121,10 @@ private:
// The paint timer, used for coalescing painting.
RunLoop::Timer<PluginControllerProxy> m_paintTimer;
+ // Whether we're waiting for the plug-in proxy in the web process to draw the contents of its
+ // backing store into the web process backing store.
+ bool m_waitingForDidUpdate;
+
// The backing store that this plug-in draws into.
RefPtr<BackingStore> m_backingStore;
};
diff --git a/WebKit2/PluginProcess/PluginControllerProxy.messages.in b/WebKit2/PluginProcess/PluginControllerProxy.messages.in
index be840be..baab004 100644
--- a/WebKit2/PluginProcess/PluginControllerProxy.messages.in
+++ b/WebKit2/PluginProcess/PluginControllerProxy.messages.in
@@ -59,6 +59,9 @@ messages -> PluginControllerProxy {
# Sent when the plug-in focus changes.
SetFocus(bool isFocused)
+ # Sent when the update requested by Update has been painted.
+ DidUpdate()
+
#if PLATFORM(MAC)
# Sent when the containing NSWindow's focus changes
WindowFocusChanged(bool hasFocus)
diff --git a/WebKit2/WebProcess/Plugins/PluginProxy.cpp b/WebKit2/WebProcess/Plugins/PluginProxy.cpp
index 4747869..dc15157 100644
--- a/WebKit2/WebProcess/Plugins/PluginProxy.cpp
+++ b/WebKit2/WebProcess/Plugins/PluginProxy.cpp
@@ -58,7 +58,7 @@ PluginProxy::PluginProxy(PassRefPtr<PluginProcessConnection> connection)
, m_pluginInstanceID(generatePluginInstanceID())
, m_pluginController(0)
, m_isStarted(false)
-
+ , m_waitingForPaintInResponseToUpdate(false)
{
}
@@ -122,6 +122,12 @@ void PluginProxy::paint(GraphicsContext* graphicsContext, const IntRect& dirtyRe
m_backingStore->paint(graphicsContext, dirtyRectInPluginCoordinates);
graphicsContext->restore();
+
+ if (m_waitingForPaintInResponseToUpdate) {
+ m_waitingForPaintInResponseToUpdate = false;
+ m_connection->connection()->send(Messages::PluginControllerProxy::DidUpdate(), m_pluginInstanceID);
+ return;
+ }
}
#if PLATFORM(MAC)
@@ -349,7 +355,8 @@ void PluginProxy::update(const IntRect& paintedRect)
m_pluginBackingStore->paint(graphicsContext.get(), paintedRectPluginCoordinates);
}
- // Ask the controller to invalidate the rect for us.
+ // Ask the controller to invalidate the rect for us.
+ m_waitingForPaintInResponseToUpdate = true;
m_pluginController->invalidate(paintedRectPluginCoordinates);
}
diff --git a/WebKit2/WebProcess/Plugins/PluginProxy.h b/WebKit2/WebProcess/Plugins/PluginProxy.h
index 4bea06d..ef1db8e 100644
--- a/WebKit2/WebProcess/Plugins/PluginProxy.h
+++ b/WebKit2/WebProcess/Plugins/PluginProxy.h
@@ -114,6 +114,9 @@ private:
RefPtr<BackingStore> m_pluginBackingStore;
bool m_isStarted;
+
+ // Whether we're called invalidate in response to an update call, and are now waiting for a paint call.
+ bool m_waitingForPaintInResponseToUpdate;
};
} // namespace WebKit
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list