Backed out changesets 90446493d402 and c4f4027f9f3a (bug 1179051) for crashes.

This commit is contained in:
Ryan VanderMeulen 2015-07-19 22:39:20 -04:00
parent 1c6931cc67
commit 734c9eb563
16 changed files with 21 additions and 427 deletions

View File

@ -1,36 +0,0 @@
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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/. */
#include "gfxTelemetry.h"
namespace mozilla {
namespace gfx {
const char*
FeatureStatusToString(FeatureStatus aStatus)
{
switch (aStatus) {
case FeatureStatus::Unused:
return "unused";
case FeatureStatus::Unavailable:
return "unavailable";
case FeatureStatus::Blocked:
return "blocked";
case FeatureStatus::Blacklisted:
return "blacklisted";
case FeatureStatus::Failed:
return "failed";
case FeatureStatus::Disabled:
return "disabled";
case FeatureStatus::Available:
return "available";
default:
MOZ_ASSERT_UNREACHABLE("missing status case");
return "unknown";
}
}
} // namespace gfx
} // namespace mozilla

View File

@ -1,46 +0,0 @@
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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/. */
#ifndef gfx_src_gfxTelemetry_h__
#define gfx_src_gfxTelemetry_h__
namespace mozilla {
namespace gfx {
// Describes the status of a graphics feature, in terms of whether or not we've
// attempted to initialize the feature, and if so, whether or not it succeeded
// (and if not, why).
enum class FeatureStatus
{
// This feature has not been requested.
Unused,
// This feature is unavailable due to Safe Mode or not being included with
// the operating system.
Unavailable,
// This feature was blocked for reasons outside the blacklist, such as a
// runtime test failing.
Blocked,
// This feature has been blocked by the graphics blacklist.
Blacklisted,
// This feature was attempted but failed to activate.
Failed,
// This feature was explicitly disabled by the user.
Disabled,
// This feature is available for use.
Available
};
const char* FeatureStatusToString(FeatureStatus aStatus);
} // namespace gfx
} // namespace mozilla
#endif // gfx_src_gfxTelemetry_h__

View File

