Skip to content
Permalink
Browse files
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.

Canonical link: https://commits.webkit.org/60713@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@70162 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
Anders Carlsson committed Oct 20, 2010
1 parent b688d87 commit baee402b7b8c4c402df5cb512c030924ca62aef1
Showing 7 changed files with 70 additions and 0 deletions.
@@ -1,3 +1,36 @@
2010-10-20 Anders Carlsson <andersca@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@apple.com>

Reviewed by Geoffrey Garen.
@@ -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)
{
@@ -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);
@@ -94,6 +94,7 @@ class PluginControllerProxy : PluginController {
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)
@@ -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)
@@ -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());

@@ -112,6 +112,9 @@ class PluginProxy : public Plugin {
// 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;

0 comments on commit baee402

Please sign in to comment.