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/. */
7 #include "nsServiceManagerUtils.h"
13 NS_IMPL_ISUPPORTS_INHERITED(GfxInfo
, GfxInfoBase
, nsIGfxInfoDebug
)
18 GfxInfo::~GfxInfo() {}
21 GfxInfo::GetD2DEnabled(bool* aEnabled
) { return NS_ERROR_FAILURE
; }
24 GfxInfo::GetDWriteEnabled(bool* aEnabled
) { return NS_ERROR_FAILURE
; }
27 GfxInfo::GetEmbeddedInFirefoxReality(bool* aEmbeddedInFirefoxReality
) {
28 return NS_ERROR_NOT_IMPLEMENTED
;
32 GfxInfo::GetHasBattery(bool* aHasBattery
) { return NS_ERROR_NOT_IMPLEMENTED
; }
35 GfxInfo::GetDWriteVersion(nsAString
& aDwriteVersion
) {
36 return NS_ERROR_FAILURE
;
40 GfxInfo::GetCleartypeParameters(nsAString
& aCleartypeParams
) {
41 return NS_ERROR_FAILURE
;
45 GfxInfo::GetWindowProtocol(nsAString
& aWindowProtocol
) {
46 return NS_ERROR_NOT_IMPLEMENTED
;
50 GfxInfo::GetTestType(nsAString
& aTestType
) { return NS_ERROR_NOT_IMPLEMENTED
; }
53 GfxInfo::GetAdapterDescription(nsAString
& aAdapterDescription
) {
54 return NS_ERROR_FAILURE
;
58 GfxInfo::GetAdapterDescription2(nsAString
& aAdapterDescription
) {
59 return NS_ERROR_FAILURE
;
63 GfxInfo::GetAdapterRAM(uint32_t* aAdapterRAM
) { return NS_ERROR_FAILURE
; }
66 GfxInfo::GetAdapterRAM2(uint32_t* aAdapterRAM
) { return NS_ERROR_FAILURE
; }
69 GfxInfo::GetAdapterDriverVendor(nsAString
& aAdapterDriverVendor
) {
70 return NS_ERROR_NOT_IMPLEMENTED
;
74 GfxInfo::GetAdapterDriverVendor2(nsAString
& aAdapterDriverVendor2
) {
75 return NS_ERROR_NOT_IMPLEMENTED
;
79 GfxInfo::GetAdapterDriver(nsAString
& aAdapterDriver
) {
80 return NS_ERROR_FAILURE
;
84 GfxInfo::GetAdapterDriver2(nsAString
& aAdapterDriver
) {
85 return NS_ERROR_FAILURE
;
89 GfxInfo::GetAdapterDriverVersion(nsAString
& aAdapterDriverVersion
) {
90 return NS_ERROR_FAILURE
;
94 GfxInfo::GetAdapterDriverVersion2(nsAString
& aAdapterDriverVersion
) {
95 return NS_ERROR_FAILURE
;
99 GfxInfo::GetAdapterDriverDate(nsAString
& aAdapterDriverDate
) {
100 return NS_ERROR_FAILURE
;
104 GfxInfo::GetAdapterDriverDate2(nsAString
& aAdapterDriverDate
) {
105 return NS_ERROR_FAILURE
;
109 GfxInfo::GetAdapterVendorID(nsAString
& aAdapterVendorID
) {
110 return NS_ERROR_FAILURE
;
114 GfxInfo::GetAdapterVendorID2(nsAString
& aAdapterVendorID
) {
115 return NS_ERROR_FAILURE
;
119 GfxInfo::GetAdapterDeviceID(nsAString
& aAdapterDeviceID
) {
120 return NS_ERROR_FAILURE
;
124 GfxInfo::GetAdapterDeviceID2(nsAString
& aAdapterDeviceID
) {
125 return NS_ERROR_FAILURE
;
129 GfxInfo::GetAdapterSubsysID(nsAString
& aAdapterSubsysID
) {
130 return NS_ERROR_FAILURE
;
134 GfxInfo::GetAdapterSubsysID2(nsAString
& aAdapterSubsysID
) {
135 return NS_ERROR_FAILURE
;
139 GfxInfo::GetIsGPU2Active(bool* aIsGPU2Active
) { return NS_ERROR_FAILURE
; }
142 GfxInfo::GetDrmRenderDevice(nsACString
& aDrmRenderDevice
) {
143 return NS_ERROR_NOT_IMPLEMENTED
;
146 const nsTArray
<GfxDriverInfo
>& GfxInfo::GetGfxDriverInfo() {
147 if (sDriverInfo
->IsEmpty()) {
148 APPEND_TO_DRIVER_BLOCKLIST2(
149 OperatingSystem::Ios
, DeviceFamily::All
,
150 nsIGfxInfo::FEATURE_OPENGL_LAYERS
, nsIGfxInfo::FEATURE_STATUS_OK
,
151 DRIVER_COMPARISON_IGNORED
, GfxDriverInfo::allDriverVersions
,
152 "FEATURE_OK_FORCE_OPENGL");
158 nsresult
GfxInfo::GetFeatureStatusImpl(
159 int32_t aFeature
, int32_t* aStatus
, nsAString
& aSuggestedDriverVersion
,
160 const nsTArray
<GfxDriverInfo
>& aDriverInfo
, nsACString
& aFailureId
,
161 OperatingSystem
* aOS
/* = nullptr */) {
162 NS_ENSURE_ARG_POINTER(aStatus
);
163 aSuggestedDriverVersion
.SetIsVoid(true);
164 *aStatus
= nsIGfxInfo::FEATURE_STATUS_UNKNOWN
;
165 if (aOS
) *aOS
= OperatingSystem::Ios
;
167 if (sShutdownOccurred
) {
171 // OpenGL layers are never blocklisted on iOS.
172 // This early return is so we avoid potentially slow
173 // GLStrings initialization on startup when we initialize GL layers.
174 if (aFeature
== nsIGfxInfo::FEATURE_OPENGL_LAYERS
||
175 aFeature
== nsIGfxInfo::FEATURE_WEBGL_OPENGL
) {
176 *aStatus
= nsIGfxInfo::FEATURE_STATUS_OK
;
180 return GfxInfoBase::GetFeatureStatusImpl(
181 aFeature
, aStatus
, aSuggestedDriverVersion
, aDriverInfo
, aFailureId
, aOS
);
186 // Implement nsIGfxInfoDebug
188 NS_IMETHODIMP
GfxInfo::SpoofVendorID(const nsAString
& aVendorID
) {
189 return NS_ERROR_FAILURE
;
192 NS_IMETHODIMP
GfxInfo::SpoofDeviceID(const nsAString
& aDeviceID
) {
193 return NS_ERROR_FAILURE
;
196 NS_IMETHODIMP
GfxInfo::SpoofDriverVersion(const nsAString
& aDriverVersion
) {
197 return NS_ERROR_FAILURE
;
200 NS_IMETHODIMP
GfxInfo::SpoofOSVersion(uint32_t aVersion
) {
201 return NS_ERROR_FAILURE
;
206 } // namespace widget
207 } // namespace mozilla