Bug 1883868 - Restrict new codepath to worker threads. CLOSED TREE

So as to not change load timing from stylo threads.
This commit is contained in:
Cosmin Sabou 2024-03-09 02:01:13 +02:00
parent 0f00df454f
commit a789c90976

View File

@ -18,6 +18,7 @@
#include "mozilla/gfx/2D.h"
#include "gfxPlatformFontList.h"
#include "mozilla/PostTraversalTask.h"
#include "mozilla/dom/WorkerCommon.h"
#include "gfxOTSUtils.h"
#include "nsIFontLoadCompleteCallback.h"
#include "nsProxyRelease.h"
@ -816,7 +817,7 @@ void gfxUserFontEntry::Load() {
if (mUserFontLoadState != STATUS_NOT_LOADED) {
return;
}
if (!NS_IsMainThread()) {
if (dom::IsCurrentThreadRunningWorker()) {
// TODO: Maybe support loading the font entry in workers, at least for
// buffers or other sync sources?
NS_DispatchToMainThread(NewRunnableMethod("gfxUserFontEntry::Load", this,