Bug 771350, part 0: Remove some dead code to make later patches clearer. r=BenWa

This commit is contained in:
Chris Jones 2012-07-23 16:58:35 -07:00
Родитель 11b999f514
Коммит 82f0a71400
2 изменённых файлов: 5 добавлений и 37 удалений

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

@ -878,8 +878,7 @@ public:
void DirectUpdate(gfxASurface* aUpdate, nsIntRegion& aRegion);
void Upload(gfxASurface* aUpdate, const nsIntRegion& aUpdated,
const nsIntRect& aRect, const nsIntPoint& aRotation,
bool aDelayUpload, nsIntRegion& aPendingUploadRegion);
const nsIntRect& aRect, const nsIntPoint& aRotation);
protected:
virtual nsIntPoint GetOriginOffset() {
@ -915,8 +914,7 @@ ShadowBufferOGL::DirectUpdate(gfxASurface* aUpdate, nsIntRegion& aRegion)
void
ShadowBufferOGL::Upload(gfxASurface* aUpdate, const nsIntRegion& aUpdated,
const nsIntRect& aRect, const nsIntPoint& aRotation,
bool aDelayUpload, nsIntRegion& aPendingUploadRegion)
const nsIntRect& aRect, const nsIntPoint& aRotation)
{
// aUpdated is in screen coordinates. Convert it to buffer coordinates.
nsIntRegion destRegion(aUpdated);
@ -935,16 +933,8 @@ ShadowBufferOGL::Upload(gfxASurface* aUpdate, const nsIntRegion& aUpdated,
((destBounds.y % size.height) + destBounds.height <= size.height),
"Updated region lies across rotation boundaries!");
if (aDelayUpload) {
// Record the region that needs to be updated, and clip it to the size of
// the texture.
aPendingUploadRegion.Or(aPendingUploadRegion, destRegion).
And(aPendingUploadRegion, nsIntRect(0, 0, size.width, size.height));
} else {
// NB: this gfxContext must not escape EndUpdate() below
DirectUpdate(aUpdate, destRegion);
aPendingUploadRegion.Sub(aPendingUploadRegion, destRegion);
}
// NB: this gfxContext must not escape EndUpdate() below
DirectUpdate(aUpdate, destRegion);
mBufferRect = aRect;
mBufferRotation = aRotation;
@ -982,7 +972,7 @@ ShadowThebesLayerOGL::Swap(const ThebesBuffer& aNewFront,
mBuffer = new ShadowBufferOGL(this);
}
AutoOpenSurface frontSurface(OPEN_READ_ONLY, aNewFront.buffer());
mBuffer->Upload(frontSurface.Get(), aUpdatedRegion, aNewFront.rect(), aNewFront.rotation(), false, mRegionPendingUpload);
mBuffer->Upload(frontSurface.Get(), aUpdatedRegion, aNewFront.rect(), aNewFront.rotation());
*aNewBack = aNewFront;
*aNewBackValidRegion = mValidRegion;
@ -993,13 +983,6 @@ ShadowThebesLayerOGL::Swap(const ThebesBuffer& aNewFront,
void
ShadowThebesLayerOGL::DestroyFrontBuffer()
{
mFrontBuffer.Clear();
mOldValidRegion.SetEmpty();
if (IsSurfaceDescriptorValid(mFrontBufferDescriptor)) {
mAllocator->DestroySharedSurface(&mFrontBufferDescriptor);
}
mBuffer = nsnull;
}

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

@ -125,7 +125,6 @@ public:
virtual void SetValidRegion(const nsIntRegion& aRegion)
{
mOldValidRegion = mValidRegion;
ShadowThebesLayer::SetValidRegion(aRegion);
}
@ -139,20 +138,6 @@ public:
private:
nsRefPtr<ShadowBufferOGL> mBuffer;
// When doing delayed texture upload, this is the region of the buffer that
// still requires uploading.
nsIntRegion mRegionPendingUpload;
// Following used for double-buffering
ShadowThebesLayerBufferOGL mFrontBuffer;
// Describes the gfxASurface we hand out to |mFrontBuffer|.
SurfaceDescriptor mFrontBufferDescriptor;
// When we receive an update from our remote partner, we stow away
// our previous parameters that described our previous front buffer.
// Then when we Swap() back/front buffers, we can return these
// parameters to our partner (adjusted as needed).
nsIntRegion mOldValidRegion;
};
} /* layers */