diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-08 15:18:09 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-08 15:18:09 +0000 |
commit | 0cd6f26b6b8fcec2b43398fd831f6b9e0cb977e3 (patch) | |
tree | 673eec8dca4c4cfc5125dd4447f6608e589fa6b9 /gfx/thebes/gfxUserFontSet.cpp | |
parent | Adding debian version 115.8.0esr-1~deb12u1. (diff) | |
download | firefox-esr-0cd6f26b6b8fcec2b43398fd831f6b9e0cb977e3.tar.xz firefox-esr-0cd6f26b6b8fcec2b43398fd831f6b9e0cb977e3.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() { |