Bug 1482956 - Use an AutoTArray in PaintTask to reduce heap allocations. r=nical
There should only ever be at most four TextureClients here, so allocated a vector seems wasteful.
This commit is contained in:
@@ -276,9 +276,9 @@ ContentClient::BeginPaint(PaintedLayer* aLayer,
|
||||
|
||||
if (result.mAsyncPaint) {
|
||||
result.mAsyncTask->mTarget = mBuffer->GetBufferTarget();
|
||||
result.mAsyncTask->mClients.push_back(mBuffer->GetClient());
|
||||
result.mAsyncTask->mClients.AppendElement(mBuffer->GetClient());
|
||||
if (mBuffer->GetClientOnWhite()) {
|
||||
result.mAsyncTask->mClients.push_back(mBuffer->GetClientOnWhite());
|
||||
result.mAsyncTask->mClients.AppendElement(mBuffer->GetClientOnWhite());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -887,9 +887,9 @@ ContentClientDoubleBuffered::FinalizeFrame(PaintState& aPaintState)
|
||||
mBuffer->UpdateDestinationFrom(*mFrontBuffer, updateRegion.GetBounds());
|
||||
|
||||
if (aPaintState.mAsyncPaint) {
|
||||
aPaintState.mAsyncTask->mClients.push_back(mFrontBuffer->GetClient());
|
||||
aPaintState.mAsyncTask->mClients.AppendElement(mFrontBuffer->GetClient());
|
||||
if (mFrontBuffer->GetClientOnWhite()) {
|
||||
aPaintState.mAsyncTask->mClients.push_back(mFrontBuffer->GetClientOnWhite());
|
||||
aPaintState.mAsyncTask->mClients.AppendElement(mFrontBuffer->GetClientOnWhite());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user