public Object initTest(TestEnvironment env, Result result) {
   Context ctx = new Context();
   ctx.bimg = ((BufImg) env.getModifier(bufimgsrcroot)).getImage();
   if (env.isEnabled(doRenderTo)) {
     Graphics2D g2d = ctx.bimg.createGraphics();
     g2d.setColor(Color.white);
     g2d.fillRect(3, 0, 1, 1);
     g2d.dispose();
   }
   if (env.isEnabled(doRenderFrom)) {
     GraphicsConfiguration cfg =
         GraphicsEnvironment.getLocalGraphicsEnvironment()
             .getDefaultScreenDevice()
             .getDefaultConfiguration();
     VolatileImage vimg = cfg.createCompatibleVolatileImage(8, 1);
     vimg.validate(cfg);
     Graphics2D g2d = vimg.createGraphics();
     for (int i = 0; i < 100; i++) {
       g2d.drawImage(ctx.bimg, 0, 0, null);
     }
     g2d.dispose();
     vimg.flush();
   }
   result.setUnits(1);
   result.setUnitName(getUnitName());
   return ctx;
 }
 public Object initTest(TestEnvironment env, Result result) {
   Context ctx = createContext();
   initContext(env, ctx);
   result.setUnits((int) (ctx.pixscale * pixelsTouched(ctx)));
   result.setUnitName("pixel");
   return ctx;
 }
 public Object initTest(TestEnvironment env, Result result) {
   Context ctx = new Context(env, result);
   result.setUnits(ctx.scanlineStride);
   result.setUnitName("byte");
   return ctx;
 }
 public Object initTest(TestEnvironment env, Result result) {
   Context ctx = new Context(env, result);
   result.setUnits(1);
   result.setUnitName("bit");
   return ctx;
 }