зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1335321 - stylo: Do CachedBorderImageData::PurgeCachedImages work on the main thread. r=bholley
MozReview-Commit-ID: 82vKTooB2fh --HG-- extra : rebase_source : 7a4cfc44987a499738f6d8f79cf107393c3fca0c
This commit is contained in:
Родитель
7f072468f4
Коммит
8856103bc6
|
@ -2054,10 +2054,29 @@ CachedBorderImageData::GetCachedSVGViewportSize()
|
|||
return mCachedSVGViewportSize;
|
||||
}
|
||||
|
||||
struct PurgeCachedImagesTask : mozilla::Runnable
|
||||
{
|
||||
NS_IMETHOD Run() final
|
||||
{
|
||||
mSubImages.Clear();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsCOMArray<imgIContainer> mSubImages;
|
||||
};
|
||||
|
||||
void
|
||||
CachedBorderImageData::PurgeCachedImages()
|
||||
{
|
||||
mSubImages.Clear();
|
||||
if (ServoStyleSet::IsInServoTraversal()) {
|
||||
RefPtr<PurgeCachedImagesTask> task = new PurgeCachedImagesTask();
|
||||
task->mSubImages.SwapElements(mSubImages);
|
||||
// This will run the task immediately if we're already on the main thread,
|
||||
// but that is fine.
|
||||
NS_DispatchToMainThread(task.forget());
|
||||
} else {
|
||||
mSubImages.Clear();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
|
Загрузка…
Ссылка в новой задаче