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
parent c7cf0b5f09
commit 6929a01f36
2 changed files with 16 additions and 0 deletions

View File

@ -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

View File

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