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

Unified Diff: webkit/glue/plugins/webplugin_delegate_impl.cc

Issue 18637: More speedup of scrolling when many windowed plugins in a page. Scrolling is... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: 'spell Created 11 years, 11 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
Index: webkit/glue/plugins/webplugin_delegate_impl.cc
===================================================================
--- webkit/glue/plugins/webplugin_delegate_impl.cc (revision 8294)
+++ webkit/glue/plugins/webplugin_delegate_impl.cc (working copy)
@@ -14,6 +14,7 @@
#include "webkit/default_plugin/plugin_impl.h"
#include "webkit/glue/glue_util.h"
#include "webkit/glue/webplugin.h"
+#include "webkit/glue/plugins/plugin_constants_win.h"
#include "webkit/glue/plugins/plugin_instance.h"
#include "webkit/glue/plugins/plugin_lib.h"
#include "webkit/glue/plugins/plugin_list.h"
@@ -22,7 +23,6 @@
static StatsCounter windowless_queue("Plugin.ThrottleQueue");
-static const wchar_t kNativeWindowClassName[] = L"NativeWindowClass";
static const wchar_t kWebPluginDelegateProperty[] =
L"WebPluginDelegateProperty";
static const wchar_t kPluginNameAtomProperty[] = L"PluginNameAtom";
@@ -793,6 +793,28 @@
return TRUE;
}
+ static UINT custom_msg = RegisterWindowMessage(kPaintMessageName);
+ if (message == custom_msg) {
+ // Get the invalid rect which is in screen coordinates and convert to
+ // window coordinates.
+ gfx::Rect invalid_rect;
+ invalid_rect.set_x(wparam >> 16);
+ invalid_rect.set_y(wparam & 0xFFFF);
+ invalid_rect.set_width(lparam >> 16);
+ invalid_rect.set_height(lparam & 0xFFFF);
+
+ RECT window_rect;
+ GetWindowRect(hwnd, &window_rect);
+ invalid_rect.Offset(-window_rect.left, -window_rect.top);
+
+ // The plugin window might have non-client area. If we don't pass in
+ // RDW_FRAME then the children don't receive WM_NCPAINT messages while
+ // scrolling, which causes painting problems (http://b/issue?id=923945).
+ RedrawWindow(hwnd, &invalid_rect.ToRECT(), NULL,
+ RDW_UPDATENOW | RDW_INVALIDATE | RDW_ALLCHILDREN | RDW_FRAME);
+ return FALSE;
+ }
+
current_plugin_instance_ = delegate;
switch (message) {
« chrome/browser/render_widget_host_view_win.cc ('K') | « webkit/glue/plugins/plugin_constants_win.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698