/work/obj-fuzz/dist/include/mozilla/webgpu/Adapter.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
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/. */ |
5 | | |
6 | | #ifndef WEBGPU_Adapter_H_ |
7 | | #define WEBGPU_Adapter_H_ |
8 | | |
9 | | #include "mozilla/AlreadyAddRefed.h" |
10 | | #include "nsString.h" |
11 | | #include "ObjectModel.h" |
12 | | |
13 | | namespace mozilla { |
14 | | namespace dom { |
15 | | struct WebGPUDeviceDescriptor; |
16 | | struct WebGPUExtensions; |
17 | | struct WebGPUFeatures; |
18 | | } // namespace dom |
19 | | |
20 | | namespace webgpu { |
21 | | class Device; |
22 | | class Instance; |
23 | | |
24 | | class Adapter final |
25 | | : public ChildOf<Instance> |
26 | | { |
27 | | public: |
28 | | WEBGPU_DECL_GOOP(Adapter) |
29 | | |
30 | | const nsString mName; |
31 | | |
32 | | private: |
33 | | Adapter() = delete; |
34 | | virtual ~Adapter(); |
35 | | |
36 | | public: |
37 | 0 | void GetName(nsString& out) const { |
38 | 0 | out = mName; |
39 | 0 | } |
40 | | |
41 | | void Extensions(dom::WebGPUExtensions& out) const; |
42 | | void Features(dom::WebGPUFeatures& out) const; |
43 | | already_AddRefed<Device> CreateDevice(const dom::WebGPUDeviceDescriptor& desc) const; |
44 | | }; |
45 | | |
46 | | } // namespace webgpu |
47 | | } // namespace mozilla |
48 | | |
49 | | #endif // WEBGPU_Adapter_H_ |