Package sun.awt.image

Examples of sun.awt.image.SurfaceManager


                // Getting the DataBuffer for an image (as it's done below) defeats
                // possible future acceleration.
                // Calling setLocalAccelerationEnabled on that image's surface
                // manager re-enables it.
                SurfaceManager sm = SurfaceManager.getManager(bi);
                if (sm.getClass().getName().equals("sun.awt.image.CachingSurfaceManager")) {
                    try {
                        accEnabled = (Boolean) ReflectionUtils.callGet(sm, "isLocalAccelerationEnabled");
                    }
                    catch (Exception e) {
                        // ignore
                    }
                }

                WritableRaster raster = bi.getRaster();
                DataBufferInt buffer = (DataBufferInt) raster.getDataBuffer();
                ThemeReader.paintBackground(buffer.getData(),
                        part.getControlName(c), part.getValue(),
                        TMSchema.State.getValue(part, state),
                        0, 0, w, h, w);

                if (sm.getClass().getName().equals("sun.awt.image.CachingSurfaceManager")) {
                    try {
                        boolean oldAccEnabled = (Boolean) ReflectionUtils.callGet(sm, "isLocalAccelerationEnabled");
                        if (accEnabled != oldAccEnabled) {
                            ReflectionUtils.callSet(sm, "setLocalAccelerationEnabled", accEnabled);
                            ReflectionUtils.call(sm, "rasterChanged");
View Full Code Here


            // possible future acceleration.
            // Calling setLocalAccelerationEnabled on that image's surface
            // manager re-enables it.
            boolean accelerated = false;
            CachingSurfaceManager csm = null;
            SurfaceManager sm = SurfaceManager.getManager(image);
            if (sm instanceof CachingSurfaceManager) {
                csm = (CachingSurfaceManager)sm;
                accelerated = csm.isLocalAccelerationEnabled();
            }
View Full Code Here

    public SurfaceData getSourceSurfaceData(Image img,
                                            int txtype,
                                            CompositeType comp,
                                            Color bgColor)
    {
        SurfaceManager srcMgr = SurfaceManager.getManager(img);
        SurfaceData srcData = srcMgr.getPrimarySurfaceData();
        if (img.getAccelerationPriority() > 0.0f &&
            blitProxyKey != null)
        {
            SurfaceDataProxy sdp =
                (SurfaceDataProxy) srcMgr.getCacheData(blitProxyKey);
            if (sdp == null || !sdp.isValid()) {
                if (srcData.getState() == State.UNTRACKABLE) {
                    sdp = SurfaceDataProxy.UNCACHED;
                } else {
                    sdp = makeProxyFor(srcData);
                }
                srcMgr.setCacheData(blitProxyKey, sdp);
            }
            srcData = sdp.replaceData(srcData, txtype, comp, bgColor);
        }
        return srcData;
    }
View Full Code Here

     * Extracts the SurfaceManager from the given Image, and then
     * returns the SurfaceData object that would best be suited as the
     * destination surface in some rendering operation.
     */
    public static SurfaceData getPrimarySurfaceData(Image img) {
        SurfaceManager sMgr = SurfaceManager.getManager(img);
        return sMgr.getPrimarySurfaceData();
    }
View Full Code Here

    /**
     * Restores the contents of the given Image and then returns the new
     * SurfaceData object in use by the Image's SurfaceManager.
     */
    public static SurfaceData restoreContents(Image img) {
        SurfaceManager sMgr = SurfaceManager.getManager(img);
        return sMgr.restoreContents();
    }
View Full Code Here

            wrn = null;
        }
        setSurfaceLost(true);
        if (image != null) {
            // Inform the Volatile that it lost its accelerated surface
            SurfaceManager sMgr = SurfaceManager.getManager(image);
            sMgr.acceleratedSurfaceLost();
        }
    }
View Full Code Here

     * should be disabled.
     */
    protected void disableDD() {
        markSurfaceLost();
        if (image != null) {
            SurfaceManager sMgr = SurfaceManager.getManager(image);
            // REMIND: yes, this is not pretty; the accelerationEnabled property
            // should be pulled up to SurfaceManager some day.
            if (sMgr instanceof WinVolatileSurfaceManager) {
                ((WinVolatileSurfaceManager)sMgr).setAccelerationEnabled(false);
            }
View Full Code Here

     * surface).
     * Upon next validation the SurfaceManager will create a non-D3D surface.
     */
    public void disableD3D() {
        markSurfaceLost();
        SurfaceManager sMgr = SurfaceManager.getManager(image);
        if (sMgr instanceof WinVolatileSurfaceManager) {
            ((WinVolatileSurfaceManager)sMgr).setD3DAccelerationEnabled(false);
        }
    }
View Full Code Here

    public SurfaceData getSourceSurfaceData(Image img,
                                            int txtype,
                                            CompositeType comp,
                                            Color bgColor)
    {
        SurfaceManager srcMgr = SurfaceManager.getManager(img);
        SurfaceData srcData = srcMgr.getPrimarySurfaceData();
        if (img.getAccelerationPriority() > 0.0f &&
            blitProxyKey != null)
        {
            SurfaceDataProxy sdp =
                (SurfaceDataProxy) srcMgr.getCacheData(blitProxyKey);
            if (sdp == null || !sdp.isValid()) {
                if (srcData.getState() == State.UNTRACKABLE) {
                    sdp = SurfaceDataProxy.UNCACHED;
                } else {
                    sdp = makeProxyFor(srcData);
                }
                srcMgr.setCacheData(blitProxyKey, sdp);
            }
            srcData = sdp.replaceData(srcData, txtype, comp, bgColor);
        }
        return srcData;
    }
View Full Code Here

     * Extracts the SurfaceManager from the given Image, and then
     * returns the SurfaceData object that would best be suited as the
     * destination surface in some rendering operation.
     */
    public static SurfaceData getPrimarySurfaceData(Image img) {
        SurfaceManager sMgr = SurfaceManager.getManager(img);
        return sMgr.getPrimarySurfaceData();
    }
View Full Code Here

TOP

Related Classes of sun.awt.image.SurfaceManager

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.