当前位置: 首页>>代码示例>>Java>>正文


Java SurfaceData.invalidate方法代码示例

本文整理汇总了Java中sun.java2d.SurfaceData.invalidate方法的典型用法代码示例。如果您正苦于以下问题:Java SurfaceData.invalidate方法的具体用法?Java SurfaceData.invalidate怎么用?Java SurfaceData.invalidate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在sun.java2d.SurfaceData的用法示例。


在下文中一共展示了SurfaceData.invalidate方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: displayChanged

import sun.java2d.SurfaceData; //导入方法依赖的package包/类
/**
 * Called from SunGraphicsEnv when there has been a display mode change.
 * Note that we simply invalidate hardware surfaces here; we do not
 * attempt to recreate or re-render them.  This is to avoid threading
 * conflicts with the native toolkit and associated threads.  Instead,
 * we just nullify the old surface data object and wait for a future
 * method in the rendering process to recreate the surface.
 */
public void displayChanged() {
    if (!isAccelerationEnabled()) {
        return;
    }
    lostSurface = true;
    if (sdAccel != null) {
        // First, nullify the software surface.  This guards against
        // using a SurfaceData that was created in a different
        // display mode.
        sdBackup = null;
        // Now, invalidate the old hardware-based SurfaceData
        // Note that getBackupSurface may set sdAccel to null so we have to invalidate it before
        SurfaceData oldData = sdAccel;
        sdAccel = null;
        oldData.invalidate();
        sdCurrent = getBackupSurface();
    }
    // Update graphicsConfig for the vImg in case it changed due to
    // this display change event
    vImg.updateGraphicsConfig();
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:30,代码来源:VolatileSurfaceManager.java

示例2: disposeImpl

import sun.java2d.SurfaceData; //导入方法依赖的package包/类
@Override
protected void disposeImpl() {
    SurfaceData oldData = surfaceData;
    surfaceData = null;
    ScreenUpdateManager.getInstance().dropScreenSurface(oldData);
    oldData.invalidate();
    // remove from updater before calling targetDisposedPeer
    WToolkit.targetDisposedPeer(target, this);
    _dispose();
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:11,代码来源:WComponentPeer.java

示例3: doValidateSurface

import sun.java2d.SurfaceData; //导入方法依赖的package包/类
final void doValidateSurface() {
    SurfaceData oldData = surfaceData;
    if (oldData != null) {
        surfaceData = graphicsConfig.createSurfaceData(this);
        oldData.invalidate();
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:8,代码来源:XWindow.java

示例4: dispose

import sun.java2d.SurfaceData; //导入方法依赖的package包/类
public void dispose() {
    SurfaceData oldData = surfaceData;
    surfaceData = null;
    if (oldData != null) {
        oldData.invalidate();
    }
    XToolkit.targetDisposedPeer(target, this);
    destroy();
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:10,代码来源:XWindow.java

示例5: doDispose

import sun.java2d.SurfaceData; //导入方法依赖的package包/类
/**
 * 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();
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:14,代码来源:XBaseMenuWindow.java

示例6: dispose

import sun.java2d.SurfaceData; //导入方法依赖的package包/类
@Override
public void dispose() {
    cancelTasks();
    SurfaceData surfaceData = contentView.getSurfaceData();
    if (surfaceData != null) {
        surfaceData.invalidate();
    }
    super.dispose();
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:10,代码来源:CWarningWindow.java

示例7: replaceSurfaceData

import sun.java2d.SurfaceData; //导入方法依赖的package包/类
/**
 * 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;
            }
        }
    }
    // it would be better to do this before we create new ones,
    // 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;
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:52,代码来源:WComponentPeer.java

示例8: displayChanged

import sun.java2d.SurfaceData; //导入方法依赖的package包/类
/**
 * Called from SunGraphicsEnv when there has been a display mode change.
 * Note that we simply invalidate hardware surfaces here; we do not
 * attempt to recreate or re-render them.  This is to avoid threading
 * conflicts with the native toolkit and associated threads.  Instead,
 * we just nullify the old surface data object and wait for a future
 * method in the rendering process to recreate the surface.
 */
public void displayChanged() {
    lostSurface = true;
    if (sdAccel != null) {
        // First, nullify the software surface.  This guards against
        // using a SurfaceData that was created in a different
        // display mode.
        sdBackup = null;
        // Now, invalidate the old hardware-based SurfaceData
        // Note that getBackupSurface may set sdAccel to null so we have to invalidate it before
        SurfaceData oldData = sdAccel;
        sdAccel = null;
        oldData.invalidate();
        sdCurrent = getBackupSurface();
    }
    // Update graphicsConfig for the vImg in case it changed due to
    // this display change event
    vImg.updateGraphicsConfig();

    // Compare the Graphics configuration transforms to determine
    // whether the software backed surface needs to be invalidated.
    AffineTransform atUpdated = vImg.getGraphicsConfig()
                                    .getDefaultTransform();
    if (!isAccelerationEnabled()) {
        if (!atUpdated.equals(atCurrent)) {
            // Ideally there is no need to re-create a software surface.
            // But some OSs allow changes to display state at runtime. Such
            // a provision would cause mismatch in graphics configuration of
            // the display and the surface. Hence we re-create the software
            // surface as well.
            sdBackup = null;
            sdCurrent = getBackupSurface();
        } else {
            // Software backed surface was not invalidated.
            lostSurface = false;
        }
    }

    // Update the AffineTransformation backing the volatile image
    atCurrent = atUpdated;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:49,代码来源:VolatileSurfaceManager.java


注:本文中的sun.java2d.SurfaceData.invalidate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。