Bug 1264142 - Add ImageLayerComposite::GetFullyRenderedRegion() r=mattwoodrow

This commit is contained in:
Sotaro Ikeda 2016-04-12 23:49:40 -07:00
parent 8897dad51c
commit 91dd2137b1
3 changed files with 20 additions and 1 deletions

View File

@ -168,6 +168,23 @@ ImageLayerComposite::IsOpaque()
return false;
}
nsIntRegion
ImageLayerComposite::GetFullyRenderedRegion()
{
if (!mImageHost ||
!mImageHost->IsAttached()) {
return GetShadowVisibleRegion().ToUnknownRegion();
}
if (mScaleMode == ScaleMode::STRETCH) {
nsIntRegion shadowVisibleRegion;
shadowVisibleRegion.And(GetShadowVisibleRegion().ToUnknownRegion(), nsIntRegion(gfx::IntRect(0, 0, mScaleToSize.width, mScaleToSize.height)));
return shadowVisibleRegion;
}
return GetShadowVisibleRegion().ToUnknownRegion();
}
CompositableHost*
ImageLayerComposite::GetCompositableHost()
{

View File

@ -61,6 +61,8 @@ public:
virtual bool IsOpaque() override;
virtual nsIntRegion GetFullyRenderedRegion() override;
protected:
virtual void PrintInfo(std::stringstream& aStream, const char* aPrefix) override;

View File

@ -527,7 +527,7 @@ public:
* While progressive drawing is in progress this region will be
* a subset of the shadow visible region.
*/
nsIntRegion GetFullyRenderedRegion();
virtual nsIntRegion GetFullyRenderedRegion();
protected:
gfx::Matrix4x4 mShadowTransform;