зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 505fe9841b16 (bug 915940) on suspicion of Windows PGO-only compilation failures
This commit is contained in:
Родитель
e0603f52f4
Коммит
f1a11dfd16
|
@ -211,7 +211,6 @@ MemoryTextureClient::Allocate(uint32_t aSize)
|
|||
{
|
||||
MOZ_ASSERT(!mBuffer);
|
||||
mBuffer = new uint8_t[aSize];
|
||||
GfxHeapTexturesReporter::OnAlloc(mBuffer);
|
||||
mBufSize = aSize;
|
||||
return true;
|
||||
}
|
||||
|
@ -229,10 +228,9 @@ MemoryTextureClient::MemoryTextureClient(CompositableClient* aCompositable,
|
|||
MemoryTextureClient::~MemoryTextureClient()
|
||||
{
|
||||
MOZ_COUNT_DTOR(MemoryTextureClient);
|
||||
if (ShouldDeallocateInDestructor() && mBuffer) {
|
||||
if (ShouldDeallocateInDestructor()) {
|
||||
// if the buffer has never been shared we must deallocate it or ir would
|
||||
// leak.
|
||||
GfxHeapTexturesReporter::OnFree(mBuffer);
|
||||
delete mBuffer;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -535,9 +535,6 @@ MemoryTextureHost::~MemoryTextureHost()
|
|||
void
|
||||
MemoryTextureHost::DeallocateSharedData()
|
||||
{
|
||||
if (mBuffer) {
|
||||
GfxHeapTexturesReporter::OnFree(mBuffer);
|
||||
}
|
||||
delete[] mBuffer;
|
||||
}
|
||||
|
||||
|
|
|
@ -27,8 +27,6 @@ using namespace mozilla::ipc;
|
|||
namespace mozilla {
|
||||
namespace layers {
|
||||
|
||||
mozilla::Atomic<int32_t> GfxHeapTexturesReporter::sAmount;
|
||||
|
||||
SharedMemory::SharedMemoryType OptimalShmemType()
|
||||
{
|
||||
return SharedMemory::TYPE_BASIC;
|
||||
|
@ -90,7 +88,6 @@ ISurfaceAllocator::AllocSurfaceDescriptorWithCaps(const gfxIntSize& aSize,
|
|||
if (!data) {
|
||||
return false;
|
||||
}
|
||||
GfxHeapTexturesReporter::OnAlloc(data);
|
||||
#ifdef XP_MACOSX
|
||||
// Workaround a bug in Quartz where drawing an a8 surface to another a8
|
||||
// surface with OPERATOR_SOURCE still requires the destination to be clear.
|
||||
|
@ -138,8 +135,7 @@ ISurfaceAllocator::DestroySharedSurface(SurfaceDescriptor* aSurface)
|
|||
case SurfaceDescriptor::TSurfaceDescriptorD3D10:
|
||||
break;
|
||||
case SurfaceDescriptor::TMemoryImage:
|
||||
GfxHeapTexturesReporter::OnFree((uint8_t*)aSurface->get_MemoryImage().data());
|
||||
delete [] (uint8_t*)aSurface->get_MemoryImage().data();
|
||||
delete [] (unsigned char *)aSurface->get_MemoryImage().data();
|
||||
break;
|
||||
case SurfaceDescriptor::Tnull_t:
|
||||
case SurfaceDescriptor::T__None:
|
||||
|
|
|
@ -11,8 +11,6 @@
|
|||
#include "gfxASurface.h" // for gfxASurface, etc
|
||||
#include "gfxPoint.h" // for gfxIntSize
|
||||
#include "mozilla/ipc/SharedMemory.h" // for SharedMemory, etc
|
||||
#include "nsIMemoryReporter.h" // for MemoryUniReporter
|
||||
#include "mozilla/Atomics.h" // for Atomic
|
||||
|
||||
/*
|
||||
* FIXME [bjacob] *** PURE CRAZYNESS WARNING ***
|
||||
|
@ -27,8 +25,6 @@
|
|||
|
||||
class gfxASurface;
|
||||
class gfxSharedImageSurface;
|
||||
class MemoryTextureClient;
|
||||
class MemoryTextureHost;
|
||||
|
||||
namespace base {
|
||||
class Thread;
|
||||
|
@ -137,38 +133,6 @@ protected:
|
|||
~ISurfaceAllocator() {}
|
||||
};
|
||||
|
||||
class GfxHeapTexturesReporter MOZ_FINAL : public mozilla::MemoryUniReporter
|
||||
{
|
||||
public:
|
||||
GfxHeapTexturesReporter()
|
||||
: MemoryUniReporter("explicit/gfx/heap-textures", KIND_HEAP, UNITS_BYTES,
|
||||
"Heap memory shared between threads by texture clients and hosts.")
|
||||
{
|
||||
#ifdef DEBUG
|
||||
// There must be only one instance of this class, due to |sAmount|
|
||||
// being static.
|
||||
static bool hasRun = false;
|
||||
MOZ_ASSERT(!hasRun);
|
||||
hasRun = true;
|
||||
#endif
|
||||
}
|
||||
|
||||
static void OnAlloc(void* aPointer)
|
||||
{
|
||||
sAmount += MallocSizeOfOnAlloc(aPointer);
|
||||
}
|
||||
|
||||
static void OnFree(void* aPointer)
|
||||
{
|
||||
sAmount -= MallocSizeOfOnFree(aPointer);
|
||||
}
|
||||
|
||||
private:
|
||||
int64_t Amount() MOZ_OVERRIDE { return sAmount; }
|
||||
|
||||
static mozilla::Atomic<int32_t> sAmount;
|
||||
};
|
||||
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
#include "mozilla/layers/CompositorChild.h"
|
||||
#include "mozilla/layers/CompositorParent.h"
|
||||
#include "mozilla/layers/ImageBridgeChild.h"
|
||||
#include "mozilla/layers/ISurfaceAllocator.h" // for GfxHeapTexturesReporter
|
||||
|
||||
#include "prlog.h"
|
||||
#include "prenv.h"
|
||||
|
@ -442,8 +441,6 @@ gfxPlatform::Init()
|
|||
false);
|
||||
|
||||
CreateCMSOutputProfile();
|
||||
|
||||
NS_RegisterMemoryReporter(new GfxHeapTexturesReporter());
|
||||
}
|
||||
|
||||
void
|
||||
|
|
Загрузка…
Ссылка в новой задаче