Don't create huge surfaces. We need a surface big enough to hold our widget'spixel dimensions, not twip dimensions. Bug 384266, r+sr=roc

This commit is contained in:
bzbarsky@mit.edu 2007-06-13 15:34:06 -07:00
parent 5ecac60819
commit 83592e4d83

View File

@ -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) {