aSurface->DrawString("FillRect - The red line should be at the right edge under the rectangle\0", ox + 30, oy);
nsAutoString strText2(NS_LITERAL_STRING("FillRect - The red line should be at the right edge under the rectangle")); aSurface->DrawString(strText2, ox + 30, oy);
drawtest(nsIRenderingContext *aSurface){nsFont  *font;nsPoint *pointlist;   // Get the size of a pixel.  nsIDeviceContext* deviceContext;  aSurface->GetDeviceContext(deviceContext);  float p2t; // pixel to twips conversion  deviceContext->GetDevUnitsToAppUnits(p2t);  NS_RELEASE(deviceContext);  font = new nsFont("Times", NS_FONT_STYLE_NORMAL,NS_FONT_VARIANT_NORMAL,NS_FONT_WEIGHT_BOLD,0,12);  aSurface->SetFont(*font);   // Clear surface.  nsRect rect;  gWindow->GetClientBounds(rect);  aSurface->SetColor(NS_RGB(255, 255, 255));  aSurface->FillRect(0,0,rect.width,rect.height);  aSurface->SetColor(NS_RGB(255, 0, 0));  aSurface->DrawString("GFX - Pixel coverage test\0",150,30);  aSurface->DrawString("(Use (u, d, r, l) keys to scroll the window contents)\0",150,50);              aSurface->Translate(gOffsetX, gOffsetY);   // Starting coordinates  nscoord ox = 90; // pixels  nscoord oy = 100; // pixels   // Spacing between tests  nscoord yspacing = 50; // pixels    //--------------   // DrawLine TEST   //--------------  aSurface->SetColor(NS_RGB(255, 0, 0));  aSurface->DrawLine(pixelLoc(12, p2t, ox),                     pixelLoc(0,  p2t, oy),                      pixelLoc(12, p2t, ox),                      pixelLoc(10, p2t, oy));  aSurface->SetColor(NS_RGB(0, 0, 0));  aSurface->DrawLine(pixelLoc(0, p2t, ox),                     pixelLoc(10,p2t, oy),                      pixelLoc(12,p2t, ox),                      pixelLoc(10, p2t, oy));  aSurface->DrawString("DrawLine - There should be a one pixel gap where the red and black lines meet\0",ox + 30, oy);  oy += yspacing; //------------------  // DrawPolyline TEST  //------------------  pointlist = new nsPoint[5];  pointlist[0].x = pixelLoc(0, p2t, ox);  pointlist[0].y = pixelLoc(0, p2t, oy);  pointlist[1].x = pixelLoc(10, p2t, ox);  pointlist[1].y = pixelLoc(0, p2t, oy);  pointlist[2].x = pixelLoc(10, p2t, ox);  pointlist[2].y = pixelLoc(10, p2t, oy);  pointlist[3].x = pixelLoc(0, p2t, ox);  pointlist[3].y = pixelLoc(10, p2t, oy);  pointlist[4].x = pixelLoc(0, p2t, ox);  pointlist[4].y = pixelLoc(1, p2t, oy);  aSurface->DrawPolyline(pointlist,5);  aSurface->DrawString("DrawPolyline - There should be a one pixel gap in the rectangle\0", ox + 30, oy);  delete [] pointlist;  oy += yspacing;   //--------------   // FillRect TEST   //--------------     aSurface->SetColor(NS_RGB(255, 0, 0));  aSurface->DrawLine(pixelLoc(9,p2t, ox),                     pixelLoc(0,p2t, oy),                      pixelLoc(9,p2t,  ox),                      pixelLoc(30,p2t, oy));  aSurface->SetColor(NS_RGB(0, 0, 0));  aSurface->FillRect(pixelLoc(0,  p2t, ox),                     pixelLoc(10,  p2t, oy),                     pixelLoc(10, p2t,  0),                     pixelLoc(10, p2t,  0));  aSurface->DrawString("FillRect - The red line should be at the right edge under the rectangle\0", ox + 30, oy);  oy += yspacing;   //--------------  // DrawRect TEST  //--------------  aSurface->SetColor(NS_RGB(255, 0, 0));  aSurface->DrawLine(pixelLoc(9,p2t, ox),                     pixelLoc(0,p2t, oy),                      pixelLoc(9,p2t,  ox),                      pixelLoc(30,p2t, oy));  aSurface->SetColor(NS_RGB(0, 0, 0));  aSurface->DrawRect(pixelLoc(0,  p2t, ox),                     pixelLoc(10,  p2t, oy),                     pixelLoc(10, p2t,  0),                     pixelLoc(10, p2t,  0));  aSurface->DrawString("DrawRect - The red line should be at the right edge under the rectangle\0", ox + 30, oy);  oy += yspacing;  /*#ifdef WINDOWSBROKEN  pointlist = new nsPoint[5];  pointlist[0].x = 200;pointlist[0].y = 200;  pointlist[1].x = 250;pointlist[1].y = 200;  pointlist[2].x = 240;pointlist[2].y = 220;  pointlist[3].x = 260;pointlist[3].y = 240;  pointlist[4].x = 225;pointlist[4].y = 225;  aSurface->DrawPolygon(pointlist,6);  aSurface->DrawString("This is an open Polygon\0",250,200);  delete [] pointlist;#endif    aSurface->DrawEllipse(30, 150,50,100);  aSurface->DrawString("This is an Ellipse\0",30,140);*/  return(30);}