зеркало из https://github.com/mozilla/gecko-dev.git
Bug 937878 - Don't let too many ContentHostIncremental updates queue up. r=nrc
This commit is contained in:
Родитель
f3b6ab9782
Коммит
9ec181130a
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче