Changeset 70162 in webkit


Ignore:
Timestamp:
Oct 20, 2010 12:37:57 PM (14 years ago)
Author:
andersca@apple.com
Message:

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.

Location:
trunk/WebKit2
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKit2/ChangeLog

    r70148 r70162  
     12010-10-20  Anders Carlsson  <andersca@apple.com>
     2
     3        Reviewed by Darin Adler.
     4
     5        Out of process plug-ins are never asked to initially paint
     6        https://bugs.webkit.org/show_bug.cgi?id=47993
     7        <rdar://problem/8570342>
     8
     9        * Platform/CoreIPC/HandleMessage.h:
     10        (CoreIPC::callMemberFunction):
     11        Add new callMemberFunction overload.
     12
     13        * PluginProcess/PluginControllerProxy.cpp:
     14        (WebKit::PluginControllerProxy::paintEntirePlugin):
     15        Set the dirty rect to be the entire plug-in rect and then paint the plug-in.
     16
     17        * PluginProcess/PluginControllerProxy.messages.in:
     18        Add PaintEntirePlugin message.
     19
     20        * WebProcess/Plugins/PluginProxy.cpp:
     21        (WebKit::PluginProxy::PluginProxy):
     22        Initialize m_pluginBackingStoreContainsValidData to false.
     23
     24        (WebKit::PluginProxy::paint):
     25        If m_pluginBackingStoreContainsValidData is false, synchronously ask the plug-in to paint,
     26        then blit the plug-in backing store into our own backing store.
     27
     28        (WebKit::PluginProxy::geometryDidChange):
     29        Set m_pluginBackingStoreContainsValidData to false.
     30
     31        (WebKit::PluginProxy::update):
     32        Set m_pluginBackingStoreContainsValidData to true if the plug-in has painted its entire area.
     33
    1342010-10-19  Jessie Berlin  <jberlin@apple.com>
    235
  • trunk/WebKit2/Platform/CoreIPC/HandleMessage.h

    r69329 r70162  
    5555
    5656// Dispatch functions with reply arguments.
     57
     58template<typename C, typename MF>
     59void callMemberFunction(const Arguments0&, Arguments0&, C* object, MF function)
     60{
     61    (object->*function)();
     62}
    5763
    5864template<typename C, typename MF, typename R1>
  • trunk/WebKit2/PluginProcess/PluginControllerProxy.cpp

    r70098 r70162  
    8787{
    8888    ASSERT(!m_dirtyRect.isEmpty());
     89    m_paintTimer.stop();
    8990
    9091    if (!m_backingStore)
     
    292293}
    293294
     295void PluginControllerProxy::paintEntirePlugin()
     296{
     297    m_dirtyRect = m_frameRect;
     298    paint();
     299}
     300
    294301void PluginControllerProxy::setFocus(bool hasFocus)
    295302{
  • trunk/WebKit2/PluginProcess/PluginControllerProxy.h

    r70098 r70162  
    9595    void handleMouseLeaveEvent(const WebMouseEvent&, bool& handled);
    9696    void handleKeyboardEvent(const WebKeyboardEvent&, bool& handled);
     97    void paintEntirePlugin();
    9798    void setFocus(bool);
    9899    void didUpdate();
  • trunk/WebKit2/PluginProcess/PluginControllerProxy.messages.in

    r70098 r70162  
    6363    DidUpdate()
    6464
     65    # Paint the entire plug-in.
     66    PaintEntirePlugin() -> ()
     67   
    6568#if PLATFORM(MAC)
    6669    # Sent when the containing NSWindow's focus changes
  • trunk/WebKit2/WebProcess/Plugins/PluginProxy.cpp

    r70098 r70162  
    5858    , m_pluginInstanceID(generatePluginInstanceID())
    5959    , m_pluginController(0)
     60    , m_pluginBackingStoreContainsValidData(false)
    6061    , m_isStarted(false)
    6162    , m_waitingForPaintInResponseToUpdate(false)
     
    113114    if (!m_backingStore)
    114115        return;
     116
     117    if (!m_pluginBackingStoreContainsValidData) {
     118        m_connection->connection()->sendSync(Messages::PluginControllerProxy::PaintEntirePlugin(), Messages::PluginControllerProxy::PaintEntirePlugin::Reply(), m_pluginInstanceID, CoreIPC::Connection::NoTimeout);
     119   
     120        // Blit the plug-in backing store into our own backing store.
     121        OwnPtr<WebCore::GraphicsContext> graphicsContext = m_backingStore->createGraphicsContext();
     122       
     123        m_pluginBackingStore->paint(graphicsContext.get(), IntRect(0, 0, m_frameRect.width(), m_frameRect.height()));
     124       
     125        m_pluginBackingStoreContainsValidData = true;
     126    }
    115127
    116128    IntRect dirtyRectInPluginCoordinates = dirtyRect;
     
    170182            return;
    171183        }
     184
     185        m_pluginBackingStoreContainsValidData = false;
    172186    }
    173187
     
    346360void PluginProxy::update(const IntRect& paintedRect)
    347361{
     362    if (paintedRect == m_frameRect)
     363        m_pluginBackingStoreContainsValidData = true;
     364
    348365    IntRect paintedRectPluginCoordinates = paintedRect;
    349366    paintedRectPluginCoordinates.move(-m_frameRect.x(), -m_frameRect.y());
  • trunk/WebKit2/WebProcess/Plugins/PluginProxy.h

    r70098 r70162  
    113113    // that it's painted something in it, we'll blit from it to our own backing store.
    114114    RefPtr<BackingStore> m_pluginBackingStore;
     115   
     116    // Whether all of the plug-in backing store contains valid data.
     117    bool m_pluginBackingStoreContainsValidData;
    115118
    116119    bool m_isStarted;
Note: See TracChangeset for help on using the changeset viewer.