Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
michael@0 | 1 | /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- |
michael@0 | 2 | * |
michael@0 | 3 | * This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 4 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 5 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 6 | |
michael@0 | 7 | #include "nsISupports.idl" |
michael@0 | 8 | |
michael@0 | 9 | /* NOTE: this interface is completely undesigned, not stable and likely to change */ |
michael@0 | 10 | |
michael@0 | 11 | [scriptable, uuid(1194ba76-aeb5-48df-abfd-844740ce3696)] |
michael@0 | 12 | interface nsIGfxInfo : nsISupports |
michael@0 | 13 | { |
michael@0 | 14 | /* |
michael@0 | 15 | * These are win32-specific |
michael@0 | 16 | */ |
michael@0 | 17 | readonly attribute boolean D2DEnabled; |
michael@0 | 18 | readonly attribute boolean DWriteEnabled; |
michael@0 | 19 | readonly attribute DOMString DWriteVersion; |
michael@0 | 20 | readonly attribute DOMString cleartypeParameters; |
michael@0 | 21 | |
michael@0 | 22 | // XXX: Switch to a list of devices, rather than explicitly numbering them. |
michael@0 | 23 | |
michael@0 | 24 | /** |
michael@0 | 25 | * The name of the display adapter. |
michael@0 | 26 | */ |
michael@0 | 27 | readonly attribute DOMString adapterDescription; |
michael@0 | 28 | readonly attribute DOMString adapterDescription2; |
michael@0 | 29 | |
michael@0 | 30 | readonly attribute DOMString adapterDriver; |
michael@0 | 31 | readonly attribute DOMString adapterDriver2; |
michael@0 | 32 | |
michael@0 | 33 | /* These types are inspired by DXGI_ADAPTER_DESC */ |
michael@0 | 34 | readonly attribute DOMString adapterVendorID; |
michael@0 | 35 | readonly attribute DOMString adapterVendorID2; |
michael@0 | 36 | |
michael@0 | 37 | readonly attribute DOMString adapterDeviceID; |
michael@0 | 38 | readonly attribute DOMString adapterDeviceID2; |
michael@0 | 39 | |
michael@0 | 40 | /** |
michael@0 | 41 | * The amount of RAM in MB in the display adapter. |
michael@0 | 42 | */ |
michael@0 | 43 | readonly attribute DOMString adapterRAM; |
michael@0 | 44 | readonly attribute DOMString adapterRAM2; |
michael@0 | 45 | |
michael@0 | 46 | readonly attribute DOMString adapterDriverVersion; |
michael@0 | 47 | readonly attribute DOMString adapterDriverVersion2; |
michael@0 | 48 | |
michael@0 | 49 | readonly attribute DOMString adapterDriverDate; |
michael@0 | 50 | readonly attribute DOMString adapterDriverDate2; |
michael@0 | 51 | |
michael@0 | 52 | readonly attribute boolean isGPU2Active; |
michael@0 | 53 | |
michael@0 | 54 | void getFailures( |
michael@0 | 55 | [optional] out unsigned long failureCount, |
michael@0 | 56 | [retval, array, size_is(failureCount)] out string failures); |
michael@0 | 57 | |
michael@0 | 58 | [noscript, notxpcom] void logFailure(in ACString failure); |
michael@0 | 59 | /* |
michael@0 | 60 | * A set of constants for features that we can ask this GfxInfo object |
michael@0 | 61 | * about via GetFeatureStatus |
michael@0 | 62 | */ |
michael@0 | 63 | /* Don't assign 0 or -1 */ |
michael@0 | 64 | /* Whether Direct2D is supported for content rendering. */ |
michael@0 | 65 | const long FEATURE_DIRECT2D = 1; |
michael@0 | 66 | /* Whether Direct3D 9 is supported for layers. */ |
michael@0 | 67 | const long FEATURE_DIRECT3D_9_LAYERS = 2; |
michael@0 | 68 | /* Whether Direct3D 10.0 is supported for layers. */ |
michael@0 | 69 | const long FEATURE_DIRECT3D_10_LAYERS = 3; |
michael@0 | 70 | /* Whether Direct3D 10.1 is supported for layers. */ |
michael@0 | 71 | const long FEATURE_DIRECT3D_10_1_LAYERS = 4; |
michael@0 | 72 | /* Whether OpenGL is supported for layers */ |
michael@0 | 73 | const long FEATURE_OPENGL_LAYERS = 5; |
michael@0 | 74 | /* Whether WebGL is supported via OpenGL. */ |
michael@0 | 75 | const long FEATURE_WEBGL_OPENGL = 6; |
michael@0 | 76 | /* Whether WebGL is supported via ANGLE (D3D9 -- does not check for the presence of ANGLE libs). */ |
michael@0 | 77 | const long FEATURE_WEBGL_ANGLE = 7; |
michael@0 | 78 | /* Whether WebGL antialiasing is supported. */ |
michael@0 | 79 | const long FEATURE_WEBGL_MSAA = 8; |
michael@0 | 80 | /* Whether Stagefright is supported */ |
michael@0 | 81 | const long FEATURE_STAGEFRIGHT = 9; |
michael@0 | 82 | /* Whether Webrtc Hardware acceleration is supported */ |
michael@0 | 83 | const long FEATURE_WEBRTC_HW_ACCELERATION = 10; |
michael@0 | 84 | |
michael@0 | 85 | /* |
michael@0 | 86 | * A set of return values from GetFeatureStatus |
michael@0 | 87 | */ |
michael@0 | 88 | |
michael@0 | 89 | /* We don't explicitly block or discourage the feature. Which means we'll try getting it from the |
michael@0 | 90 | * hardware, and see what happens. */ |
michael@0 | 91 | const long FEATURE_NO_INFO = 1; |
michael@0 | 92 | /* We don't know the status of the feature yet. The analysis probably hasn't finished yet. */ |
michael@0 | 93 | const long FEATURE_STATUS_UNKNOWN = 2; |
michael@0 | 94 | /* This feature is blocked on this driver version. Updating driver will typically unblock it. */ |
michael@0 | 95 | const long FEATURE_BLOCKED_DRIVER_VERSION = 3; |
michael@0 | 96 | /* This feature is blocked on this device, regardless of driver version. |
michael@0 | 97 | * Typically means we hit too many driver crashes without a good reason to hope for them to |
michael@0 | 98 | * get fixed soon. */ |
michael@0 | 99 | const long FEATURE_BLOCKED_DEVICE = 4; |
michael@0 | 100 | /* This feature is available and can be used, but is not suggested (e.g. shouldn't be used by default */ |
michael@0 | 101 | const long FEATURE_DISCOURAGED = 5; |
michael@0 | 102 | /* This feature is blocked on this OS version. */ |
michael@0 | 103 | const long FEATURE_BLOCKED_OS_VERSION = 6; |
michael@0 | 104 | |
michael@0 | 105 | /** |
michael@0 | 106 | * Ask about a feature, and return the status of that feature |
michael@0 | 107 | */ |
michael@0 | 108 | long getFeatureStatus(in long aFeature); |
michael@0 | 109 | |
michael@0 | 110 | /* |
michael@0 | 111 | * Ask about a feature, return the minimum driver version required for it if its status is |
michael@0 | 112 | * FEATURE_BLOCKED_DRIVER_VERSION, otherwise return an empty string. |
michael@0 | 113 | */ |
michael@0 | 114 | DOMString getFeatureSuggestedDriverVersion(in long aFeature); |
michael@0 | 115 | |
michael@0 | 116 | /** |
michael@0 | 117 | * WebGL info; valid params are "full-renderer", "vendor", "renderer", "version", |
michael@0 | 118 | * "shading_language_version", "extensions". These return info from |
michael@0 | 119 | * underlying GL impl that's used to implement WebGL. |
michael@0 | 120 | */ |
michael@0 | 121 | DOMString getWebGLParameter(in DOMString aParam); |
michael@0 | 122 | |
michael@0 | 123 | // only useful on X11 |
michael@0 | 124 | [noscript, notxpcom] void GetData(); |
michael@0 | 125 | |
michael@0 | 126 | [implicit_jscontext] |
michael@0 | 127 | jsval getInfo(); |
michael@0 | 128 | }; |
michael@0 | 129 |