summaryrefslogtreecommitdiffstats
path: root/gfx/thebes/gfxUserFontSet.cpp
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-08 15:18:54 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-08 15:18:54 +0000
commita5f28e22cc28ca53d092f6545bc924ee43a8bbe4 (patch)
tree7e02d01734d97de08bdeed66d2d5185f8e4f0a61 /gfx/thebes/gfxUserFontSet.cpp
parentReleasing progress-linux version 115.8.0esr-1~deb12u1progress7u1. (diff)
downloadfirefox-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.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() {