Backed out changeset 5368aced79b3 (bug 814437) because it breaks Android builds

This commit is contained in:
Ehsan Akhgari 2012-11-30 15:41:08 -05:00
parent 124f3b2486
commit 12de3548e2
5 changed files with 12 additions and 49 deletions

View File

@ -1148,6 +1148,7 @@ public:
* Can be used anytime
*/
const nsIntRegion& GetValidRegion() const { return mValidRegion; }
virtual const nsIntRegion& GetValidLowPrecisionRegion() const { return mValidRegion; }
virtual ThebesLayer* AsThebesLayer() { return this; }

View File

@ -191,12 +191,6 @@ public:
virtual void PaintedTiledLayerBuffer(const BasicTiledLayerBuffer* aTiledBuffer) = 0;
virtual void MemoryPressure() = 0;
/**
* If some part of the buffer is being rendered at a lower precision, this
* returns that region. If it is not, an empty region will be returned.
*/
virtual const nsIntRegion& GetValidLowPrecisionRegion() const = 0;
};
// Normal integer division truncates towards zero,

View File

@ -1684,26 +1684,13 @@ LayerManagerOGL::ComputeRenderIntegrityInternal(Layer* aLayer,
SubtractTransformedRegion(aScreenRegion, incompleteRegion, transformToScreen);
// See if there's any incomplete low-precision rendering
TiledLayerComposer* composer = nullptr;
ShadowLayer* shadow = aLayer->AsShadowLayer();
if (shadow) {
composer = shadow->AsTiledLayerComposer();
if (composer) {
incompleteRegion.Sub(incompleteRegion, composer->GetValidLowPrecisionRegion());
incompleteRegion.Sub(incompleteRegion, thebesLayer->GetValidLowPrecisionRegion());
if (!incompleteRegion.IsEmpty()) {
SubtractTransformedRegion(aLowPrecisionScreenRegion, incompleteRegion, transformToScreen);
}
}
}
// If we can't get a valid low precision region, assume it's the same as
// the high precision region.
if (!composer) {
SubtractTransformedRegion(aLowPrecisionScreenRegion, incompleteRegion, transformToScreen);
}
}
}
static int
GetRegionArea(const nsIntRegion& aRegion)
{
@ -1761,6 +1748,7 @@ LayerManagerOGL::ComputeRenderIntegrity()
#ifdef MOZ_ANDROID_OMTC
// Use the transform on the primary scrollable layer and its FrameMetrics
// to find out how much of the viewport the current displayport covers
bool hasLowPrecision = true;
Layer* primaryScrollable = GetPrimaryScrollableLayer();
if (primaryScrollable) {
// This is derived from the code in
@ -1780,39 +1768,17 @@ LayerManagerOGL::ComputeRenderIntegrity()
GetDisplayportCoverage(metrics.mCriticalDisplayPort, transform, screenRect);
}
// Clip the screen rect to the document bounds
gfxRect documentBounds =
transform.TransformBounds(gfxRect(metrics.mScrollableRect.x - metrics.mScrollOffset.x,
metrics.mScrollableRect.y - metrics.mScrollOffset.y,
metrics.mScrollableRect.width,
metrics.mScrollableRect.height));
documentBounds.RoundOut();
screenRect = screenRect.Intersect(nsIntRect(documentBounds.x, documentBounds.y,
documentBounds.width, documentBounds.height));
// If the screen rect is empty, the user has scrolled entirely into
// over-scroll and so we can be considered to have full integrity.
if (screenRect.IsEmpty()) {
return 1.0f;
}
// Work out how much of the display-port covers the screen
bool hasLowPrecision = false;
if (!metrics.mDisplayPort.IsEmpty()) {
if (hasLowPrecision) {
lowPrecisionMultiplier =
GetDisplayportCoverage(metrics.mDisplayPort, transform, screenRect);
} else {
lowPrecisionMultiplier = highPrecisionMultiplier =
highPrecisionMultiplier =
GetDisplayportCoverage(metrics.mDisplayPort, transform, screenRect);
}
}
}
// If none of the screen is covered, we have zero integrity.
if (highPrecisionMultiplier <= 0.0f && lowPrecisionMultiplier <= 0.0f) {
return 0.0f;
}
#endif // MOZ_ANDROID_OMTC
nsIntRegion screenRegion(screenRect);
@ -1832,7 +1798,7 @@ LayerManagerOGL::ComputeRenderIntegrity()
}
return ((highPrecisionIntegrity * highPrecisionMultiplier) +
(lowPrecisionIntegrity * lowPrecisionMultiplier)) / 2;
(lowPrecisionIntegrity * lowPrecisionMultiplier)) / 2.f;
}
return 1.f;

View File

@ -113,6 +113,9 @@ public:
TiledThebesLayerOGL(LayerManagerOGL *aManager);
virtual ~TiledThebesLayerOGL();
// Layer implementation
const nsIntRegion& GetValidLowPrecisionRegion() const { return mLowPrecisionVideoMemoryTiledBuffer.GetValidRegion(); }
// LayerOGL impl
void Destroy() {}
Layer* GetLayer() { return this; }
@ -132,7 +135,6 @@ public:
void PaintedTiledLayerBuffer(const BasicTiledLayerBuffer* mTiledBuffer);
void ProcessUploadQueue();
void ProcessLowPrecisionUploadQueue();
const nsIntRegion& GetValidLowPrecisionRegion() const { return mLowPrecisionVideoMemoryTiledBuffer.GetValidRegion(); }
void MemoryPressure();