Bug 1317554. Make the notifications that VectorImage sends on draw async. r=aosmond

This commit is contained in:
Timothy Nikkel 2016-11-18 15:59:04 -06:00
Родитель 6393f96201
Коммит a8ff4ecff5
1 изменённых файлов: 13 добавлений и 2 удалений

Просмотреть файл

@ -985,8 +985,19 @@ VectorImage::CreateSurfaceAndShow(const SVGDrawingParameters& aParams, BackendTy
// Send out an invalidation so that surfaces that are still in use get
// re-locked. See the discussion of the UnlockSurfaces call above.
mProgressTracker->SyncNotifyProgress(FLAG_FRAME_COMPLETE,
GetMaxSizedIntRect());
if (!(aParams.flags & FLAG_ASYNC_NOTIFY)) {
mProgressTracker->SyncNotifyProgress(FLAG_FRAME_COMPLETE,
GetMaxSizedIntRect());
} else {
NotNull<RefPtr<VectorImage>> image = WrapNotNull(this);
NS_DispatchToMainThread(NS_NewRunnableFunction([=]() -> void {
RefPtr<ProgressTracker> tracker = image->GetProgressTracker();
if (tracker) {
tracker->SyncNotifyProgress(FLAG_FRAME_COMPLETE,
GetMaxSizedIntRect());
}
}));
}
}