Bug 789396 - Don't overwrite the existing mContainerLayerGeneration value on ThebesLayerItemsEntrys. r=roc

This commit is contained in:
Matt Woodrow 2012-09-12 09:17:26 +12:00
parent b5a6e210b0
commit 087d06c226
2 changed files with 10 additions and 3 deletions

View File

@ -2001,7 +2001,9 @@ FrameLayerBuilder::AddThebesDisplayItem(ThebesLayer* aLayer,
ThebesLayerItemsEntry* entry = mThebesLayerItems.PutEntry(aLayer);
if (entry) {
entry->mContainerLayerFrame = aContainerLayerFrame;
entry->mContainerLayerGeneration = mContainerLayerGeneration;
if (entry->mContainerLayerGeneration == 0) {
entry->mContainerLayerGeneration = mContainerLayerGeneration;
}
NS_ASSERTION(aItem->GetUnderlyingFrame(), "Must have frame");
ClippedDisplayItem* cdi =
entry->mItems.AppendElement(ClippedDisplayItem(aItem, aClip,
@ -2047,7 +2049,9 @@ FrameLayerBuilder::GetLastPaintOffset(ThebesLayer* aLayer)
{
ThebesLayerItemsEntry* entry = mThebesLayerItems.PutEntry(aLayer);
if (entry) {
entry->mContainerLayerGeneration = mContainerLayerGeneration;
if (entry->mContainerLayerGeneration == 0) {
entry->mContainerLayerGeneration = mContainerLayerGeneration;
}
if (entry->mHasExplicitLastPaintOffset)
return entry->mLastPaintOffset;
}
@ -2059,7 +2063,9 @@ FrameLayerBuilder::SaveLastPaintOffset(ThebesLayer* aLayer)
{
ThebesLayerItemsEntry* entry = mThebesLayerItems.PutEntry(aLayer);
if (entry) {
entry->mContainerLayerGeneration = mContainerLayerGeneration;
if (entry->mContainerLayerGeneration == 0) {
entry->mContainerLayerGeneration = mContainerLayerGeneration;
}
entry->mLastPaintOffset = GetTranslationForThebesLayer(aLayer);
entry->mHasExplicitLastPaintOffset = true;
}

View File

@ -566,6 +566,7 @@ public:
public:
ThebesLayerItemsEntry(const ThebesLayer *key) :
nsPtrHashKey<ThebesLayer>(key), mContainerLayerFrame(nullptr),
mContainerLayerGeneration(0),
mHasExplicitLastPaintOffset(false), mCommonClipCount(0) {}
ThebesLayerItemsEntry(const ThebesLayerItemsEntry &toCopy) :
nsPtrHashKey<ThebesLayer>(toCopy.mKey), mItems(toCopy.mItems)