Bug 1439525 - Reset the cursor when swapping the shmems out. r?nical
Seems like a footgun to leave mCursor pointing to some random value when
the shmems have been swapped out. Currently nobody seems to be reusing
one of these things after a Flush() call but this should make things work
better if anybody tries.
MozReview-Commit-ID: AKfN0TlIMjU
--- a/gfx/layers/wr/IpcResourceUpdateQueue.cpp
+++ b/gfx/layers/wr/IpcResourceUpdateQueue.cpp
@@ -128,16 +128,17 @@ ShmSegmentsWriter::AllocLargeChunk(size_
void
ShmSegmentsWriter::Flush(nsTArray<RefCountedShmem>& aSmallAllocs, nsTArray<ipc::Shmem>& aLargeAllocs)
{
MOZ_ASSERT(aSmallAllocs.IsEmpty());
MOZ_ASSERT(aLargeAllocs.IsEmpty());
mSmallAllocs.SwapElements(aSmallAllocs);
mLargeAllocs.SwapElements(aLargeAllocs);
+ mCursor = 0;
}
void
ShmSegmentsWriter::Clear()
{
if (mShmAllocator) {
IpcResourceUpdateQueue::ReleaseShmems(mShmAllocator, mSmallAllocs);
IpcResourceUpdateQueue::ReleaseShmems(mShmAllocator, mLargeAllocs);