зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1438207 - Finalize the current frame of an ICO decoder correctly. r=tnikkel
Originally we attempted to finalize the current frame from the contained decoder in nsICODecoder::FinishResource. This is wrong because we haven't acquired the frame from the contained decoder yet. This happens in nsICODecoder::GetFinalStateFromContainedDecoder, and so imgFrame::Finalize call should be moved there. This was causing us to use fallback image sharing with WebRender after a GPU process crash, instead of shared surfaces, because it can't get a new file handle for the surface data until we have finished writing all of the image data.
This commit is contained in:
Родитель
09da568225
Коммит
f6a1a2419b
|
@ -100,6 +100,13 @@ nsICODecoder::GetFinalStateFromContainedDecoder()
|
|||
mInvalidRect.UnionRect(mInvalidRect, mContainedDecoder->TakeInvalidRect());
|
||||
mCurrentFrame = mContainedDecoder->GetCurrentFrameRef();
|
||||
|
||||
// Finalize the frame which we deferred to ensure we could modify the final
|
||||
// result (e.g. to apply the BMP mask).
|
||||
MOZ_ASSERT(!mContainedDecoder->GetFinalizeFrames());
|
||||
if (mCurrentFrame) {
|
||||
mCurrentFrame->FinalizeSurface();
|
||||
}
|
||||
|
||||
// Propagate errors.
|
||||
nsresult rv = HasError() || mContainedDecoder->HasError()
|
||||
? NS_ERROR_FAILURE
|
||||
|
@ -664,13 +671,6 @@ nsICODecoder::FinishResource()
|
|||
MOZ_ASSERT_IF(mContainedDecoder->HasSize(),
|
||||
mContainedDecoder->Size() == mDirEntry->mSize);
|
||||
|
||||
// Finalize the frame which we deferred to ensure we could modify the final
|
||||
// result (e.g. to apply the BMP mask).
|
||||
MOZ_ASSERT(!mContainedDecoder->GetFinalizeFrames());
|
||||
if (mCurrentFrame) {
|
||||
mCurrentFrame->FinalizeSurface();
|
||||
}
|
||||
|
||||
return Transition::TerminateSuccess();
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче