本文整理汇总了Java中sun.java2d.windows.GDIWindowSurfaceData.createData方法的典型用法代码示例。如果您正苦于以下问题:Java GDIWindowSurfaceData.createData方法的具体用法?Java GDIWindowSurfaceData.createData怎么用?Java GDIWindowSurfaceData.createData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sun.java2d.windows.GDIWindowSurfaceData
的用法示例。
在下文中一共展示了GDIWindowSurfaceData.createData方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getGdiSurface
import sun.java2d.windows.GDIWindowSurfaceData; //导入方法依赖的package包/类
/**
* Creates (or returns a cached one) gdi surface for the same peer as
* the passed d3dw surface has.
*
* @param d3dw surface used as key into the cache
* @return gdi window surface associated with the d3d window surfaces' peer
*/
private synchronized SurfaceData getGdiSurface(D3DWindowSurfaceData d3dw) {
if (gdiSurfaces == null) {
gdiSurfaces =
new HashMap<D3DWindowSurfaceData, GDIWindowSurfaceData>();
}
GDIWindowSurfaceData gdisd = gdiSurfaces.get(d3dw);
if (gdisd == null) {
gdisd = GDIWindowSurfaceData.createData(d3dw.getPeer());
gdiSurfaces.put(d3dw, gdisd);
}
return gdisd;
}
示例2: createSurfaceData
import sun.java2d.windows.GDIWindowSurfaceData; //导入方法依赖的package包/类
/**
* Creates a new SurfaceData that will be associated with the given
* WComponentPeer.
*/
@Override
public SurfaceData createSurfaceData(WComponentPeer peer,
int numBackBuffers)
{
SurfaceData sd = WGLSurfaceData.createData(peer);
if (sd == null) {
sd = GDIWindowSurfaceData.createData(peer);
}
return sd;
}
示例3: createScreenSurface
import sun.java2d.windows.GDIWindowSurfaceData; //导入方法依赖的package包/类
/**
* If possible, creates a D3DWindowSurfaceData (which is actually
* a back-buffer surface). If the creation fails, returns GDI
* onscreen surface instead.
*
* Note that the created D3D surface does not initialize the native
* resources (and is marked lost) to avoid wasting video memory. It is
* restored when a graphics object is requested from the peer.
*
* Note that this method is called from a synchronized block in
* WComponentPeer, so we don't need to synchronize
*
* Note that we only create a substibute d3dw surface if certain conditions
* are met
* <ul>
* <li>the fake d3d rendering on screen is not disabled via flag
* <li>d3d on the device is enabled
* <li>surface is larger than MIN_WIN_SIZE (don't bother for smaller ones)
* <li>it doesn't have a backBuffer for a BufferStrategy already
* <li>the peer is either Canvas, Panel, Window, Frame,
* Dialog or EmbeddedFrame
* </ul>
*
* @param gc GraphicsConfiguration on associated with the surface
* @param peer peer for which the surface is to be created
* @param bbNum number of back-buffers requested. if this number is >0,
* method returns GDI surface (we don't want to have two swap chains)
* @param isResize whether this surface is being created in response to
* a component resize event. This determines whether a repaint event will
* be issued after a surface is created: it will be if <code>isResize</code>
* is <code>true</code>.
* @return surface data to be use for onscreen rendering
*/
@Override
public SurfaceData createScreenSurface(Win32GraphicsConfig gc,
WComponentPeer peer,
int bbNum, boolean isResize)
{
if (done || !(gc instanceof D3DGraphicsConfig)) {
return super.createScreenSurface(gc, peer, bbNum, isResize);
}
SurfaceData sd = null;
if (canUseD3DOnScreen(peer, gc, bbNum)) {
try {
// note that the created surface will be in the "lost"
// state, it will be restored prior to rendering to it
// for the first time. This is done so that vram is not
// wasted for surfaces never rendered to
sd = D3DSurfaceData.createData(peer);
} catch (InvalidPipeException ipe) {
sd = null;
}
}
if (sd == null) {
sd = GDIWindowSurfaceData.createData(peer);
// note that we do not add this surface to the list of cached gdi
// surfaces as there's no d3dw surface to associate it with;
// this peer will have a gdi surface until next time a surface
// will need to be replaced
}
if (isResize) {
// since we'd potentially replaced the back-buffer surface
// (either with another bb, or a gdi one), the
// component will need to be completely repainted;
// this only need to be done when the surface is created in
// response to a resize event since when a component is created it
// will be repainted anyway
repaintPeerTarget(peer);
}
return sd;
}
示例4: createSurfaceData
import sun.java2d.windows.GDIWindowSurfaceData; //导入方法依赖的package包/类
/**
* Creates a new SurfaceData that will be associated with the given
* WComponentPeer.
*/
public SurfaceData createSurfaceData(WComponentPeer peer,
int numBackBuffers)
{
return GDIWindowSurfaceData.createData(peer);
}
示例5: createScreenSurface
import sun.java2d.windows.GDIWindowSurfaceData; //导入方法依赖的package包/类
/**
* If possible, creates a D3DWindowSurfaceData (which is actually
* a back-buffer surface). If the creation fails, returns GDI
* onscreen surface instead.
*
* Note that the created D3D surface does not initialize the native
* resources (and is marked lost) to avoid wasting video memory. It is
* restored when a graphics object is requested from the peer.
*
* Note that this method is called from a synchronized block in
* WComponentPeer, so we don't need to synchronize
*
* Note that we only create a substibute d3dw surface if certain conditions
* are met
* <ul>
* <li>the fake d3d rendering on screen is not disabled via flag
* <li>d3d on the device is enabled
* <li>surface is larger than MIN_WIN_SIZE (don't bother for smaller ones)
* <li>it doesn't have a backBuffer for a BufferStrategy already
* <li>the peer is either Canvas, Panel, Window, Frame,
* Dialog or EmbeddedFrame
* </ul>
*
* @param gc GraphicsConfiguration on associated with the surface
* @param peer peer for which the surface is to be created
* @param bbNum number of back-buffers requested. if this number is >0,
* method returns GDI surface (we don't want to have two swap chains)
* @param isResize whether this surface is being created in response to
* a component resize event. This determines whether a repaint event will
* be issued after a surface is created: it will be if {@code isResize}
* is {@code true}.
* @return surface data to be use for onscreen rendering
*/
@Override
public SurfaceData createScreenSurface(Win32GraphicsConfig gc,
WComponentPeer peer,
int bbNum, boolean isResize)
{
if (done || !(gc instanceof D3DGraphicsConfig)) {
return super.createScreenSurface(gc, peer, bbNum, isResize);
}
SurfaceData sd = null;
if (canUseD3DOnScreen(peer, gc, bbNum)) {
try {
// note that the created surface will be in the "lost"
// state, it will be restored prior to rendering to it
// for the first time. This is done so that vram is not
// wasted for surfaces never rendered to
sd = D3DSurfaceData.createData(peer);
} catch (InvalidPipeException ipe) {
sd = null;
}
}
if (sd == null) {
sd = GDIWindowSurfaceData.createData(peer);
// note that we do not add this surface to the list of cached gdi
// surfaces as there's no d3dw surface to associate it with;
// this peer will have a gdi surface until next time a surface
// will need to be replaced
}
if (isResize) {
// since we'd potentially replaced the back-buffer surface
// (either with another bb, or a gdi one), the
// component will need to be completely repainted;
// this only need to be done when the surface is created in
// response to a resize event since when a component is created it
// will be repainted anyway
repaintPeerTarget(peer);
}
return sd;
}