Bug 739679 - Part 5: Remove memset for 565 surfaces. r=mwoodrow

This commit is contained in:
Benoit Girard 2012-04-18 20:40:08 -04:00
parent 51549b38f1
commit 561a82215a
2 changed files with 8 additions and 5 deletions

View File

@ -79,10 +79,12 @@ BasicTiledLayerBuffer::PaintThebes(BasicTiledThebesLayer* aLayer,
long start = PR_IntervalNow();
#endif
if (UseSinglePaintBuffer()) {
SAMPLE_LABEL("BasicTiledLayerBuffer", "PaintThebesSingleBuffer");
const nsIntRect bounds = aPaintRegion.GetBounds();
mSinglePaintBuffer = new gfxImageSurface(gfxIntSize(bounds.width, bounds.height), GetFormat());
mSinglePaintBufferOffset = nsIntPoint(bounds.x, bounds.y);
{
SAMPLE_LABEL("BasicTiledLayerBuffer", "PaintThebesSingleBufferAlloc");
mSinglePaintBuffer = new gfxImageSurface(gfxIntSize(bounds.width, bounds.height), GetFormat(), !aLayer->CanUseOpaqueSurface());
mSinglePaintBufferOffset = nsIntPoint(bounds.x, bounds.y);
}
nsRefPtr<gfxContext> ctxt = new gfxContext(mSinglePaintBuffer);
ctxt->NewPath();
ctxt->Translate(gfxPoint(-bounds.x, -bounds.y));
@ -92,6 +94,7 @@ BasicTiledLayerBuffer::PaintThebes(BasicTiledThebesLayer* aLayer,
}
start = PR_IntervalNow();
#endif
SAMPLE_LABEL("BasicTiledLayerBuffer", "PaintThebesSingleBufferDraw");
mCallback(mThebesLayer, ctxt, aPaintRegion, aPaintRegion, mCallbackData);
}
@ -133,7 +136,7 @@ BasicTiledLayerBuffer::ValidateTileInternal(BasicTiledLayerTile aTile,
{
if (aTile == GetPlaceholderTile()) {
gfxImageSurface* tmpTile = new gfxImageSurface(gfxIntSize(GetTileLength(), GetTileLength()),
GetFormat());
GetFormat(), !mThebesLayer->CanUseOpaqueSurface());
aTile = BasicTiledLayerTile(tmpTile);
}

View File

@ -61,7 +61,7 @@ gfxReusableSurfaceWrapper::GetWritable(gfxImageSurface** aSurface)
}
// Something else is reading the surface, copy it
gfxImageSurface* copySurface = new gfxImageSurface(mSurface->GetSize(), mSurface->Format());
gfxImageSurface* copySurface = new gfxImageSurface(mSurface->GetSize(), mSurface->Format(), false);
copySurface->CopyFrom(mSurface);
*aSurface = copySurface;