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

Unified Diff: chrome/browser/renderer_host/render_widget_host_view_win.cc

Issue 66013: Fix problems correctly invalidating/repainting when our updated paint rect fo... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 8 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/browser/renderer_host/render_widget_host_view_win.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/renderer_host/render_widget_host_view_win.cc
===================================================================
--- chrome/browser/renderer_host/render_widget_host_view_win.cc (revision 13668)
+++ chrome/browser/renderer_host/render_widget_host_view_win.cc (working copy)
@@ -134,6 +134,7 @@
track_mouse_leave_(false),
ime_notification_(false),
is_hidden_(false),
+ about_to_validate_and_paint_(false),
close_on_deactivate_(false),
tooltip_hwnd_(NULL),
tooltip_showing_(false),
@@ -447,7 +448,10 @@
if (is_hidden_)
return;
- Redraw(rect);
+ if (about_to_validate_and_paint_)
+ InvalidateRect(&rect.ToRECT(), false);
+ else
+ Redraw(rect);
}
void RenderWidgetHostViewWin::DidScrollRect(
@@ -552,11 +556,16 @@
void RenderWidgetHostViewWin::OnPaint(HDC dc) {
DCHECK(render_widget_host_->process()->channel());
+ about_to_validate_and_paint_ = true;
+ BackingStore* backing_store = render_widget_host_->GetBackingStore();
+
+ // We initialize |paint_dc| (and thus call BeginPaint()) after calling
+ // GetBackingStore(), so that if it updates the invalid rect we'll catch the
+ // changes and repaint them.
+ about_to_validate_and_paint_ = false;
CPaintDC paint_dc(m_hWnd);
+
HBRUSH white_brush = reinterpret_cast<HBRUSH>(GetStockObject(WHITE_BRUSH));
-
- BackingStore* backing_store = render_widget_host_->GetBackingStore();
-
if (backing_store) {
gfx::Rect damaged_rect(paint_dc.m_ps.rcPaint);
« no previous file with comments | « chrome/browser/renderer_host/render_widget_host_view_win.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698