Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
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/. */
6 #include "GfxInfo.h"
8 using namespace mozilla::widget;
10 /* GetD2DEnabled and GetDwriteEnabled shouldn't be called until after gfxPlatform initialization
11 * has occurred because they depend on it for information. (See bug 591561) */
12 nsresult
13 GfxInfo::GetD2DEnabled(bool *aEnabled)
14 {
15 return NS_ERROR_FAILURE;
16 }
18 nsresult
19 GfxInfo::GetDWriteEnabled(bool *aEnabled)
20 {
21 return NS_ERROR_FAILURE;
22 }
24 /* readonly attribute DOMString DWriteVersion; */
25 NS_IMETHODIMP
26 GfxInfo::GetDWriteVersion(nsAString & aDwriteVersion)
27 {
28 return NS_ERROR_FAILURE;
29 }
31 /* readonly attribute DOMString cleartypeParameters; */
32 NS_IMETHODIMP
33 GfxInfo::GetCleartypeParameters(nsAString & aCleartypeParams)
34 {
35 return NS_ERROR_FAILURE;
36 }
38 /* readonly attribute DOMString adapterDescription; */
39 NS_IMETHODIMP
40 GfxInfo::GetAdapterDescription(nsAString & aAdapterDescription)
41 {
42 aAdapterDescription.AssignLiteral("");
43 return NS_OK;
44 }
46 /* readonly attribute DOMString adapterDescription2; */
47 NS_IMETHODIMP
48 GfxInfo::GetAdapterDescription2(nsAString & aAdapterDescription)
49 {
50 return NS_ERROR_FAILURE;
51 }
53 /* readonly attribute DOMString adapterRAM; */
54 NS_IMETHODIMP
55 GfxInfo::GetAdapterRAM(nsAString & aAdapterRAM)
56 {
57 aAdapterRAM.AssignLiteral("");
58 return NS_OK;
59 }
61 /* readonly attribute DOMString adapterRAM2; */
62 NS_IMETHODIMP
63 GfxInfo::GetAdapterRAM2(nsAString & aAdapterRAM)
64 {
65 return NS_ERROR_FAILURE;
66 }
68 /* readonly attribute DOMString adapterDriver; */
69 NS_IMETHODIMP
70 GfxInfo::GetAdapterDriver(nsAString & aAdapterDriver)
71 {
72 aAdapterDriver.AssignLiteral("");
73 return NS_OK;
74 }
76 /* readonly attribute DOMString adapterDriver2; */
77 NS_IMETHODIMP
78 GfxInfo::GetAdapterDriver2(nsAString & aAdapterDriver)
79 {
80 return NS_ERROR_FAILURE;
81 }
83 /* readonly attribute DOMString adapterDriverVersion; */
84 NS_IMETHODIMP
85 GfxInfo::GetAdapterDriverVersion(nsAString & aAdapterDriverVersion)
86 {
87 aAdapterDriverVersion.AssignLiteral("");
88 return NS_OK;
89 }
91 /* readonly attribute DOMString adapterDriverVersion2; */
92 NS_IMETHODIMP
93 GfxInfo::GetAdapterDriverVersion2(nsAString & aAdapterDriverVersion)
94 {
95 return NS_ERROR_FAILURE;
96 }
98 /* readonly attribute DOMString adapterDriverDate; */
99 NS_IMETHODIMP
100 GfxInfo::GetAdapterDriverDate(nsAString & aAdapterDriverDate)
101 {
102 aAdapterDriverDate.AssignLiteral("");
103 return NS_OK;
104 }
106 /* readonly attribute DOMString adapterDriverDate2; */
107 NS_IMETHODIMP
108 GfxInfo::GetAdapterDriverDate2(nsAString & aAdapterDriverDate)
109 {
110 return NS_ERROR_FAILURE;
111 }
113 /* readonly attribute DOMString adapterVendorID; */
114 NS_IMETHODIMP
115 GfxInfo::GetAdapterVendorID(nsAString & aAdapterVendorID)
116 {
117 aAdapterVendorID.AssignLiteral("");
118 return NS_OK;
119 }
121 /* readonly attribute DOMString adapterVendorID2; */
122 NS_IMETHODIMP
123 GfxInfo::GetAdapterVendorID2(nsAString & aAdapterVendorID)
124 {
125 return NS_ERROR_FAILURE;
126 }
128 /* readonly attribute DOMString adapterDeviceID; */
129 NS_IMETHODIMP
130 GfxInfo::GetAdapterDeviceID(nsAString & aAdapterDeviceID)
131 {
132 aAdapterDeviceID.AssignLiteral("");
133 return NS_OK;
134 }
136 /* readonly attribute DOMString adapterDeviceID2; */
137 NS_IMETHODIMP
138 GfxInfo::GetAdapterDeviceID2(nsAString & aAdapterDeviceID)
139 {
140 return NS_ERROR_FAILURE;
141 }
143 /* readonly attribute boolean isGPU2Active; */
144 NS_IMETHODIMP
145 GfxInfo::GetIsGPU2Active(bool* aIsGPU2Active)
146 {
147 return NS_ERROR_FAILURE;
148 }
150 const nsTArray<GfxDriverInfo>&
151 GfxInfo::GetGfxDriverInfo()
152 {
153 return *mDriverInfo;
154 }
156 uint32_t GfxInfo::OperatingSystemVersion()
157 {
158 return 0;
159 }
161 nsresult
162 GfxInfo::GetFeatureStatusImpl(int32_t /*aFeature*/,
163 int32_t *aStatus,
164 nsAString & /*aSuggestedDriverVersion*/,
165 const nsTArray<GfxDriverInfo>& /*aDriverInfo*/,
166 OperatingSystem* /*aOS*/ /* = nullptr */)
167 {
168 NS_ENSURE_ARG_POINTER(aStatus);
169 *aStatus = nsIGfxInfo::FEATURE_NO_INFO;
171 return NS_OK;
172 }
174 #ifdef DEBUG
176 // Implement nsIGfxInfoDebug
178 /* void spoofVendorID (in DOMString aVendorID); */
179 NS_IMETHODIMP GfxInfo::SpoofVendorID(const nsAString &)
180 {
181 return NS_OK;
182 }
184 /* void spoofDeviceID (in unsigned long aDeviceID); */
185 NS_IMETHODIMP GfxInfo::SpoofDeviceID(const nsAString &)
186 {
187 return NS_OK;
188 }
190 /* void spoofDriverVersion (in DOMString aDriverVersion); */
191 NS_IMETHODIMP GfxInfo::SpoofDriverVersion(const nsAString &)
192 {
193 return NS_OK;
194 }
196 /* void spoofOSVersion (in unsigned long aVersion); */
197 NS_IMETHODIMP GfxInfo::SpoofOSVersion(uint32_t)
198 {
199 return NS_OK;
200 }
202 #endif