http://pancyl.com/debug.htm

I've put some timing code in my applet.  It may be useful to do a comparison 
between 1.5 and 1.6 with the D3D acceleration on your own machine.

What you will see in the console window is --

PanCyl v0.3.2_D3DTest
Interp Time = 841ms
Paint Time(640, 360) = 50ms
---

Interp Time = 591ms
Paint Time(640, 360) = 30ms
---

Interp Time = 611ms
Paint Time(640, 360) = 30ms
---

What you are looking at is the time to interpolate a 640x360 image (my own 
bicubic interpolator -- it's slow) and then the time to paint that 640x360 
image in a Canvas.

Here's the rendering method that is in MyCanvas.  I only use paint() for system 
events.  mis is a MemoryImageSource; bs is the BufferStrategy; bg is the 
BufferStrategy Graphics

//this is what is timed

           t1 = System.currentTimeMillis();
           System.err.println("Interp Time = " + (t1 - t0) + "ms");

           t2 = System.currentTimeMillis();
           canvas.newPixels();
           t3 = System.currentTimeMillis();
           System.err.println("Paint Time(" + canvasW + ", " + canvasH + ") = " + (t3 - 
t2) + "ms");
           System.err.println("---\n");

   public void newPixels()
   {
       try
       {
           if(!this.isShowing())return;
           do {
               do {
                   bg = (Graphics2D)bs.getDrawGraphics();
                   mis.newPixels(0,0,thisW,thisH,true);
                   bg.drawImage(canvasImage, 0, 0, thisW, thisH, this);
                   if(DRAWATT)
                       drawAttribution(); // ignore this
                   bg.dispose();
               } while (bs.contentsRestored());
               bs.show();
            } while (bs.contentsLost());
       }
       catch (Exception ie)
       {
           ie.printStackTrace();
       }
   }

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA2D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to