Backed out 2 changesets (bug 1473732) for devtools and web platform reftest leaks. CLOSED TREE

Backed out changeset 7742f4ea046b (bug 1473732)
Backed out changeset 3354b6d032f3 (bug 1473732)
This commit is contained in:
Cosmin Sabou 2018-07-30 20:52:11 +03:00
Родитель e748fd8968
Коммит 09c97210a7
2 изменённых файлов: 13 добавлений и 19 удалений

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

@ -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

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

@ -13,7 +13,6 @@
#include "SkAdvancedTypefaceMetrics.h"
#include "SkFDot6.h"
#include "SkMutex.h"
#include "SkPath.h"
#include "SkScalerContext.h"
#include "SkTypefaceCache.h"
@ -170,8 +169,6 @@ static bool isAxisAligned(const SkScalerContextRec& rec) {
bothZero(rec.fPost2x2[0][0], rec.fPost2x2[1][1]));
}
SK_DECLARE_STATIC_MUTEX(gTypefaceMutex);
class SkCairoFTTypeface : public SkTypeface {
public:
virtual SkStreamAsset* onOpenStream(int*) const override { return nullptr; }
@ -272,19 +269,9 @@ public:
}
private:
void internal_dispose() const override
{
SkAutoMutexAcquire lock(gTypefaceMutex);
internal_dispose_restore_refcnt_to_1();
delete this;
}
~SkCairoFTTypeface()
{
if (cairo_font_face_get_user_data(fFontFace, &kSkTypefaceKey) == this) {
cairo_font_face_set_user_data(fFontFace, &kSkTypefaceKey, nullptr, nullptr);
}
cairo_font_face_set_user_data(fFontFace, &kSkTypefaceKey, nullptr, nullptr);
cairo_font_face_destroy(fFontFace);
#ifdef CAIRO_HAS_FC_FONT
if (fPattern) {
@ -303,13 +290,12 @@ SkTypeface* SkCreateTypefaceFromCairoFTFontWithFontconfig(cairo_scaled_font_t* s
SkASSERT(cairo_font_face_status(fontFace) == CAIRO_STATUS_SUCCESS);
SkASSERT(cairo_font_face_get_type(fontFace) == CAIRO_FONT_TYPE_FT);
SkAutoMutexAcquire lock(gTypefaceMutex);
SkTypeface* typeface = reinterpret_cast<SkTypeface*>(cairo_font_face_get_user_data(fontFace, &kSkTypefaceKey));
if (typeface && typeface->getRefCnt() > 0) {
if (typeface) {
typeface->ref();
} else {
typeface = new SkCairoFTTypeface(fontFace, pattern);
SkTypefaceCache::Add(typeface);
}
return typeface;