Bug 937878 - Don't let too many ContentHostIncremental updates queue up. r=nrc

This commit is contained in:
Matt Woodrow 2013-11-15 12:56:42 +13:00
Родитель f3b6ab9782
Коммит 9ec181130a
2 изменённых файлов: 16 добавлений и 0 удалений

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

@ -495,6 +495,7 @@ ContentHostIncremental::EnsureDeprecatedTextureHostIncremental(ISurfaceAllocator
mUpdateList.AppendElement(new TextureCreationRequest(aTextureInfo,
aBufferRect));
mDeAllocator = aAllocator;
FlushUpdateQueue();
}
void
@ -510,6 +511,20 @@ ContentHostIncremental::UpdateIncremental(TextureIdentifier aTextureId,
aUpdated,
aBufferRect,
aBufferRotation));
FlushUpdateQueue();
}
void
ContentHostIncremental::FlushUpdateQueue()
{
// If we're not compositing for some reason (the window being minimized
// is one example), then we never process these updates and it can consume
// huge amounts of memory. Instead we forcibly process the updates (during the
// transaction) if the list gets too long.
static const uint32_t kMaxUpdateCount = 6;
if (mUpdateList.Length() >= kMaxUpdateCount) {
ProcessTextureUpdates();
}
}
void

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

@ -296,6 +296,7 @@ public:
private:
void FlushUpdateQueue();
void ProcessTextureUpdates();
class Request