Bug 1072871 - Make sure the targets don't disappear under us. r=benwa

This commit is contained in:
Milan Sreckovic 2014-12-15 12:10:06 -05:00
parent 8a59420134
commit 063f91af17

View File

@ -531,14 +531,12 @@ bool TextureClient::CopyToTextureClient(TextureClient* aTarget,
return false;
}
DrawTarget* destinationTarget = aTarget->BorrowDrawTarget();
DrawTarget* sourceTarget = BorrowDrawTarget();
RefPtr<DrawTarget> destinationTarget = aTarget->BorrowDrawTarget();
RefPtr<DrawTarget> sourceTarget = BorrowDrawTarget();
RefPtr<gfx::SourceSurface> source = sourceTarget->Snapshot();
destinationTarget->CopySurface(source,
aRect ? *aRect : gfx::IntRect(gfx::IntPoint(0, 0), GetSize()),
aPoint ? *aPoint : gfx::IntPoint(0, 0));
source = nullptr;
return true;
}