Bug 1662338 [wpt PR 25313] - [css-flex] Port some mozilla tests to check-layout,...
[gecko.git] / widget / GfxInfoX11.h
blobb69777528c13083e36124a5c2ddcd2e2afcf9267
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 GetEmbeddedInFirefoxReality(
25 bool* aEmbeddedInFirefoxReality) override;
26 NS_IMETHOD GetHasBattery(bool* aHasBattery) override;
27 NS_IMETHOD GetCleartypeParameters(nsAString& aCleartypeParams) override;
28 NS_IMETHOD GetWindowProtocol(nsAString& aWindowProtocol) override;
29 NS_IMETHOD GetDesktopEnvironment(nsAString& aDesktopEnvironment) override;
30 NS_IMETHOD GetAdapterDescription(nsAString& aAdapterDescription) override;
31 NS_IMETHOD GetAdapterDriver(nsAString& aAdapterDriver) override;
32 NS_IMETHOD GetAdapterVendorID(nsAString& aAdapterVendorID) override;
33 NS_IMETHOD GetAdapterDeviceID(nsAString& aAdapterDeviceID) override;
34 NS_IMETHOD GetAdapterSubsysID(nsAString& aAdapterSubsysID) override;
35 NS_IMETHOD GetAdapterRAM(uint32_t* aAdapterRAM) override;
36 NS_IMETHOD GetAdapterDriverVendor(nsAString& aAdapterDriverVendor) override;
37 NS_IMETHOD GetAdapterDriverVersion(nsAString& aAdapterDriverVersion) override;
38 NS_IMETHOD GetAdapterDriverDate(nsAString& aAdapterDriverDate) override;
39 NS_IMETHOD GetAdapterDescription2(nsAString& aAdapterDescription) override;
40 NS_IMETHOD GetAdapterDriver2(nsAString& aAdapterDriver) override;
41 NS_IMETHOD GetAdapterVendorID2(nsAString& aAdapterVendorID) override;
42 NS_IMETHOD GetAdapterDeviceID2(nsAString& aAdapterDeviceID) override;
43 NS_IMETHOD GetAdapterSubsysID2(nsAString& aAdapterSubsysID) override;
44 NS_IMETHOD GetAdapterRAM2(uint32_t* aAdapterRAM) override;
45 NS_IMETHOD GetAdapterDriverVendor2(nsAString& aAdapterDriverVendor) override;
46 NS_IMETHOD GetAdapterDriverVersion2(
47 nsAString& aAdapterDriverVersion) override;
48 NS_IMETHOD GetAdapterDriverDate2(nsAString& aAdapterDriverDate) override;
49 NS_IMETHOD GetIsGPU2Active(bool* aIsGPU2Active) override;
50 NS_IMETHOD GetDisplayInfo(nsTArray<nsString>& aDisplayInfo) override;
51 NS_IMETHOD GetDisplayWidth(nsTArray<uint32_t>& aDisplayWidth) override;
52 NS_IMETHOD GetDisplayHeight(nsTArray<uint32_t>& aDisplayHeight) override;
53 using GfxInfoBase::GetFeatureStatus;
54 using GfxInfoBase::GetFeatureSuggestedDriverVersion;
56 virtual nsresult Init() override;
58 NS_IMETHOD_(void) GetData() override;
60 #ifdef DEBUG
61 NS_DECL_ISUPPORTS_INHERITED
62 NS_DECL_NSIGFXINFODEBUG
63 #endif
65 protected:
66 ~GfxInfo() = default;
68 virtual nsresult GetFeatureStatusImpl(
69 int32_t aFeature, int32_t* aStatus, nsAString& aSuggestedDriverVersion,
70 const nsTArray<GfxDriverInfo>& aDriverInfo, nsACString& aFailureId,
71 OperatingSystem* aOS = nullptr) override;
72 virtual const nsTArray<GfxDriverInfo>& GetGfxDriverInfo() override;
74 virtual bool DoesWindowProtocolMatch(
75 const nsAString& aBlocklistWindowProtocol,
76 const nsAString& aWindowProtocol) override;
78 virtual bool DoesDriverVendorMatch(const nsAString& aBlocklistVendor,
79 const nsAString& aDriverVendor) override;
81 private:
82 nsCString mVendorId;
83 nsCString mDeviceId;
84 nsCString mDriverVendor;
85 nsCString mDriverVersion;
86 nsCString mAdapterDescription;
87 uint32_t mAdapterRAM;
88 nsCString mOS;
89 nsCString mOSRelease;
90 nsAutoCStringN<16> mDesktopEnvironment;
92 struct ScreenInfo {
93 uint32_t mWidth;
94 uint32_t mHeight;
95 bool mIsDefault;
98 nsTArray<ScreenInfo> mScreenInfo;
99 bool mHasTextureFromPixmap;
100 unsigned int mGLMajorVersion, mGLMinorVersion;
101 bool mIsMesa;
102 bool mIsAccelerated;
103 bool mIsWayland;
104 bool mIsWaylandDRM;
105 bool mIsXWayland;
107 void AddCrashReportAnnotations();
110 } // namespace widget
111 } // namespace mozilla
113 #endif /* __GfxInfoX11_h__ */