Chromium Code Reviews| Index: content/browser/renderer_host/render_widget_host_view_win.cc |
| =================================================================== |
| --- content/browser/renderer_host/render_widget_host_view_win.cc (revision 157794) |
| +++ content/browser/renderer_host/render_widget_host_view_win.cc (working copy) |
| @@ -1311,14 +1311,18 @@ |
| DCHECK(render_widget_host_->GetProcess()->HasConnection()); |
| + // 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)); |
|
apatrick_chromium
2012/09/20 22:14:17
This has to be above the definition of paint_dc as
|
| + GetUpdateRgn(damage_region, FALSE); |
| + |
| + CPaintDC paint_dc(m_hWnd); |
|
apatrick_chromium
2012/09/20 22:14:17
This moved up so everything uses a single definiti
|
| + |
| // If the GPU process is rendering to a child window, compositing is |
| // already triggered by damage to compositor_host_window_, so all we need to |
| // 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) && |
| @@ -1330,6 +1334,12 @@ |
| return; |
| } |
| + if (accelerated_surface_.get() && |
|
apatrick_chromium
2012/09/20 22:14:17
And this moved above the call to GetBackingStore.
|
| + 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)); |
| @@ -1339,28 +1349,15 @@ |
| // 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()); |