Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2344)

Unified Diff: chrome/plugin/webplugin_proxy.h

Issue 5040: Fix painting problem with transparent plugins because plugins were ignoring t... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/plugin/webplugin_delegate_stub.cc ('k') | chrome/plugin/webplugin_proxy.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/plugin/webplugin_proxy.h
===================================================================
--- chrome/plugin/webplugin_proxy.h (revision 2736)
+++ chrome/plugin/webplugin_proxy.h (working copy)
@@ -62,6 +62,12 @@
// object with that id exists.
WebPluginResourceClient* GetResourceClient(int id);
+ // For windowless plugins, paints the given rectangle into the local buffer.
+ void Paint(const gfx::Rect& rect);
+
+ // Callback from the renderer to let us know that a paint occurred.
+ void DidPaint();
+
// Notification received on a plugin issued resource request
// creation.
void OnResourceCreated(int resource_id, HANDLE cookie);
@@ -77,7 +83,7 @@
const gfx::Rect& clip_rect,
bool visible,
const SharedMemoryHandle& windowless_buffer,
- const SharedMemoryLock& lock);
+ const SharedMemoryHandle& background_buffer);
void CancelDocumentLoad();
@@ -90,13 +96,17 @@
private:
bool Send(IPC::Message* msg);
- // Called periodically so that we can paint windowless plugins.
- void OnPaintTimerFired();
-
// Updates the shared memory section where windowless plugins paint.
- void SetWindowlessBuffer(const SharedMemoryHandle& handle,
- const SharedMemoryLock& lock);
+ void SetWindowlessBuffer(const SharedMemoryHandle& windowless_buffer,
+ const SharedMemoryHandle& background_buffer);
+ // Converts a shared memory section handle from the renderer process into a
+ // bitmap and hdc that are mapped to this process.
+ void ConvertBuffer(const SharedMemoryHandle& buffer,
+ ScopedHandle* shared_section,
+ ScopedBitmap* bitmap,
+ ScopedHDC* hdc);
+
// Called when a plugin's origin moves, so that we can update the world
// transform of the local HDC.
void UpdateTransform();
@@ -109,20 +119,23 @@
NPObject* window_npobject_;
NPObject* plugin_element_;
WebPluginDelegateImpl* delegate_;
+ gfx::Rect damaged_rect_;
+ bool waiting_for_paint_;
uint32 cp_browsing_context_;
ScopedHandle modal_dialog_event_;
- // Used to desynchronize windowless painting. We accumulate invalidates and
- // paint into a shared buffer when our repeating timer fires. After painting
- // we tell the renderer asynchronously and it paints from the buffer. This
- // allows the renderer to paint without a blocking call, which improves
- // performance, and lets us control the frame rate at which we paint.
- gfx::Rect damaged_rect_;
- base::RepeatingTimer<WebPluginProxy> paint_timer_;
+ // Variables used for desynchronized windowless plugin painting. See note in
+ // webplugin_delegate_proxy.h for how this works.
+
+ // These hold the bitmap where the plugin draws.
ScopedHandle windowless_shared_section_;
ScopedBitmap windowless_bitmap_;
ScopedHDC windowless_hdc_;
- ScopedHandle windowless_buffer_lock_;
+
+ // These hold the bitmap of the background image.
+ ScopedHandle background_shared_section_;
+ ScopedBitmap background_bitmap_;
+ ScopedHDC background_hdc_;
};
#endif // CHROME_PLUGIN_PLUGIN_WEBPLUGIN_PROXY_H__
« no previous file with comments | « chrome/plugin/webplugin_delegate_stub.cc ('k') | chrome/plugin/webplugin_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698