summaryrefslogtreecommitdiffstats
path: root/chrome/renderer/webplugin_delegate_proxy.h
diff options
context:
space:
mode:
authorstuartmorgan@chromium.org <stuartmorgan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-13 19:54:57 +0000
committerstuartmorgan@chromium.org <stuartmorgan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-13 19:54:57 +0000
commit270b9088890d22620d7f8791687fa3ddabe5d1a6 (patch)
treef78448a4d7b23c7ae64a9b99038215ce5f5c7db0 /chrome/renderer/webplugin_delegate_proxy.h
parent28ed3b4d95b376634e1ef88a9299f5d2a2a9153a (diff)
downloadchromium_src-270b9088890d22620d7f8791687fa3ddabe5d1a6.zip
chromium_src-270b9088890d22620d7f8791687fa3ddabe5d1a6.tar.gz
chromium_src-270b9088890d22620d7f8791687fa3ddabe5d1a6.tar.bz2
Switch plugin backing store to local memory on non-Windows platforms
TransportDIB has non-trivial overhead on the Mac, and the backing store is never shared with any other process, so it's better to use local memory. Windows is excluded because PlatformCanvas requires a DIB on Windows. BUG=42858 TEST=Windowless plugins should continue to draw. Review URL: http://codereview.chromium.org/1873001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47180 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/webplugin_delegate_proxy.h')
-rw-r--r--chrome/renderer/webplugin_delegate_proxy.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/chrome/renderer/webplugin_delegate_proxy.h b/chrome/renderer/webplugin_delegate_proxy.h
index b12183b..59bfce2 100644
--- a/chrome/renderer/webplugin_delegate_proxy.h
+++ b/chrome/renderer/webplugin_delegate_proxy.h
@@ -183,9 +183,16 @@ class WebPluginDelegateProxy
// Clears the shared memory section and canvases used for windowless plugins.
void ResetWindowlessBitmaps();
+#if !defined(OS_WIN)
+ // Creates a process-local memory section and canvas. PlatformCanvas on
+ // Windows only works with a DIB, not arbitrary memory.
+ bool CreateLocalBitmap(std::vector<uint8>* memory,
+ scoped_ptr<skia::PlatformCanvas>* canvas);
+#endif
+
// Creates a shared memory section and canvas.
- bool CreateBitmap(scoped_ptr<TransportDIB>* memory,
- scoped_ptr<skia::PlatformCanvas>* canvas);
+ bool CreateSharedBitmap(scoped_ptr<TransportDIB>* memory,
+ scoped_ptr<skia::PlatformCanvas>* canvas);
// Called for cleanup during plugin destruction. Normally right before the
// plugin window gets destroyed, or when the plugin has crashed (at which
@@ -240,7 +247,11 @@ class WebPluginDelegateProxy
// store when we get an invalidate from it. The background bitmap is used
// for transparent plugins, as they need the backgroud data during painting.
bool transparent_;
+#if defined(OS_WIN)
scoped_ptr<TransportDIB> backing_store_;
+#else
+ std::vector<uint8> backing_store_;
+#endif
scoped_ptr<skia::PlatformCanvas> backing_store_canvas_;
scoped_ptr<TransportDIB> transport_store_;
scoped_ptr<skia::PlatformCanvas> transport_store_canvas_;