mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 818643. Issue an NotifyRenderingChanged callback on nsDisplayItems when we invalidate anything to do with the display item. Make nsDisplayCanvasBackground override NotifyRenderingChanged to invalidate the cached background image. r=mattwoodrow
--HG-- extra : rebase_source : c28b2804d647a991f7d2cb8167fcf039c1835d75
This commit is contained in:
parent
db76bf8271
commit
dbadcb07b6
@ -2348,6 +2348,7 @@ ContainerState::InvalidateForLayerChange(nsDisplayItem* aItem,
|
||||
GetTranslationForThebesLayer(newThebesLayer));
|
||||
}
|
||||
}
|
||||
aItem->NotifyRenderingChanged();
|
||||
return;
|
||||
}
|
||||
if (!aNewLayer) {
|
||||
@ -2410,6 +2411,7 @@ ContainerState::InvalidateForLayerChange(nsDisplayItem* aItem,
|
||||
#endif
|
||||
}
|
||||
if (!combined.IsEmpty()) {
|
||||
aItem->NotifyRenderingChanged();
|
||||
InvalidatePostTransformRegion(newThebesLayer,
|
||||
combined.ScaleToOutsidePixels(data->mXScale, data->mYScale, mAppUnitsPerDevPixel),
|
||||
GetTranslationForThebesLayer(newThebesLayer));
|
||||
|
@ -855,7 +855,17 @@ public:
|
||||
aInvalidRegion->Or(GetBounds(aBuilder, &snap), geometry->mBounds);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Called when the area rendered by this display item has changed (been
|
||||
* invalidated or changed geometry) since the last paint. This includes
|
||||
* when the display item was not rendered at all in the last paint.
|
||||
* It does NOT get called when a display item was being rendered and no
|
||||
* longer is, because generally that means there is no display item to
|
||||
* call this method on.
|
||||
*/
|
||||
virtual void NotifyRenderingChanged() {}
|
||||
|
||||
/**
|
||||
* @param aSnap set to true if the edges of the rectangles of the opaque
|
||||
* region would be snapped to device pixels when drawing
|
||||
|
@ -239,7 +239,6 @@ nsDisplayCanvasBackground::Paint(nsDisplayListBuilder* aBuilder,
|
||||
BlitSurface(dest, destRect, surf);
|
||||
|
||||
GetUnderlyingFrame()->Properties().Set(nsIFrame::CachedBackgroundImage(), surf.forget().get());
|
||||
GetUnderlyingFrame()->AddStateBits(NS_FRAME_HAS_CACHED_BACKGROUND);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -181,6 +181,10 @@ public:
|
||||
mBackgroundStyle->mLayers[mLayer].mAttachment == NS_STYLE_BG_ATTACHMENT_FIXED &&
|
||||
!mBackgroundStyle->mLayers[mLayer].mImage.IsEmpty();
|
||||
}
|
||||
virtual void NotifyRenderingChanged() MOZ_OVERRIDE
|
||||
{
|
||||
mFrame->Properties().Delete(nsIFrame::CachedBackgroundImage());
|
||||
}
|
||||
|
||||
virtual void Paint(nsDisplayListBuilder* aBuilder,
|
||||
nsRenderingContext* aCtx) MOZ_OVERRIDE;
|
||||
|
@ -4867,10 +4867,6 @@ static void InvalidateFrameInternal(nsIFrame *aFrame, bool aHasDisplayItem = tru
|
||||
aFrame->Properties().Delete(nsIFrame::InvalidationRect());
|
||||
aFrame->RemoveStateBits(NS_FRAME_HAS_INVALID_RECT);
|
||||
}
|
||||
if (aFrame->HasAnyStateBits(NS_FRAME_HAS_CACHED_BACKGROUND)) {
|
||||
aFrame->Properties().Delete(nsIFrame::CachedBackgroundImage());
|
||||
aFrame->RemoveStateBits(NS_FRAME_HAS_CACHED_BACKGROUND);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -296,10 +296,6 @@ typedef uint64_t nsFrameState;
|
||||
// the frames for future reference.
|
||||
#define NS_FRAME_NO_COMPONENT_ALPHA NS_FRAME_STATE_BIT(45)
|
||||
|
||||
// Frame has a cached rasterization of anV
|
||||
// nsDisplayBackground display item
|
||||
#define NS_FRAME_HAS_CACHED_BACKGROUND NS_FRAME_STATE_BIT(46)
|
||||
|
||||
// The frame is a descendant of nsSVGTextFrame2 and is thus used for SVG
|
||||
// text layout.
|
||||
#define NS_FRAME_IS_SVG_TEXT NS_FRAME_STATE_BIT(47)
|
||||
|
Loading…
Reference in New Issue
Block a user