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();
}
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();
}
}
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;
}
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;
}
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;
}
}
Aggregations