From a8c7df1be60f668621e525431798289d9c134d06 Mon Sep 17 00:00:00 2001 From: "bzbarsky%mit.edu" Date: Wed, 13 Jun 2007 22:34:06 +0000 Subject: [PATCH] Don't create huge surfaces. We need a surface big enough to hold our widget's pixel dimensions, not twip dimensions. Bug 384266, r+sr=roc --- widget/src/gtk2/nsNativeThemeGTK.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/widget/src/gtk2/nsNativeThemeGTK.cpp b/widget/src/gtk2/nsNativeThemeGTK.cpp index c097b1506fa..3a42b1ec447 100644 --- a/widget/src/gtk2/nsNativeThemeGTK.cpp +++ b/widget/src/gtk2/nsNativeThemeGTK.cpp @@ -662,6 +662,8 @@ nsNativeThemeGTK::DrawWidgetBackground(nsIRenderingContext* aContext, gfxContext* ctx = (gfxContext*)aContext->GetNativeGraphicData(nsIRenderingContext::NATIVE_THEBES_CONTEXT); + + // XXXbz do we really want to round here, then snap, then round again? gfxRect rect(0, 0, NSAppUnitsToIntPixels(drawingRect.width, p2a), NSAppUnitsToIntPixels(drawingRect.height, p2a)); // Don't snap if it's a non-unit scale factor. We're going to have to take @@ -679,7 +681,9 @@ nsNativeThemeGTK::DrawWidgetBackground(nsIRenderingContext* aContext, ctx->SetMatrix(current); } else { renderer.Draw(gdk_x11_get_default_xdisplay(), ctx, - drawingRect.width, drawingRect.height, rendererFlags, nsnull); + NSToIntCeil(NSAppUnitsToFloatPixels(drawingRect.width, p2a)), + NSToIntCeil(NSAppUnitsToFloatPixels(drawingRect.height, p2a)), + rendererFlags, nsnull); } if (!safeState) {