本文整理汇总了Java中sun.java2d.SurfaceData.isSurfaceLost方法的典型用法代码示例。如果您正苦于以下问题:Java SurfaceData.isSurfaceLost方法的具体用法?Java SurfaceData.isSurfaceLost怎么用?Java SurfaceData.isSurfaceLost使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sun.java2d.SurfaceData
的用法示例。
在下文中一共展示了SurfaceData.isSurfaceLost方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: validateSurfaceData
import sun.java2d.SurfaceData; //导入方法依赖的package包/类
@Override
public SurfaceData validateSurfaceData(SurfaceData srcData,
SurfaceData cachedData,
int w, int h)
{
if (cachedData == null || cachedData.isSurfaceLost()) {
try {
cachedData = d3dgc.createManagedSurface(w, h, transparency);
} catch (InvalidPipeException e) {
if (!d3dgc.getD3DDevice().isD3DAvailable()) {
invalidate();
flush();
return null;
}
}
}
return cachedData;
}
示例2: getElem
import sun.java2d.SurfaceData; //导入方法依赖的package包/类
protected int getElem(final int x, final int y,
final SurfaceData sData)
{
if (sData.isSurfaceLost()) {
return 0;
}
int retPixel;
D3DRenderQueue rq = D3DRenderQueue.getInstance();
rq.lock();
try {
rq.flushAndInvokeNow(new Runnable() {
public void run() {
pixel = dbGetPixelNative(sData.getNativeOps(), x, y);
}
});
} finally {
retPixel = pixel;
rq.unlock();
}
return retPixel;
}
示例3: setElem
import sun.java2d.SurfaceData; //导入方法依赖的package包/类
protected void setElem(final int x, final int y, final int pixel,
final SurfaceData sData)
{
if (sData.isSurfaceLost()) {
return;
}
D3DRenderQueue rq = D3DRenderQueue.getInstance();
rq.lock();
try {
rq.flushAndInvokeNow(new Runnable() {
public void run() {
dbSetPixelNative(sData.getNativeOps(), x, y, pixel);
}
});
sData.markDirty();
} finally {
rq.unlock();
}
}
示例4: validateSurfaceData
import sun.java2d.SurfaceData; //导入方法依赖的package包/类
@Override
public SurfaceData validateSurfaceData(SurfaceData srcData,
SurfaceData cachedData,
int w, int h)
{
if (cachedData == null || cachedData.isSurfaceLost()) {
try {
cachedData = d3dgc.createManagedSurface(w, h, transparency);
} catch (InvalidPipeException e) {
if (!D3DGraphicsDevice.isD3DAvailable()) {
invalidate();
flush();
return null;
}
}
}
return cachedData;
}