Backed out changeset d5607eeaa106 (bug 1036654) for Windows build bustage on a CLOSED TREE

This commit is contained in:
Wes Kocher 2014-07-16 13:16:40 -07:00
parent a54650428d
commit 625bb4e56d
4 changed files with 4 additions and 57 deletions

View File

@ -12,8 +12,7 @@ using namespace mozilla::gl;
NS_IMPL_ISUPPORTS(GfxTexturesReporter, nsIMemoryReporter)
Atomic<size_t> GfxTexturesReporter::sAmount(0);
Atomic<size_t> GfxTexturesReporter::sTileWasteAmount(0);
int64_t GfxTexturesReporter::sAmount = 0;
static uint32_t
GetBitsPerTexel(GLenum format, GLenum type)

View File

@ -7,7 +7,6 @@
#ifndef GFXTEXTURESREPORTER_H_
#define GFXTEXTURESREPORTER_H_
#include "mozilla/Atomics.h"
#include "nsIMemoryReporter.h"
#include "GLTypes.h"
@ -44,49 +43,16 @@ public:
static void UpdateAmount(MemoryUse action, GLenum format, GLenum type,
int32_t tileWidth, int32_t tileHeight);
static void UpdateWasteAmount(int delta) {
sTileWasteAmount += delta;
}
NS_IMETHOD CollectReports(nsIHandleReportCallback* aHandleReport,
nsISupports* aData, bool aAnonymize)
{
MOZ_COLLECT_REPORT("gfx-tiles-waste", KIND_OTHER, UNITS_BYTES,
sTileWasteAmount,
"Memory lost due to tiles extending past content boundaries");
return MOZ_COLLECT_REPORT(
"gfx-textures", KIND_OTHER, UNITS_BYTES, sAmount,
"Memory used for storing GL textures.");
}
private:
static Atomic<size_t> sAmount;
// Count the amount of memory lost to tile waste
static Atomic<size_t> sTileWasteAmount;
};
class GfxTextureWasteTracker {
public:
GfxTextureWasteTracker()
: mBytes(0)
{
MOZ_COUNT_CTOR(GfxTextureWasteTracker);
}
void Update(size_t aPixelArea, size_t aBytesPerPixel) {
GfxTexturesReporter::UpdateWasteAmount(-mBytes);
mBytes = aPixelArea * aBytesPerPixel;
GfxTexturesReporter::UpdateWasteAmount(mBytes);
}
~GfxTextureWasteTracker() {
GfxTexturesReporter::UpdateWasteAmount(-mBytes);
MOZ_COUNT_DTOR(GfxTextureWasteTracker);
}
private:
GfxTextureWasteTracker(const GfxTextureWasteTracker& aRef);
size_t mBytes;
static int64_t sAmount;
};
}

View File

@ -26,7 +26,6 @@
#include "nsAutoPtr.h" // for nsRefPtr
#include "nsCOMPtr.h" // for already_AddRefed
#include "nsISupportsImpl.h" // for TextureImage::AddRef, etc
#include "GfxTexturesReporter.h"
class gfxReusableSurfaceWrapper;
class gfxImageSurface;
@ -352,14 +351,6 @@ public:
*/
virtual void WaitForBufferOwnership() {}
/**
* Track how much of this texture is wasted.
* For example we might allocate a 256x256 tile but only use 10x10.
*/
void SetWaste(int aWasteArea) {
mWasteTracker.Update(aWasteArea, BytesPerPixel(GetFormat()));
}
private:
/**
* Called once, just before the destructor.
@ -402,11 +393,10 @@ protected:
RefPtr<TextureChild> mActor;
RefPtr<ISurfaceAllocator> mAllocator;
TextureFlags mFlags;
FenceHandle mReleaseFenceHandle;
FenceHandle mAcquireFenceHandle;
gl::GfxTextureWasteTracker mWasteTracker;
bool mShared;
bool mValid;
FenceHandle mReleaseFenceHandle;
FenceHandle mAcquireFenceHandle;
friend class TextureChild;
friend class RemoveTextureFromCompositableTracker;

View File

@ -950,14 +950,6 @@ ClientTiledLayerBuffer::ValidateTile(TileClient aTile,
ctxt = nullptr;
drawTarget = nullptr;
nsIntRegion tileRegion =
nsIntRect(aTileOrigin.x, aTileOrigin.y,
GetScaledTileSize().width, GetScaledTileSize().height);
// Intersect this area with the portion that's invalid.
tileRegion = tileRegion.Sub(tileRegion, GetValidRegion());
tileRegion = tileRegion.Sub(tileRegion, aDirtyRegion); // Has now been validated
backBuffer->SetWaste(tileRegion.Area() * mResolution * mResolution);
backBuffer->Unlock();
if (createdTextureClient) {