@Override public void flip(WComponentPeer peer,Component target,VolatileImage backBuffer,int x1,int y1,int x2,int y2,BufferCapabilities.FlipContents flipAction){
  SurfaceManager d3dvsm=SurfaceManager.getManager(backBuffer);
  SurfaceData sd=d3dvsm.getPrimarySurfaceData();
  if (sd instanceof D3DSurfaceData) {
    D3DSurfaceData d3dsd=(D3DSurfaceData)sd;
    D3DSurfaceData.swapBuffers(d3dsd,x1,y1,x2,y2);
  }
 else {
    Graphics g=peer.getGraphics();
    try {
      g.drawImage(backBuffer,x1,y1,x2,y2,x1,y1,x2,y2,null);
    }
  finally {
      g.dispose();
    }
  }
  if (flipAction == BufferCapabilities.FlipContents.BACKGROUND) {
    Graphics g=backBuffer.getGraphics();
    try {
      g.setColor(target.getBackground());
      g.fillRect(0,0,backBuffer.getWidth(),backBuffer.getHeight());
    }
  finally {
      g.dispose();
    }
  }
}

@ Override public void flip ( WComponentPeer peer , Component target , VolatileImage backBuffer , int x1 , int y1 , int x2 , int y2 , BufferCapabilities . FlipContents flipAction ) { SurfaceManager d3dvsm = SurfaceManager . getManager ( backBuffer ) ; SurfaceData sd = d3dvsm . getPrimarySurfaceData ( ) ; if ( sd instanceof D3DSurfaceData ) { D3DSurfaceData d3dsd = ( D3DSurfaceData ) sd ; D3DSurfaceData . swapBuffers ( d3dsd , x1 , y1 , x2 , y2 ) ; } else { Graphics g = peer . getGraphics ( ) ; try { g . drawImage ( backBuffer , x1 , y1 , x2 , y2 , x1 , y1 , x2 , y2 , null ) ; } finally { g . dispose ( ) ; } } if ( flipAction == BufferCapabilities . FlipContents . BACKGROUND ) { Graphics g = backBuffer . getGraphics ( ) ; try { g . setColor ( target . getBackground ( ) ) ; g . fillRect ( 0 , 0 , backBuffer . getWidth ( ) , backBuffer . getHeight ( ) ) ; } finally { g . dispose ( ) ; } } }
performs the native d3d flip operation for the given target component .
