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
This commit is contained in:
bzbarsky%mit.edu 2007-06-13 22:34:06 +00:00
Родитель cfff75470d
Коммит a8c7df1be6
1 изменённых файлов: 5 добавлений и 1 удалений

Просмотреть файл

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