Bug 1404181 - Part 7: Add a way to check if existing painted items might need to be redrawn for a sync decode. r=mstange

MozReview-Commit-ID: 98qxakaKolI

--HG--
extra : rebase_source : 079fe441ed82ef59b4300fc9d1a8ce5f0cf51b7b
This commit is contained in:
Matt Woodrow ext:(%2C%20Miko%20Mynttinen%20%3Cmikokm%40gmail.com%3E%2C%20Timothy%20Nikkel%20%3Ctnikkel%40gmail.com%3E) 2017-09-27 17:03:38 +13:00
Родитель 7aeb11cd77
Коммит 17aef36fd6
4 изменённых файлов: 65 добавлений и 0 удалений

Просмотреть файл

@ -188,6 +188,11 @@ public:
mOrdinal = f->GetOrdinal();
}
virtual bool InvalidateForSyncDecodeImages() const override
{
return ShouldInvalidateToSyncDecodeImages();
}
int32_t mOrdinal;
};

Просмотреть файл

@ -915,6 +915,11 @@ public:
{
return LAYER_ACTIVE;
}
virtual nsDisplayItemGeometry* AllocateGeometry(nsDisplayListBuilder* aBuilder) override
{
return new nsDisplayPluginGeometry(this, aBuilder);
}
};
static nsRect

Просмотреть файл

@ -348,6 +348,21 @@ private:
mozilla::UniquePtr<PluginFrameDidCompositeObserver> mDidCompositeObserver;
};
class nsDisplayPluginGeometry : public nsDisplayItemGenericGeometry
{
public:
nsDisplayPluginGeometry(nsDisplayItem *aItem, nsDisplayListBuilder* aBuilder)
: nsDisplayItemGenericGeometry(aItem, aBuilder)
{}
// Plugins MozPaintWait event depends on sync decode, so we always want
// to rebuild the display list when sync decoding.
virtual bool InvalidateForSyncDecodeImages() const override
{
return true;
}
};
class nsDisplayPlugin : public nsDisplayItem {
public:
nsDisplayPlugin(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame)
@ -391,6 +406,11 @@ public:
aManager);
}
virtual nsDisplayItemGeometry* AllocateGeometry(nsDisplayListBuilder* aBuilder) override
{
return new nsDisplayPluginGeometry(this, aBuilder);
}
virtual bool CreateWebRenderCommands(mozilla::wr::DisplayListBuilder& aBuilder,
mozilla::wr::IpcResourceUpdateQueue& aResources,
const StackingContextHelper& aSc,

Просмотреть файл

@ -61,6 +61,11 @@ public:
mBounds.MoveBy(aOffset);
}
virtual bool InvalidateForSyncDecodeImages() const
{
return false;
}
/**
* Bounds of the display item
*/
@ -170,6 +175,11 @@ public:
: nsDisplayItemGenericGeometry(aItem, aBuilder)
, nsImageGeometryMixin(aItem, aBuilder)
{ }
virtual bool InvalidateForSyncDecodeImages() const override
{
return ShouldInvalidateToSyncDecodeImages();
}
};
class nsDisplayItemBoundsGeometry : public nsDisplayItemGeometry
@ -189,6 +199,11 @@ public:
virtual void MoveBy(const nsPoint& aOffset) override;
virtual bool InvalidateForSyncDecodeImages() const override
{
return ShouldInvalidateToSyncDecodeImages();
}
nsRect mContentRect;
};
@ -201,6 +216,11 @@ public:
virtual void MoveBy(const nsPoint& aOffset) override;
virtual bool InvalidateForSyncDecodeImages() const override
{
return ShouldInvalidateToSyncDecodeImages();
}
nsRect mPositioningArea;
nsRect mDestRect;
};
@ -286,6 +306,11 @@ class nsDisplayMaskGeometry : public nsDisplaySVGEffectGeometry
public:
nsDisplayMaskGeometry(nsDisplayMask* aItem, nsDisplayListBuilder* aBuilder);
virtual bool InvalidateForSyncDecodeImages() const override
{
return ShouldInvalidateToSyncDecodeImages();
}
nsTArray<nsRect> mDestRects;
};
@ -295,6 +320,11 @@ class nsDisplayFilterGeometry : public nsDisplaySVGEffectGeometry
public:
nsDisplayFilterGeometry(nsDisplayFilter* aItem,
nsDisplayListBuilder* aBuilder);
virtual bool InvalidateForSyncDecodeImages() const override
{
return ShouldInvalidateToSyncDecodeImages();
}
};
class nsCharClipGeometry : public nsDisplayItemGenericGeometry
@ -316,6 +346,11 @@ public:
nsDisplayListBuilder* aBuilder,
const nsPoint& aFrameOffsetToViewport);
virtual bool InvalidateForSyncDecodeImages() const override
{
return ShouldInvalidateToSyncDecodeImages();
}
nsPoint mFrameOffsetToViewport;
};