Backed out changeset ac77b26ec1ee (bug 915940) for PGO build bustage

This commit is contained in:
Wes Kocher 2013-10-01 14:30:13 -07:00
parent 5dc1c55908
commit d7b977ae9b
5 changed files with 2 additions and 50 deletions

View File

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

View File

@ -537,9 +537,6 @@ MemoryTextureHost::~MemoryTextureHost()
void
MemoryTextureHost::DeallocateSharedData()
{
if (mBuffer) {
GfxHeapTexturesReporter::OnFree(mBuffer);
}
delete[] mBuffer;
}

View File

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

View File

@ -11,8 +11,6 @@
#include "gfxTypes.h"
#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 ***
@ -26,8 +24,6 @@
#endif
class gfxSharedImageSurface;
class MemoryTextureClient;
class MemoryTextureHost;
namespace base {
class Thread;
@ -136,38 +132,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

View File

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