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

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

Issue 10982033: Revert 157915 to see if it caused issue 152019 - Avoid calling RWHVWin::GetBackingStore when accele… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 3 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/render_widget_host_view_win.cc
===================================================================
--- content/browser/renderer_host/render_widget_host_view_win.cc (revision 158623)
+++ content/browser/renderer_host/render_widget_host_view_win.cc (working copy)
@@ -1306,14 +1306,6 @@
void RenderWidgetHostViewWin::OnPaint(HDC unused_dc) {
TRACE_EVENT0("browser", "RenderWidgetHostViewWin::OnPaint");
-
- // Grab the region to paint before creation of paint_dc since it clears the
- // damage region.
- base::win::ScopedGDIObject<HRGN> damage_region(CreateRectRgn(0, 0, 0, 0));
- GetUpdateRgn(damage_region, FALSE);
-
- CPaintDC paint_dc(m_hWnd);
-
if (!render_widget_host_)
return;
@@ -1324,6 +1316,9 @@
// do here is clear borders during resize.
if (compositor_host_window_ &&
render_widget_host_->is_accelerated_compositing_active()) {
+ // We initialize paint_dc here so that BeginPaint()/EndPaint()
+ // get called to validate the region.
+ CPaintDC paint_dc(m_hWnd);
RECT host_rect, child_rect;
GetClientRect(&host_rect);
if (::GetClientRect(compositor_host_window_, &child_rect) &&
@@ -1335,12 +1330,6 @@
return;
}
- if (accelerated_surface_.get() &&
- render_widget_host_->is_accelerated_compositing_active()) {
- AcceleratedPaint(paint_dc.m_hDC);
- return;
- }
-
about_to_validate_and_paint_ = true;
BackingStoreWin* backing_store = static_cast<BackingStoreWin*>(
render_widget_host_->GetBackingStore(true));
@@ -1350,15 +1339,28 @@
// changes and repaint them.
about_to_validate_and_paint_ = false;
+ // Grab the region to paint before creation of paint_dc since it clears the
+ // damage region.
+ base::win::ScopedGDIObject<HRGN> damage_region(CreateRectRgn(0, 0, 0, 0));
+ GetUpdateRgn(damage_region, FALSE);
+
if (compositor_host_window_ && 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);
if (damaged_rect.IsEmpty())
return;
+ if (accelerated_surface_.get() &&
+ render_widget_host_->is_accelerated_compositing_active()) {
+ AcceleratedPaint(paint_dc.m_hDC);
+ return;
+ }
+
if (backing_store) {
gfx::Rect bitmap_rect(gfx::Point(), backing_store->size());
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698