summaryrefslogtreecommitdiffstats
path: root/gfx/thebes/gfxUserFontSet.cpp
diff options
context:
space:
mode:
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() {