mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 853337 - Make sure we actually call Flush and MarkDirty on frames when we've done some decoding work. r=seth
This commit is contained in:
parent
1b4363a309
commit
1587c1c909
@ -610,7 +610,9 @@ nsresult
|
||||
nsICODecoder::AllocateFrame()
|
||||
{
|
||||
if (mContainedDecoder) {
|
||||
return mContainedDecoder->AllocateFrame();
|
||||
nsresult rv = mContainedDecoder->AllocateFrame();
|
||||
mCurrentFrame = mContainedDecoder->GetCurrentFrame();
|
||||
return rv;
|
||||
}
|
||||
|
||||
return Decoder::AllocateFrame();
|
||||
|
@ -188,6 +188,8 @@ Decoder::AllocateFrame()
|
||||
MOZ_ASSERT(mNeedsNewFrame);
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
MarkFrameDirty();
|
||||
|
||||
nsresult rv;
|
||||
if (mNewFrameData.mPaletteDepth) {
|
||||
rv = mImage.EnsureFrame(mNewFrameData.mFrameNum, mNewFrameData.mOffsetX,
|
||||
@ -329,8 +331,6 @@ Decoder::PostFrameStop(RasterImage::FrameAlpha aFrameAlpha /* = RasterImage::kFr
|
||||
// Flush any invalidations before we finish the frame
|
||||
FlushInvalidations();
|
||||
|
||||
mCurrentFrame = nullptr;
|
||||
|
||||
// Fire notifications
|
||||
if (mObserver) {
|
||||
mObserver->OnStopFrame();
|
||||
@ -403,5 +403,15 @@ Decoder::NeedNewFrame(uint32_t framenum, uint32_t x_offset, uint32_t y_offset,
|
||||
mNeedsNewFrame = true;
|
||||
}
|
||||
|
||||
void
|
||||
Decoder::MarkFrameDirty()
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
if (mCurrentFrame) {
|
||||
mCurrentFrame->MarkImageDataDirty();
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace image
|
||||
} // namespace mozilla
|
||||
|
@ -162,6 +162,12 @@ public:
|
||||
// status code from that attempt. Clears mNewFrameData.
|
||||
virtual nsresult AllocateFrame();
|
||||
|
||||
// Called when a chunk of decoding has been done and the frame needs to be
|
||||
// marked as dirty. Must be called only on the main thread.
|
||||
void MarkFrameDirty();
|
||||
|
||||
imgFrame* GetCurrentFrame() const { return mCurrentFrame; }
|
||||
|
||||
protected:
|
||||
|
||||
/*
|
||||
|
@ -3399,6 +3399,8 @@ RasterImage::FinishedSomeDecoding(eShutdownIntent aIntent /* = eShutdownIntent_D
|
||||
nsresult rv = NS_OK;
|
||||
|
||||
if (image->mDecoder) {
|
||||
image->mDecoder->MarkFrameDirty();
|
||||
|
||||
if (request && request->mChunkCount && !image->mDecoder->IsSizeDecode()) {
|
||||
Telemetry::Accumulate(Telemetry::IMAGE_DECODE_CHUNKS, request->mChunkCount);
|
||||
}
|
||||
|
@ -707,9 +707,36 @@ nsresult imgFrame::UnlockImageData()
|
||||
if (mQuartzSurface)
|
||||
mQuartzSurface->Flush();
|
||||
#endif
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void imgFrame::MarkImageDataDirty()
|
||||
{
|
||||
if (mImageSurface)
|
||||
mImageSurface->Flush();
|
||||
|
||||
#ifdef USE_WIN_SURFACE
|
||||
if (mWinSurface)
|
||||
mWinSurface->Flush();
|
||||
#endif
|
||||
|
||||
if (mImageSurface)
|
||||
mImageSurface->MarkDirty();
|
||||
|
||||
#ifdef USE_WIN_SURFACE
|
||||
if (mWinSurface)
|
||||
mWinSurface->MarkDirty();
|
||||
#endif
|
||||
|
||||
#ifdef XP_MACOSX
|
||||
// The quartz image surface (ab)uses the flush method to get the
|
||||
// cairo_image_surface data into a CGImage, so we have to call Flush() here.
|
||||
if (mQuartzSurface)
|
||||
mQuartzSurface->Flush();
|
||||
#endif
|
||||
}
|
||||
|
||||
int32_t imgFrame::GetTimeout() const
|
||||
{
|
||||
// Ensure a minimal time between updates so we don't throttle the UI thread.
|
||||
|
@ -69,6 +69,7 @@ public:
|
||||
|
||||
nsresult LockImageData();
|
||||
nsresult UnlockImageData();
|
||||
void MarkImageDataDirty();
|
||||
|
||||
nsresult GetSurface(gfxASurface **aSurface) const
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user