summaryrefslogtreecommitdiffstats
path: root/chrome/plugin/webplugin_delegate_stub.cc
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-01 00:38:11 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-01 00:38:11 +0000
commitc20b454f6a44ff119c0683a8228b292ba88d6044 (patch)
treefa3e0721d2c084d14eb067cdc4b7c7a8bdc7ae17 /chrome/plugin/webplugin_delegate_stub.cc
parent3deb65daf866945e0a5e211897e0d5382f3c272b (diff)
downloadchromium_src-c20b454f6a44ff119c0683a8228b292ba88d6044.zip
chromium_src-c20b454f6a44ff119c0683a8228b292ba88d6044.tar.gz
chromium_src-c20b454f6a44ff119c0683a8228b292ba88d6044.tar.bz2
Fix painting problem with transparent plugins because plugins were ignoring the alpha channel sometimes.
This change introduces another buffer which holds the background image for transparent plugins. Before painting these plugins, their backing store is overwritten with the background data. This change also uses an ACK from the renderer to figure out when it can paint, similar to how the renderer does it, which gives us throttling and also doesn't lead to painting when the tab is hidden. Review URL: http://codereview.chromium.org/5040 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2744 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/plugin/webplugin_delegate_stub.cc')
-rw-r--r--chrome/plugin/webplugin_delegate_stub.cc14
1 files changed, 12 insertions, 2 deletions
diff --git a/chrome/plugin/webplugin_delegate_stub.cc b/chrome/plugin/webplugin_delegate_stub.cc
index e2129f2..84bc069 100644
--- a/chrome/plugin/webplugin_delegate_stub.cc
+++ b/chrome/plugin/webplugin_delegate_stub.cc
@@ -80,6 +80,8 @@ void WebPluginDelegateStub::OnMessageReceived(const IPC::Message& msg) {
OnDidFinishLoadWithReason)
IPC_MESSAGE_HANDLER(PluginMsg_SetFocus, OnSetFocus)
IPC_MESSAGE_HANDLER(PluginMsg_HandleEvent, OnHandleEvent)
+ IPC_MESSAGE_HANDLER(PluginMsg_Paint, OnPaint)
+ IPC_MESSAGE_HANDLER(PluginMsg_DidPaint, OnDidPaint)
IPC_MESSAGE_HANDLER(PluginMsg_Print, OnPrint)
IPC_MESSAGE_HANDLER(PluginMsg_GetPluginScriptableObject,
OnGetPluginScriptableObject)
@@ -199,6 +201,14 @@ void WebPluginDelegateStub::OnHandleEvent(const NPEvent& event,
*handled = delegate_->HandleEvent(const_cast<NPEvent*>(&event), cursor);
}
+void WebPluginDelegateStub::OnPaint(const gfx::Rect& damaged_rect) {
+ webplugin_->Paint(damaged_rect);
+}
+
+void WebPluginDelegateStub::OnDidPaint() {
+ webplugin_->DidPaint();
+}
+
void WebPluginDelegateStub::OnPrint(PluginMsg_PrintResponse_Params* params) {
gfx::Emf emf;
if (!emf.CreateDc(NULL, NULL)) {
@@ -229,9 +239,9 @@ void WebPluginDelegateStub::OnUpdateGeometry(
const gfx::Rect& clip_rect,
bool visible,
const SharedMemoryHandle& windowless_buffer,
- const SharedMemoryLock& lock) {
+ const SharedMemoryHandle& background_buffer) {
webplugin_->UpdateGeometry(
- window_rect, clip_rect, visible, windowless_buffer, lock);
+ window_rect, clip_rect, visible, windowless_buffer, background_buffer);
}
void WebPluginDelegateStub::OnGetPluginScriptableObject(int* route_id,