Loading gfx/layers/PaintThread.cpp +10 −2 Original line number Diff line number Diff line Loading @@ -22,7 +22,7 @@ #include "mozilla/SyncRunnable.h" #include "nsIPropertyBag2.h" #include "nsServiceManagerUtils.h" #include "prsystem.h" #include "nsSystemInfo.h" // Uncomment the following line to dispatch sync runnables when // painting so that rasterization happens synchronously from Loading Loading @@ -156,7 +156,15 @@ PaintThread::AddRef() /* static */ int32_t PaintThread::CalculatePaintWorkerCount() { int32_t cpuCores = PR_GetNumberOfProcessors(); int32_t cpuCores = 1; nsCOMPtr<nsIPropertyBag2> systemInfo = do_GetService(NS_SYSTEMINFO_CONTRACTID); if (systemInfo) { nsresult rv = systemInfo->GetPropertyAsInt32(NS_LITERAL_STRING("cpucores"), &cpuCores); if (NS_FAILED(rv)) { cpuCores = 1; } } int32_t workerCount = gfxPrefs::LayersOMTPPaintWorkers(); // If not manually specified, default to (cpuCores * 3) / 4, and clamp Loading Loading
gfx/layers/PaintThread.cpp +10 −2 Original line number Diff line number Diff line Loading @@ -22,7 +22,7 @@ #include "mozilla/SyncRunnable.h" #include "nsIPropertyBag2.h" #include "nsServiceManagerUtils.h" #include "prsystem.h" #include "nsSystemInfo.h" // Uncomment the following line to dispatch sync runnables when // painting so that rasterization happens synchronously from Loading Loading @@ -156,7 +156,15 @@ PaintThread::AddRef() /* static */ int32_t PaintThread::CalculatePaintWorkerCount() { int32_t cpuCores = PR_GetNumberOfProcessors(); int32_t cpuCores = 1; nsCOMPtr<nsIPropertyBag2> systemInfo = do_GetService(NS_SYSTEMINFO_CONTRACTID); if (systemInfo) { nsresult rv = systemInfo->GetPropertyAsInt32(NS_LITERAL_STRING("cpucores"), &cpuCores); if (NS_FAILED(rv)) { cpuCores = 1; } } int32_t workerCount = gfxPrefs::LayersOMTPPaintWorkers(); // If not manually specified, default to (cpuCores * 3) / 4, and clamp Loading