Bug 1568151 - Replace `target.getInspector()` by `target.getFront("inspector")`....
[gecko.git] / widget / nsIGfxInfo.idl
blob7b862eb460db1f298fa59d7babf0d2f198788fa0
1 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #include "nsISupports.idl"
9 /* NOTE: this interface is completely undesigned, not stable and likely to change */
10 [scriptable, builtinclass, uuid(1accd618-4c80-4703-9d29-ecf257d397c8)]
11 interface nsIGfxInfo : nsISupports
14 * These are win32-specific
16 readonly attribute boolean D2DEnabled;
17 readonly attribute boolean DWriteEnabled;
18 readonly attribute boolean usingGPUProcess;
19 readonly attribute AString DWriteVersion;
20 readonly attribute AString cleartypeParameters;
23 * These are non-Android linux-specific
25 readonly attribute AString windowProtocol;
28 * These are valid across all platforms.
30 readonly attribute AString ContentBackend;
31 readonly attribute boolean WebRenderEnabled;
32 readonly attribute boolean isHeadless;
33 readonly attribute boolean UsesTiling;
34 readonly attribute boolean ContentUsesTiling;
35 readonly attribute boolean OffMainThreadPaintEnabled;
36 readonly attribute long OffMainThreadPaintWorkerCount;
37 readonly attribute unsigned long TargetFrameRate;
39 // XXX: Switch to a list of devices, rather than explicitly numbering them.
41 /**
42 * The name of the display adapter.
44 readonly attribute AString adapterDescription;
45 readonly attribute AString adapterDescription2;
47 readonly attribute AString adapterDriver;
48 readonly attribute AString adapterDriver2;
50 /* These types are inspired by DXGI_ADAPTER_DESC */
51 readonly attribute AString adapterVendorID;
52 readonly attribute AString adapterVendorID2;
54 readonly attribute AString adapterDeviceID;
55 readonly attribute AString adapterDeviceID2;
57 readonly attribute AString adapterSubsysID;
58 readonly attribute AString adapterSubsysID2;
60 /**
61 * The amount of RAM in MB in the display adapter.
63 readonly attribute AString adapterRAM;
64 readonly attribute AString adapterRAM2;
66 readonly attribute AString adapterDriverVendor;
67 readonly attribute AString adapterDriverVendor2;
69 readonly attribute AString adapterDriverVersion;
70 readonly attribute AString adapterDriverVersion2;
72 readonly attribute AString adapterDriverDate;
73 readonly attribute AString adapterDriverDate2;
75 readonly attribute boolean isGPU2Active;
77 /**
78 * Returns an array of objects describing each monitor. Guaranteed properties
79 * are "screenWidth" and "screenHeight". This is only implemented on Desktop.
81 * Windows additionally supplies "refreshRate" and "pseudoDisplay".
83 * OS X additionally supplies "scale".
85 [implicit_jscontext]
86 jsval getMonitors();
88 Array<ACString> getFailures(out Array<long> indices);
90 [noscript, notxpcom] void logFailure(in ACString failure);
92 * A set of constants for features that we can ask this GfxInfo object
93 * about via GetFeatureStatus
95 /* Don't assign any value <= 0 */
96 /* Whether Direct2D is supported for content rendering. */
97 const long FEATURE_DIRECT2D = 1;
98 /* Whether Direct3D 9 is supported for layers. */
99 const long FEATURE_DIRECT3D_9_LAYERS = 2;
100 /* Whether Direct3D 10.0 is supported for layers. */
101 const long FEATURE_DIRECT3D_10_LAYERS = 3;
102 /* Whether Direct3D 10.1 is supported for layers. */
103 const long FEATURE_DIRECT3D_10_1_LAYERS = 4;
104 /* Whether OpenGL is supported for layers */
105 const long FEATURE_OPENGL_LAYERS = 5;
106 /* Whether WebGL is supported via OpenGL. */
107 const long FEATURE_WEBGL_OPENGL = 6;
108 /* Whether WebGL is supported via ANGLE (D3D9 -- does not check for the presence of ANGLE libs). */
109 const long FEATURE_WEBGL_ANGLE = 7;
110 /* Whether WebGL antialiasing is supported. */
111 const long FEATURE_WEBGL_MSAA = 8;
112 /* Whether Stagefright is supported, starting in 17. */
113 const long FEATURE_STAGEFRIGHT = 9;
114 /* Whether Webrtc Hardware acceleration is supported, starting in 31. */
115 const long FEATURE_WEBRTC_HW_ACCELERATION = 10;
116 /* Whether Direct3D 11 is supported for layers, starting in 32. */
117 const long FEATURE_DIRECT3D_11_LAYERS = 11;
118 /* Whether hardware accelerated video decoding is supported, starting in 36. */
119 const long FEATURE_HARDWARE_VIDEO_DECODING = 12;
120 /* Whether Direct3D 11 is supported for ANGLE, starting in 38. */
121 const long FEATURE_DIRECT3D_11_ANGLE = 13;
122 /* Whether Webrtc Hardware acceleration is supported, starting in 42. */
123 const long FEATURE_WEBRTC_HW_ACCELERATION_ENCODE = 14;
124 /* Whether Webrtc Hardware acceleration is supported, starting in 42. */
125 const long FEATURE_WEBRTC_HW_ACCELERATION_DECODE = 15;
126 /* Whether Canvas acceleration is supported, starting in 45 */
127 const long FEATURE_CANVAS2D_ACCELERATION = 16;
128 /* Whether hardware VP8 decoding is supported, starting in 48; not for downloadable blocking. */
129 const long FEATURE_VP8_HW_DECODE = 17;
130 /* Whether hardware VP9 decoding is supported, starting in 48; not for downloadable blocking. */
131 const long FEATURE_VP9_HW_DECODE = 18;
132 /* Whether NV_dx_interop2 is supported, starting in 50; downloadable blocking in 58. */
133 const long FEATURE_DX_INTEROP2 = 19;
134 /* Whether the GPU process is supported, starting in 52; downloadable blocking in 58. */
135 const long FEATURE_GPU_PROCESS = 20;
136 /* Whether the WebGL2 is supported, starting in 54 */
137 const long FEATURE_WEBGL2 = 21;
138 /* Whether Advanced Layers is supported, starting in 56 */
139 const long FEATURE_ADVANCED_LAYERS = 22;
140 /* Whether D3D11 keyed mutex is supported, starting in 56 */
141 const long FEATURE_D3D11_KEYED_MUTEX = 23;
142 /* Whether WebRender is supported, starting in 62 */
143 const long FEATURE_WEBRENDER = 24;
144 /* Whether WebRender is supported, starting in 62 */
145 const long FEATURE_DX_NV12 = 25;
146 const long FEATURE_DX_P010 = 26;
147 const long FEATURE_DX_P016 = 27;
148 /* the maximum feature value. */
149 const long FEATURE_MAX_VALUE = FEATURE_DX_P016;
152 * A set of return values from GetFeatureStatus
155 /* The driver is safe to the best of our knowledge */
156 const long FEATURE_STATUS_OK = 1;
157 /* We don't know the status of the feature yet. The analysis probably hasn't finished yet. */
158 const long FEATURE_STATUS_UNKNOWN = 2;
159 /* This feature is blocked on this driver version. Updating driver will typically unblock it. */
160 const long FEATURE_BLOCKED_DRIVER_VERSION = 3;
161 /* This feature is blocked on this device, regardless of driver version.
162 * Typically means we hit too many driver crashes without a good reason to hope for them to
163 * get fixed soon. */
164 const long FEATURE_BLOCKED_DEVICE = 4;
165 /* This feature is available and can be used, but is not suggested (e.g. shouldn't be used by default */
166 const long FEATURE_DISCOURAGED = 5;
167 /* This feature is blocked on this OS version. */
168 const long FEATURE_BLOCKED_OS_VERSION = 6;
169 /* This feature is blocked because of mismatched driver versions. */
170 const long FEATURE_BLOCKED_MISMATCHED_VERSION = 7;
173 * Ask about a feature, and return the status of that feature.
174 * If the feature is not ok then aFailureId will give a unique failure Id
175 * otherwise it will be empty.
177 long getFeatureStatus(in long aFeature, [optional] out ACString aFailureId);
180 * Ask about a feature, return the minimum driver version required for it if its status is
181 * FEATURE_BLOCKED_DRIVER_VERSION, otherwise return an empty string.
183 AString getFeatureSuggestedDriverVersion(in long aFeature);
185 // only useful on X11
186 [noscript, notxpcom] void GetData();
188 [implicit_jscontext]
189 jsval getInfo();
191 // Return an object describing all features that have been configured:
193 // "features": [
194 // // For each feature:
195 // {
196 // "name": <string>,
197 // "description": <string>,
198 // "status": <string>,
199 // "log": [
200 // // One or more log entries, the first denotes the default value.
201 // {
202 // "type": <string>, // "base", "user", "env", or "runtime"
203 // "status": <string>,
204 // "message": <string> // Set unless type is "base" and status is "available".
205 // }
206 // ]
207 // }
208 // ]
209 // "fallbacks": [
210 // // For each workaround:
211 // {
212 // "name:" <string>,
213 // "description": <string>,
214 // "message": <string>
215 // ]
216 // }
218 // When a message is prefixed with a '#', it is a special status code. Status
219 // codes are unique identifiers that can be searched in the codebase to find
220 // which line of code caused the message. Some codes are standardized to
221 // improve about:support messaging:
223 // "[CONTEXT_]FEATURE_FAILURE_BUG_<number>"
224 // CONTEXT is optional and can currently only be "BLOCKLIST".
225 // <number> refers to a bug number in Bugzilla.
227 [implicit_jscontext]
228 jsval getFeatureLog();
230 // Returns an object containing information about graphics features. It is
231 // intended to be directly included into the Telemetry environment.
233 // "layers":
234 // {
235 // "compositor": "d3d9", "d3d11", "opengl", "basic", or "none"
236 // // ("none" indicates no compositors have been created)
237 // // Feature is one of "d3d9", "d3d11", "opengl", "basic", or "d2d".
238 // "<feature>": {
239 // // Each backend can have one of the following statuses:
240 // // "unused" - This feature has not been requested.
241 // // "unavailable" - OS version or restriction prevents use.
242 // // "blocked" - An internal condition (such as safe mode) prevents use.
243 // // "blacklisted" - Blocked due to a blacklist restriction.
244 // // "disabled" - User explicitly disabled this default feature.
245 // // "failed" - Feature failed to initialize.
246 // // "available" - User has this feature available by default.
247 // "status": "<status>",
248 // "version": "<version>",
249 // "warp": true|false, // D3D11 only.
250 // "textureSharing": true|false, // D3D11 only.
251 // }
252 // }
253 [implicit_jscontext]
254 jsval getFeatures();
256 // Returns an array listing any active crash guards.
258 // [
259 // {
260 // // Type is one of "d3d11layers", "d3d9video", "glcontext",
261 // // or "d3d11video".
262 // "type": "<identifier>",
264 // // Preference that must be deleted/reset to retrigger the guard.
265 // "prefName": "<preference>",
266 // }
267 // ]
268 [implicit_jscontext]
269 jsval getActiveCrashGuards();
271 // Forces the GPU process to start or shutdown. This is intended only for
272 // xpcshell-tests.
273 boolean controlGPUProcessForXPCShell(in boolean aEnable);