Search in sources :

Example 16 with SurfaceData

use of sun.java2d.SurfaceData in project jdk8u_jdk by JetBrains.

the class XBaseMenuWindow method doDispose.

/**
     * Performs disposal of menu window.
     * Should be called only on eventHandlerThread
     */
protected void doDispose() {
    xSetVisible(false);
    SurfaceData oldData = surfaceData;
    surfaceData = null;
    if (oldData != null) {
        oldData.invalidate();
    }
    destroy();
}
Also used : SurfaceData(sun.java2d.SurfaceData)

Example 17 with SurfaceData

use of sun.java2d.SurfaceData in project jdk8u_jdk by JetBrains.

the class XWindow method doValidateSurface.

final void doValidateSurface() {
    SurfaceData oldData = surfaceData;
    if (oldData != null) {
        surfaceData = graphicsConfig.createSurfaceData(this);
        oldData.invalidate();
    }
}
Also used : SurfaceData(sun.java2d.SurfaceData)

Example 18 with SurfaceData

use of sun.java2d.SurfaceData in project jdk8u_jdk by JetBrains.

the class X11VolatileSurfaceManager method initAcceleratedSurface.

/**
     * Create a pixmap-based SurfaceData object
     */
protected SurfaceData initAcceleratedSurface() {
    SurfaceData sData;
    try {
        X11GraphicsConfig gc = (X11GraphicsConfig) vImg.getGraphicsConfig();
        ColorModel cm = gc.getColorModel();
        long drawable = 0;
        if (context instanceof Long) {
            drawable = ((Long) context).longValue();
        }
        sData = X11SurfaceData.createData(gc, vImg.getWidth(), vImg.getHeight(), cm, vImg, drawable, Transparency.OPAQUE);
    } catch (NullPointerException ex) {
        sData = null;
    } catch (OutOfMemoryError er) {
        sData = null;
    }
    return sData;
}
Also used : X11GraphicsConfig(sun.awt.X11GraphicsConfig) SurfaceData(sun.java2d.SurfaceData) ColorModel(java.awt.image.ColorModel)

Example 19 with SurfaceData

use of sun.java2d.SurfaceData in project jdk8u_jdk by JetBrains.

the class XRVolatileSurfaceManager method initAcceleratedSurface.

/**
     * Create a pixmap-based SurfaceData object
     */
protected SurfaceData initAcceleratedSurface() {
    SurfaceData sData;
    try {
        XRGraphicsConfig gc = (XRGraphicsConfig) vImg.getGraphicsConfig();
        ColorModel cm = gc.getColorModel();
        long drawable = 0;
        if (context instanceof Long) {
            drawable = ((Long) context).longValue();
        }
        sData = XRSurfaceData.createData(gc, vImg.getWidth(), vImg.getHeight(), cm, vImg, drawable, vImg.getTransparency());
    } catch (NullPointerException ex) {
        sData = null;
    } catch (OutOfMemoryError er) {
        sData = null;
    }
    return sData;
}
Also used : SurfaceData(sun.java2d.SurfaceData) ColorModel(java.awt.image.ColorModel)

Example 20 with SurfaceData

use of sun.java2d.SurfaceData in project jdk8u_jdk by JetBrains.

the class WComponentPeer method replaceSurfaceData.

/**
     * Multi-buffer version of replaceSurfaceData.  This version is called
     * by createBuffers(), which needs to acquire the same locks in the same
     * order, but also needs to perform additional functions inside the
     * locks.
     */
public void replaceSurfaceData(int newNumBackBuffers, BufferCapabilities caps) {
    SurfaceData oldData = null;
    VolatileImage oldBB = null;
    synchronized (((Component) target).getTreeLock()) {
        synchronized (this) {
            if (pData == 0) {
                return;
            }
            numBackBuffers = newNumBackBuffers;
            ScreenUpdateManager mgr = ScreenUpdateManager.getInstance();
            oldData = surfaceData;
            mgr.dropScreenSurface(oldData);
            createScreenSurface(true);
            if (oldData != null) {
                oldData.invalidate();
            }
            oldBB = backBuffer;
            if (numBackBuffers > 0) {
                // set the caps first, they're used when creating the bb
                backBufferCaps = caps;
                Win32GraphicsConfig gc = (Win32GraphicsConfig) getGraphicsConfiguration();
                backBuffer = gc.createBackBuffer(this);
            } else if (backBuffer != null) {
                backBufferCaps = null;
                backBuffer = null;
            }
        }
    }
    // but then we'd run into deadlock issues
    if (oldData != null) {
        oldData.flush();
        // null out the old data to make it collected faster
        oldData = null;
    }
    if (oldBB != null) {
        oldBB.flush();
        // null out the old data to make it collected faster
        oldData = null;
    }
}
Also used : Win32GraphicsConfig(sun.awt.Win32GraphicsConfig) D3DSurfaceData(sun.java2d.d3d.D3DSurfaceData) SurfaceData(sun.java2d.SurfaceData) OGLSurfaceData(sun.java2d.opengl.OGLSurfaceData) SunVolatileImage(sun.awt.image.SunVolatileImage) VolatileImage(java.awt.image.VolatileImage) ScreenUpdateManager(sun.java2d.ScreenUpdateManager)

Aggregations

SurfaceData (sun.java2d.SurfaceData)39 ColorModel (java.awt.image.ColorModel)9 SunGraphics2D (sun.java2d.SunGraphics2D)7 Blit (sun.java2d.loops.Blit)7 TransformBlit (sun.java2d.loops.TransformBlit)7 ScaledBlit (sun.java2d.loops.ScaledBlit)6 SurfaceType (sun.java2d.loops.SurfaceType)6 GDIWindowSurfaceData (sun.java2d.windows.GDIWindowSurfaceData)5 Component (java.awt.Component)4 BufferedImage (java.awt.image.BufferedImage)4 OGLSurfaceData (sun.java2d.opengl.OGLSurfaceData)4 BufferCapabilities (java.awt.BufferCapabilities)3 Graphics (java.awt.Graphics)3 Raster (java.awt.image.Raster)3 WeakReference (java.lang.ref.WeakReference)3 SurfaceManager (sun.awt.image.SurfaceManager)3 InvalidPipeException (sun.java2d.InvalidPipeException)3 D3DSurfaceData (sun.java2d.d3d.D3DSurfaceData)3 Graphics2D (java.awt.Graphics2D)2 PaintContext (java.awt.PaintContext)2