summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorvangelis@chromium.org <vangelis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-25 15:36:15 +0000
committervangelis@chromium.org <vangelis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-25 15:36:15 +0000
commit83faf3da9b8ba721d34befd55368e69d0f398c80 (patch)
tree40b74a142cb32fb9ef69c284cba6b6d0e82d7b7e /chrome
parent8d37d826421c8ddd5f657a184821da8cf4ab4443 (diff)
downloadchromium_src-83faf3da9b8ba721d34befd55368e69d0f398c80.zip
chromium_src-83faf3da9b8ba721d34befd55368e69d0f398c80.tar.gz
chromium_src-83faf3da9b8ba721d34befd55368e69d0f398c80.tar.bz2
Defer hiding the compositor window until after the software view has repainted when switching
from composited to non-composited mode to avoid flashing of stale content. R=jamesr@chromium.org, BUG=77126 Review URL: http://codereview.chromium.org/6676125 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@79401 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/renderer_host/render_widget_host_view_win.cc8
-rw-r--r--chrome/browser/renderer_host/render_widget_host_view_win.h4
2 files changed, 11 insertions, 1 deletions
diff --git a/chrome/browser/renderer_host/render_widget_host_view_win.cc b/chrome/browser/renderer_host/render_widget_host_view_win.cc
index 21765a0..52ef7d2 100644
--- a/chrome/browser/renderer_host/render_widget_host_view_win.cc
+++ b/chrome/browser/renderer_host/render_widget_host_view_win.cc
@@ -217,6 +217,7 @@ RenderWidgetHostView* RenderWidgetHostView::CreateViewForWidget(
RenderWidgetHostViewWin::RenderWidgetHostViewWin(RenderWidgetHost* widget)
: render_widget_host_(widget),
compositor_host_window_(NULL),
+ hide_compositor_window_at_next_paint_(false),
track_mouse_leave_(false),
ime_notification_(false),
capture_enter_key_(false),
@@ -851,6 +852,11 @@ void RenderWidgetHostViewWin::OnPaint(HDC unused_dc) {
base::win::ScopedGDIObject<HRGN> damage_region(CreateRectRgn(0, 0, 0, 0));
GetUpdateRgn(damage_region, FALSE);
+ if (hide_compositor_window_at_next_paint_) {
+ ::ShowWindow(compositor_host_window_, SW_HIDE);
+ hide_compositor_window_at_next_paint_ = false;
+ }
+
CPaintDC paint_dc(m_hWnd);
gfx::Rect damaged_rect(paint_dc.m_ps.rcPaint);
@@ -1596,7 +1602,7 @@ void RenderWidgetHostViewWin::ShowCompositorHostWindow(bool show) {
SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE);
}
} else {
- ::ShowWindow(compositor_host_window_, SW_HIDE);
+ hide_compositor_window_at_next_paint_ = true;
}
}
diff --git a/chrome/browser/renderer_host/render_widget_host_view_win.h b/chrome/browser/renderer_host/render_widget_host_view_win.h
index b441749..4399b8a 100644
--- a/chrome/browser/renderer_host/render_widget_host_view_win.h
+++ b/chrome/browser/renderer_host/render_widget_host_view_win.h
@@ -278,6 +278,10 @@ class RenderWidgetHostViewWin
// When we are doing accelerated compositing
HWND compositor_host_window_;
+ // true if the compositor host window must be hidden after the
+ // software renderered view is updated.
+ bool hide_compositor_window_at_next_paint_;
+
// The cursor for the page. This is passed up from the renderer.
WebCursor current_cursor_;