Enable parallel painting on OSX and cap the amount of paint workers to 4. (bug 1430793, r=milan)

--HG--
extra : rebase_source : 9d5c853f84b160819540cc062fb84f4bea8fcb02
This commit is contained in:
Ryan Hunt 2018-01-25 14:12:39 -06:00
parent a87c1eea8d
commit 43118373ed
2 changed files with 8 additions and 7 deletions

View File

@ -137,13 +137,10 @@ PaintThread::CalculatePaintWorkerCount()
int32_t workerCount = gfxPrefs::LayersOMTPPaintWorkers();
// If not manually specified, default to (cpuCores * 3) / 4
// If not manually specified, default to (cpuCores * 3) / 4, and clamp
// between 1 and 4. If a user wants more, they can manually specify it
if (workerCount < 1) {
workerCount = std::max((cpuCores * 3) / 4, 1);
if (workerCount > 32) {
workerCount = 32;
}
workerCount = std::min(std::max((cpuCores * 3) / 4, 1), 4);
}
return workerCount;

View File

@ -5935,5 +5935,9 @@ pref("layers.omtp.enabled", true);
#else
pref("layers.omtp.enabled", false);
#endif
pref("layers.omtp.release-capture-on-main-thread", false);
#if defined(XP_MACOSX)
pref("layers.omtp.paint-workers", -1);
#else
pref("layers.omtp.paint-workers", 1);
#endif
pref("layers.omtp.release-capture-on-main-thread", false);