summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-14 19:39:36 +0000
committertc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-14 19:39:36 +0000
commit985df7f10b022a58dd7111e470fac9ded5be40dd (patch)
tree6c73dae99611a97663e589ef901743d2bb815fb5
parentc42f20260ca942b40c3687065469829d48b5c979 (diff)
downloadchromium_src-985df7f10b022a58dd7111e470fac9ded5be40dd.zip
chromium_src-985df7f10b022a58dd7111e470fac9ded5be40dd.tar.gz
chromium_src-985df7f10b022a58dd7111e470fac9ded5be40dd.tar.bz2
fix windows painting by redrawing the area
WM_PAINT requests to be painted Review URL: http://codereview.chromium.org/10949 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5494 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--webkit/tools/test_shell/webwidget_host.cc11
-rw-r--r--webkit/tools/test_shell/webwidget_host.h11
2 files changed, 13 insertions, 9 deletions
diff --git a/webkit/tools/test_shell/webwidget_host.cc b/webkit/tools/test_shell/webwidget_host.cc
index ca0289e..5c384a5 100644
--- a/webkit/tools/test_shell/webwidget_host.cc
+++ b/webkit/tools/test_shell/webwidget_host.cc
@@ -59,9 +59,14 @@ LRESULT CALLBACK WebWidgetHost::WndProc(HWND hwnd, UINT message, WPARAM wparam,
delete host;
break;
- case WM_PAINT:
+ case WM_PAINT: {
+ RECT rect;
+ if (GetUpdateRect(hwnd, &rect, FALSE)) {
+ host->UpdatePaintRect(gfx::Rect(rect));
+ }
host->Paint();
return 0;
+ }
case WM_ERASEBKGND:
// Do nothing here to avoid flashing, the background will be erased
@@ -195,6 +200,10 @@ bool WebWidgetHost::WndProc(UINT message, WPARAM wparam, LPARAM lparam) {
return false;
}
+void WebWidgetHost::UpdatePaintRect(const gfx::Rect& rect) {
+ paint_rect_ = paint_rect_.Union(rect);
+}
+
void WebWidgetHost::Paint() {
RECT r;
GetClientRect(view_, &r);
diff --git a/webkit/tools/test_shell/webwidget_host.h b/webkit/tools/test_shell/webwidget_host.h
index 4f78744..3bb7b5c 100644
--- a/webkit/tools/test_shell/webwidget_host.h
+++ b/webkit/tools/test_shell/webwidget_host.h
@@ -42,20 +42,15 @@ class WebWidgetHost {
#endif
void DiscardBackingStore();
+ // Allow clients to update the paint rect. For example, if we get a gdk
+ // expose or WM_PAINT event, we need to update the paint rect.
+ void UpdatePaintRect(const gfx::Rect& rect);
void Paint();
protected:
WebWidgetHost();
~WebWidgetHost();
-#if defined(OS_MACOSX) || defined(OS_LINUX)
- public:
- // Allow clients to update the paint rect. For example, if we get a gdk
- // expose event, we need to update the paint rect.
- void UpdatePaintRect(const gfx::Rect& rect);
- protected:
-#endif
-
#if defined(OS_WIN)
// Per-class wndproc. Returns true if the event should be swallowed.
virtual bool WndProc(UINT message, WPARAM wparam, LPARAM lparam);