summaryrefslogtreecommitdiffstats
path: root/gfx/thebes/gfxUserFontSet.cpp
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-08 15:18:07 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-08 15:18:07 +0000
commit328078c4d259e52db1a4848c00ee0b420775c91c (patch)
treeca9b0e61a1c03f0246b0371423bbbe570193e2f1 /gfx/thebes/gfxUserFontSet.cpp
parentAdding upstream version 115.8.0esr. (diff)
downloadfirefox-esr-328078c4d259e52db1a4848c00ee0b420775c91c.tar.xz
firefox-esr-328078c4d259e52db1a4848c00ee0b420775c91c.zip
Adding upstream version 115.9.0esr.upstream/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.cpp13
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() {