@ -18,7 +18,6 @@ EXPORTS += [
'FilterSupport.h',
'gfxCore.h',
'gfxCrashReporterUtils.h',
'gfxTelemetry.h',
'nsBoundingMetrics.h',
'nsColor.h',
'nsColorNameList.h',
@ -57,7 +56,6 @@ UNIFIED_SOURCES += [
'DriverInitCrashDetection.cpp',
'FilterSupport.cpp',
'gfxCrashReporterUtils.cpp',
'gfxTelemetry.cpp',
'nsColor.cpp',
'nsFont.cpp',
'nsFontMetrics.cpp',

View File

@ -379,7 +379,6 @@ gfxPlatform::gfxPlatform()
, mTileHeight(-1)
, mAzureCanvasBackendCollector(this, &gfxPlatform::GetAzureBackendInfo)
, mApzSupportCollector(this, &gfxPlatform::GetApzSupportInfo)
, mCompositorBackend(layers::LayersBackend::LAYERS_NONE)
{
mAllowDownloadableFonts = UNINITIALIZED_VALUE;
mFallbackUsesCmaps = UNINITIALIZED_VALUE;
@ -411,12 +410,6 @@ gfxPlatform::GetPlatform()
return gPlatform;
}
bool
gfxPlatform::Initialized()
{
return !!gPlatform;
}
void RecordingPrefChanged(const char *aPrefName, void *aClosure)
{
if (Preferences::GetBool("gfx.2d.recording", false)) {
@ -2451,21 +2444,3 @@ gfxPlatform::GetCompositorBackends(bool useAcceleration, nsTArray<mozilla::layer
aBackends.AppendElement(LayersBackend::LAYERS_BASIC);
}
}
void
gfxPlatform::NotifyCompositorCreated(LayersBackend aBackend)
{
if (mCompositorBackend == aBackend) {
return;
}
NS_ASSERTION(mCompositorBackend == LayersBackend::LAYERS_NONE, "Compositor backend changed.");
// Set the backend before we notify so it's available immediately.
mCompositorBackend = aBackend;
// Notify that we created a compositor, so telemetry can update.
if (nsCOMPtr<nsIObserverService> obsvc = services::GetObserverService()) {
obsvc->NotifyObservers(nullptr, "compositor:created", nullptr);
}
}

View File

@ -159,12 +159,6 @@ public:
*/
static gfxPlatform *GetPlatform();
/**
* Returns whether or not graphics has been initialized yet. This is
* intended for Telemetry where we don't necessarily want to initialize
* graphics just to observe its state.
*/
static bool Initialized();
/**
* Shut down Thebes.
@ -637,11 +631,6 @@ public:
*/
static bool PerfWarnings();
void NotifyCompositorCreated(mozilla::layers::LayersBackend aBackend);
mozilla::layers::LayersBackend GetCompositorBackend() const {
return mCompositorBackend;
}
protected:
gfxPlatform();
virtual ~gfxPlatform();
@ -762,10 +751,6 @@ private:
mozilla::RefPtr<mozilla::gfx::DrawEventRecorder> mRecorder;
mozilla::RefPtr<mozilla::gl::SkiaGLGlue> mSkiaGlue;
// Backend that we are compositing with. NONE, if no compositor has been
// created yet.
mozilla::layers::LayersBackend mCompositorBackend;
};
#endif /* GFX_PLATFORM_H */

View File

@ -377,8 +377,6 @@ gfxWindowsPlatform::gfxWindowsPlatform()
, mIsWARP(false)
, mHasDeviceReset(false)
, mDoesD3D11TextureSharingWork(false)
, mD3D11Status(FeatureStatus::Unused)
, mD2DStatus(FeatureStatus::Unused)
{
mUseClearTypeForDownloadableFonts = UNINITIALIZED_VALUE;
mUseClearTypeAlways = UNINITIALIZED_VALUE;
@ -438,7 +436,7 @@ gfxWindowsPlatform::CanUseHardwareVideoDecoding()
return !IsWARP() && gfxPlatform::CanUseHardwareVideoDecoding();
}
FeatureStatus
void
gfxWindowsPlatform::InitD2DSupport()
{
#ifdef CAIRO_HAS_D2D_SURFACE
@ -460,41 +458,30 @@ gfxWindowsPlatform::InitD2DSupport()
// If D2D is blocked or D3D9 is prefered, and D2D is not force-enabled, then
// we don't attempt to use D2D.
if (!gfxPrefs::Direct2DForceEnabled()) {
if (d2dBlocked) {
return FeatureStatus::Blacklisted;
}
if (gfxPrefs::LayersPreferD3D9()) {
return FeatureStatus::Disabled;
}
if ((d2dBlocked || gfxPrefs::LayersPreferD3D9()) && !gfxPrefs::Direct2DForceEnabled()) {
return;
}
// Do not ever try to use D2D if it's explicitly disabled or if we're not
// using DWrite fonts.
if (gfxPrefs::Direct2DDisabled() || mUsingGDIFonts) {
return FeatureStatus::Disabled;
return;
}
if (!IsVistaOrLater() || !GetD3D11Device()) {
return FeatureStatus::Unavailable;
ID3D11Device* device = GetD3D11Device();
if (IsVistaOrLater() &&
!InSafeMode() &&
device &&
mDoesD3D11TextureSharingWork)
{
VerifyD2DDevice(gfxPrefs::Direct2DForceEnabled());
if (mD3D10Device && GetD3D11Device()) {
mRenderMode = RENDER_DIRECT2D;
mUseDirectWrite = true;
}
} else {
mD3D10Device = nullptr;
}
if (!mDoesD3D11TextureSharingWork) {
return FeatureStatus::Failed;
}
if (InSafeMode()) {
return FeatureStatus::Blocked;
}
VerifyD2DDevice(gfxPrefs::Direct2DForceEnabled());
if (!mD3D10Device || !GetD3D11Device()) {
return FeatureStatus::Failed;
}
mRenderMode = RENDER_DIRECT2D;
mUseDirectWrite = true;
return FeatureStatus::Available;
#else
return FeatureStatus::Unavailable;
#endif
}
@ -565,7 +552,7 @@ gfxWindowsPlatform::UpdateRenderMode()
mRenderMode = RENDER_GDI;
mUseDirectWrite = gfxPrefs::DirectWriteFontRenderingEnabled();
mD2DStatus = InitD2DSupport();
InitD2DSupport();
InitDWriteSupport();
uint32_t canvasMask = BackendTypeBit(BackendType::CAIRO);
@ -2069,17 +2056,15 @@ gfxWindowsPlatform::InitD3D11Devices()
mD3D11DeviceInitialized = true;
mDoesD3D11TextureSharingWork = false;
MOZ_ASSERT(!mD3D11Device);
MOZ_ASSERT(!mD3D11Device);
DriverInitCrashDetection detectCrashes;
if (InSafeMode() || detectCrashes.DisableAcceleration()) {
mD3D11Status = FeatureStatus::Blocked;
return;
}
D3D11Status status = CheckD3D11Support();
if (status == D3D11Status::Blocked) {
mD3D11Status = FeatureStatus::Blacklisted;
return;
}
@ -2089,7 +2074,6 @@ gfxWindowsPlatform::InitD3D11Devices()
if (!sD3D11CreateDeviceFn) {
// We should just be on Windows Vista or XP in this case.
mD3D11Status = FeatureStatus::Unavailable;
return;
}
@ -2113,7 +2097,6 @@ gfxWindowsPlatform::InitD3D11Devices()
(status == D3D11Status::TryWARP || status == D3D11Status::ForceWARP))
{
AttemptWARPDeviceCreation(featureLevels);
mD3D11Status = FeatureStatus::Failed;
}
if (!mD3D11Device) {
@ -2122,7 +2105,6 @@ gfxWindowsPlatform::InitD3D11Devices()
}
mD3D11Device->SetExceptionMode(0);
mD3D11Status = FeatureStatus::Available;
// We create our device for D2D content drawing here. Normally we don't use
// D2D content drawing when using WARP. However when WARP is forced by
@ -2427,32 +2409,3 @@ gfxWindowsPlatform::GetAcceleratedCompositorBackends(nsTArray<LayersBackend>& aB
}
}
}
FeatureStatus
gfxWindowsPlatform::GetD2D1Status()
{
if (GetD2DStatus() != FeatureStatus::Available ||
!Factory::SupportsD2D1())
{
return FeatureStatus::Unavailable;
}
if (!GetD3D11ContentDevice()) {
return FeatureStatus::Failed;
}
if (!gfxPrefs::Direct2DUse1_1()) {
return FeatureStatus::Disabled;
}
return FeatureStatus::Available;
}
unsigned
gfxWindowsPlatform::GetD3D11Version()
{
ID3D11Device* device = GetD3D11Device();
if (!device) {
return 0;
}
return device->GetFeatureLevel();
}

View File

@ -20,7 +20,6 @@
#include "gfxDWriteFonts.h"
#endif
#include "gfxPlatform.h"
#include "gfxTelemetry.h"
#include "gfxTypes.h"
#include "mozilla/Attributes.h"
#include "mozilla/Atomics.h"
@ -262,18 +261,6 @@ public:
}
bool SupportsApzTouchInput() const override;
// Return the diagnostic status of DirectX initialization. If
// initialization has not been attempted, this returns
// FeatureStatus::Unused.
mozilla::gfx::FeatureStatus GetD3D11Status() const {
return mD3D11Status;
}
mozilla::gfx::FeatureStatus GetD2DStatus() const {
return mD2DStatus;
}
unsigned GetD3D11Version();
mozilla::gfx::FeatureStatus GetD2D1Status();
virtual already_AddRefed<mozilla::gfx::VsyncSource> CreateHardwareVsyncSource() override;
static mozilla::Atomic<size_t> sD3D11MemoryUsed;
static mozilla::Atomic<size_t> sD3D9MemoryUsed;
@ -311,7 +298,7 @@ private:
bool AttemptD3D11ContentDeviceCreation(const nsTArray<D3D_FEATURE_LEVEL>& aFeatureLevels);
// Used by UpdateRenderMode().
mozilla::gfx::FeatureStatus InitD2DSupport();
void InitD2DSupport();
void InitDWriteSupport();
IDXGIAdapter1 *GetDXGIAdapter();
@ -339,9 +326,6 @@ private:
bool mDoesD3D11TextureSharingWork;
DeviceResetReason mDeviceResetReason;
mozilla::gfx::FeatureStatus mD3D11Status;
mozilla::gfx::FeatureStatus mD2DStatus;
virtual void GetPlatformCMSOutputProfile(void* &mem, size_t &size);
};

