1 /* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 * This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #ifndef GFX_PLATFORM_WORKER_H
7 #define GFX_PLATFORM_WORKER_H
9 #include "mozilla/ThreadLocal.h"
10 #include "mozilla/RefPtr.h"
20 } // namespace mozilla
23 * Threadlocal instance of gfxPlatform data that may be used/shared on a DOM
26 class gfxPlatformWorker final
{
28 static gfxPlatformWorker
* Get();
29 static void Shutdown();
31 RefPtr
<mozilla::gfx::DrawTarget
> ScreenReferenceDrawTarget();
34 explicit gfxPlatformWorker(RefPtr
<mozilla::dom::WeakWorkerRef
>&& aWorkerRef
);
37 static MOZ_THREAD_LOCAL(gfxPlatformWorker
*) sInstance
;
39 RefPtr
<mozilla::dom::WeakWorkerRef
> mWorkerRef
;
41 RefPtr
<mozilla::gfx::DrawTarget
> mScreenReferenceDrawTarget
;
44 #endif // GFX_PLATFORM_WORKER_H