mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-25 20:01:50 +00:00
Bug 1113435 - Only cull the fully rendered region when doing progressive draw. r=jrmuizel
--HG-- extra : rebase_source : 063a04e728be38aaf2dc812ead3957c001e61e64
This commit is contained in:
parent
d3c56bfcd0
commit
130ecad54e
@ -236,6 +236,8 @@ public:
|
||||
*/
|
||||
virtual const nsIntRegion& GetValidLowPrecisionRegion() const = 0;
|
||||
|
||||
virtual const nsIntRegion& GetValidRegion() const = 0;
|
||||
|
||||
#if defined(MOZ_WIDGET_GONK) && ANDROID_VERSION >= 17
|
||||
/**
|
||||
* Store a fence that will signal when the current buffer is no longer being read.
|
||||
|
@ -233,7 +233,7 @@ LayerManagerComposite::ApplyOcclusionCulling(Layer* aLayer, nsIntRegion& aOpaque
|
||||
!aLayer->GetMaskLayer() &&
|
||||
aLayer->GetLocalOpacity() == 1.0f) {
|
||||
if (aLayer->GetContentFlags() & Layer::CONTENT_OPAQUE) {
|
||||
localOpaque.Or(localOpaque, composite->GetShadowVisibleRegion());
|
||||
localOpaque.Or(localOpaque, composite->GetFullyRenderedRegion());
|
||||
}
|
||||
localOpaque.MoveBy(transform2d._31, transform2d._32);
|
||||
const nsIntRect* clip = aLayer->GetEffectiveClipRect();
|
||||
@ -1151,6 +1151,20 @@ LayerComposite::SetLayerManager(LayerManagerComposite* aManager)
|
||||
mCompositor = aManager->GetCompositor();
|
||||
}
|
||||
|
||||
nsIntRegion
|
||||
LayerComposite::GetFullyRenderedRegion() {
|
||||
if (TiledLayerComposer* tiled = GetTiledLayerComposer()) {
|
||||
nsIntRegion shadowVisibleRegion = GetShadowVisibleRegion();
|
||||
// Discard the region which hasn't been drawn yet when doing
|
||||
// progressive drawing. Note that if the shadow visible region
|
||||
// shrunk the tiled valig region may not have discarded this yet.
|
||||
shadowVisibleRegion.And(shadowVisibleRegion, tiled->GetValidRegion());
|
||||
return shadowVisibleRegion;
|
||||
} else {
|
||||
return GetShadowVisibleRegion();
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef MOZ_HAVE_PLATFORM_SPECIFIC_LAYER_BUFFERS
|
||||
|
||||
/*static*/ bool
|
||||
|
@ -441,6 +441,13 @@ public:
|
||||
bool HasLayerBeenComposited() { return mLayerComposited; }
|
||||
nsIntRect GetClearRect() { return mClearRect; }
|
||||
|
||||
/**
|
||||
* Return the part of the visible region that has been fully rendered.
|
||||
* While progressive drawing is in progress this region will be
|
||||
* a subset of the shadow visible region.
|
||||
*/
|
||||
nsIntRegion GetFullyRenderedRegion();
|
||||
|
||||
protected:
|
||||
gfx::Matrix4x4 mShadowTransform;
|
||||
nsIntRegion mShadowVisibleRegion;
|
||||
|
@ -231,6 +231,11 @@ public:
|
||||
return mLowPrecisionTiledBuffer.GetValidRegion();
|
||||
}
|
||||
|
||||
const nsIntRegion& GetValidRegion() const MOZ_OVERRIDE
|
||||
{
|
||||
return mTiledBuffer.GetValidRegion();
|
||||
}
|
||||
|
||||
virtual void SetCompositor(Compositor* aCompositor) MOZ_OVERRIDE
|
||||
{
|
||||
CompositableHost::SetCompositor(aCompositor);
|
||||
|
Loading…
x
Reference in New Issue
Block a user