Add a usingGPUProcess property to nsIGfxInfo. (bug 1317441 part 1, r=mattwoodrow)
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user