NS_IMETHODIMP nsRenderingContextPh :: DrawImage(nsIImage *aImage, nscoord aX, nscoord aY, nscoord aWidth, nscoord aHeight) { PR_LOG(PhGfxLog, PR_LOG_DEBUG, ("nsRenderingContextPh::DrawImage2\n"));  nsresult res; nscoord x,y,w,h;  if (mClipRegion->IsEmpty()) {  PR_LOG(PhGfxLog, PR_LOG_DEBUG, ("nsRenderingContextPh::DrawImage2 drawing image with empty clip region\n")); printf("nsRenderingContextPh::DrawImage2 drawing image with empty clip region\n"); return NS_ERROR_FAILURE; }  x = aX; y = aY; w = aWidth; h = aHeight;  mTMatrix->TransformCoord(&x,&y,&w,&h);  SELECT(mSurface); res = aImage->Draw( *this, mSurface, x, y, w, h ); Mask = aImage->GetAlphaBits();  #ifdef DEBUG {  } #endif  PgFLUSH(); return res; }
NS_IMETHODIMP DrawImage(nsIImage *aImage, nscoord aX, nscoord aY, nscoord aWidth, nscoord aHeight) { nscoord x, y, w, h; x = aX; y = aY; w = aWidth; h = aHeight; mTranMatrix->TransformCoord(&x, &y, &w, &h); return (aImage->Draw(*this, mSurface, x, y, w, h)); }
NS_IMETHODIMP nsRenderingContextPh :: DrawImage(nsIImage *aImage, nscoord aX, nscoord aY,                                        nscoord aWidth, nscoord aHeight) {  PR_LOG(PhGfxLog, PR_LOG_DEBUG, ("nsRenderingContextPh::DrawImage2\n"));  nsresult res;  nscoord x,y,w,h;  if (mClipRegion->IsEmpty())  {    // this is bad!     PR_LOG(PhGfxLog, PR_LOG_DEBUG, ("nsRenderingContextPh::DrawImage2 drawing image with empty clip region\n"));     printf("nsRenderingContextPh::DrawImage2 drawing image with empty clip region\n");     return NS_ERROR_FAILURE;  }    x = aX;  y = aY;  w = aWidth;  h = aHeight;  mTMatrix->TransformCoord(&x,&y,&w,&h);  SELECT(mSurface);  res = aImage->Draw( *this, mSurface, x, y, w, h );  Mask = aImage->GetAlphaBits();#ifdef DEBUG{/*  PhImage_t *image;  PRUint32 w, h;    image = ((nsDrawingSurfacePh *)mSurface)->mPixmap;  ((nsDrawingSurfacePh *)mSurface)->GetDimensions(&w,&h);    unsigned char *ptr;  ptr = image->image;      do_bmp(ptr,image->bpl/3,w,h);*/}#endif  PgFLUSH();	//kedl  return res;}