Exemplo n.º 1
0
 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;
 }
Exemplo n.º 2
0
 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;
 }
Exemplo n.º 3
0
 public Object initTest(TestEnvironment env, Result result) {
   Context ctx = new Context(env, result);
   result.setUnits(ctx.scanlineStride);
   result.setUnitName("byte");
   return ctx;
 }
Exemplo n.º 4
0
 public Object initTest(TestEnvironment env, Result result) {
   Context ctx = new Context(env, result);
   result.setUnits(1);
   result.setUnitName("bit");
   return ctx;
 }