2011-02-17 Simon Fraser <simon.fraser@apple.com>
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 18 Feb 2011 05:44:22 +0000 (05:44 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 18 Feb 2011 05:44:22 +0000 (05:44 +0000)
commit8480f2cf99df8de9e21ae02b81a986cc8ee41a2a
tree0bbf9783f61fca0d50aa66f4fd4c65ad3ca8d320
parent24d4967f9e6008dc22c73c6646e570d421f22dd9
2011-02-17  Simon Fraser  <simon.fraser@apple.com>

        Reviewed by Sam Weinig.

        WebKit2 snapshots don't show plug-ins
        https://bugs.webkit.org/show_bug.cgi?id=54716

        Fix WebKit2 plug-ins to do a software paint for
        snapshotting.

        * PluginProcess/PluginControllerProxy.h:
        * PluginProcess/PluginControllerProxy.cpp:
        (WebKit::PluginControllerProxy::snapshot): Respond to the snapshot
        message by getting a sharable bitmap from the plugin, and returning
        a handle to it in the reply.

        * PluginProcess/PluginControllerProxy.messages.in: Add the snapshot
        message.

        * Shared/Plugins/PluginQuirks.h:
        * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
        (WebKit::NetscapePluginModule::determineQuirks): Add a quirk for the
        ability to be snapshotted, which we only set for Flash at the moment.

        * WebProcess/Plugins/Netscape/NetscapePlugin.h:
        * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
        (WebKit::NetscapePlugin::snapshot): Create a shareable bitmap, and
        paint into it.
        (WebKit::NetscapePlugin::supportsSnapshotting): Test the quirk.

        * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
        (WebKit::NetscapePlugin::platformPaint): Allow the paint to happen
        if we're snapshotting, even when using the CoreAnimation drawing
        model.

        * WebProcess/Plugins/Plugin.h: New snapshot method.

        * WebProcess/Plugins/PluginProxy.h:
        * WebProcess/Plugins/PluginProxy.cpp:
        (WebKit::PluginProxy::snapshot): Send a sync message to the plugin process,
        asking for a snapshot in a shareble bitmap.

        * WebProcess/Plugins/PluginView.h:
        * WebProcess/Plugins/PluginView.cpp:
        (WebKit::PluginView::paint): Use the snapshot if we have one, to avoid
        calling into the plugin to draw, which may run script.

        (WebKit::PluginView::notifyWidget): Generate the snapshot before
        a flattening paint, and throw it away after.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@78956 268f45cc-cd09-0410-ab3c-d52691b4dbfc
14 files changed:
Source/WebKit2/ChangeLog
Source/WebKit2/PluginProcess/PluginControllerProxy.cpp
Source/WebKit2/PluginProcess/PluginControllerProxy.h
Source/WebKit2/PluginProcess/PluginControllerProxy.messages.in
Source/WebKit2/Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm
Source/WebKit2/Shared/Plugins/PluginQuirks.h
Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp
Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.h
Source/WebKit2/WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm
Source/WebKit2/WebProcess/Plugins/Plugin.h
Source/WebKit2/WebProcess/Plugins/PluginProxy.cpp
Source/WebKit2/WebProcess/Plugins/PluginProxy.h
Source/WebKit2/WebProcess/Plugins/PluginView.cpp
Source/WebKit2/WebProcess/Plugins/PluginView.h