1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/widget/nsIGfxInfo.idl Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,129 @@ 1.4 +/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- 1.5 + * 1.6 + * This Source Code Form is subject to the terms of the Mozilla Public 1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.8 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.9 + 1.10 +#include "nsISupports.idl" 1.11 + 1.12 +/* NOTE: this interface is completely undesigned, not stable and likely to change */ 1.13 + 1.14 +[scriptable, uuid(1194ba76-aeb5-48df-abfd-844740ce3696)] 1.15 +interface nsIGfxInfo : nsISupports 1.16 +{ 1.17 + /* 1.18 + * These are win32-specific 1.19 + */ 1.20 + readonly attribute boolean D2DEnabled; 1.21 + readonly attribute boolean DWriteEnabled; 1.22 + readonly attribute DOMString DWriteVersion; 1.23 + readonly attribute DOMString cleartypeParameters; 1.24 + 1.25 + // XXX: Switch to a list of devices, rather than explicitly numbering them. 1.26 + 1.27 + /** 1.28 + * The name of the display adapter. 1.29 + */ 1.30 + readonly attribute DOMString adapterDescription; 1.31 + readonly attribute DOMString adapterDescription2; 1.32 + 1.33 + readonly attribute DOMString adapterDriver; 1.34 + readonly attribute DOMString adapterDriver2; 1.35 + 1.36 + /* These types are inspired by DXGI_ADAPTER_DESC */ 1.37 + readonly attribute DOMString adapterVendorID; 1.38 + readonly attribute DOMString adapterVendorID2; 1.39 + 1.40 + readonly attribute DOMString adapterDeviceID; 1.41 + readonly attribute DOMString adapterDeviceID2; 1.42 + 1.43 + /** 1.44 + * The amount of RAM in MB in the display adapter. 1.45 + */ 1.46 + readonly attribute DOMString adapterRAM; 1.47 + readonly attribute DOMString adapterRAM2; 1.48 + 1.49 + readonly attribute DOMString adapterDriverVersion; 1.50 + readonly attribute DOMString adapterDriverVersion2; 1.51 + 1.52 + readonly attribute DOMString adapterDriverDate; 1.53 + readonly attribute DOMString adapterDriverDate2; 1.54 + 1.55 + readonly attribute boolean isGPU2Active; 1.56 + 1.57 + void getFailures( 1.58 + [optional] out unsigned long failureCount, 1.59 + [retval, array, size_is(failureCount)] out string failures); 1.60 + 1.61 + [noscript, notxpcom] void logFailure(in ACString failure); 1.62 + /* 1.63 + * A set of constants for features that we can ask this GfxInfo object 1.64 + * about via GetFeatureStatus 1.65 + */ 1.66 + /* Don't assign 0 or -1 */ 1.67 + /* Whether Direct2D is supported for content rendering. */ 1.68 + const long FEATURE_DIRECT2D = 1; 1.69 + /* Whether Direct3D 9 is supported for layers. */ 1.70 + const long FEATURE_DIRECT3D_9_LAYERS = 2; 1.71 + /* Whether Direct3D 10.0 is supported for layers. */ 1.72 + const long FEATURE_DIRECT3D_10_LAYERS = 3; 1.73 + /* Whether Direct3D 10.1 is supported for layers. */ 1.74 + const long FEATURE_DIRECT3D_10_1_LAYERS = 4; 1.75 + /* Whether OpenGL is supported for layers */ 1.76 + const long FEATURE_OPENGL_LAYERS = 5; 1.77 + /* Whether WebGL is supported via OpenGL. */ 1.78 + const long FEATURE_WEBGL_OPENGL = 6; 1.79 + /* Whether WebGL is supported via ANGLE (D3D9 -- does not check for the presence of ANGLE libs). */ 1.80 + const long FEATURE_WEBGL_ANGLE = 7; 1.81 + /* Whether WebGL antialiasing is supported. */ 1.82 + const long FEATURE_WEBGL_MSAA = 8; 1.83 + /* Whether Stagefright is supported */ 1.84 + const long FEATURE_STAGEFRIGHT = 9; 1.85 + /* Whether Webrtc Hardware acceleration is supported */ 1.86 + const long FEATURE_WEBRTC_HW_ACCELERATION = 10; 1.87 + 1.88 + /* 1.89 + * A set of return values from GetFeatureStatus 1.90 + */ 1.91 + 1.92 + /* We don't explicitly block or discourage the feature. Which means we'll try getting it from the 1.93 + * hardware, and see what happens. */ 1.94 + const long FEATURE_NO_INFO = 1; 1.95 + /* We don't know the status of the feature yet. The analysis probably hasn't finished yet. */ 1.96 + const long FEATURE_STATUS_UNKNOWN = 2; 1.97 + /* This feature is blocked on this driver version. Updating driver will typically unblock it. */ 1.98 + const long FEATURE_BLOCKED_DRIVER_VERSION = 3; 1.99 + /* This feature is blocked on this device, regardless of driver version. 1.100 + * Typically means we hit too many driver crashes without a good reason to hope for them to 1.101 + * get fixed soon. */ 1.102 + const long FEATURE_BLOCKED_DEVICE = 4; 1.103 + /* This feature is available and can be used, but is not suggested (e.g. shouldn't be used by default */ 1.104 + const long FEATURE_DISCOURAGED = 5; 1.105 + /* This feature is blocked on this OS version. */ 1.106 + const long FEATURE_BLOCKED_OS_VERSION = 6; 1.107 + 1.108 + /** 1.109 + * Ask about a feature, and return the status of that feature 1.110 + */ 1.111 + long getFeatureStatus(in long aFeature); 1.112 + 1.113 + /* 1.114 + * Ask about a feature, return the minimum driver version required for it if its status is 1.115 + * FEATURE_BLOCKED_DRIVER_VERSION, otherwise return an empty string. 1.116 + */ 1.117 + DOMString getFeatureSuggestedDriverVersion(in long aFeature); 1.118 + 1.119 + /** 1.120 + * WebGL info; valid params are "full-renderer", "vendor", "renderer", "version", 1.121 + * "shading_language_version", "extensions". These return info from 1.122 + * underlying GL impl that's used to implement WebGL. 1.123 + */ 1.124 + DOMString getWebGLParameter(in DOMString aParam); 1.125 + 1.126 + // only useful on X11 1.127 + [noscript, notxpcom] void GetData(); 1.128 + 1.129 + [implicit_jscontext] 1.130 + jsval getInfo(); 1.131 +}; 1.132 +