diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-08 15:18:54 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-08 15:18:54 +0000 |
commit | a5f28e22cc28ca53d092f6545bc924ee43a8bbe4 (patch) | |
tree | 7e02d01734d97de08bdeed66d2d5185f8e4f0a61 /gfx/thebes/gfxUserFontSet.cpp | |
parent | Releasing progress-linux version 115.8.0esr-1~deb12u1progress7u1. (diff) | |
download | firefox-esr-a5f28e22cc28ca53d092f6545bc924ee43a8bbe4.tar.xz firefox-esr-a5f28e22cc28ca53d092f6545bc924ee43a8bbe4.zip |
Merging upstream version 115.9.0esr.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'gfx/thebes/gfxUserFontSet.cpp')
-rw-r--r-- | gfx/thebes/gfxUserFontSet.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/gfx/thebes/gfxUserFontSet.cpp b/gfx/thebes/gfxUserFontSet.cpp index 1d83a34977..0c7c6d24e1 100644 --- a/gfx/thebes/gfxUserFontSet.cpp +++ b/gfx/thebes/gfxUserFontSet.cpp @@ -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" @@ -786,9 +787,17 @@ bool gfxUserFontEntry::LoadPlatformFont(uint32_t aSrcIndex, } void gfxUserFontEntry::Load() { - if (mUserFontLoadState == STATUS_NOT_LOADED) { - LoadNextSrc(); + if (mUserFontLoadState != STATUS_NOT_LOADED) { + return; + } + 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, + &gfxUserFontEntry::Load)); + return; } + LoadNextSrc(); } void gfxUserFontEntry::IncrementGeneration() { |