Bug 1613552 [wpt PR 21618] - Fix timeout vs. task-queue race conditions in promise...
[gecko.git] / widget / GfxInfoX11.h
blob0ed45df96d2c983f5fb95e3390274ab980c47609
1 /* vim: se cin sw=2 ts=2 et : */
2 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
4 * This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
8 #ifndef __GfxInfoX11_h__
9 #define __GfxInfoX11_h__
11 #include "GfxInfoBase.h"
12 #include "nsString.h"
14 namespace mozilla {
15 namespace widget {
17 class GfxInfo final : public GfxInfoBase {
18 public:
19 // We only declare the subset of nsIGfxInfo that we actually implement. The
20 // rest is brought forward from GfxInfoBase.
21 NS_IMETHOD GetD2DEnabled(bool* aD2DEnabled) override;
22 NS_IMETHOD GetDWriteEnabled(bool* aDWriteEnabled) override;
23 NS_IMETHOD GetDWriteVersion(nsAString& aDwriteVersion) override;
24 NS_IMETHOD GetHasBattery(bool* aHasBattery) override;
25 NS_IMETHOD GetCleartypeParameters(nsAString& aCleartypeParams) override;
26 NS_IMETHOD GetWindowProtocol(nsAString& aWindowProtocol) override;
27 NS_IMETHOD GetDesktopEnvironment(nsAString& aDesktopEnvironment) override;
28 NS_IMETHOD GetAdapterDescription(nsAString& aAdapterDescription) override;
29 NS_IMETHOD GetAdapterDriver(nsAString& aAdapterDriver) override;
30 NS_IMETHOD GetAdapterVendorID(nsAString& aAdapterVendorID) override;
31 NS_IMETHOD GetAdapterDeviceID(nsAString& aAdapterDeviceID) override;
32 NS_IMETHOD GetAdapterSubsysID(nsAString& aAdapterSubsysID) override;
33 NS_IMETHOD GetAdapterRAM(uint32_t* aAdapterRAM) override;
34 NS_IMETHOD GetAdapterDriverVendor(nsAString& aAdapterDriverVendor) override;
35 NS_IMETHOD GetAdapterDriverVersion(nsAString& aAdapterDriverVersion) override;
36 NS_IMETHOD GetAdapterDriverDate(nsAString& aAdapterDriverDate) override;
37 NS_IMETHOD GetAdapterDescription2(nsAString& aAdapterDescription) override;
38 NS_IMETHOD GetAdapterDriver2(nsAString& aAdapterDriver) override;
39 NS_IMETHOD GetAdapterVendorID2(nsAString& aAdapterVendorID) override;
40 NS_IMETHOD GetAdapterDeviceID2(nsAString& aAdapterDeviceID) override;
41 NS_IMETHOD GetAdapterSubsysID2(nsAString& aAdapterSubsysID) override;
42 NS_IMETHOD GetAdapterRAM2(uint32_t* aAdapterRAM) override;
43 NS_IMETHOD GetAdapterDriverVendor2(nsAString& aAdapterDriverVendor) override;
44 NS_IMETHOD GetAdapterDriverVersion2(
45 nsAString& aAdapterDriverVersion) override;
46 NS_IMETHOD GetAdapterDriverDate2(nsAString& aAdapterDriverDate) override;
47 NS_IMETHOD GetIsGPU2Active(bool* aIsGPU2Active) override;
48 NS_IMETHOD GetDisplayInfo(nsTArray<nsString>& aDisplayInfo) override;
49 NS_IMETHOD GetDisplayWidth(nsTArray<uint32_t>& aDisplayWidth) override;
50 NS_IMETHOD GetDisplayHeight(nsTArray<uint32_t>& aDisplayHeight) override;
51 using GfxInfoBase::GetFeatureStatus;
52 using GfxInfoBase::GetFeatureSuggestedDriverVersion;
54 virtual nsresult Init() override;
56 NS_IMETHOD_(void) GetData() override;
58 #ifdef DEBUG
59 NS_DECL_ISUPPORTS_INHERITED
60 NS_DECL_NSIGFXINFODEBUG
61 #endif
63 protected:
64 ~GfxInfo() {}
66 virtual nsresult GetFeatureStatusImpl(
67 int32_t aFeature, int32_t* aStatus, nsAString& aSuggestedDriverVersion,
68 const nsTArray<GfxDriverInfo>& aDriverInfo, nsACString& aFailureId,
69 OperatingSystem* aOS = nullptr) override;
70 virtual const nsTArray<GfxDriverInfo>& GetGfxDriverInfo() override;
72 virtual bool DoesWindowProtocolMatch(
73 const nsAString& aBlocklistWindowProtocol,
74 const nsAString& aWindowProtocol) override;
76 virtual bool DoesDriverVendorMatch(const nsAString& aBlocklistVendor,
77 const nsAString& aDriverVendor) override;
79 private:
80 nsCString mVendorId;
81 nsCString mDeviceId;
82 nsCString mDriverVendor;
83 nsCString mDriverVersion;
84 nsCString mAdapterDescription;
85 uint32_t mAdapterRAM;
86 nsCString mOS;
87 nsCString mOSRelease;
88 nsAutoCStringN<16> mDesktopEnvironment;
90 struct ScreenInfo {
91 uint32_t mWidth;
92 uint32_t mHeight;
93 bool mIsDefault;
96 nsTArray<ScreenInfo> mScreenInfo;
97 bool mHasTextureFromPixmap;
98 unsigned int mGLMajorVersion, mGLMinorVersion;
99 bool mIsMesa;
100 bool mIsAccelerated;
101 bool mIsWayland;
102 bool mIsWaylandDRM;
104 void AddCrashReportAnnotations();
107 } // namespace widget
108 } // namespace mozilla
110 #endif /* __GfxInfoX11_h__ */