mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-19 08:15:31 +00:00
Bug 1192910 - Ensure we flush paints on the main thread during an APZ flush. r=mstange. reland because backout didn't fix the issue
MozReview-Commit-ID: 61dyeqxxtVP
This commit is contained in:
parent
cf4896ee92
commit
7a65557850
@ -892,9 +892,19 @@ APZCCallbackHelper::NotifyMozMouseScrollEvent(const FrameMetrics::ViewID& aScrol
|
||||
}
|
||||
|
||||
void
|
||||
APZCCallbackHelper::NotifyFlushComplete()
|
||||
APZCCallbackHelper::NotifyFlushComplete(nsIPresShell* aShell)
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
// In some cases, flushing the APZ state to the main thread doesn't actually
|
||||
// trigger a flush and repaint (this is an intentional optimization - the stuff
|
||||
// visible to the user is still correct). However, reftests update their
|
||||
// snapshot based on invalidation events that are emitted during paints,
|
||||
// so we ensure that we kick off a paint when an APZ flush is done. Note that
|
||||
// only chrome/testing code can trigger this behaviour.
|
||||
if (aShell && aShell->GetRootFrame()) {
|
||||
aShell->GetRootFrame()->SchedulePaint();
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIObserverService> observerService = mozilla::services::GetObserverService();
|
||||
MOZ_ASSERT(observerService);
|
||||
observerService->NotifyObservers(nullptr, "apz-repaints-flushed", nullptr);
|
||||
|
@ -161,7 +161,7 @@ public:
|
||||
static void NotifyMozMouseScrollEvent(const FrameMetrics::ViewID& aScrollId, const nsString& aEvent);
|
||||
|
||||
/* Notify content that the repaint flush is complete. */
|
||||
static void NotifyFlushComplete();
|
||||
static void NotifyFlushComplete(nsIPresShell* aShell);
|
||||
|
||||
/* Temporarily ignore the Displayport for better paint performance. */
|
||||
static void SuppressDisplayport(const bool& aEnabled);
|
||||
|
@ -232,5 +232,5 @@ void
|
||||
ChromeProcessController::NotifyFlushComplete()
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
APZCCallbackHelper::NotifyFlushComplete();
|
||||
APZCCallbackHelper::NotifyFlushComplete(GetPresShell());
|
||||
}
|
||||
|
@ -151,7 +151,11 @@ APZChild::RecvNotifyAPZStateChange(const ViewID& aViewId,
|
||||
bool
|
||||
APZChild::RecvNotifyFlushComplete()
|
||||
{
|
||||
APZCCallbackHelper::NotifyFlushComplete();
|
||||
nsCOMPtr<nsIPresShell> shell;
|
||||
if (nsCOMPtr<nsIDocument> doc = mBrowser->GetDocument()) {
|
||||
shell = doc->GetShell();
|
||||
}
|
||||
APZCCallbackHelper::NotifyFlushComplete(shell.get());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user