aPresContext->GetPixelsToTwips(&twipsPerPx);
twipsPerPx = aPresContext->PixelsToTwips();
nsSVGOuterSVGFrame::Paint(nsIPresContext* aPresContext,                          nsIRenderingContext& aRenderingContext,                          const nsRect& aDirtyRect,                          nsFramePaintLayer aWhichLayer,                          PRUint32 aFlags){  //    if (NS_FRAME_PAINT_LAYER_BACKGROUND == aWhichLayer) {//      if (GetStyleDisplay()->IsVisible() && mRect.width && mRect.height) {//        // Paint our background and border//        const nsStyleBorder* border = GetStyleBorder();//        const nsStylePadding* padding = GetStylePadding();//        const nsStyleOutline* outline = GetStyleOutline();//        nsRect  rect(0, 0, mRect.width, mRect.height);// //       nsCSSRendering::PaintBackground(aPresContext, aRenderingContext, this,// //                                       aDirtyRect, rect, *border, *padding, PR_TRUE);//        nsCSSRendering::PaintBorder(aPresContext, aRenderingContext, this,//                                    aDirtyRect, rect, *border, mStyleContext, 0);//        nsCSSRendering::PaintOutline(aPresContext, aRenderingContext, this,//                                    aDirtyRect, rect, *border, *outline, mStyleContext, 0);      //      }//    }  if (aWhichLayer != NS_FRAME_PAINT_LAYER_FOREGROUND) return NS_OK;  if (aDirtyRect.width<=0 || aDirtyRect.height<=0) return NS_OK;#if defined(DEBUG) && defined(SVG_DEBUG_PRINTING)  {    nsCOMPtr<nsIDeviceContext>  dx;    aRenderingContext.GetDeviceContext(*getter_AddRefs(dx));    float zoom,tzoom,scale;    dx->GetZoom(zoom);    dx->GetTextZoom(tzoom);    dx->GetCanonicalPixelScale(scale);    printf("nsSVGOuterSVGFrame(%p)::Paint()[ z=%f tz=%f ps=%f\n",this,zoom,tzoom,scale);    printf("dirtyrect= %d, %d, %d, %d\n", aDirtyRect.x, aDirtyRect.y, aDirtyRect.width, aDirtyRect.height);    nsTransform2D* xform;    aRenderingContext.GetCurrentTransform(xform);    printf("translation=(%f,%f)\n", xform->GetXTranslation(), xform->GetYTranslation());    float sx=1.0f,sy=1.0f;    xform->TransformNoXLate(&sx,&sy);    printf("scale=(%f,%f)\n", sx, sy);    float twipsPerScPx,twipsPerPx;    aPresContext->GetScaledPixelsToTwips(&twipsPerScPx);    aPresContext->GetPixelsToTwips(&twipsPerPx);    printf("tw/sc(px)=%f tw/px=%f\n", twipsPerScPx, twipsPerPx);    int fontsc;    aPresContext->GetFontScaler(&fontsc);    printf("font scale=%d\n",fontsc);    printf("]\n");  }#endif    // initialize Mozilla rendering context  aRenderingContext.PushState();    PRBool clipState;  aRenderingContext.SetClipRect(aDirtyRect,nsClipCombine_kIntersect,clipState);#if defined(DEBUG) && defined(SVG_DEBUG_PAINT_TIMING)  PRTime start = PR_Now();#endif  float pxPerTwips = GetPxPerTwips();  // XXX why do we need to inflate the rect here?   nsRect dirtyRectPx((int)(aDirtyRect.x*pxPerTwips), (int)(aDirtyRect.y*pxPerTwips),                     (int)(aDirtyRect.width*pxPerTwips), (int)(aDirtyRect.height*pxPerTwips));//   nsRect dirtyRectPx((int)(aDirtyRect.x*pxPerTwips-1), (int)(aDirtyRect.y*pxPerTwips-1),//                      (int)(aDirtyRect.width*pxPerTwips+2), (int)(aDirtyRect.height*pxPerTwips+2));    nsCOMPtr<nsISVGRendererCanvas> canvas;  mRenderer->CreateCanvas(&aRenderingContext, aPresContext, dirtyRectPx,                          getter_AddRefs(canvas));  canvas->Clear(NS_RGB(255,255,255));  // paint children:  for (nsIFrame* kid = mFrames.FirstChild(); kid;       kid = kid->GetNextSibling()) {    nsISVGChildFrame* SVGFrame=nsnull;    kid->QueryInterface(NS_GET_IID(nsISVGChildFrame),(void**)&SVGFrame);    if (SVGFrame)      SVGFrame->Paint(canvas, aDirtyRect);  }    canvas->Flush();  canvas = nsnull;#if defined(DEBUG) && defined(SVG_DEBUG_PAINT_TIMING)  PRTime end = PR_Now();  printf("SVG Paint Timing: %f ms\n", (end-start)/1000.0);#endif    aRenderingContext.PopState(clipState);    return NS_OK;  // see if we have to draw a selection frame around this container  //return nsFrame::Paint(aPresContext, aRenderingContext, aDirtyRect, aWhichLayer);}