Bug 805745. Move the forced repaint from the Paint notification to the WillPaint notification. r=mattwoodrow

This commit is contained in:
Timothy Nikkel 2012-12-12 15:57:08 -06:00
parent 36be428d56
commit 80370ef686

View File

@ -335,11 +335,6 @@ void nsViewManager::Refresh(nsView *aView, const nsIntRegion& aRegion,
#endif
return;
}
if (aView->ForcedRepaint() && IsRefreshDriverPaintingEnabled()) {
ProcessPendingUpdates();
aView->SetForcedRepaint(false);
}
nsIWidget *widget = aView->GetWidget();
if (!widget) {
@ -675,6 +670,19 @@ void nsViewManager::WillPaintWindow(nsIWidget* aWidget, bool aWillSendDidPaint)
rootVM->ProcessPendingUpdates();
}
if (aWidget && IsRefreshDriverPaintingEnabled()) {
nsView* view = nsView::GetViewFor(aWidget);
if (view && view->ForcedRepaint()) {
ProcessPendingUpdates();
// Re-get the view pointer here since the ProcessPendingUpdates might have
// destroyed it during CallWillPaintOnObservers.
view = nsView::GetViewFor(aWidget);
if (view) {
view->SetForcedRepaint(false);
}
}
}
nsCOMPtr<nsIPresShell> shell = mPresShell;
if (shell) {
shell->WillPaintWindow(aWillSendDidPaint);