зеркало из https://github.com/mozilla/gecko-dev.git
Bug 539356 - Part 23 - Fix MovePixels crash when our surface is in an error state. r=jrmuizel
This commit is contained in:
Родитель
b489b85891
Коммит
bf589f8d22
|
@ -488,6 +488,13 @@ gfxASurface::MovePixels(const nsIntRect& aSourceRect,
|
|||
nsRefPtr<gfxASurface> tmp =
|
||||
CreateSimilarSurface(GetContentType(),
|
||||
gfxIntSize(aSourceRect.width, aSourceRect.height));
|
||||
// CreateSimilarSurface can return nsnull if the current surface is
|
||||
// in an error state. This isn't good, but its better to carry
|
||||
// on with the error surface instead of crashing.
|
||||
NS_ASSERTION(tmp, "Must have temporary surface to move pixels!");
|
||||
if (!tmp) {
|
||||
return;
|
||||
}
|
||||
nsRefPtr<gfxContext> ctx = new gfxContext(tmp);
|
||||
ctx->SetOperator(gfxContext::OPERATOR_SOURCE);
|
||||
ctx->SetSource(this, gfxPoint(-aSourceRect.x, -aSourceRect.y));
|
||||
|
|
Загрузка…
Ссылка в новой задаче