Bug 1782737 - Update symbol-scrapers fetch job for correct store_name r=gsvelto
[gecko.git] / gfx / ipc / CanvasManagerChild.h
blobf5d1dac2bcaefb716f64bbd65021f240b63494ae
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #ifndef _include_gfx_ipc_CanvasManagerChild_h__
7 #define _include_gfx_ipc_CanvasManagerChild_h__
9 #include "mozilla/Atomics.h"
10 #include "mozilla/gfx/PCanvasManagerChild.h"
11 #include "mozilla/gfx/Types.h"
12 #include "mozilla/ThreadLocal.h"
14 namespace mozilla {
15 namespace dom {
16 class IPCWorkerRef;
17 class WorkerPrivate;
18 } // namespace dom
20 namespace webgpu {
21 class WebGPUChild;
22 } // namespace webgpu
24 namespace gfx {
25 class DataSourceSurface;
27 class CanvasManagerChild final : public PCanvasManagerChild {
28 public:
29 NS_INLINE_DECL_THREADSAFE_REFCOUNTING(CanvasManagerChild, override);
31 explicit CanvasManagerChild(uint32_t aId);
32 uint32_t Id() const { return mId; }
33 already_AddRefed<DataSourceSurface> GetSnapshot(
34 uint32_t aManagerId, int32_t aProtocolId,
35 const layers::CompositableHandle& aHandle, SurfaceFormat aFormat,
36 bool aPremultiply, bool aYFlip);
37 void ActorDestroy(ActorDestroyReason aReason) override;
39 static CanvasManagerChild* Get();
40 static void Shutdown();
41 static bool CreateParent(
42 mozilla::ipc::Endpoint<PCanvasManagerParent>&& aEndpoint);
44 RefPtr<webgpu::WebGPUChild> GetWebGPUChild();
46 private:
47 ~CanvasManagerChild();
48 void Destroy();
50 RefPtr<mozilla::dom::IPCWorkerRef> mWorkerRef;
51 RefPtr<webgpu::WebGPUChild> mWebGPUChild;
52 const uint32_t mId;
54 static MOZ_THREAD_LOCAL(CanvasManagerChild*) sLocalManager;
55 static Atomic<uint32_t> sNextId;
58 } // namespace gfx
59 } // namespace mozilla
61 #endif // _include_gfx_ipc_CanvasManagerChild_h__