View File

@ -157,7 +157,6 @@ const PREF_UPDATE_AUTODOWNLOAD = "app.update.auto";
const EXPERIMENTS_CHANGED_TOPIC = "experiments-changed";
const SEARCH_ENGINE_MODIFIED_TOPIC = "browser-search-engine-modified";
const SEARCH_SERVICE_TOPIC = "browser-search-service";
const COMPOSITOR_CREATED_TOPIC = "compositor:created";
/**
* Get the current browser.
@ -810,14 +809,12 @@ EnvironmentCache.prototype = {
// Watch the search engine change and service topics.
Services.obs.addObserver(this, SEARCH_ENGINE_MODIFIED_TOPIC, false);
Services.obs.addObserver(this, SEARCH_SERVICE_TOPIC, false);
Services.obs.addObserver(this, COMPOSITOR_CREATED_TOPIC, false);
},
_removeObservers: function () {
// Remove the search engine change and service observers.
Services.obs.removeObserver(this, SEARCH_ENGINE_MODIFIED_TOPIC);
Services.obs.removeObserver(this, SEARCH_SERVICE_TOPIC);
Services.obs.removeObserver(this, COMPOSITOR_CREATED_TOPIC);
},
observe: function (aSubject, aTopic, aData) {
@ -837,12 +834,6 @@ EnvironmentCache.prototype = {
// Now that the search engine init is complete, record the default search choice.
this._updateSearchEngine();
break;
case COMPOSITOR_CREATED_TOPIC:
// Full graphics information is not available until we have created at
// least one off-main-thread-composited window. Thus we wait for the
// first compositor to be created and then query nsIGfxInfo again.
this._onCompositorCreated();
break;
}
},
@ -905,19 +896,6 @@ EnvironmentCache.prototype = {
this._onEnvironmentChange("search-engine-changed", oldEnvironment);
},
/**
* Update the graphics features object.
*/
_onCompositorCreated: function () {
let gfxData = this._currentEnvironment.system.gfx;
try {
let gfxInfo = Cc["@mozilla.org/gfx/info;1"].getService(Ci.nsIGfxInfo);
gfxData.features = gfxInfo.getFeatures();
} catch (e) {
this._log.error("nsIGfxInfo.getFeatures() caught error", e);
}
},
/**
* Get the build data in object form.
* @return Object containing the build data.
@ -1150,7 +1128,6 @@ EnvironmentCache.prototype = {
//DWriteVersion: getGfxField("DWriteVersion", null),
adapters: [],
monitors: [],
features: {},
};
#if !defined(MOZ_WIDGET_GONK) && !defined(MOZ_WIDGET_ANDROID) && !defined(MOZ_WIDGET_GTK)
@ -1162,13 +1139,6 @@ EnvironmentCache.prototype = {
}
#endif
try {
let gfxInfo = Cc["@mozilla.org/gfx/info;1"].getService(Ci.nsIGfxInfo);
gfxData.features = gfxInfo.getFeatures();
} catch (e) {
this._log.error("nsIGfxInfo.getFeatures() caught error", e);
}
// GfxInfo does not yet expose a way to iterate through all the adapters.
gfxData.adapters.push(getGfxAdapter(""));
gfxData.adapters[0].GPUActive = true;

View File

@ -145,28 +145,6 @@ Structure::
},
...
],
features: {
compositor: <string>, // Layers backend for compositing (eg "d3d11", "none", "opengl")
// Each the following features can have one of the following statuses:
// "unused" - This feature has not been requested.
// "unavailable" - Safe Mode or OS restriction prevents use.
// "blocked" - Blocked due to an internal condition such as safe mode.
// "blacklisted" - Blocked due to a blacklist restriction.
// "disabled" - User explicitly disabled this default feature.
// "failed" - This feature was attempted but failed to initialize.
// "available" - User has this feature available.
"d3d11" { // This feature is Windows-only.
status: <string>,
warp: <bool>, // Software rendering (WARP) mode was chosen.
textureSharing: <bool> // Whether or not texture sharing works.
version: <number>, // The D3D11 device feature level.
},
"d2d" { // This feature is Windows-only.
status: <string>,
version: <string>, // Either "1.0" or "1.1".
},
},
},
},
addons: {

View File

@ -430,9 +430,6 @@ function checkSystemSection(data) {
}
}
Assert.equal(typeof gfxData.features, "object");
Assert.equal(typeof gfxData.features.compositor, "string");
try {
// If we've not got nsIGfxInfoDebug, then this will throw and stop us doing
// this test.
@ -442,9 +439,6 @@ function checkSystemSection(data) {
Assert.equal(GFX_VENDOR_ID, gfxData.adapters[0].vendorID);
Assert.equal(GFX_DEVICE_ID, gfxData.adapters[0].deviceID);
}
let features = gfxInfo.getFeatures();
Assert.equal(features.compositor, gfxData.features.compositor);
}
catch (e) {}
}

View File

@ -33,7 +33,6 @@
#include "mozilla/gfx/2D.h"
#include "mozilla/gfx/Logging.h"
#include "gfxPrefs.h"
#include "gfxPlatform.h"
#if defined(MOZ_CRASHREPORTER)
#include "nsExceptionHandler.h"
@ -1180,90 +1179,6 @@ GfxInfoBase::GetMonitors(JSContext* aCx, JS::MutableHandleValue aResult)
return NS_OK;
}
static const char*
GetLayersBackendName(layers::LayersBackend aBackend)
{
switch (aBackend) {
case layers::LayersBackend::LAYERS_NONE:
return "none";
case layers::LayersBackend::LAYERS_OPENGL:
return "opengl";
case layers::LayersBackend::LAYERS_D3D9:
return "d3d9";
case layers::LayersBackend::LAYERS_D3D11:
return "d3d11";
case layers::LayersBackend::LAYERS_CLIENT:
return "client";
default:
MOZ_ASSERT_UNREACHABLE("unknown layers backend");
return "unknown";
}
}
nsresult
GfxInfoBase::GetFeatures(JSContext* aCx, JS::MutableHandle<JS::Value> aOut)
{
JS::Rooted<JSObject*> obj(aCx, JS_NewPlainObject(aCx));
if (!obj) {
return NS_ERROR_OUT_OF_MEMORY;
}
aOut.setObject(*obj);
layers::LayersBackend backend = gfxPlatform::Initialized()
? gfxPlatform::GetPlatform()->GetCompositorBackend()
: layers::LayersBackend::LAYERS_NONE;
const char* backendName = GetLayersBackendName(backend);
{
JS::Rooted<JSString*> str(aCx, JS_NewStringCopyZ(aCx, backendName));
JS::Rooted<JS::Value> val(aCx, StringValue(str));
JS_SetProperty(aCx, obj, "compositor", val);
}
// If graphics isn't initialized yet, just stop now.
if (!gfxPlatform::Initialized()) {
return NS_OK;
}
DescribeFeatures(aCx, obj);
return NS_OK;
}
void
GfxInfoBase::DescribeFeatures(JSContext* cx, JS::Handle<JSObject*> aOut)
{
}
bool
GfxInfoBase::InitFeatureObject(JSContext* aCx,
JS::Handle<JSObject*> aContainer,
const char* aName,
mozilla::gfx::FeatureStatus aFeatureStatus,
JS::MutableHandle<JSObject*> aOutObj)
{
JS::Rooted<JSObject*> obj(aCx, JS_NewPlainObject(aCx));
if (!obj) {
return false;
}
const char* status = FeatureStatusToString(aFeatureStatus);
// Set "status".
{
JS::Rooted<JSString*> str(aCx, JS_NewStringCopyZ(aCx, status));
JS::Rooted<JS::Value> val(aCx, JS::StringValue(str));
JS_SetProperty(aCx, obj, "status", val);
}
// Add the feature object to the container.
{
JS::Rooted<JS::Value> val(aCx, JS::ObjectValue(*obj));
JS_SetProperty(aCx, aContainer, aName, val);
}
aOutObj.set(obj);
return true;
}
GfxInfoCollectorBase::GfxInfoCollectorBase()
{
GfxInfoBase::AddCollector(this);

View File

@ -19,7 +19,6 @@
#include "nsTArray.h"
#include "nsString.h"
#include "GfxInfoCollector.h"
#include "gfxTelemetry.h"
#include "nsIGfxInfoDebug.h"
#include "mozilla/Mutex.h"
#include "js/Value.h"
@ -59,7 +58,6 @@ public:
NS_IMETHOD GetFailures(uint32_t *failureCount, int32_t** indices, char ***failures) override;
NS_IMETHOD_(void) LogFailure(const nsACString &failure) override;
NS_IMETHOD GetInfo(JSContext*, JS::MutableHandle<JS::Value>) override;
NS_IMETHOD GetFeatures(JSContext*, JS::MutableHandle<JS::Value>) override;
// Initialization function. If you override this, you must call this class's
// version of Init first.
@ -105,14 +103,6 @@ protected:
// (while subclasses check for more specific ones).
virtual const nsTArray<GfxDriverInfo>& GetGfxDriverInfo() = 0;
virtual void DescribeFeatures(JSContext* aCx, JS::Handle<JSObject*> obj);
bool InitFeatureObject(
JSContext* aCx,
JS::Handle<JSObject*> aContainer,
const char* aName,
mozilla::gfx::FeatureStatus aFeatureStatus,
JS::MutableHandle<JSObject*> aOutObj);
private:
virtual int32_t FindBlocklistedDeviceInList(const nsTArray<GfxDriverInfo>& aDriverInfo,
nsAString& aSuggestedVersion,

View File

@ -1131,8 +1131,6 @@ void nsBaseWidget::CreateCompositor(int aWidth, int aHeight)
WindowUsesOMTC();
mLayerManager = lm.forget();
gfxPlatform::GetPlatform()->NotifyCompositorCreated(mLayerManager->GetCompositorBackendType());
}
bool nsBaseWidget::ShouldUseOffMainThreadCompositing()

View File

@ -8,7 +8,7 @@
/* NOTE: this interface is completely undesigned, not stable and likely to change */
[scriptable, uuid(98690931-c9a5-4675-9ab4-90932ec32bf2)]
[scriptable, uuid(47eedfa0-f7cb-445b-b5cf-a2ca83600560)]
interface nsIGfxInfo : nsISupports
{
/*
@ -147,31 +147,5 @@ interface nsIGfxInfo : nsISupports
[implicit_jscontext]
jsval getInfo();
// 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.
// // "blacklisted" - Blocked due to a blacklist restriction.
// // "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();
};

View File

@ -1255,42 +1255,6 @@ GfxInfo::FindMonitors(JSContext* aCx, JS::HandleObject aOutArray)
return NS_OK;
}
void
GfxInfo::DescribeFeatures(JSContext* aCx, JS::Handle<JSObject*> aObj)
{
JS::Rooted<JSObject*> obj(aCx);
gfxWindowsPlatform* platform = gfxWindowsPlatform::GetPlatform();
gfx::FeatureStatus d3d11 = platform->GetD3D11Status();
if (!InitFeatureObject(aCx, aObj, "d3d11", d3d11, &obj)) {
return;
}
if (d3d11 == gfx::FeatureStatus::Available) {
JS::Rooted<JS::Value> val(aCx, JS::Int32Value(platform->GetD3D11Version()));
JS_SetProperty(aCx, obj, "version", val);
val = JS::BooleanValue(platform->IsWARP());
JS_SetProperty(aCx, obj, "warp", val);
val = JS::BooleanValue(platform->DoesD3D11TextureSharingWork());
JS_SetProperty(aCx, obj, "textureSharing", val);
}
gfx::FeatureStatus d2d = platform->GetD2DStatus();
if (!InitFeatureObject(aCx, aObj, "d2d", d2d, &obj)) {
return;
}
{
const char* version = "1.0";
if (platform->GetD2D1Status() == gfx::FeatureStatus::Available)
version = "1.1";
JS::Rooted<JSString*> str(aCx, JS_NewStringCopyZ(aCx, version));
JS::Rooted<JS::Value> val(aCx, JS::StringValue(str));
JS_SetProperty(aCx, obj, "version", val);
}
}
#ifdef DEBUG
// Implement nsIGfxInfoDebug

View File

@ -68,8 +68,6 @@ protected:
OperatingSystem* aOS = nullptr);
virtual const nsTArray<GfxDriverInfo>& GetGfxDriverInfo();
void DescribeFeatures(JSContext* cx, JS::Handle<JSObject*> aOut) override;
private:
void AddCrashReportAnnotations();