Bug 1649121: part 26) Move `CollectTopMostChildContentsCompletelyInRange`. r=masayuki
[gecko.git] / widget / nsIGfxInfo.idl
bloba273a8ac9cd96576c9ffc07321d7741454c574b5
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 EmbeddedInFirefoxReality;
19 readonly attribute boolean usingGPUProcess;
20 readonly attribute boolean hasBattery;
21 readonly attribute AString DWriteVersion;
22 readonly attribute AString cleartypeParameters;
25 * These are non-Android linux-specific
27 readonly attribute AString windowProtocol;
28 readonly attribute AString desktopEnvironment;
31 * These are valid across all platforms.
33 readonly attribute AString ContentBackend;
34 readonly attribute boolean WebRenderEnabled;
35 readonly attribute boolean isHeadless;
36 readonly attribute boolean UsesTiling;
37 readonly attribute boolean ContentUsesTiling;
38 readonly attribute boolean OffMainThreadPaintEnabled;
39 readonly attribute long OffMainThreadPaintWorkerCount;
40 readonly attribute unsigned long TargetFrameRate;
42 // XXX: Switch to a list of devices, rather than explicitly numbering them.
44 /**
45 * The name of the display adapter.
47 readonly attribute AString adapterDescription;
48 readonly attribute AString adapterDescription2;
50 readonly attribute AString adapterDriver;
51 readonly attribute AString adapterDriver2;
53 /* These types are inspired by DXGI_ADAPTER_DESC */
54 readonly attribute AString adapterVendorID;
55 readonly attribute AString adapterVendorID2;
57 readonly attribute AString adapterDeviceID;
58 readonly attribute AString adapterDeviceID2;
60 readonly attribute AString adapterSubsysID;
61 readonly attribute AString adapterSubsysID2;
63 /**
64 * The amount of RAM in MB in the display adapter.
66 readonly attribute unsigned long adapterRAM;
67 readonly attribute unsigned long adapterRAM2;
69 readonly attribute AString adapterDriverVendor;
70 readonly attribute AString adapterDriverVendor2;
72 readonly attribute AString adapterDriverVersion;
73 readonly attribute AString adapterDriverVersion2;
75 readonly attribute AString adapterDriverDate;
76 readonly attribute AString adapterDriverDate2;
78 readonly attribute boolean isGPU2Active;
80 /**
81 * Information about display devices
83 readonly attribute Array<AString> displayInfo;
84 readonly attribute Array<unsigned long> displayWidth;
85 readonly attribute Array<unsigned long> displayHeight;
87 /**
88 * Returns an array of objects describing each monitor. Guaranteed properties
89 * are "screenWidth" and "screenHeight". This is only implemented on Desktop.
91 * Windows additionally supplies "refreshRate" and "pseudoDisplay".
93 * OS X additionally supplies "scale".
95 [implicit_jscontext]
96 jsval getMonitors();
98 Array<ACString> getFailures(out Array<long> indices);
100 [noscript, notxpcom] void logFailure(in ACString failure);
102 * A set of constants for features that we can ask this GfxInfo object
103 * about via GetFeatureStatus
105 /* Don't assign any value <= 0 */
106 /* Whether Direct2D is supported for content rendering. */
107 const long FEATURE_DIRECT2D = 1;
108 /* Whether Direct3D 9 is supported for layers. */
109 const long FEATURE_DIRECT3D_9_LAYERS = 2;
110 /* Whether Direct3D 10.0 is supported for layers. */
111 const long FEATURE_DIRECT3D_10_LAYERS = 3;
112 /* Whether Direct3D 10.1 is supported for layers. */
113 const long FEATURE_DIRECT3D_10_1_LAYERS = 4;
114 /* Whether OpenGL is supported for layers */
115 const long FEATURE_OPENGL_LAYERS = 5;
116 /* Whether WebGL is supported via OpenGL. */
117 const long FEATURE_WEBGL_OPENGL = 6;
118 /* Whether WebGL is supported via ANGLE (D3D9 -- does not check for the presence of ANGLE libs). */
119 const long FEATURE_WEBGL_ANGLE = 7;
120 /* Whether WebGL antialiasing is supported. */
121 const long FEATURE_WEBGL_MSAA = 8;
122 /* Whether Stagefright is supported, starting in 17. */
123 const long FEATURE_STAGEFRIGHT = 9;
124 /* Whether Webrtc Hardware H.264 acceleration is supported, starting in 71. */
125 const long FEATURE_WEBRTC_HW_ACCELERATION_H264 = 10;
126 /* Whether Direct3D 11 is supported for layers, starting in 32. */
127 const long FEATURE_DIRECT3D_11_LAYERS = 11;
128 /* Whether hardware accelerated video decoding is supported, starting in 36. */
129 const long FEATURE_HARDWARE_VIDEO_DECODING = 12;
130 /* Whether Direct3D 11 is supported for ANGLE, starting in 38. */
131 const long FEATURE_DIRECT3D_11_ANGLE = 13;
132 /* Whether Webrtc Hardware acceleration is supported, starting in 42. */
133 const long FEATURE_WEBRTC_HW_ACCELERATION_ENCODE = 14;
134 /* Whether Webrtc Hardware acceleration is supported, starting in 42. */
135 const long FEATURE_WEBRTC_HW_ACCELERATION_DECODE = 15;
136 /* Whether Canvas acceleration is supported, starting in 45 */
137 const long FEATURE_CANVAS2D_ACCELERATION = 16;
138 /* Whether hardware VP8 decoding is supported, starting in 48; not for downloadable blocking. */
139 const long FEATURE_VP8_HW_DECODE = 17;
140 /* Whether hardware VP9 decoding is supported, starting in 48; not for downloadable blocking. */
141 const long FEATURE_VP9_HW_DECODE = 18;
142 /* Whether NV_dx_interop2 is supported, starting in 50; downloadable blocking in 58. */
143 const long FEATURE_DX_INTEROP2 = 19;
144 /* Whether the GPU process is supported, starting in 52; downloadable blocking in 58. */
145 const long FEATURE_GPU_PROCESS = 20;
146 /* Whether the WebGL2 is supported, starting in 54 */
147 const long FEATURE_WEBGL2 = 21;
148 /* Whether Advanced Layers is supported, starting in 56 */
149 const long FEATURE_ADVANCED_LAYERS = 22;
150 /* Whether D3D11 keyed mutex is supported, starting in 56 */
151 const long FEATURE_D3D11_KEYED_MUTEX = 23;
152 /* Whether WebRender is supported, starting in 62 */
153 const long FEATURE_WEBRENDER = 24;
154 /* Whether WebRender is supported, starting in 62 */
155 const long FEATURE_DX_NV12 = 25;
156 const long FEATURE_DX_P010 = 26;
157 const long FEATURE_DX_P016 = 27;
158 /* Whether OpenGL swizzle configuration of texture units is supported, starting in 70 */
159 const long FEATURE_GL_SWIZZLE = 28;
160 /* Whether WebRender native compositor is supported, starting in 73 */
161 const long FEATURE_WEBRENDER_COMPOSITOR = 29;
162 /* Whether WebRender can use scissored clears for cached surfaces, staring in 79 */
163 const long FEATURE_WEBRENDER_SCISSORED_CACHE_CLEARS = 30;
164 /* the maximum feature value. */
165 const long FEATURE_MAX_VALUE = FEATURE_WEBRENDER_SCISSORED_CACHE_CLEARS;
168 * A set of return values from GetFeatureStatus
171 /* The driver is safe to the best of our knowledge */
172 const long FEATURE_STATUS_OK = 1;
173 /* We don't know the status of the feature yet. The analysis probably hasn't finished yet. */
174 const long FEATURE_STATUS_UNKNOWN = 2;
175 /* This feature is blocked on this driver version. Updating driver will typically unblock it. */
176 const long FEATURE_BLOCKED_DRIVER_VERSION = 3;
177 /* This feature is blocked on this device, regardless of driver version.
178 * Typically means we hit too many driver crashes without a good reason to hope for them to
179 * get fixed soon. */
180 const long FEATURE_BLOCKED_DEVICE = 4;
181 /* This feature is available and can be used, but is not suggested (e.g. shouldn't be used by default */
182 const long FEATURE_DISCOURAGED = 5;
183 /* This feature is blocked on this OS version. */
184 const long FEATURE_BLOCKED_OS_VERSION = 6;
185 /* This feature is blocked because of mismatched driver versions. */
186 const long FEATURE_BLOCKED_MISMATCHED_VERSION = 7;
187 /* This feature is blocked due to not being on the allowlist. */
188 const long FEATURE_DENIED = 8;
189 /* This feature is safe to be on this device due to the allowlist. */
190 const long FEATURE_ALLOW_ALWAYS = 9;
191 /* This feature is safe to be on this device due to the allowlist, depending on qualified/experiment status. */
192 const long FEATURE_ALLOW_QUALIFIED = 10;
195 * Ask about a feature, and return the status of that feature.
196 * If the feature is not ok then aFailureId will give a unique failure Id
197 * otherwise it will be empty.
199 long getFeatureStatus(in long aFeature, [optional] out ACString aFailureId);
202 * Ask about a feature, return the minimum driver version required for it if its status is
203 * FEATURE_BLOCKED_DRIVER_VERSION, otherwise return an empty string.
205 AString getFeatureSuggestedDriverVersion(in long aFeature);
207 // only useful on X11
208 [noscript, notxpcom] void GetData();
211 * Maximum refresh rate among detected monitors. -1 if unknown.
213 [noscript, notxpcom] long GetMaxRefreshRate();
215 [implicit_jscontext]
216 jsval getInfo();
218 // Return an object describing all features that have been configured:
220 // "features": [
221 // // For each feature:
222 // {
223 // "name": <string>,
224 // "description": <string>,
225 // "status": <string>,
226 // "log": [
227 // // One or more log entries, the first denotes the default value.
228 // {
229 // "type": <string>, // "base", "user", "env", or "runtime"
230 // "status": <string>,
231 // "message": <string> // Set unless type is "base" and status is "available".
232 // }
233 // ]
234 // }
235 // ]
236 // "fallbacks": [
237 // // For each workaround:
238 // {
239 // "name:" <string>,
240 // "description": <string>,
241 // "message": <string>
242 // ]
243 // }
245 // When a message is prefixed with a '#', it is a special status code. Status
246 // codes are unique identifiers that can be searched in the codebase to find
247 // which line of code caused the message. Some codes are standardized to
248 // improve about:support messaging:
250 // "[CONTEXT_]FEATURE_FAILURE_BUG_<number>"
251 // CONTEXT is optional and can currently only be "BLOCKLIST".
252 // <number> refers to a bug number in Bugzilla.
254 [implicit_jscontext]
255 jsval getFeatureLog();
257 // Returns an object containing information about graphics features. It is
258 // intended to be directly included into the Telemetry environment.
260 // "layers":
261 // {
262 // "compositor": "d3d9", "d3d11", "opengl", "basic", or "none"
263 // // ("none" indicates no compositors have been created)
264 // // Feature is one of "d3d9", "d3d11", "opengl", "basic", or "d2d".
265 // "<feature>": {
266 // // Each backend can have one of the following statuses:
267 // // "unused" - This feature has not been requested.
268 // // "unavailable" - OS version or restriction prevents use.
269 // // "blocked" - An internal condition (such as safe mode) prevents use.
270 // // "blocklisted" - Blocked due to a blocklist restriction.
271 // // "denied" - Blocked due to allowlist restrictions.
272 // // "disabled" - User explicitly disabled this default feature.
273 // // "failed" - Feature failed to initialize.
274 // // "available" - User has this feature available by default.
275 // "status": "<status>",
276 // "version": "<version>",
277 // "warp": true|false, // D3D11 only.
278 // "textureSharing": true|false, // D3D11 only.
279 // }
280 // }
281 [implicit_jscontext]
282 jsval getFeatures();
284 // Returns an array listing any active crash guards.
286 // [
287 // {
288 // // Type is one of "d3d11layers", "d3d9video", "glcontext",
289 // // or "d3d11video".
290 // "type": "<identifier>",
292 // // Preference that must be deleted/reset to retrigger the guard.
293 // "prefName": "<preference>",
294 // }
295 // ]
296 [implicit_jscontext]
297 jsval getActiveCrashGuards();
299 // Forces the GPU process to start or shutdown. This is intended only for
300 // xpcshell-tests.
301 boolean controlGPUProcessForXPCShell(in boolean aEnable);