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

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

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: 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.cc
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 407bc1d3c418727a58f42e1a1e2d9563efeefa03..7906219425a60c835aff939a927a1ab21182b06b 100644
--- a/chrome/browser/renderer_host/render_widget_host_view_win.cc
+++ b/chrome/browser/renderer_host/render_widget_host_view_win.cc
@@ -70,6 +70,8 @@ const wchar_t kRenderWidgetHostHWNDClass[] = L"Chrome_RenderWidgetHostHWND";
namespace {
+const char* kRenderWidgetHVWPropStr = "RWHVW_P";
nduca 2011/05/25 23:42:29 Chrome_RenderWidgetHostViewCompositorHWND_Parent
jbates 2011/05/26 18:21:16 This string isn't actually used anywhere - only th
+
// Tooltips will wrap after this width. Yes, wrap. Imagine that!
const int kTooltipMaxWidthPixels = 300;
@@ -221,6 +223,7 @@ RenderWidgetHostView* RenderWidgetHostView::CreateViewForWidget(
RenderWidgetHostViewWin::RenderWidgetHostViewWin(RenderWidgetHost* widget)
: render_widget_host_(widget),
compositor_host_window_(NULL),
+ was_compositing_just_completed_(false),
hide_compositor_window_at_next_paint_(false),
track_mouse_leave_(false),
ime_notification_(false),
@@ -232,6 +235,7 @@ RenderWidgetHostViewWin::RenderWidgetHostViewWin(RenderWidgetHost* widget)
tooltip_hwnd_(NULL),
tooltip_showing_(false),
shutdown_factory_(this),
+ method_factory_(this),
parent_hwnd_(NULL),
is_loading_(false),
overlay_color_(0),
@@ -839,7 +843,7 @@ void RenderWidgetHostViewWin::OnPaint(HDC unused_dc) {
// We initialize paint_dc here so that BeginPaint()/EndPaint()
// get called to validate the region.
CPaintDC paint_dc(m_hWnd);
- render_widget_host_->ScheduleComposite();
+ ScheduleComposite();
return;
}
@@ -1477,6 +1481,11 @@ static void PaintCompositorHostWindow(HWND hWnd) {
PAINTSTRUCT paint;
BeginPaint(hWnd, &paint);
+ RenderWidgetHostViewWin* win = static_cast<RenderWidgetHostViewWin*>(
+ GetPropA(hWnd, kRenderWidgetHVWPropStr));
+ // May block unless parent window already did this.
+ win->ScheduleComposite();
+
EndPaint(hWnd, &paint);
}
@@ -1488,6 +1497,7 @@ static LRESULT CALLBACK CompositorHostWindowProc(HWND hWnd, UINT message,
case WM_ERASEBKGND:
return 0;
case WM_DESTROY:
+ RemovePropA(hWnd, kRenderWidgetHVWPropStr);
nduca 2011/05/25 23:42:29 s/PropA/Prop if you use wchar as above
jbates 2011/05/26 18:21:16 The MSDN example for SetProp uses char* strings an
return 0;
case WM_PAINT:
PaintCompositorHostWindow(hWnd);
@@ -1497,6 +1507,20 @@ static LRESULT CALLBACK CompositorHostWindowProc(HWND hWnd, UINT message,
}
}
+void RenderWidgetHostViewWin::ScheduleComposite() {
nduca 2011/05/25 23:42:29 ScheduleCompositeIfNotAlreadyDone? A few words of
vangelis 2011/05/26 05:57:07 I agree that a comment here would be needed. I ca
jbates 2011/05/26 18:21:16 Done.
+ if (!was_compositing_just_completed_) {
+ was_compositing_just_completed_ = true;
+ render_widget_host_->ScheduleComposite();
+ MessageLoop::current()->PostTask(FROM_HERE,
+ method_factory_.NewRunnableMethod(
+ &RenderWidgetHostViewWin::ResetWasCompositingJustCompleted));
+ }
+}
+
+void RenderWidgetHostViewWin::ResetWasCompositingJustCompleted() {
+ was_compositing_just_completed_ = false;
+}
+
// Creates a HWND within the RenderWidgetHostView that will serve as a host
// for a HWND that the GPU process will create. The host window is used
// to Z-position the GPU's window relative to other plugin windows.
@@ -1537,6 +1561,8 @@ gfx::PluginWindowHandle RenderWidgetHostViewWin::GetCompositingSurface() {
0, 0, width, height, m_hWnd, 0, GetModuleHandle(NULL), 0);
ui::CheckWindowCreated(compositor_host_window_);
+ SetPropA(compositor_host_window_, kRenderWidgetHVWPropStr, this);
+
return static_cast<gfx::PluginWindowHandle>(compositor_host_window_);
}

Powered by Google App Engine
This is Rietveld 408576698