Bug 780868 - Only reuse MaskLayers on LayerManagers with the same backend type. r=nrc

This commit is contained in:
Matt Woodrow 2012-08-13 22:11:40 +12:00
parent 470534c6d3
commit c2e9a5d59c
2 changed files with 6 additions and 3 deletions

View File

@ -3109,7 +3109,7 @@ ContainerState::SetupMaskLayer(Layer *aLayer, const FrameLayerBuilder::Clip& aCl
// check to see if we can reuse a mask image
const MaskLayerImageCache::MaskLayerImageKey* key =
new MaskLayerImageCache::MaskLayerImageKey(roundedRects);
new MaskLayerImageCache::MaskLayerImageKey(roundedRects, aLayer->Manager()->GetBackendType());
const MaskLayerImageCache::MaskLayerImageKey* lookupKey = key;
nsRefPtr<ImageContainer> container =

View File

@ -113,8 +113,9 @@ public:
class MaskLayerImageKey
{
public:
MaskLayerImageKey(const nsTArray<PixelRoundedRect>& aRoundedClipRects)
: mLayerCount(0)
MaskLayerImageKey(const nsTArray<PixelRoundedRect>& aRoundedClipRects, layers::LayersBackend aBackend)
: mBackend(aBackend)
, mLayerCount(0)
, mRoundedClipRects(aRoundedClipRects)
{}
@ -132,6 +133,7 @@ public:
for (PRUint32 i = 0; i < mRoundedClipRects.Length(); ++i) {
hash = AddToHash(hash, mRoundedClipRects[i].Hash());
}
hash = AddToHash(hash, mBackend);
return hash;
}
@ -141,6 +143,7 @@ public:
return mRoundedClipRects == aOther.mRoundedClipRects;
}
layers::LayersBackend mBackend;
mutable PRUint32 mLayerCount;
nsTArray<PixelRoundedRect> mRoundedClipRects;
};