mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 987030 - Fix compressed paint timer scheduling. r=roc
This commit is contained in:
parent
57f568303e
commit
f425c9e3e7
@ -3744,9 +3744,7 @@ public:
|
||||
|
||||
NS_IMETHODIMP Notify(nsITimer* aTimer) MOZ_FINAL
|
||||
{
|
||||
mShell->SetNextPaintCompressed();
|
||||
mShell->AddInvalidateHiddenPresShellObserver(mShell->GetPresContext()->RefreshDriver());
|
||||
mShell->ScheduleViewManagerFlush();
|
||||
mShell->DelayedPaintTimerFired();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -3766,8 +3764,11 @@ PresShell::ScheduleViewManagerFlush(PaintType aType)
|
||||
static const uint32_t kPaintDelayPeriod = 1000;
|
||||
if (!mDelayedPaintTimer) {
|
||||
mDelayedPaintTimer = do_CreateInstance(NS_TIMER_CONTRACTID);
|
||||
}
|
||||
if (mDelayedPaintTimer && !mDelayedPaintTimerActive) {
|
||||
nsRefPtr<PaintTimerCallBack> cb = new PaintTimerCallBack(this);
|
||||
mDelayedPaintTimer->InitWithCallback(cb, kPaintDelayPeriod, nsITimer::TYPE_ONE_SHOT);
|
||||
mDelayedPaintTimerActive = true;
|
||||
}
|
||||
return;
|
||||
}
|
||||
@ -3775,12 +3776,21 @@ PresShell::ScheduleViewManagerFlush(PaintType aType)
|
||||
nsPresContext* presContext = GetPresContext();
|
||||
if (presContext) {
|
||||
presContext->RefreshDriver()->ScheduleViewManagerFlush();
|
||||
AddInvalidateHiddenPresShellObserver(presContext->RefreshDriver());
|
||||
}
|
||||
if (mDocument) {
|
||||
mDocument->SetNeedLayoutFlush();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
PresShell::DelayedPaintTimerFired()
|
||||
{
|
||||
mDelayedPaintTimerActive = false;
|
||||
mNextPaintCompressed = true;
|
||||
ScheduleViewManagerFlush();
|
||||
}
|
||||
|
||||
void
|
||||
PresShell::DispatchSynthMouseMove(WidgetGUIEvent* aEvent,
|
||||
bool aFlushOnHoverChange)
|
||||
|
@ -372,8 +372,6 @@ public:
|
||||
|
||||
virtual void RecordShadowStyleChange(mozilla::dom::ShadowRoot* aShadowRoot);
|
||||
|
||||
void SetNextPaintCompressed() { mNextPaintCompressed = true; }
|
||||
|
||||
protected:
|
||||
virtual ~PresShell();
|
||||
|
||||
@ -720,6 +718,9 @@ protected:
|
||||
virtual void PausePainting() MOZ_OVERRIDE;
|
||||
virtual void ResumePainting() MOZ_OVERRIDE;
|
||||
|
||||
friend class PaintTimerCallBack;
|
||||
|
||||
void DelayedPaintTimerFired();
|
||||
void UpdateImageVisibility();
|
||||
void UpdateActivePointerState(mozilla::WidgetGUIEvent* aEvent);
|
||||
|
||||
@ -840,6 +841,7 @@ protected:
|
||||
bool mImageVisibilityVisited : 1;
|
||||
|
||||
bool mNextPaintCompressed : 1;
|
||||
bool mDelayedPaintTimerActive : 1;
|
||||
|
||||
static bool sDisableNonTestMouseEvents;
|
||||
};
|
||||
|
@ -5020,17 +5020,9 @@ nsIFrame::SchedulePaint(PaintType aType)
|
||||
nsIPresShell::PAINT_DELAYED_COMPRESS :
|
||||
nsIPresShell::PAINT_DEFAULT);
|
||||
|
||||
if (aType == PAINT_DELAYED_COMPRESS) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (aType == PAINT_DEFAULT) {
|
||||
displayRoot->AddStateBits(NS_FRAME_UPDATE_LAYER_TREE);
|
||||
}
|
||||
nsIPresShell* shell = PresContext()->PresShell();
|
||||
if (shell) {
|
||||
shell->AddInvalidateHiddenPresShellObserver(pres->RefreshDriver());
|
||||
}
|
||||
}
|
||||
|
||||
Layer*
|
||||
|
Loading…
Reference in New Issue
Block a user