зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset ca73b950e612 (bug 1134762) for B2G crashtest failures.
This commit is contained in:
Родитель
f33031f3a5
Коммит
a31c9ee17c
|
@ -219,12 +219,6 @@ ClientTiledPaintedLayer::IsScrollingOnCompositor(const FrameMetrics& aParentMetr
|
|||
bool
|
||||
ClientTiledPaintedLayer::UseFastPath()
|
||||
{
|
||||
// The fast path doesn't allow rendering at low resolution. It will draw the low-res
|
||||
// area at full resolution and cause OOM.
|
||||
if (gfxPrefs::UseLowPrecisionBuffer()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
LayerMetricsWrapper scrollAncestor;
|
||||
GetAncestorLayers(&scrollAncestor, nullptr);
|
||||
if (!scrollAncestor) {
|
||||
|
@ -233,35 +227,16 @@ ClientTiledPaintedLayer::UseFastPath()
|
|||
const FrameMetrics& parentMetrics = scrollAncestor.Metrics();
|
||||
|
||||
bool multipleTransactionsNeeded = gfxPlatform::GetPlatform()->UseProgressivePaint()
|
||||
|| gfxPrefs::UseLowPrecisionBuffer()
|
||||
|| !parentMetrics.GetCriticalDisplayPort().IsEmpty();
|
||||
bool isFixed = GetIsFixedPosition() || GetParent()->GetIsFixedPosition();
|
||||
bool isScrollable = parentMetrics.IsScrollable();
|
||||
|
||||
return !multipleTransactionsNeeded || isFixed || !isScrollable;
|
||||
}
|
||||
|
||||
bool
|
||||
ClientTiledPaintedLayer::UseProgressiveDraw() {
|
||||
// Don't draw progressively in a reftest scenario (that's what the HasShadowTarget() check is for).
|
||||
if (!gfxPlatform::GetPlatform()->UseProgressivePaint() || ClientManager()->HasShadowTarget()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// XXX We probably want to disable progressive drawing for non active APZ layers in the future
|
||||
// but we should wait for a proper test case before making this change.
|
||||
|
||||
#if 0 //!defined(MOZ_WIDGET_ANDROID) || defined(MOZ_ANDROID_APZ)
|
||||
LayerMetricsWrapper scrollAncestor;
|
||||
GetAncestorLayers(&scrollAncestor, nullptr);
|
||||
if (!scrollAncestor) {
|
||||
return true;
|
||||
}
|
||||
const FrameMetrics& parentMetrics = scrollAncestor.Metrics();
|
||||
|
||||
return !IsScrollingOnCompositor(parentMetrics);
|
||||
#else
|
||||
return true;
|
||||
return !multipleTransactionsNeeded || isFixed || !isScrollable
|
||||
#if !defined(MOZ_WIDGET_ANDROID) || defined(MOZ_ANDROID_APZ)
|
||||
|| !IsScrollingOnCompositor(parentMetrics)
|
||||
#endif
|
||||
;
|
||||
}
|
||||
|
||||
bool
|
||||
|
@ -276,8 +251,10 @@ ClientTiledPaintedLayer::RenderHighPrecision(nsIntRegion& aInvalidRegion,
|
|||
return false;
|
||||
}
|
||||
|
||||
// Only draw progressively when the resolution is unchanged
|
||||
if (UseProgressiveDraw() &&
|
||||
// Only draw progressively when the resolution is unchanged, and we're not
|
||||
// in a reftest scenario (that's what the HasShadowManager() check is for).
|
||||
if (gfxPlatform::GetPlatform()->UseProgressivePaint() &&
|
||||
!ClientManager()->HasShadowTarget() &&
|
||||
mContentClient->mTiledBuffer.GetFrameResolution() == mPaintData.mResolution) {
|
||||
// Store the old valid region, then clear it before painting.
|
||||
// We clip the old valid region to the visible region, as it only gets
|
||||
|
@ -441,16 +418,6 @@ ClientTiledPaintedLayer::RenderLayer()
|
|||
ToClientLayer(GetMaskLayer())->RenderLayer();
|
||||
}
|
||||
|
||||
// In some cases we can take a fast path and just be done with it.
|
||||
if (UseFastPath()) {
|
||||
TILING_LOG("TILING %p: Taking fast-path\n", this);
|
||||
mValidRegion = neededRegion;
|
||||
mContentClient->mTiledBuffer.PaintThebes(mValidRegion, invalidRegion, callback, data);
|
||||
ClientManager()->Hold(this);
|
||||
mContentClient->UseTiledLayerBuffer(TiledContentClient::TILED_BUFFER);
|
||||
return;
|
||||
}
|
||||
|
||||
// For more complex cases we need to calculate a bunch of metrics before we
|
||||
// can do the paint.
|
||||
BeginPaint();
|
||||
|
@ -458,6 +425,32 @@ ClientTiledPaintedLayer::RenderLayer()
|
|||
return;
|
||||
}
|
||||
|
||||
// In some cases we can take a fast path and just be done with it.
|
||||
if (UseFastPath()) {
|
||||
TILING_LOG("TILING %p: Taking fast-path\n", this);
|
||||
mValidRegion = neededRegion;
|
||||
|
||||
// Make sure that tiles that fall outside of the visible region or outside of the
|
||||
// critical displayport are discarded on the first update. Also make sure that we
|
||||
// only draw stuff inside the critical displayport on the first update.
|
||||
if (!mPaintData.mCriticalDisplayPort.IsEmpty()) {
|
||||
mValidRegion.And(mValidRegion, LayerIntRect::ToUntyped(mPaintData.mCriticalDisplayPort));
|
||||
invalidRegion.And(invalidRegion, LayerIntRect::ToUntyped(mPaintData.mCriticalDisplayPort));
|
||||
}
|
||||
|
||||
if (invalidRegion.IsEmpty()) {
|
||||
EndPaint();
|
||||
return;
|
||||
}
|
||||
|
||||
mContentClient->mTiledBuffer.SetFrameResolution(mPaintData.mResolution);
|
||||
mContentClient->mTiledBuffer.PaintThebes(mValidRegion, invalidRegion, callback, data);
|
||||
ClientManager()->Hold(this);
|
||||
mContentClient->UseTiledLayerBuffer(TiledContentClient::TILED_BUFFER);
|
||||
EndPaint();
|
||||
return;
|
||||
}
|
||||
|
||||
// Make sure that tiles that fall outside of the visible region or outside of the
|
||||
// critical displayport are discarded on the first update. Also make sure that we
|
||||
// only draw stuff inside the critical displayport on the first update.
|
||||
|
|
|
@ -106,13 +106,6 @@ private:
|
|||
*/
|
||||
bool IsScrollingOnCompositor(const FrameMetrics& aParentMetrics);
|
||||
|
||||
/**
|
||||
* Check if we should use progressive draw on this layer. We will
|
||||
* disable progressive draw based on a preference or if the layer
|
||||
* is not being scrolled.
|
||||
*/
|
||||
bool UseProgressiveDraw();
|
||||
|
||||
/**
|
||||
* Helper function to do the high-precision paint.
|
||||
* This function returns true if it updated the paint buffer.
|
||||
|
|
Загрузка…
Ссылка в новой задаче