Package sun.java2d

Examples of sun.java2d.SurfaceData


    /*
     * Subclasses should override disposeImpl() instead of dispose(). Client
     * code should always invoke dispose(), never disposeImpl().
     */
    protected void disposeImpl() {
        SurfaceData oldData = surfaceData;
        surfaceData = null;
        oldData.invalidate();
        MToolkit.targetDisposedPeer(target, this);
        pDispose();
    }
View Full Code Here


        } else {
            pReshape(x, y, width, height);
        }

        if ((width != oldWidth) || (height != oldHeight)) {
            SurfaceData oldData = surfaceData;
            if (oldData != null) {
                surfaceData = graphicsConfig.createSurfaceData(this);
                oldData.invalidate();
            }
            oldWidth = width;
            oldHeight = height;
        }
        validateSurface(width, height);
View Full Code Here

    void validateSurface(int width, int height) {
        SunToolkit.awtLock();
        try {
            if (!disposed && (width != oldWidth || height != oldHeight)) {
                SurfaceData oldData = surfaceData;
                if (oldData != null) {
                    surfaceData = graphicsConfig.createSurfaceData(this);
                    oldData.invalidate();
                }
                oldWidth = width;
                oldHeight = height;
            }
        } finally {
View Full Code Here

            long pDst = dstData.getNativeOps();
            setRenderTarget(nativeContext, pDst);

            // keep the reference to the old data until we set the
            // new one on the native level, preventing it from being disposed
            SurfaceData tmpData = dstData;
            validatedDstData = dstData;
            tmpData = null;
        }
        // it's better to use dstData instead of validatedDstData because
        // the latter may be set to null via invalidateContext at any moment.
View Full Code Here

        //     - bicubic interpolation is specified
        //     - a background color is specified and will be used
        //     - the source surface is not a texture
        //     - an appropriate TransformBlit primitive could not be found
        if (interpType != AffineTransformOp.TYPE_BICUBIC) {
            SurfaceData dstData = sg.surfaceData;
            SurfaceData srcData =
                dstData.getSourceSurfaceData(img,
                                             sg.TRANSFORM_GENERIC,
                                             sg.imageComp,
                                             bgColor);

            if (srcData != null &&
                !isBgOperation(srcData, bgColor) &&
                srcData.getSurfaceType() == D3DSurfaceData.D3DTexture)
            {
                SurfaceType srcType = srcData.getSurfaceType();
                SurfaceType dstType = dstData.getSurfaceType();
                TransformBlit blit = TransformBlit.getFromCache(srcType,
                                                                sg.imageComp,
                                                                dstType);
View Full Code Here

        if (comp.getRule() != AlphaComposite.SRC_OVER) {
            comp = AlphaComposite.SrcOver;
        }

        synchronized (D3DContext.LOCK) {
            SurfaceData dstData = sg2d.surfaceData;
            long pCtx = D3DContext.getContext(dstData, dstData,
                                              sg2d.getCompClip(), comp,
                                              null, sg2d.eargb,
                                              D3DContext.NO_CONTEXT_FLAGS);

            doDrawGlyphList(dstData.getNativeOps(), pCtx,
                            sg2d.getCompClip(), gl);
        }
    }
View Full Code Here

     * 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();
        }
        XToolkit.targetDisposedPeer(target, this);
        destroy();
    }
View Full Code Here

    {
        Blit convertsrc = Blit.getFromCache(src.getSurfaceType(),
                                            CompositeType.SrcNoEa,
                                            SurfaceType.IntArgbPre);

        SurfaceData cachedSrc = null;
        if (srcTmp != null) {
            // use cached intermediate surface, if available
            cachedSrc = (SurfaceData)srcTmp.get();
        }
View Full Code Here

        try {
            if (g != null) {
                if (!(g instanceof SunGraphics2D)) {
                    return false;
                }
                SurfaceData sData = ((SunGraphics2D)g).surfaceData;
                if (!(sData instanceof OGLSurfaceData)) {
                    return false;
                }

                // make a context current to the destination surface
View Full Code Here

        if (!(g instanceof SunGraphics2D)) {
            return null;
        }

        SunGraphics2D sg2d = (SunGraphics2D)g;
        SurfaceData sData = (SurfaceData)sg2d.surfaceData;

        // this is the upper-left origin of the region to be painted,
        // relative to the upper-left origin of the surface
        // (in Java2D coordinates)
        int x0 = sg2d.transX;
        int y0 = sg2d.transY;

        // this is the lower-left origin of the region to be painted,
        // relative to the lower-left origin of the surface
        // (in OpenGL coordinates)
        Rectangle surfaceBounds = sData.getBounds();
        int x1 = x0;
        int y1 = surfaceBounds.height - (y0 + componentHeight);

        return new Rectangle(x1, y1, componentWidth, componentHeight);
    }
View Full Code Here

TOP

Related Classes of sun.java2d.SurfaceData

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.