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

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

Issue 7068029: Fix residue left over from find bar when using accelerated compositing (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comments Created 9 years, 7 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: chrome/browser/renderer_host/render_widget_host_view_win.h
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 d90487c500460a2dc34a0a50de3f7132f5646442..3a24cc121ba15dd8355771976d0d8106bc508c13 100644
--- a/chrome/browser/renderer_host/render_widget_host_view_win.h
+++ b/chrome/browser/renderer_host/render_widget_host_view_win.h
@@ -75,6 +75,14 @@ class RenderWidgetHostViewWin
void CreateWnd(HWND parent);
+ // This method schedules and waits for compositing unless it was already done
+ // during this windows event handling loop.
+ // render_widget_host_->ScheduleComposite() blocks waiting for rendering
+ // results. ScheduleCompositeIfNeeded can be called in response to a WM_PAINT
+ // message to the compositor window or an OnPaint message to the parent
+ // window, or both, and we only want to wait once.
+ void ScheduleCompositeIfNeeded();
+
DECLARE_WND_CLASS_EX(kRenderWidgetHostHWNDClass, CS_DBLCLKS, 0);
BEGIN_MSG_MAP(RenderWidgetHostHWND)
@@ -268,6 +276,9 @@ class RenderWidgetHostViewWin
// Clean up the compositor window, if needed.
void CleanupCompositorWindow();
+ // Reset was_compositing_just_scheduled_ to false.
+ void ResetWasCompositingJustScheduled();
+
// Whether the window should be activated.
bool IsActivatable() const;
@@ -277,6 +288,13 @@ class RenderWidgetHostViewWin
// When we are doing accelerated compositing
HWND compositor_host_window_;
+ // This bool is set to true on the first call to ScheduleComposite, and an
+ // async task is posted to reset it to false.
+ // This is to ensure that the blocking call to
+ // render_widget_host_->ScheduleComposite() only happens once for the same
+ // set of windows WM_PAINT/OnPaint events.
+ bool was_compositing_just_scheduled_;
+
// true if the compositor host window must be hidden after the
// software renderered view is updated.
bool hide_compositor_window_at_next_paint_;
@@ -331,6 +349,9 @@ class RenderWidgetHostViewWin
// Factory used to safely scope delayed calls to ShutdownHost().
ScopedRunnableMethodFactory<RenderWidgetHostViewWin> shutdown_factory_;
+ // Factory used to safely scope calls to RenderWidgetHostViewWin methods.
+ ScopedRunnableMethodFactory<RenderWidgetHostViewWin> method_factory_;
+
// Our parent HWND. We keep a reference to it as we SetParent(NULL) when
// hidden to prevent getting messages (Paint, Resize...), and we reattach
// when shown again.

Powered by Google App Engine
This is Rietveld 408576698