author | Matt Woodrow <mwoodrow@mozilla.com> |
Sat, 30 Jun 2012 15:06:13 +1200 | |
changeset 98025 | 3f8e99e9234442b96484b5fe66d9d39e57c63a20 |
parent 98024 | ba7021170544272ea019fce1323e3475b70a85ff |
child 98026 | 6e8c5c011767c7d7e5072dc27cb192750ce347c0 |
push id | 23017 |
push user | ryanvm@gmail.com |
push date | Sat, 30 Jun 2012 19:29:24 +0000 |
treeherder | mozilla-central@4c2ddc60f360 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | jrmuizel |
bugs | 539356 |
milestone | 16.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
--- a/gfx/thebes/gfxASurface.cpp +++ b/gfx/thebes/gfxASurface.cpp @@ -483,16 +483,23 @@ void gfxASurface::MovePixels(const nsIntRect& aSourceRect, const nsIntPoint& aDestTopLeft) { // Assume the backend can't handle self copying well and allocate // a temporary surface instead. 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)); ctx->Paint(); ctx = new gfxContext(this); ctx->SetOperator(gfxContext::OPERATOR_SOURCE); ctx->SetSource(tmp, gfxPoint(aDestTopLeft.x, aDestTopLeft.y));