mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 539356 - Part 13 - Only repaint widgets that have had changes since the last paint. r=roc
This commit is contained in:
parent
574dba78d6
commit
4dffec4e63
@ -4663,6 +4663,10 @@ nsIFrame::SchedulePaint(PRUint32 aFlags)
|
||||
pres = displayRoot->PresContext();
|
||||
}
|
||||
pres->PresShell()->ScheduleViewManagerFlush(aFlags);
|
||||
nsIWidget *widget = GetNearestWidget();
|
||||
if (widget) {
|
||||
widget->SetNeedsPaint(true);
|
||||
}
|
||||
}
|
||||
|
||||
Layer*
|
||||
|
@ -378,7 +378,8 @@ void nsViewManager::ProcessPendingUpdatesForView(nsView* aView,
|
||||
// damage is applied based on the final widget geometry
|
||||
if (aFlushDirtyRegion) {
|
||||
nsIWidget *widget = aView->GetWidget();
|
||||
if (widget) {
|
||||
if (widget && widget->NeedsPaint()) {
|
||||
widget->SetNeedsPaint(false);
|
||||
#ifdef DEBUG_INVALIDATIONS
|
||||
printf("---- PAINT START ----PresShell(%p), nsView(%p), nsIWidget(%p)\n", mPresShell, aView, widget);
|
||||
#endif
|
||||
|
@ -387,6 +387,7 @@ class nsIWidget : public nsISupports {
|
||||
nsIWidget()
|
||||
: mLastChild(nsnull)
|
||||
, mPrevSibling(nsnull)
|
||||
, mNeedsPaint(false)
|
||||
{}
|
||||
|
||||
|
||||
@ -1570,6 +1571,13 @@ class nsIWidget : public nsISupports {
|
||||
*/
|
||||
virtual bool WidgetPaintsBackground() { return false; }
|
||||
|
||||
void SetNeedsPaint(bool aNeedsPaint) { mNeedsPaint = aNeedsPaint; }
|
||||
bool NeedsPaint() {
|
||||
if (!mNeedsPaint) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
protected:
|
||||
|
||||
// keep the list of children. We also keep track of our siblings.
|
||||
@ -1582,6 +1590,7 @@ protected:
|
||||
nsIWidget* mLastChild;
|
||||
nsCOMPtr<nsIWidget> mNextSibling;
|
||||
nsIWidget* mPrevSibling;
|
||||
bool mNeedsPaint;
|
||||
};
|
||||
|
||||
NS_DEFINE_STATIC_IID_ACCESSOR(nsIWidget, NS_IWIDGET_IID)
|
||||
|
Loading…
Reference in New Issue
Block a user