mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-03 12:35:58 +00:00
Bug 855221 - Don't flush from imgFrame::ImageUpdated(), which can be called from the decoder thread. r=jrmuizel
--HG-- extra : rebase_source : a52a6ed8dc4d0477593f0af8289bb14a61594a3a
This commit is contained in:
parent
95b5af7754
commit
c7a211e679
@ -228,6 +228,8 @@ nsresult imgFrame::Init(int32_t aX, int32_t aY, int32_t aWidth, int32_t aHeight,
|
||||
|
||||
nsresult imgFrame::Optimize()
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
if (gDisableOptimize)
|
||||
return NS_OK;
|
||||
|
||||
@ -486,6 +488,7 @@ void imgFrame::Draw(gfxContext *aContext, gfxPattern::GraphicsFilter aFilter,
|
||||
}
|
||||
}
|
||||
|
||||
// This can be called from any thread, but not simultaneously.
|
||||
nsresult imgFrame::ImageUpdated(const nsIntRect &aUpdateRect)
|
||||
{
|
||||
mDecoded.UnionRect(mDecoded, aUpdateRect);
|
||||
@ -495,10 +498,6 @@ nsresult imgFrame::ImageUpdated(const nsIntRect &aUpdateRect)
|
||||
nsIntRect boundsRect(mOffset, mSize);
|
||||
mDecoded.IntersectRect(mDecoded, boundsRect);
|
||||
|
||||
#ifdef XP_MACOSX
|
||||
if (mQuartzSurface)
|
||||
mQuartzSurface->Flush();
|
||||
#endif
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -575,6 +574,8 @@ void imgFrame::GetPaletteData(uint32_t **aPalette, uint32_t *length) const
|
||||
|
||||
nsresult imgFrame::LockImageData()
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
NS_ABORT_IF_FALSE(mLockCount >= 0, "Unbalanced locks and unlocks");
|
||||
if (mLockCount < 0) {
|
||||
return NS_ERROR_FAILURE;
|
||||
@ -630,6 +631,8 @@ nsresult imgFrame::LockImageData()
|
||||
|
||||
nsresult imgFrame::UnlockImageData()
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
NS_ABORT_IF_FALSE(mLockCount != 0, "Unlocking an unlocked image!");
|
||||
if (mLockCount == 0) {
|
||||
return NS_ERROR_FAILURE;
|
||||
@ -672,6 +675,8 @@ nsresult imgFrame::UnlockImageData()
|
||||
|
||||
void imgFrame::MarkImageDataDirty()
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
if (mImageSurface)
|
||||
mImageSurface->Flush();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user