Add a usingGPUProcess property to nsIGfxInfo. (bug 1317441 part 1, r=mattwoodrow)

This commit is contained in:
David Anderson
2016-11-14 15:02:02 -08:00
parent 73a85cfd72
commit 49768b31fb
3 changed files with 16 additions and 0 deletions

View File

@@ -30,6 +30,7 @@
#include "mozilla/Preferences.h"
#include "mozilla/dom/ContentChild.h"
#include "mozilla/gfx/2D.h"
#include "mozilla/gfx/GPUProcessManager.h"
#include "mozilla/gfx/Logging.h"
#include "MediaPrefs.h"
#include "gfxPrefs.h"
@@ -1427,6 +1428,19 @@ GfxInfoBase::GetContentBackend(nsAString & aContentBackend)
return NS_OK;
}
NS_IMETHODIMP
GfxInfoBase::GetUsingGPUProcess(bool *aOutValue)
{
GPUProcessManager* gpu = GPUProcessManager::Get();
if (!gpu) {
// Not supported in content processes.
return NS_ERROR_FAILURE;
}
*aOutValue = !!gpu->GetGPUChild();
return NS_OK;
}
GfxInfoCollectorBase::GfxInfoCollectorBase()
{
GfxInfoBase::AddCollector(this);

View File

@@ -59,6 +59,7 @@ public:
NS_IMETHOD GetFeatureLog(JSContext*, JS::MutableHandle<JS::Value>) override;
NS_IMETHOD GetActiveCrashGuards(JSContext*, JS::MutableHandle<JS::Value>) override;
NS_IMETHOD GetContentBackend(nsAString & aContentBackend) override;
NS_IMETHOD GetUsingGPUProcess(bool *aOutValue) override;
// Initialization function. If you override this, you must call this class's
// version of Init first.

View File

@@ -15,6 +15,7 @@ interface nsIGfxInfo : nsISupports
*/
readonly attribute boolean D2DEnabled;
readonly attribute boolean DWriteEnabled;
readonly attribute boolean usingGPUProcess;
readonly attribute DOMString DWriteVersion;
readonly attribute DOMString cleartypeParameters;