Bug 906147 - Make sure we lock component alpha textures in the correct order to prevent deadlocks. r=nrc

This commit is contained in:
Matt Woodrow 2013-08-21 11:49:31 +12:00
parent ad0de92b78
commit 971cc56ca4

View File

@ -472,14 +472,20 @@ ContentClientDoubleBuffered::SyncFrontBufferToBackBuffer()
AutoDeprecatedTextureClient autoTextureFront;
AutoDeprecatedTextureClient autoTextureFrontOnWhite;
if (SupportsAzureContent()) {
RotatedBuffer frontBuffer(autoTextureFront.GetDrawTarget(mFrontClient),
autoTextureFrontOnWhite.GetDrawTarget(mFrontClientOnWhite),
// We need to ensure that we lock these two buffers in the same
// order as the compositor to prevent deadlocks.
DrawTarget* dt = autoTextureFront.GetDrawTarget(mFrontClient);
DrawTarget* dtOnWhite = autoTextureFrontOnWhite.GetDrawTarget(mFrontClientOnWhite);
RotatedBuffer frontBuffer(dt,
dtOnWhite,
mFrontBufferRect,
mFrontBufferRotation);
UpdateDestinationFrom(frontBuffer, updateRegion);
} else {
RotatedBuffer frontBuffer(autoTextureFront.GetSurface(mFrontClient),
autoTextureFrontOnWhite.GetSurface(mFrontClientOnWhite),
gfxASurface* surf = autoTextureFront.GetSurface(mFrontClient);
gfxASurface* surfOnWhite = autoTextureFrontOnWhite.GetSurface(mFrontClientOnWhite);
RotatedBuffer frontBuffer(surf,
surfOnWhite,
mFrontBufferRect,
mFrontBufferRotation);
UpdateDestinationFrom(frontBuffer, updateRegion);