Bug 751916 - don't recycle tile if the format has changed. r=joe
authorBenoit Girard <b56girard@gmail.com>
Thu, 30 Aug 2012 15:35:36 -0400
changeset 110229 d04edff1ae419e88973956f0de96d883b4f604d0
parent 110228 ce60fb4481d56ababef289c328c8d865866ccf89
child 110230 021eea9c166beb065e84ca77162a91d13cfdc15c
push idunknown
push userunknown
push dateunknown
reviewersjoe
bugs751916
milestone18.0a1
Bug 751916 - don't recycle tile if the format has changed. r=joe
gfx/layers/basic/BasicTiledThebesLayer.cpp
--- a/gfx/layers/basic/BasicTiledThebesLayer.cpp
+++ b/gfx/layers/basic/BasicTiledThebesLayer.cpp
@@ -131,17 +131,17 @@ BasicTiledLayerBuffer::PaintThebes(Basic
   mSinglePaintBuffer = nullptr;
 }
 
 BasicTiledLayerTile
 BasicTiledLayerBuffer::ValidateTileInternal(BasicTiledLayerTile aTile,
                                             const nsIntPoint& aTileOrigin,
                                             const nsIntRect& aDirtyRect)
 {
-  if (aTile == GetPlaceholderTile()) {
+  if (aTile == GetPlaceholderTile() || aTile.mSurface->Format() != GetFormat()) {
     gfxImageSurface* tmpTile = new gfxImageSurface(gfxIntSize(GetTileLength(), GetTileLength()),
                                                    GetFormat(), !mThebesLayer->CanUseOpaqueSurface());
     aTile = BasicTiledLayerTile(tmpTile);
   }
 
   gfxRect drawRect(aDirtyRect.x - aTileOrigin.x, aDirtyRect.y - aTileOrigin.y,
                    aDirtyRect.width, aDirtyRect.height);