Bug 1880804 [wpt PR 44645] - Implement constructor in RTCEncodedVideoFrame, a=testonly
[gecko.git] / widget / uikit / GfxInfo.cpp
blobcb378915aa1708ed81ba381a1677e9af1e8b5e2e
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"
7 #include "nsServiceManagerUtils.h"
9 namespace mozilla {
10 namespace widget {
12 #ifdef DEBUG
13 NS_IMPL_ISUPPORTS_INHERITED(GfxInfo, GfxInfoBase, nsIGfxInfoDebug)
14 #endif
16 GfxInfo::GfxInfo() {}
18 GfxInfo::~GfxInfo() {}
20 NS_IMETHODIMP
21 GfxInfo::GetD2DEnabled(bool* aEnabled) { return NS_ERROR_FAILURE; }
23 NS_IMETHODIMP
24 GfxInfo::GetDWriteEnabled(bool* aEnabled) { return NS_ERROR_FAILURE; }
26 NS_IMETHODIMP
27 GfxInfo::GetEmbeddedInFirefoxReality(bool* aEmbeddedInFirefoxReality) {
28 return NS_ERROR_NOT_IMPLEMENTED;
31 NS_IMETHODIMP
32 GfxInfo::GetHasBattery(bool* aHasBattery) { return NS_ERROR_NOT_IMPLEMENTED; }
34 NS_IMETHODIMP
35 GfxInfo::GetDWriteVersion(nsAString& aDwriteVersion) {
36 return NS_ERROR_FAILURE;
39 NS_IMETHODIMP
40 GfxInfo::GetCleartypeParameters(nsAString& aCleartypeParams) {
41 return NS_ERROR_FAILURE;
44 NS_IMETHODIMP
45 GfxInfo::GetWindowProtocol(nsAString& aWindowProtocol) {
46 return NS_ERROR_NOT_IMPLEMENTED;
49 NS_IMETHODIMP
50 GfxInfo::GetTestType(nsAString& aTestType) { return NS_ERROR_NOT_IMPLEMENTED; }
52 NS_IMETHODIMP
53 GfxInfo::GetAdapterDescription(nsAString& aAdapterDescription) {
54 return NS_ERROR_FAILURE;
57 NS_IMETHODIMP
58 GfxInfo::GetAdapterDescription2(nsAString& aAdapterDescription) {
59 return NS_ERROR_FAILURE;
62 NS_IMETHODIMP
63 GfxInfo::GetAdapterRAM(uint32_t* aAdapterRAM) { return NS_ERROR_FAILURE; }
65 NS_IMETHODIMP
66 GfxInfo::GetAdapterRAM2(uint32_t* aAdapterRAM) { return NS_ERROR_FAILURE; }
68 NS_IMETHODIMP
69 GfxInfo::GetAdapterDriverVendor(nsAString& aAdapterDriverVendor) {
70 return NS_ERROR_NOT_IMPLEMENTED;
73 NS_IMETHODIMP
74 GfxInfo::GetAdapterDriverVendor2(nsAString& aAdapterDriverVendor2) {
75 return NS_ERROR_NOT_IMPLEMENTED;
78 NS_IMETHODIMP
79 GfxInfo::GetAdapterDriver(nsAString& aAdapterDriver) {
80 return NS_ERROR_FAILURE;
83 NS_IMETHODIMP
84 GfxInfo::GetAdapterDriver2(nsAString& aAdapterDriver) {
85 return NS_ERROR_FAILURE;
88 NS_IMETHODIMP
89 GfxInfo::GetAdapterDriverVersion(nsAString& aAdapterDriverVersion) {
90 return NS_ERROR_FAILURE;
93 NS_IMETHODIMP
94 GfxInfo::GetAdapterDriverVersion2(nsAString& aAdapterDriverVersion) {
95 return NS_ERROR_FAILURE;
98 NS_IMETHODIMP
99 GfxInfo::GetAdapterDriverDate(nsAString& aAdapterDriverDate) {
100 return NS_ERROR_FAILURE;
103 NS_IMETHODIMP
104 GfxInfo::GetAdapterDriverDate2(nsAString& aAdapterDriverDate) {
105 return NS_ERROR_FAILURE;
108 NS_IMETHODIMP
109 GfxInfo::GetAdapterVendorID(nsAString& aAdapterVendorID) {
110 return NS_ERROR_FAILURE;
113 NS_IMETHODIMP
114 GfxInfo::GetAdapterVendorID2(nsAString& aAdapterVendorID) {
115 return NS_ERROR_FAILURE;
118 NS_IMETHODIMP
119 GfxInfo::GetAdapterDeviceID(nsAString& aAdapterDeviceID) {
120 return NS_ERROR_FAILURE;
123 NS_IMETHODIMP
124 GfxInfo::GetAdapterDeviceID2(nsAString& aAdapterDeviceID) {
125 return NS_ERROR_FAILURE;
128 NS_IMETHODIMP
129 GfxInfo::GetAdapterSubsysID(nsAString& aAdapterSubsysID) {
130 return NS_ERROR_FAILURE;
133 NS_IMETHODIMP
134 GfxInfo::GetAdapterSubsysID2(nsAString& aAdapterSubsysID) {
135 return NS_ERROR_FAILURE;
138 NS_IMETHODIMP
139 GfxInfo::GetIsGPU2Active(bool* aIsGPU2Active) { return NS_ERROR_FAILURE; }
141 NS_IMETHODIMP
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");
155 return *sDriverInfo;
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) {
168 return NS_OK;
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;
177 return NS_OK;
180 return GfxInfoBase::GetFeatureStatusImpl(
181 aFeature, aStatus, aSuggestedDriverVersion, aDriverInfo, aFailureId, aOS);
184 #ifdef DEBUG
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;
204 #endif
206 } // namespace widget
207 } // namespace mozilla