aRC.CopyOffScreenBits(aDS,aSrcRect.x,aSrcRect.y,destRect,flag1);
aRC.CopyOffScreenBits(aDS,aSrcRect.x,aSrcRect.y,destRect,flag);
TileImage(nsIRenderingContext& aRC,nsDrawingSurface  aDS,nsRect &aSrcRect,PRInt16 aWidth,PRInt16 aHeight){nsRect  destRect;PRInt32 flag = NS_COPYBITS_TO_BACK_BUFFER | NS_COPYBITS_XFORM_DEST_VALUES | NS_COPYBITS_XFORM_SOURCE_VALUES;PRInt32 flag1 = NS_COPYBITS_TO_BACK_BUFFER | NS_COPYBITS_XFORM_DEST_VALUES;    if( aSrcRect.width < aWidth) {    // width is less than double so double our source bitmap width    destRect = aSrcRect;    destRect.x += aSrcRect.width;    aRC.CopyOffScreenBits(aDS,aSrcRect.x,aSrcRect.y,destRect,flag1);    aSrcRect.width*=2;     TileImage(aRC,aDS,aSrcRect,aWidth,aHeight);  } else if (aSrcRect.height < aHeight) {    // height is less than double so double our source bitmap height    destRect = aSrcRect;    destRect.y += aSrcRect.height;    aRC.CopyOffScreenBits(aDS,aSrcRect.x,aSrcRect.y,destRect,flag1);    aSrcRect.height*=2;    TileImage(aRC,aDS,aSrcRect,aWidth,aHeight);  } }