|
1 /* vim: se cin sw=2 ts=2 et : */ |
|
2 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- |
|
3 * |
|
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/. */ |
|
7 |
|
8 #ifndef __mozilla_widget_GfxInfo_h__ |
|
9 #define __mozilla_widget_GfxInfo_h__ |
|
10 |
|
11 #include "GfxInfoBase.h" |
|
12 |
|
13 #include "nsString.h" |
|
14 |
|
15 namespace mozilla { |
|
16 namespace widget { |
|
17 |
|
18 class GfxInfo : public GfxInfoBase |
|
19 { |
|
20 public: |
|
21 |
|
22 GfxInfo(); |
|
23 // We only declare the subset of nsIGfxInfo that we actually implement. The |
|
24 // rest is brought forward from GfxInfoBase. |
|
25 NS_IMETHOD GetD2DEnabled(bool *aD2DEnabled); |
|
26 NS_IMETHOD GetDWriteEnabled(bool *aDWriteEnabled); |
|
27 NS_IMETHOD GetDWriteVersion(nsAString & aDwriteVersion); |
|
28 NS_IMETHOD GetCleartypeParameters(nsAString & aCleartypeParams); |
|
29 NS_IMETHOD GetAdapterDescription(nsAString & aAdapterDescription); |
|
30 NS_IMETHOD GetAdapterDriver(nsAString & aAdapterDriver); |
|
31 NS_IMETHOD GetAdapterVendorID(nsAString & aAdapterVendorID); |
|
32 NS_IMETHOD GetAdapterDeviceID(nsAString & aAdapterDeviceID); |
|
33 NS_IMETHOD GetAdapterRAM(nsAString & aAdapterRAM); |
|
34 NS_IMETHOD GetAdapterDriverVersion(nsAString & aAdapterDriverVersion); |
|
35 NS_IMETHOD GetAdapterDriverDate(nsAString & aAdapterDriverDate); |
|
36 NS_IMETHOD GetAdapterDescription2(nsAString & aAdapterDescription); |
|
37 NS_IMETHOD GetAdapterDriver2(nsAString & aAdapterDriver); |
|
38 NS_IMETHOD GetAdapterVendorID2(nsAString & aAdapterVendorID); |
|
39 NS_IMETHOD GetAdapterDeviceID2(nsAString & aAdapterDeviceID); |
|
40 NS_IMETHOD GetAdapterRAM2(nsAString & aAdapterRAM); |
|
41 NS_IMETHOD GetAdapterDriverVersion2(nsAString & aAdapterDriverVersion); |
|
42 NS_IMETHOD GetAdapterDriverDate2(nsAString & aAdapterDriverDate); |
|
43 NS_IMETHOD GetIsGPU2Active(bool *aIsGPU2Active); |
|
44 |
|
45 using GfxInfoBase::GetFeatureStatus; |
|
46 using GfxInfoBase::GetFeatureSuggestedDriverVersion; |
|
47 using GfxInfoBase::GetWebGLParameter; |
|
48 |
|
49 virtual nsresult Init(); |
|
50 |
|
51 #ifdef DEBUG |
|
52 NS_DECL_ISUPPORTS_INHERITED |
|
53 NS_DECL_NSIGFXINFODEBUG |
|
54 #endif |
|
55 |
|
56 virtual uint32_t OperatingSystemVersion() MOZ_OVERRIDE { return mOSXVersion; } |
|
57 |
|
58 protected: |
|
59 |
|
60 virtual nsresult GetFeatureStatusImpl(int32_t aFeature, |
|
61 int32_t *aStatus, |
|
62 nsAString & aSuggestedDriverVersion, |
|
63 const nsTArray<GfxDriverInfo>& aDriverInfo, |
|
64 OperatingSystem* aOS = nullptr); |
|
65 virtual const nsTArray<GfxDriverInfo>& GetGfxDriverInfo(); |
|
66 |
|
67 private: |
|
68 |
|
69 void GetDeviceInfo(); |
|
70 void AddCrashReportAnnotations(); |
|
71 |
|
72 nsString mAdapterRAMString; |
|
73 nsString mDeviceID; |
|
74 nsString mDriverVersion; |
|
75 nsString mDriverDate; |
|
76 nsString mDeviceKey; |
|
77 |
|
78 nsString mAdapterVendorID; |
|
79 nsString mAdapterDeviceID; |
|
80 |
|
81 uint32_t mOSXVersion; |
|
82 }; |
|
83 |
|
84 } // namespace widget |
|
85 } // namespace mozilla |
|
86 |
|
87 #endif /* __mozilla_widget_GfxInfo_h__ */ |