Bug 739679 - Part 6: Fix unlocking gfxReusableSurface. r=pcwalton

This commit is contained in:
Benoit Girard 2012-04-23 20:08:18 -04:00
Родитель e62af607e0
Коммит 8946afadc7
4 изменённых файлов: 10 добавлений и 2 удалений

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

@ -116,8 +116,6 @@ protected:
int mRetainedHeight; // in tiles
private:
TiledLayerBuffer(const TiledLayerBuffer&) MOZ_DELETE;
const Derived& AsDerived() const { return *static_cast<const Derived*>(this); }
Derived& AsDerived() { return *static_cast<Derived*>(this); }

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

@ -79,6 +79,9 @@ class BasicTiledLayerBuffer : public TiledLayerBuffer<BasicTiledLayerBuffer, Bas
friend class TiledLayerBuffer<BasicTiledLayerBuffer, BasicTiledLayerTile>;
public:
BasicTiledLayerBuffer()
{}
void PaintThebes(BasicTiledThebesLayer* aLayer,
const nsIntRegion& aNewValidRegion,
const nsIntRegion& aPaintRegion,

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

@ -136,6 +136,12 @@ TiledThebesLayerOGL::ProcessUploadQueue()
mValidRegion = mVideoMemoryTiledBuffer.GetValidRegion();
mMainMemoryTiledBuffer.ReadUnlock();
// Release all the tiles by replacing the tile buffer with an empty
// tiled buffer. This will prevent us from doing a double unlock when
// calling ~TiledThebesLayerOGL.
// FIXME: This wont be needed when we do progressive upload and lock
// tile by tile.
mMainMemoryTiledBuffer = BasicTiledLayerBuffer();
mRegionToUpload = nsIntRegion();
}

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

@ -48,6 +48,7 @@ void
gfxReusableSurfaceWrapper::ReadUnlock()
{
PR_ATOMIC_DECREMENT(&mReadCount);
NS_ABORT_IF_FALSE(mReadCount >= 0, "Should not be negative");
}
gfxReusableSurfaceWrapper*