use of sun.awt.Win32GraphicsConfig in project jdk8u_jdk by JetBrains.
the class WComponentPeer method createBuffers.
/**
* The following multibuffering-related methods delegate to our
* associated GraphicsConfig (Win or WGL) to handle the appropriate
* native windowing system specific actions.
*/
@Override
public void createBuffers(int numBuffers, BufferCapabilities caps) throws AWTException {
Win32GraphicsConfig gc = (Win32GraphicsConfig) getGraphicsConfiguration();
gc.assertOperationSupported((Component) target, numBuffers, caps);
// Re-create the primary surface with the new number of back buffers
try {
replaceSurfaceData(numBuffers - 1, caps);
} catch (InvalidPipeException e) {
throw new AWTException(e.getMessage());
}
}
use of sun.awt.Win32GraphicsConfig 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;
}
}
use of sun.awt.Win32GraphicsConfig in project jdk8u_jdk by JetBrains.
the class WComponentPeer method flip.
@Override
public void flip(int x1, int y1, int x2, int y2, BufferCapabilities.FlipContents flipAction) {
VolatileImage backBuffer = this.backBuffer;
if (backBuffer == null) {
throw new IllegalStateException("Buffers have not been created");
}
Win32GraphicsConfig gc = (Win32GraphicsConfig) getGraphicsConfiguration();
gc.flip(this, (Component) target, backBuffer, x1, y1, x2, y2, flipAction);
}
use of sun.awt.Win32GraphicsConfig in project jdk8u_jdk by JetBrains.
the class WComponentPeer method createScreenSurface.
public void createScreenSurface(boolean isResize) {
Win32GraphicsConfig gc = (Win32GraphicsConfig) getGraphicsConfiguration();
ScreenUpdateManager mgr = ScreenUpdateManager.getInstance();
surfaceData = mgr.createScreenSurface(gc, this, numBackBuffers, isResize);
}
Aggregations