mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 805343. Part 2: Update FrameLayerBuilder::HasVisibleRetainedDataFor to account for occluded display items. r=mattwoodrow
--HG-- extra : rebase_source : 293895627ef5f37c508a23fe9e9a5639527aafcc
This commit is contained in:
parent
7aebe60cc1
commit
4f25ab855f
@ -1102,13 +1102,15 @@ FrameLayerBuilder::GetDisplayItemDataForManager(nsDisplayItem* aItem,
|
||||
}
|
||||
|
||||
bool
|
||||
FrameLayerBuilder::HasRetainedDataFor(nsIFrame* aFrame, uint32_t aDisplayItemKey)
|
||||
FrameLayerBuilder::HasVisibleRetainedDataFor(nsIFrame* aFrame, uint32_t aDisplayItemKey)
|
||||
{
|
||||
nsTArray<DisplayItemData*> *array =
|
||||
reinterpret_cast<nsTArray<DisplayItemData*>*>(aFrame->Properties().Get(LayerManagerDataProperty()));
|
||||
if (array) {
|
||||
for (uint32_t i = 0; i < array->Length(); i++) {
|
||||
if (array->ElementAt(i)->mDisplayItemKey == aDisplayItemKey) {
|
||||
DisplayItemData* data = array->ElementAt(i);
|
||||
if (data->mDisplayItemKey == aDisplayItemKey &&
|
||||
data->IsVisibleInLayer()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -315,10 +315,10 @@ public:
|
||||
LayerManager* GetRetainingLayerManager() { return mRetainingManager; }
|
||||
|
||||
/**
|
||||
* Returns true if the given display item was rendered during the previous
|
||||
* paint. Returns false otherwise.
|
||||
* Returns true if the given display item was visible in its layer during
|
||||
* the previous paint. Returns false otherwise.
|
||||
*/
|
||||
static bool HasRetainedDataFor(nsIFrame* aFrame, uint32_t aDisplayItemKey);
|
||||
static bool HasVisibleRetainedDataFor(nsIFrame* aFrame, uint32_t aDisplayItemKey);
|
||||
|
||||
typedef void (*DisplayItemDataCallback)(nsIFrame *aFrame, DisplayItemData* aItem);
|
||||
|
||||
|
@ -4873,7 +4873,7 @@ void
|
||||
nsIFrame::InvalidateFrameSubtree(uint32_t aDisplayItemKey)
|
||||
{
|
||||
bool hasDisplayItem =
|
||||
!aDisplayItemKey || FrameLayerBuilder::HasRetainedDataFor(this, aDisplayItemKey);
|
||||
!aDisplayItemKey || FrameLayerBuilder::HasVisibleRetainedDataFor(this, aDisplayItemKey);
|
||||
InvalidateFrame(aDisplayItemKey);
|
||||
|
||||
if (HasAnyStateBits(NS_FRAME_ALL_DESCENDANTS_NEED_PAINT) || !hasDisplayItem) {
|
||||
@ -4919,7 +4919,7 @@ void
|
||||
nsIFrame::InvalidateFrame(uint32_t aDisplayItemKey)
|
||||
{
|
||||
bool hasDisplayItem =
|
||||
!aDisplayItemKey || FrameLayerBuilder::HasRetainedDataFor(this, aDisplayItemKey);
|
||||
!aDisplayItemKey || FrameLayerBuilder::HasVisibleRetainedDataFor(this, aDisplayItemKey);
|
||||
InvalidateFrameInternal(this, hasDisplayItem);
|
||||
}
|
||||
|
||||
@ -4927,7 +4927,7 @@ void
|
||||
nsIFrame::InvalidateFrameWithRect(const nsRect& aRect, uint32_t aDisplayItemKey)
|
||||
{
|
||||
bool hasDisplayItem =
|
||||
!aDisplayItemKey || FrameLayerBuilder::HasRetainedDataFor(this, aDisplayItemKey);
|
||||
!aDisplayItemKey || FrameLayerBuilder::HasVisibleRetainedDataFor(this, aDisplayItemKey);
|
||||
bool alreadyInvalid = false;
|
||||
if (!HasAnyStateBits(NS_FRAME_NEEDS_PAINT)) {
|
||||
InvalidateFrameInternal(this, hasDisplayItem);
|
||||
|
Loading…
Reference in New Issue
Block a user