Commit acd8ea2c authored by Cosmin Sabou's avatar Cosmin Sabou
Browse files

Backed out changeset e354029775b8 (bug 1473732) for causing leaks at...

Backed out changeset e354029775b8 (bug 1473732) for causing leaks at gfxFT2FontBase::GetGlyph, GetCharWidth. CLOSED TREE
parent 80a830bc
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -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
@@ -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