Bug 1874684 - Part 28: Return DateDuration from DifferenceISODateTime. r=mgaudet
[gecko.git] / gfx / thebes / gfxPlatformWorker.h
blob047c7c99890a1a5c43bc98a38a7f749176faff37
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"
12 namespace mozilla {
13 namespace dom {
14 class WeakWorkerRef;
15 } // namespace dom
17 namespace gfx {
18 class DrawTarget;
19 } // namespace gfx
20 } // namespace mozilla
22 /**
23 * Threadlocal instance of gfxPlatform data that may be used/shared on a DOM
24 * worker thread.
26 class gfxPlatformWorker final {
27 public:
28 static gfxPlatformWorker* Get();
29 static void Shutdown();
31 RefPtr<mozilla::gfx::DrawTarget> ScreenReferenceDrawTarget();
33 private:
34 explicit gfxPlatformWorker(RefPtr<mozilla::dom::WeakWorkerRef>&& aWorkerRef);
35 ~gfxPlatformWorker();
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