nsIGfxInfo.idl 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250
  1. /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  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/. */
  6. #include "nsISupports.idl"
  7. /* NOTE: this interface is completely undesigned, not stable and likely to change */
  8. [scriptable, uuid(1accd618-4c80-4703-9d29-ecf257d397c8)]
  9. interface nsIGfxInfo : nsISupports
  10. {
  11. /*
  12. * These are win32-specific
  13. */
  14. readonly attribute boolean D2DEnabled;
  15. readonly attribute boolean DWriteEnabled;
  16. readonly attribute DOMString DWriteVersion;
  17. readonly attribute DOMString cleartypeParameters;
  18. /*
  19. * These are valid across all platforms.
  20. */
  21. readonly attribute DOMString ContentBackend;
  22. // XXX: Switch to a list of devices, rather than explicitly numbering them.
  23. /**
  24. * The name of the display adapter.
  25. */
  26. readonly attribute DOMString adapterDescription;
  27. readonly attribute DOMString adapterDescription2;
  28. readonly attribute DOMString adapterDriver;
  29. readonly attribute DOMString adapterDriver2;
  30. /* These types are inspired by DXGI_ADAPTER_DESC */
  31. readonly attribute DOMString adapterVendorID;
  32. readonly attribute DOMString adapterVendorID2;
  33. readonly attribute DOMString adapterDeviceID;
  34. readonly attribute DOMString adapterDeviceID2;
  35. readonly attribute DOMString adapterSubsysID;
  36. readonly attribute DOMString adapterSubsysID2;
  37. /**
  38. * The amount of RAM in MB in the display adapter.
  39. */
  40. readonly attribute DOMString adapterRAM;
  41. readonly attribute DOMString adapterRAM2;
  42. readonly attribute DOMString adapterDriverVersion;
  43. readonly attribute DOMString adapterDriverVersion2;
  44. readonly attribute DOMString adapterDriverDate;
  45. readonly attribute DOMString adapterDriverDate2;
  46. readonly attribute boolean isGPU2Active;
  47. /**
  48. * Returns an array of objects describing each monitor. Guaranteed properties
  49. * are "screenWidth" and "screenHeight". This is only implemented on Desktop.
  50. *
  51. * Windows additionally supplies "refreshRate" and "pseudoDisplay".
  52. *
  53. * OS X additionally supplies "scale".
  54. */
  55. [implicit_jscontext]
  56. jsval getMonitors();
  57. void getFailures(
  58. out unsigned long failureCount,
  59. [optional, array, size_is(failureCount)] out long indices,
  60. [retval, array, size_is(failureCount)] out string failures);
  61. [noscript, notxpcom] void logFailure(in ACString failure);
  62. /*
  63. * A set of constants for features that we can ask this GfxInfo object
  64. * about via GetFeatureStatus
  65. */
  66. /* Don't assign any value <= 0 */
  67. /* Whether Direct2D is supported for content rendering. */
  68. const long FEATURE_DIRECT2D = 1;
  69. /* Whether Direct3D 9 is supported for layers. */
  70. const long FEATURE_DIRECT3D_9_LAYERS = 2;
  71. /* Whether Direct3D 10.0 is supported for layers. */
  72. const long FEATURE_DIRECT3D_10_LAYERS = 3;
  73. /* Whether Direct3D 10.1 is supported for layers. */
  74. const long FEATURE_DIRECT3D_10_1_LAYERS = 4;
  75. /* Whether OpenGL is supported for layers */
  76. const long FEATURE_OPENGL_LAYERS = 5;
  77. /* Whether WebGL is supported via OpenGL. */
  78. const long FEATURE_WEBGL_OPENGL = 6;
  79. /* Whether WebGL is supported via ANGLE (D3D9 -- does not check for the presence of ANGLE libs). */
  80. const long FEATURE_WEBGL_ANGLE = 7;
  81. /* Whether WebGL antialiasing is supported. */
  82. const long FEATURE_WEBGL_MSAA = 8;
  83. /* Whether Stagefright is supported, starting in 17. */
  84. const long FEATURE_STAGEFRIGHT = 9;
  85. /* Whether Webrtc Hardware acceleration is supported, starting in 31. */
  86. const long FEATURE_WEBRTC_HW_ACCELERATION = 10;
  87. /* Whether Direct3D 11 is supported for layers, starting in 32. */
  88. const long FEATURE_DIRECT3D_11_LAYERS = 11;
  89. /* Whether hardware accelerated video decoding is supported, starting in 36. */
  90. const long FEATURE_HARDWARE_VIDEO_DECODING = 12;
  91. /* Whether Direct3D 11 is supported for ANGLE, starting in 38. */
  92. const long FEATURE_DIRECT3D_11_ANGLE = 13;
  93. /* Whether Webrtc Hardware acceleration is supported, starting in 42. */
  94. const long FEATURE_WEBRTC_HW_ACCELERATION_ENCODE = 14;
  95. /* Whether Webrtc Hardware acceleration is supported, starting in 42. */
  96. const long FEATURE_WEBRTC_HW_ACCELERATION_DECODE = 15;
  97. /* Whether Canvas acceleration is supported, starting in 45 */
  98. const long FEATURE_CANVAS2D_ACCELERATION = 16;
  99. /* Whether hardware VP8 decoding is supported, starting in 48. */
  100. const long FEATURE_VP8_HW_DECODE = 17;
  101. /* Whether hardware VP9 decoding is supported, starting in 48. */
  102. const long FEATURE_VP9_HW_DECODE = 18;
  103. /* Whether NV_dx_interop2 is supported, starting in 50. */
  104. const long FEATURE_DX_INTEROP2 = 19;
  105. /*
  106. * A set of return values from GetFeatureStatus
  107. */
  108. /* The driver is safe to the best of our knowledge */
  109. const long FEATURE_STATUS_OK = 1;
  110. /* We don't know the status of the feature yet. The analysis probably hasn't finished yet. */
  111. const long FEATURE_STATUS_UNKNOWN = 2;
  112. /* This feature is blocked on this driver version. Updating driver will typically unblock it. */
  113. const long FEATURE_BLOCKED_DRIVER_VERSION = 3;
  114. /* This feature is blocked on this device, regardless of driver version.
  115. * Typically means we hit too many driver crashes without a good reason to hope for them to
  116. * get fixed soon. */
  117. const long FEATURE_BLOCKED_DEVICE = 4;
  118. /* This feature is available and can be used, but is not suggested (e.g. shouldn't be used by default */
  119. const long FEATURE_DISCOURAGED = 5;
  120. /* This feature is blocked on this OS version. */
  121. const long FEATURE_BLOCKED_OS_VERSION = 6;
  122. /* This feature is blocked because of mismatched driver versions. */
  123. const long FEATURE_BLOCKED_MISMATCHED_VERSION = 7;
  124. /**
  125. * Ask about a feature, and return the status of that feature.
  126. * If the feature is not ok then aFailureId will give a unique failure Id
  127. * otherwise it will be empty.
  128. */
  129. long getFeatureStatus(in long aFeature, [optional] out ACString aFailureId);
  130. /*
  131. * Ask about a feature, return the minimum driver version required for it if its status is
  132. * FEATURE_BLOCKED_DRIVER_VERSION, otherwise return an empty string.
  133. */
  134. DOMString getFeatureSuggestedDriverVersion(in long aFeature);
  135. /**
  136. * WebGL info; valid params are "full-renderer", "vendor", "renderer", "version",
  137. * "shading_language_version", "extensions". These return info from
  138. * underlying GL impl that's used to implement WebGL.
  139. */
  140. DOMString getWebGLParameter(in DOMString aParam);
  141. // only useful on X11
  142. [noscript, notxpcom] void GetData();
  143. [implicit_jscontext]
  144. jsval getInfo();
  145. // Return an object describing all features that have been configured:
  146. //
  147. // "features": [
  148. // // For each feature:
  149. // {
  150. // "name": <string>,
  151. // "description": <string>,
  152. // "status": <string>,
  153. // "log": [
  154. // // One or more log entries, the first denotes the default value.
  155. // {
  156. // "type": <string>, // "base", "user", "env", or "runtime"
  157. // "status": <string>,
  158. // "message": <string> // Set unless type is "base" and status is "available".
  159. // }
  160. // ]
  161. // }
  162. // ]
  163. // "fallbacks": [
  164. // // For each workaround:
  165. // {
  166. // "name:" <string>,
  167. // "description": <string>,
  168. // "message": <string>
  169. // ]
  170. // }
  171. //
  172. // When a message is prefixed with a '#', it is a special status code. Status
  173. // codes are unique identifiers that can be searched in the codebase to find
  174. // which line of code caused the message. Some codes are standardized to
  175. // improve about:support messaging:
  176. //
  177. // "[CONTEXT_]FEATURE_FAILURE_BUG_<number>"
  178. // CONTEXT is optional and can currently only be "BLOCKLIST".
  179. // <number> refers to a bug number in Bugzilla.
  180. //
  181. [implicit_jscontext]
  182. jsval getFeatureLog();
  183. // Returns an object containing information about graphics features. It is
  184. // intended to be directly included into the Telemetry environment.
  185. //
  186. // "layers":
  187. // {
  188. // "compositor": "d3d9", "d3d11", "opengl", "basic", or "none"
  189. // // ("none" indicates no compositors have been created)
  190. // // Feature is one of "d3d9", "d3d11", "opengl", "basic", or "d2d".
  191. // "<feature>": {
  192. // // Each backend can have one of the following statuses:
  193. // // "unused" - This feature has not been requested.
  194. // // "unavailable" - OS version or restriction prevents use.
  195. // // "blocked" - An internal condition (such as safe mode) prevents use.
  196. // // "blacklisted" - Blocked due to a blacklist restriction.
  197. // // "disabled" - User explicitly disabled this default feature.
  198. // // "failed" - Feature failed to initialize.
  199. // // "available" - User has this feature available by default.
  200. // "status": "<status>",
  201. // "version": "<version>",
  202. // "warp": true|false, // D3D11 only.
  203. // "textureSharing": true|false, // D3D11 only.
  204. // }
  205. // }
  206. [implicit_jscontext]
  207. jsval getFeatures();
  208. // Returns an array listing any active crash guards.
  209. //
  210. // [
  211. // {
  212. // // Type is one of "d3d11layers", "d3d9video", "glcontext",
  213. // // or "d3d11video".
  214. // "type": "<identifier>",
  215. //
  216. // // Preference that must be deleted/reset to retrigger the guard.
  217. // "prefName": "<preference>",
  218. // }
  219. // ]
  220. [implicit_jscontext]
  221. jsval getActiveCrashGuards();
  222. };