Bug 777194. Part 2: Remove RETENTION_THRESHOLD. FrameLayerBuilder limits the complexity of visible regions anyway. r=bas

This commit is contained in:
Robert O'Callahan 2012-08-17 11:38:59 +12:00
Родитель 926420a445
Коммит 0cebdd894a
1 изменённых файлов: 18 добавлений и 29 удалений

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

@ -42,15 +42,7 @@ ThebesLayerD3D10::~ThebesLayerD3D10()
{
}
/**
* Retention threshold - amount of pixels intersection required to enable
* layer content retention. This is a guesstimate. Profiling could be done to
* figure out the optimal threshold.
*/
#define RETENTION_THRESHOLD 16384
void
ThebesLayerD3D10::InvalidateRegion(const nsIntRegion &aRegion)
{
mValidRegion.Sub(mValidRegion, aRegion);
@ -64,7 +56,6 @@ void ThebesLayerD3D10::CopyRegion(ID3D10Texture2D* aSrc, const nsIntPoint &aSrcO
nsIntRegionRectIterator iter(aCopyRegion);
const nsIntRect *r;
while ((r = iter.Next())) {
if (r->width * r->height > RETENTION_THRESHOLD) {
// Calculate the retained rectangle's position on the old and the new
// surface.
D3D10_BOX box;
@ -84,7 +75,6 @@ void ThebesLayerD3D10::CopyRegion(ID3D10Texture2D* aSrc, const nsIntPoint &aSrcO
retainedRegion.Or(retainedRegion, *r);
}
}
// Areas which were valid and were retained are still valid
aValidRegion->And(*aValidRegion, retainedRegion);
@ -219,8 +209,7 @@ ThebesLayerD3D10::Validate(ReadbackProcessor *aReadback)
// and we should silently ignore the failure. In the future when device
// failures are properly handled we should test for the type of failure
// and gracefully handle different failures. See bug 569081.
if (!oldTexture || !mTexture ||
largeRect.width * largeRect.height < RETENTION_THRESHOLD) {
if (!oldTexture || !mTexture) {
mValidRegion.SetEmpty();
} else {
CopyRegion(oldTexture, mTextureRect.TopLeft(),