Bug 795833 - Add a RequestRepaint method to nsIWidgetListener and use it in the android widget instead of invalidating the view. r=roc

This commit is contained in:
Matt Woodrow 2012-12-18 16:42:02 +13:00
parent 50e3f14547
commit 0c5f6b76a2
4 changed files with 16 additions and 4 deletions

View File

@ -1073,6 +1073,15 @@ nsView::DidPaintWindow()
vm->DidPaintWindow();
}
void
nsView::RequestRepaint()
{
nsIPresShell* presShell = mViewManager->GetPresShell();
if (presShell) {
presShell->ScheduleViewManagerFlush();
}
}
nsEventStatus
nsView::HandleEvent(nsGUIEvent* aEvent, bool aUseAttachedEvents)
{

View File

@ -170,6 +170,7 @@ public:
void WillPaintWindow(nsIWidget* aWidget, bool aWillSendDidPaint);
bool PaintWindow(nsIWidget* aWidget, nsIntRegion aRegion, uint32_t aFlags);
void DidPaintWindow();
void RequestRepaint() MOZ_OVERRIDE;
nsEventStatus HandleEvent(nsGUIEvent* aEvent, bool aUseAttachedEvents);
virtual ~nsView();

View File

@ -272,10 +272,7 @@ void
nsWindow::RedrawAll()
{
if (mFocus && mFocus->mWidgetListener) {
nsIView* view = mFocus->mWidgetListener->GetView();
if (view && view->GetViewManager()) {
view->GetViewManager()->InvalidateView(view);
}
mFocus->mWidgetListener->RequestRepaint();
}
}

View File

@ -133,6 +133,11 @@ public:
*/
virtual void DidPaintWindow() { }
/**
* Request that layout schedules a repaint on the next refresh driver tick.
*/
virtual void RequestRepaint() { }
/**
* Handle an event.
*/