From 818a6bd4fb594bd75f2fa8d08fc2c0399d350289 Mon Sep 17 00:00:00 2001 From: "vladimir%pobox.com" Date: Fri, 10 Nov 2006 23:34:05 +0000 Subject: [PATCH] b=359147, big images don't redraw, r=stuart git-svn-id: svn://10.0.0.236/trunk@215128 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/gfx/src/thebes/nsThebesImage.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/mozilla/gfx/src/thebes/nsThebesImage.cpp b/mozilla/gfx/src/thebes/nsThebesImage.cpp index 95c759c8e7a..e8f39b922a1 100644 --- a/mozilla/gfx/src/thebes/nsThebesImage.cpp +++ b/mozilla/gfx/src/thebes/nsThebesImage.cpp @@ -238,10 +238,18 @@ nsThebesImage::Optimize(nsIDeviceContext* aContext) // a distinction between DIB and DDB and we want to use DDBs as much // as we can. if (mWinSurface) { - nsRefPtr wsurf = mWinSurface->OptimizeToDDB(nsnull, mFormat, mWidth, mHeight); - if (wsurf) { - mOptSurface = wsurf; - } else { + // Don't do DDBs for large images; see bug 359147 + // We use 1024 as a reasonable sized maximum; the real fix + // will be to make sure we don't ever make a DDB that's bigger + // than the primary screen size (rule of thumb). + if (mWidth <= 1024 && mHeight <= 1024) { + nsRefPtr wsurf = mWinSurface->OptimizeToDDB(nsnull, mFormat, mWidth, mHeight); + if (wsurf) { + mOptSurface = wsurf; + } + } + + if (!mOptSurface) { // just use the DIB mOptSurface = mWinSurface; }