[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:47:53 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit cba72a58def0a67074ddf2fa9a118d3bed37ee4d
Author: andersca at apple.com <andersca at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Oct 20 19:37:57 2010 +0000

    Out of process plug-ins are never asked to initially paint
    https://bugs.webkit.org/show_bug.cgi?id=47993
    <rdar://problem/8570342>
    
    Reviewed by Darin Adler.
    
    * Platform/CoreIPC/HandleMessage.h:
    (CoreIPC::callMemberFunction):
    Add new callMemberFunction overload.
    
    * PluginProcess/PluginControllerProxy.cpp:
    (WebKit::PluginControllerProxy::paintEntirePlugin):
    Set the dirty rect to be the entire plug-in rect and then paint the plug-in.
    
    * PluginProcess/PluginControllerProxy.messages.in:
    Add PaintEntirePlugin message.
    
    * WebProcess/Plugins/PluginProxy.cpp:
    (WebKit::PluginProxy::PluginProxy):
    Initialize m_pluginBackingStoreContainsValidData to false.
    
    (WebKit::PluginProxy::paint):
    If m_pluginBackingStoreContainsValidData is false, synchronously ask the plug-in to paint,
    then blit the plug-in backing store into our own backing store.
    
    (WebKit::PluginProxy::geometryDidChange):
    Set m_pluginBackingStoreContainsValidData to false.
    
    (WebKit::PluginProxy::update):
    Set m_pluginBackingStoreContainsValidData to true if the plug-in has painted its entire area.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@70162 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index f8fbc17..8734c91 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,3 +1,36 @@
+2010-10-20  Anders Carlsson  <andersca at apple.com>
+
+        Reviewed by Darin Adler.
+
+        Out of process plug-ins are never asked to initially paint
+        https://bugs.webkit.org/show_bug.cgi?id=47993
+        <rdar://problem/8570342>
+
+        * Platform/CoreIPC/HandleMessage.h:
+        (CoreIPC::callMemberFunction):
+        Add new callMemberFunction overload.
+
+        * PluginProcess/PluginControllerProxy.cpp:
+        (WebKit::PluginControllerProxy::paintEntirePlugin):
+        Set the dirty rect to be the entire plug-in rect and then paint the plug-in.
+
+        * PluginProcess/PluginControllerProxy.messages.in:
+        Add PaintEntirePlugin message.
+
+        * WebProcess/Plugins/PluginProxy.cpp:
+        (WebKit::PluginProxy::PluginProxy):
+        Initialize m_pluginBackingStoreContainsValidData to false.
+
+        (WebKit::PluginProxy::paint):
+        If m_pluginBackingStoreContainsValidData is false, synchronously ask the plug-in to paint,
+        then blit the plug-in backing store into our own backing store.
+
+        (WebKit::PluginProxy::geometryDidChange):
+        Set m_pluginBackingStoreContainsValidData to false.
+
+        (WebKit::PluginProxy::update):
+        Set m_pluginBackingStoreContainsValidData to true if the plug-in has painted its entire area.
+
 2010-10-19  Jessie Berlin  <jberlin at apple.com>
 
         Reviewed by Geoffrey Garen.
diff --git a/WebKit2/Platform/CoreIPC/HandleMessage.h b/WebKit2/Platform/CoreIPC/HandleMessage.h
index 87909ef..0f09682 100644
--- a/WebKit2/Platform/CoreIPC/HandleMessage.h
+++ b/WebKit2/Platform/CoreIPC/HandleMessage.h
@@ -55,6 +55,12 @@ void callMemberFunction(const Arguments7<P1, P2, P3, P4, P5, P6, P7>& args, C* o
 
 // Dispatch functions with reply arguments.
 
+template<typename C, typename MF>
+void callMemberFunction(const Arguments0&, Arguments0&, C* object, MF function)
+{
+    (object->*function)();
+}
+
 template<typename C, typename MF, typename R1>
 void callMemberFunction(const Arguments0&, Arguments1<R1>& replyArgs, C* object, MF function)
 {
diff --git a/WebKit2/PluginProcess/PluginControllerProxy.cpp b/WebKit2/PluginProcess/PluginControllerProxy.cpp
index 07381e9..e6045f1 100644
--- a/WebKit2/PluginProcess/PluginControllerProxy.cpp
+++ b/WebKit2/PluginProcess/PluginControllerProxy.cpp
@@ -86,6 +86,7 @@ void PluginControllerProxy::destroy()
 void PluginControllerProxy::paint()
 {
     ASSERT(!m_dirtyRect.isEmpty());
+    m_paintTimer.stop();
 
     if (!m_backingStore)
         return;
@@ -291,6 +292,12 @@ void PluginControllerProxy::handleKeyboardEvent(const WebKeyboardEvent& keyboard
     handled = m_plugin->handleKeyboardEvent(keyboardEvent);
 }
 
+void PluginControllerProxy::paintEntirePlugin()
+{
+    m_dirtyRect = m_frameRect;
+    paint();
+}
+
 void PluginControllerProxy::setFocus(bool hasFocus)
 {
     m_plugin->setFocus(hasFocus);
diff --git a/WebKit2/PluginProcess/PluginControllerProxy.h b/WebKit2/PluginProcess/PluginControllerProxy.h
index e23090e..b32f778 100644
--- a/WebKit2/PluginProcess/PluginControllerProxy.h
+++ b/WebKit2/PluginProcess/PluginControllerProxy.h
@@ -94,6 +94,7 @@ private:
     void handleMouseEnterEvent(const WebMouseEvent&, bool& handled);
     void handleMouseLeaveEvent(const WebMouseEvent&, bool& handled);
     void handleKeyboardEvent(const WebKeyboardEvent&, bool& handled);
+    void paintEntirePlugin();
     void setFocus(bool);
     void didUpdate();
 #if PLATFORM(MAC)
diff --git a/WebKit2/PluginProcess/PluginControllerProxy.messages.in b/WebKit2/PluginProcess/PluginControllerProxy.messages.in
index baab004..1276e4d 100644
--- a/WebKit2/PluginProcess/PluginControllerProxy.messages.in
+++ b/WebKit2/PluginProcess/PluginControllerProxy.messages.in
@@ -62,6 +62,9 @@ messages -> PluginControllerProxy {
     # Sent when the update requested by Update has been painted.
     DidUpdate()
 
+    # Paint the entire plug-in.
+    PaintEntirePlugin() -> ()
+    
 #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 dc15157..093f2e7 100644
--- a/WebKit2/WebProcess/Plugins/PluginProxy.cpp
+++ b/WebKit2/WebProcess/Plugins/PluginProxy.cpp
@@ -57,6 +57,7 @@ PluginProxy::PluginProxy(PassRefPtr<PluginProcessConnection> connection)
     : m_connection(connection)
     , m_pluginInstanceID(generatePluginInstanceID())
     , m_pluginController(0)
+    , m_pluginBackingStoreContainsValidData(false)
     , m_isStarted(false)
     , m_waitingForPaintInResponseToUpdate(false)
 {
@@ -113,6 +114,17 @@ void PluginProxy::paint(GraphicsContext* graphicsContext, const IntRect& dirtyRe
     if (!m_backingStore)
         return;
 
+    if (!m_pluginBackingStoreContainsValidData) {
+        m_connection->connection()->sendSync(Messages::PluginControllerProxy::PaintEntirePlugin(), Messages::PluginControllerProxy::PaintEntirePlugin::Reply(), m_pluginInstanceID, CoreIPC::Connection::NoTimeout);
+    
+        // Blit the plug-in backing store into our own backing store.
+        OwnPtr<WebCore::GraphicsContext> graphicsContext = m_backingStore->createGraphicsContext();
+        
+        m_pluginBackingStore->paint(graphicsContext.get(), IntRect(0, 0, m_frameRect.width(), m_frameRect.height()));
+        
+        m_pluginBackingStoreContainsValidData = true;
+    }
+
     IntRect dirtyRectInPluginCoordinates = dirtyRect;
     dirtyRectInPluginCoordinates.move(-m_frameRect.x(), -m_frameRect.y());
 
@@ -169,6 +181,8 @@ void PluginProxy::geometryDidChange(const IntRect& frameRect, const IntRect& cli
             m_pluginBackingStore.clear();
             return;
         }
+
+        m_pluginBackingStoreContainsValidData = false;
     }
 
     m_connection->connection()->send(Messages::PluginControllerProxy::GeometryDidChange(frameRect, clipRect, pluginBackingStoreHandle), m_pluginInstanceID);
@@ -345,6 +359,9 @@ void PluginProxy::setCookiesForURL(const String& urlString, const String& cookie
     
 void PluginProxy::update(const IntRect& paintedRect)
 {
+    if (paintedRect == m_frameRect)
+        m_pluginBackingStoreContainsValidData = true;
+
     IntRect paintedRectPluginCoordinates = paintedRect;
     paintedRectPluginCoordinates.move(-m_frameRect.x(), -m_frameRect.y());
 
diff --git a/WebKit2/WebProcess/Plugins/PluginProxy.h b/WebKit2/WebProcess/Plugins/PluginProxy.h
index ef1db8e..ce2d84b 100644
--- a/WebKit2/WebProcess/Plugins/PluginProxy.h
+++ b/WebKit2/WebProcess/Plugins/PluginProxy.h
@@ -112,6 +112,9 @@ private:
     // This is the shared memory backing store that the plug-in paints into. When the plug-in tells us
     // that it's painted something in it, we'll blit from it to our own backing store.
     RefPtr<BackingStore> m_pluginBackingStore;
+    
+    // Whether all of the plug-in backing store contains valid data.
+    bool m_pluginBackingStoreContainsValidData;
 
     bool m_isStarted;
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list