@Override public void flip(X11ComponentPeer peer,Component target,VolatileImage xBackBuffer,int x1,int y1,int x2,int y2,BufferCapabilities.FlipContents flipAction){
  if (flipAction == BufferCapabilities.FlipContents.COPIED) {
    SurfaceManager vsm=SurfaceManager.getManager(xBackBuffer);
    SurfaceData sd=vsm.getPrimarySurfaceData();
    if (sd instanceof GLXVSyncOffScreenSurfaceData) {
      GLXVSyncOffScreenSurfaceData vsd=(GLXVSyncOffScreenSurfaceData)sd;
      SurfaceData bbsd=vsd.getFlipSurface();
      Graphics2D bbg=new SunGraphics2D(bbsd,Color.black,Color.white,null);
      try {
        bbg.drawImage(xBackBuffer,0,0,null);
      }
  finally {
        bbg.dispose();
      }
    }
 else {
      Graphics g=peer.getGraphics();
      try {
        g.drawImage(xBackBuffer,x1,y1,x2,y2,x1,y1,x2,y2,null);
      }
  finally {
        g.dispose();
      }
      return;
    }
  }
 else   if (flipAction == BufferCapabilities.FlipContents.PRIOR) {
    return;
  }
  OGLSurfaceData.swapBuffers(peer.getContentWindow());
  if (flipAction == BufferCapabilities.FlipContents.BACKGROUND) {
    Graphics g=xBackBuffer.getGraphics();
    try {
      g.setColor(target.getBackground());
      g.fillRect(0,0,xBackBuffer.getWidth(),xBackBuffer.getHeight());
    }
  finally {
      g.dispose();
    }
  }
}

@ Override public void flip ( X11ComponentPeer peer , Component target , VolatileImage xBackBuffer , int x1 , int y1 , int x2 , int y2 , BufferCapabilities . FlipContents flipAction ) { if ( flipAction == BufferCapabilities . FlipContents . COPIED ) { SurfaceManager vsm = SurfaceManager . getManager ( xBackBuffer ) ; SurfaceData sd = vsm . getPrimarySurfaceData ( ) ; if ( sd instanceof GLXVSyncOffScreenSurfaceData ) { GLXVSyncOffScreenSurfaceData vsd = ( GLXVSyncOffScreenSurfaceData ) sd ; SurfaceData bbsd = vsd . getFlipSurface ( ) ; Graphics2D bbg = new SunGraphics2D ( bbsd , Color . black , Color . white , null ) ; try { bbg . drawImage ( xBackBuffer , 0 , 0 , null ) ; } finally { bbg . dispose ( ) ; } } else { Graphics g = peer . getGraphics ( ) ; try { g . drawImage ( xBackBuffer , x1 , y1 , x2 , y2 , x1 , y1 , x2 , y2 , null ) ; } finally { g . dispose ( ) ; } return ; } } else if ( flipAction == BufferCapabilities . FlipContents . PRIOR ) { return ; } OGLSurfaceData . swapBuffers ( peer . getContentWindow ( ) ) ; if ( flipAction == BufferCapabilities . FlipContents . BACKGROUND ) { Graphics g = xBackBuffer . getGraphics ( ) ; try { g . setColor ( target . getBackground ( ) ) ; g . fillRect ( 0 , 0 , xBackBuffer . getWidth ( ) , xBackBuffer . getHeight ( ) ) ; } finally { g . dispose ( ) ; } } }
performs the native glx flip operation for the given target component .
