Add tiling and paint worker count information to about:support. (bug 1432516, r=milan)

--HG--
extra : rebase_source : f2ce10a284f53b21ce5eb94f039808ec92f40685
extra : histedit_source : d3bbb62e946fe32f601cc7753513d2d30f2aa294
This commit is contained in:
Ryan Hunt 2018-01-23 15:52:13 -06:00
Родитель f1377cabeb
Коммит 27c33e0bdf
8 изменённых файлов: 35 добавлений и 2 удалений

Просмотреть файл

@ -122,6 +122,10 @@ PaintThread::AddRef()
/* static */ int32_t
PaintThread::CalculatePaintWorkerCount()
{
if (!gfxPlatform::GetPlatform()->UsesTiling()) {
return 0;
}
int32_t cpuCores = 1;
nsCOMPtr<nsIPropertyBag2> systemInfo = do_GetService(NS_SYSTEMINFO_CONTRACTID);
if (systemInfo) {

Просмотреть файл

@ -300,11 +300,11 @@ public:
void Release();
void AddRef();
static int32_t CalculatePaintWorkerCount();
private:
PaintThread();
static int32_t CalculatePaintWorkerCount();
bool Init();
void ShutdownOnPaintThread();
void InitOnPaintThread();

Просмотреть файл

@ -469,7 +469,9 @@ var snapshotFormatters = {
addRowFromKey("features", "webgl2Extensions");
addRowFromKey("features", "supportsHardwareH264", "hardwareH264");
addRowFromKey("features", "direct2DEnabled", "#Direct2D");
addRowFromKey("features", "usesTiling");
addRowFromKey("features", "offMainThreadPaintEnabled");
addRowFromKey("features", "offMainThreadPaintWorkerCount");
if ("directWriteEnabled" in data) {
let message = data.directWriteEnabled;

Просмотреть файл

@ -100,7 +100,9 @@ glcontextCrashGuard = OpenGL
resetOnNextRestart = Reset on Next Restart
gpuProcessKillButton = Terminate GPU Process
gpuDeviceResetButton = Trigger Device Reset
usesTiling = Uses Tiling
offMainThreadPaintEnabled = Off Main Thread Painting Enabled
offMainThreadPaintWorkerCount = Off Main Thread Painting Worker Count
audioBackend = Audio Backend
maxAudioChannels = Max Channels

Просмотреть файл

@ -472,7 +472,9 @@ var dataProviders = {
DWriteEnabled: "directWriteEnabled",
DWriteVersion: "directWriteVersion",
cleartypeParameters: "clearTypeParameters",
UsesTiling: "usesTiling",
OffMainThreadPaintEnabled: "offMainThreadPaintEnabled",
OffMainThreadPaintWorkerCount: "offMainThreadPaintWorkerCount",
};
for (let prop in gfxInfoProps) {

Просмотреть файл

@ -32,6 +32,7 @@
#include "mozilla/gfx/GPUProcessManager.h"
#include "mozilla/gfx/Logging.h"
#include "mozilla/gfx/gfxVars.h"
#include "mozilla/layers/PaintThread.h"
#include "MediaPrefs.h"
#include "gfxPrefs.h"
#include "gfxPlatform.h"
@ -1488,6 +1489,13 @@ GfxInfoBase::GetWebRenderEnabled(bool* aWebRenderEnabled)
return NS_OK;
}
NS_IMETHODIMP
GfxInfoBase::GetUsesTiling(bool* aUsesTiling)
{
*aUsesTiling = gfxPlatform::GetPlatform()->UsesTiling();
return NS_OK;
}
NS_IMETHODIMP
GfxInfoBase::GetOffMainThreadPaintEnabled(bool* aOffMainThreadPaintEnabled)
{
@ -1495,6 +1503,17 @@ GfxInfoBase::GetOffMainThreadPaintEnabled(bool* aOffMainThreadPaintEnabled)
return NS_OK;
}
NS_IMETHODIMP
GfxInfoBase::GetOffMainThreadPaintWorkerCount(int32_t* aOffMainThreadPaintWorkerCount)
{
if (gfxConfig::IsEnabled(Feature::OMTP)) {
*aOffMainThreadPaintWorkerCount = layers::PaintThread::CalculatePaintWorkerCount();
} else {
*aOffMainThreadPaintWorkerCount = 0;
}
return NS_OK;
}
NS_IMETHODIMP
GfxInfoBase::GetIsHeadless(bool* aIsHeadless)
{

Просмотреть файл

@ -63,7 +63,9 @@ public:
NS_IMETHOD GetUsingGPUProcess(bool *aOutValue) override;
NS_IMETHOD GetWebRenderEnabled(bool* aWebRenderEnabled) override;
NS_IMETHOD GetIsHeadless(bool* aIsHeadless) override;
NS_IMETHOD GetUsesTiling(bool* aUsesTiling) override;
NS_IMETHOD GetOffMainThreadPaintEnabled(bool* aOffMainThreadPaintEnabled) override;
NS_IMETHOD GetOffMainThreadPaintWorkerCount(int32_t* aOffMainThreadPaintWorkerCount) override;
// Initialization function. If you override this, you must call this class's
// version of Init first.

Просмотреть файл

@ -25,7 +25,9 @@ interface nsIGfxInfo : nsISupports
readonly attribute DOMString ContentBackend;
readonly attribute boolean WebRenderEnabled;
readonly attribute boolean isHeadless;
readonly attribute boolean UsesTiling;
readonly attribute boolean OffMainThreadPaintEnabled;
readonly attribute long OffMainThreadPaintWorkerCount;
// XXX: Switch to a list of devices, rather than explicitly numbering them.