2010-08-13 15:43:35 +00:00
|
|
|
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
|
|
|
*
|
2012-05-21 11:12:37 +00:00
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2010-08-13 15:43:35 +00:00
|
|
|
|
|
|
|
#include "nsISupports.idl"
|
|
|
|
|
2010-08-16 07:15:03 +00:00
|
|
|
/* NOTE: this interface is completely undesigned, not stable and likely to change */
|
2019-05-13 19:51:49 +00:00
|
|
|
[scriptable, builtinclass, uuid(1accd618-4c80-4703-9d29-ecf257d397c8)]
|
2010-08-13 15:43:35 +00:00
|
|
|
interface nsIGfxInfo : nsISupports
|
|
|
|
{
|
2010-10-02 03:55:19 +00:00
|
|
|
/*
|
|
|
|
* These are win32-specific
|
|
|
|
*/
|
2010-08-13 15:43:35 +00:00
|
|
|
readonly attribute boolean D2DEnabled;
|
2010-08-16 07:15:03 +00:00
|
|
|
readonly attribute boolean DWriteEnabled;
|
2020-06-25 17:22:20 +00:00
|
|
|
readonly attribute boolean EmbeddedInFirefoxReality;
|
2021-04-27 15:17:12 +00:00
|
|
|
readonly attribute AString AzureCanvasBackend;
|
|
|
|
readonly attribute AString AzureContentBackend;
|
2016-11-14 23:02:02 +00:00
|
|
|
readonly attribute boolean usingGPUProcess;
|
2024-03-28 14:50:20 +00:00
|
|
|
readonly attribute boolean usingRemoteCanvas;
|
|
|
|
readonly attribute boolean usingAcceleratedCanvas;
|
2020-02-13 15:51:32 +00:00
|
|
|
readonly attribute boolean hasBattery;
|
2018-09-06 08:02:43 +00:00
|
|
|
readonly attribute AString DWriteVersion;
|
|
|
|
readonly attribute AString cleartypeParameters;
|
2024-07-21 08:43:07 +00:00
|
|
|
readonly attribute float textScaleFactor;
|
2011-08-12 13:46:41 +00:00
|
|
|
|
2019-05-27 00:02:32 +00:00
|
|
|
/*
|
|
|
|
* These are non-Android linux-specific
|
|
|
|
*/
|
|
|
|
readonly attribute AString windowProtocol;
|
2021-01-25 19:41:04 +00:00
|
|
|
readonly attribute AString testType;
|
2019-05-27 00:02:32 +00:00
|
|
|
|
2016-09-12 23:23:28 +00:00
|
|
|
/*
|
|
|
|
* These are valid across all platforms.
|
|
|
|
*/
|
2018-09-06 08:02:43 +00:00
|
|
|
readonly attribute AString ContentBackend;
|
2017-07-03 22:39:16 +00:00
|
|
|
readonly attribute boolean isHeadless;
|
2019-01-08 15:48:24 +00:00
|
|
|
readonly attribute unsigned long TargetFrameRate;
|
2022-07-22 23:08:08 +00:00
|
|
|
readonly attribute ACString CodecSupportInfo;
|
2016-09-12 23:23:28 +00:00
|
|
|
|
2016-07-29 02:43:33 +00:00
|
|
|
// XXX: Switch to a list of devices, rather than explicitly numbering them.
|
2011-08-12 13:46:41 +00:00
|
|
|
|
2024-02-05 21:19:16 +00:00
|
|
|
// Present on all platforms, but only useful on Android
|
|
|
|
cenum FontVisibilityDeviceDetermination : 8 {
|
|
|
|
Unassigned = 0,
|
|
|
|
Unknown_Platform = 1,
|
|
|
|
Windows_Platform = 2,
|
2024-11-07 13:08:10 +00:00
|
|
|
MacOS_Unknown = 3,
|
2024-02-05 21:19:16 +00:00
|
|
|
Android_Unknown_Release_Version = 4,
|
|
|
|
Android_Unknown_Peloton = 5,
|
|
|
|
Android_Unknown_vbox = 6,
|
|
|
|
Android_Unknown_mitv = 7,
|
|
|
|
Android_Chromebook = 8,
|
|
|
|
Android_Amazon = 9,
|
|
|
|
Android_sub_9 = 10,
|
|
|
|
Android_9_11 = 11,
|
|
|
|
Android_12_plus = 12,
|
|
|
|
Linux_Unknown = 13,
|
|
|
|
Linux_Ubuntu_any = 14,
|
|
|
|
Linux_Ubuntu_20 = 15,
|
|
|
|
Linux_Ubuntu_22 = 16,
|
|
|
|
Linux_Fedora_any = 17,
|
|
|
|
Linux_Fedora_38 = 18,
|
2024-11-07 13:08:10 +00:00
|
|
|
Linux_Fedora_39 = 19,
|
|
|
|
MacOS_13_plus = 20,
|
|
|
|
MacOS_sub_13 = 21
|
2024-02-05 21:19:16 +00:00
|
|
|
};
|
|
|
|
readonly attribute nsIGfxInfo_FontVisibilityDeviceDetermination fontVisibilityDetermination;
|
|
|
|
readonly attribute AString fontVisibilityDeterminationStr;
|
|
|
|
|
2010-08-27 15:49:02 +00:00
|
|
|
/**
|
|
|
|
* The name of the display adapter.
|
|
|
|
*/
|
2018-09-06 08:02:43 +00:00
|
|
|
readonly attribute AString adapterDescription;
|
|
|
|
readonly attribute AString adapterDescription2;
|
2010-08-27 15:49:02 +00:00
|
|
|
|
2018-09-06 08:02:43 +00:00
|
|
|
readonly attribute AString adapterDriver;
|
|
|
|
readonly attribute AString adapterDriver2;
|
2016-07-29 02:43:33 +00:00
|
|
|
|
2010-08-27 15:49:02 +00:00
|
|
|
/* These types are inspired by DXGI_ADAPTER_DESC */
|
2018-09-06 08:02:43 +00:00
|
|
|
readonly attribute AString adapterVendorID;
|
|
|
|
readonly attribute AString adapterVendorID2;
|
2016-07-29 02:43:33 +00:00
|
|
|
|
2018-09-06 08:02:43 +00:00
|
|
|
readonly attribute AString adapterDeviceID;
|
|
|
|
readonly attribute AString adapterDeviceID2;
|
2011-08-12 13:46:41 +00:00
|
|
|
|
2018-09-06 08:02:43 +00:00
|
|
|
readonly attribute AString adapterSubsysID;
|
|
|
|
readonly attribute AString adapterSubsysID2;
|
2014-07-09 18:21:49 +00:00
|
|
|
|
2010-08-27 15:49:02 +00:00
|
|
|
/**
|
|
|
|
* The amount of RAM in MB in the display adapter.
|
|
|
|
*/
|
2019-11-26 19:42:06 +00:00
|
|
|
readonly attribute unsigned long adapterRAM;
|
|
|
|
readonly attribute unsigned long adapterRAM2;
|
2016-07-29 02:43:33 +00:00
|
|
|
|
2019-04-30 20:29:18 +00:00
|
|
|
readonly attribute AString adapterDriverVendor;
|
|
|
|
readonly attribute AString adapterDriverVendor2;
|
|
|
|
|
2018-09-06 08:02:43 +00:00
|
|
|
readonly attribute AString adapterDriverVersion;
|
|
|
|
readonly attribute AString adapterDriverVersion2;
|
2016-07-29 02:43:33 +00:00
|
|
|
|
2018-09-06 08:02:43 +00:00
|
|
|
readonly attribute AString adapterDriverDate;
|
|
|
|
readonly attribute AString adapterDriverDate2;
|
2011-08-12 13:46:41 +00:00
|
|
|
|
|
|
|
readonly attribute boolean isGPU2Active;
|
2010-08-30 21:45:29 +00:00
|
|
|
|
2021-01-18 09:26:21 +00:00
|
|
|
readonly attribute ACString drmRenderDevice;
|
|
|
|
|
2015-07-13 08:12:26 +00:00
|
|
|
/**
|
|
|
|
* Returns an array of objects describing each monitor. Guaranteed properties
|
|
|
|
* are "screenWidth" and "screenHeight". This is only implemented on Desktop.
|
|
|
|
*
|
|
|
|
* Windows additionally supplies "refreshRate" and "pseudoDisplay".
|
|
|
|
*
|
|
|
|
* OS X additionally supplies "scale".
|
|
|
|
*/
|
|
|
|
[implicit_jscontext]
|
|
|
|
jsval getMonitors();
|
|
|
|
|
2019-06-07 20:13:56 +00:00
|
|
|
Array<ACString> getFailures(out Array<long> indices);
|
2011-02-07 19:44:48 +00:00
|
|
|
|
|
|
|
[noscript, notxpcom] void logFailure(in ACString failure);
|
2024-10-05 15:10:32 +00:00
|
|
|
|
|
|
|
%{C++
|
2010-08-30 21:45:29 +00:00
|
|
|
/*
|
|
|
|
* A set of constants for features that we can ask this GfxInfo object
|
|
|
|
* about via GetFeatureStatus
|
|
|
|
*/
|
2024-10-05 15:10:32 +00:00
|
|
|
enum FeatureType : uint8_t {
|
|
|
|
FEATURE_INVALID = 0,
|
|
|
|
#define GFXINFO_FEATURE(id, name, pref) FEATURE_##id,
|
|
|
|
#include "mozilla/widget/GfxInfoFeatureDefs.h"
|
|
|
|
#undef GFXINFO_FEATURE
|
|
|
|
FEATURE_COUNT,
|
|
|
|
/* This must be the first value after INVALID/ALL/OPTIONAL. */
|
|
|
|
FEATURE_START = FEATURE_DIRECT2D
|
|
|
|
};
|
2010-08-30 21:45:29 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* A set of return values from GetFeatureStatus
|
|
|
|
*/
|
2024-10-05 15:10:32 +00:00
|
|
|
enum FeatureStatusType : uint8_t {
|
|
|
|
FEATURE_STATUS_INVALID = 0,
|
|
|
|
#define GFXINFO_FEATURE_STATUS(id) FEATURE_##id,
|
|
|
|
#include "mozilla/widget/GfxInfoFeatureStatusDefs.h"
|
|
|
|
#undef GFXINFO_FEATURE_STATUS
|
|
|
|
};
|
|
|
|
%}
|
2010-08-30 21:45:29 +00:00
|
|
|
|
|
|
|
/**
|
2016-04-13 21:12:47 +00:00
|
|
|
* Ask about a feature, and return the status of that feature.
|
|
|
|
* If the feature is not ok then aFailureId will give a unique failure Id
|
|
|
|
* otherwise it will be empty.
|
2010-08-30 21:45:29 +00:00
|
|
|
*/
|
2016-04-13 21:12:47 +00:00
|
|
|
long getFeatureStatus(in long aFeature, [optional] out ACString aFailureId);
|
2024-10-05 15:10:32 +00:00
|
|
|
AString getFeatureStatusStr(in AString aFeature, [optional] out ACString aFailureId);
|
2010-10-07 04:40:08 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Ask about a feature, return the minimum driver version required for it if its status is
|
2016-07-29 02:43:33 +00:00
|
|
|
* FEATURE_BLOCKED_DRIVER_VERSION, otherwise return an empty string.
|
2010-10-07 04:40:08 +00:00
|
|
|
*/
|
2018-09-06 08:02:43 +00:00
|
|
|
AString getFeatureSuggestedDriverVersion(in long aFeature);
|
2024-10-05 15:10:32 +00:00
|
|
|
AString getFeatureSuggestedDriverVersionStr(in AString aFeature);
|
2010-12-16 20:49:54 +00:00
|
|
|
|
2011-09-07 21:17:44 +00:00
|
|
|
// only useful on X11
|
|
|
|
[noscript, notxpcom] void GetData();
|
2011-11-02 20:53:59 +00:00
|
|
|
|
2020-05-15 08:39:43 +00:00
|
|
|
/**
|
2020-10-23 15:12:41 +00:00
|
|
|
* Maximum refresh rate among detected monitors. -1 if unknown. aMixed is set
|
|
|
|
* to true if we know there are multiple displays and they have different
|
2022-05-06 23:37:25 +00:00
|
|
|
* refresh rates, else false. The returned value is in Hz.
|
2020-05-15 08:39:43 +00:00
|
|
|
*/
|
2020-10-23 15:12:41 +00:00
|
|
|
[noscript, notxpcom] long GetMaxRefreshRate(out boolean aMixed);
|
2020-05-15 08:39:43 +00:00
|
|
|
|
2011-11-02 20:53:59 +00:00
|
|
|
[implicit_jscontext]
|
|
|
|
jsval getInfo();
|
2015-07-19 21:50:35 +00:00
|
|
|
|
2016-04-29 04:52:56 +00:00
|
|
|
// Return an object describing all features that have been configured:
|
|
|
|
//
|
|
|
|
// "features": [
|
|
|
|
// // For each feature:
|
|
|
|
// {
|
|
|
|
// "name": <string>,
|
|
|
|
// "description": <string>,
|
|
|
|
// "status": <string>,
|
|
|
|
// "log": [
|
|
|
|
// // One or more log entries, the first denotes the default value.
|
|
|
|
// {
|
|
|
|
// "type": <string>, // "base", "user", "env", or "runtime"
|
|
|
|
// "status": <string>,
|
|
|
|
// "message": <string> // Set unless type is "base" and status is "available".
|
|
|
|
// }
|
|
|
|
// ]
|
|
|
|
// }
|
|
|
|
// ]
|
|
|
|
// "fallbacks": [
|
|
|
|
// // For each workaround:
|
|
|
|
// {
|
|
|
|
// "name:" <string>,
|
|
|
|
// "description": <string>,
|
|
|
|
// "message": <string>
|
|
|
|
// ]
|
|
|
|
// }
|
2016-05-05 18:42:12 +00:00
|
|
|
//
|
|
|
|
// When a message is prefixed with a '#', it is a special status code. Status
|
|
|
|
// codes are unique identifiers that can be searched in the codebase to find
|
|
|
|
// which line of code caused the message. Some codes are standardized to
|
|
|
|
// improve about:support messaging:
|
|
|
|
//
|
|
|
|
// "[CONTEXT_]FEATURE_FAILURE_BUG_<number>"
|
|
|
|
// CONTEXT is optional and can currently only be "BLOCKLIST".
|
|
|
|
// <number> refers to a bug number in Bugzilla.
|
|
|
|
//
|
2016-04-29 04:52:56 +00:00
|
|
|
[implicit_jscontext]
|
|
|
|
jsval getFeatureLog();
|
|
|
|
|
2015-07-19 21:50:35 +00:00
|
|
|
// Returns an object containing information about graphics features. It is
|
|
|
|
// intended to be directly included into the Telemetry environment.
|
|
|
|
//
|
|
|
|
// "layers":
|
|
|
|
// {
|
|
|
|
// "compositor": "d3d9", "d3d11", "opengl", "basic", or "none"
|
|
|
|
// // ("none" indicates no compositors have been created)
|
|
|
|
// // Feature is one of "d3d9", "d3d11", "opengl", "basic", or "d2d".
|
|
|
|
// "<feature>": {
|
|
|
|
// // Each backend can have one of the following statuses:
|
|
|
|
// // "unused" - This feature has not been requested.
|
|
|
|
// // "unavailable" - OS version or restriction prevents use.
|
|
|
|
// // "blocked" - An internal condition (such as safe mode) prevents use.
|
2020-06-23 15:14:24 +00:00
|
|
|
// // "blocklisted" - Blocked due to a blocklist restriction.
|
2020-02-13 16:06:41 +00:00
|
|
|
// // "denied" - Blocked due to allowlist restrictions.
|
2015-07-19 21:50:35 +00:00
|
|
|
// // "disabled" - User explicitly disabled this default feature.
|
|
|
|
// // "failed" - Feature failed to initialize.
|
|
|
|
// // "available" - User has this feature available by default.
|
|
|
|
// "status": "<status>",
|
|
|
|
// "version": "<version>",
|
|
|
|
// "warp": true|false, // D3D11 only.
|
|
|
|
// "textureSharing": true|false, // D3D11 only.
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
[implicit_jscontext]
|
|
|
|
jsval getFeatures();
|
2016-05-10 18:49:16 +00:00
|
|
|
|
|
|
|
// Returns an array listing any active crash guards.
|
|
|
|
//
|
|
|
|
// [
|
|
|
|
// {
|
2020-12-14 06:04:13 +00:00
|
|
|
// // Type is one of "d3d11layers", or "glcontext".
|
2016-05-10 18:49:16 +00:00
|
|
|
// "type": "<identifier>",
|
|
|
|
//
|
|
|
|
// // Preference that must be deleted/reset to retrigger the guard.
|
|
|
|
// "prefName": "<preference>",
|
|
|
|
// }
|
|
|
|
// ]
|
|
|
|
[implicit_jscontext]
|
|
|
|
jsval getActiveCrashGuards();
|
2017-01-27 00:35:55 +00:00
|
|
|
|
|
|
|
// Forces the GPU process to start or shutdown. This is intended only for
|
|
|
|
// xpcshell-tests.
|
|
|
|
boolean controlGPUProcessForXPCShell(in boolean aEnable);
|
2021-12-08 19:08:17 +00:00
|
|
|
|
2022-01-07 13:27:49 +00:00
|
|
|
// Kills the GPU process cleanly, without generating a crash dump.
|
|
|
|
// This is intended only for use by tests.
|
|
|
|
void killGPUProcessForTests();
|
|
|
|
|
2021-12-08 19:08:17 +00:00
|
|
|
// Causes the GPU process to crash. This is intended only for use by tests.
|
|
|
|
void crashGPUProcessForTests();
|
2010-08-13 15:43:35 +00:00
|
|
|
};
|