Package java.awt

Examples of java.awt.AlphaComposite


                        srcx, srcy, dstx, dsty,
                        width, height);
            return;
        }

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

        rq.lock();
        try {
View Full Code Here


                         Composite comp,
                         final int x, final int y, final int w, final int h,
                         final byte[] mask,
                         final int maskoff, final int maskscan)
    {
        AlphaComposite acomp = (AlphaComposite)comp;
        if (acomp.getRule() != AlphaComposite.SRC_OVER) {
            comp = AlphaComposite.SrcOver;
        }

        rq.lock();
        try {
View Full Code Here

    }

    private void setComposite(Composite comp, int flags) {
        // assert rq.lock.isHeldByCurrentThread();
        if (comp instanceof AlphaComposite) {
            AlphaComposite ac = (AlphaComposite)comp;
            rq.ensureCapacity(16);
            buf.putInt(SET_ALPHA_COMPOSITE);
            buf.putInt(ac.getRule());
            buf.putFloat(ac.getAlpha());
            buf.putInt(flags);
        } else if (comp instanceof XORComposite) {
            int xorPixel = ((XORComposite)comp).getXorPixel();
            rq.ensureCapacity(8);
            buf.putInt(SET_XOR_COMPOSITE);
View Full Code Here

     * with the supplied <code>Composite</code>.
     */
    private void checkAlpha(Composite composite) {

        if (composite instanceof AlphaComposite) {
            AlphaComposite alphaComposite = (AlphaComposite) composite;
            float alpha = alphaComposite.getAlpha();
            int rule = alphaComposite.getRule();

            if (alpha != 1.0
                    || (rule != AlphaComposite.SRC
                        && rule != AlphaComposite.SRC_OVER)) {

View Full Code Here

        if ((comp != validatedComp) || (flags != validatedFlags)) {
            // invalidate pixel
            validatedPixel = ~pixel;
            validatedComp = comp;
            if (comp != null) {
                AlphaComposite ac = (AlphaComposite)comp;
                setAlphaComposite(nativeContext, ac.getRule(),
                                  ac.getAlpha(), flags);
            } else {
                resetComposite(nativeContext);
            }
        }
View Full Code Here

    public void MaskFill(SunGraphics2D sg2d, SurfaceData sData,
                         Composite comp,
                         int x, int y, int w, int h,
                         byte[] mask, int maskoff, int maskscan)
    {
        AlphaComposite acomp = (AlphaComposite)comp;
        if (acomp.getRule() != AlphaComposite.SRC_OVER) {
            comp = AlphaComposite.SrcOver;
        }

        synchronized (D3DContext.LOCK) {
            long pCtx = D3DContext.getContext(sData, sData,
View Full Code Here

    protected native void doDrawGlyphList(long pData, long pCtx,
                                          Region clip, GlyphList gl);

    protected void drawGlyphList(SunGraphics2D sg2d, GlyphList gl) {
        AlphaComposite comp = (AlphaComposite)sg2d.composite;
        // We can only get here if the comp is Src or SrcOver (see
        // pipeline validation in D3DSurfaceData, so we force
        // it to be SrcOver.
        if (comp.getRule() != AlphaComposite.SRC_OVER) {
            comp = AlphaComposite.SrcOver;
        }

        synchronized (D3DContext.LOCK) {
            SurfaceData dstData = sg2d.surfaceData;
View Full Code Here

        ctx.graphics = env.getGraphics();
        int w = env.getWidth();
        int h = env.getHeight();
        if (hasGraphics2D) {
            Graphics2D g2d = (Graphics2D) ctx.graphics;
            AlphaComposite ac = (AlphaComposite) env.getModifier(compRules);
            if (env.isEnabled(doExtraAlpha)) {
                ac = AlphaComposite.getInstance(ac.getRule(), 0.125f);
            }
            g2d.setComposite(ac);
            if (env.isEnabled(doXor)) {
                g2d.setXORMode(Color.white);
            }
View Full Code Here

        Color xorcolor = null;
        CompositeContext cont = null;

        if(comp instanceof AlphaComposite){
            isAlphaComp = true;
            AlphaComposite ac = (AlphaComposite) comp;
            rule = ac.getRule();
            alpha = ac.getAlpha();
        }else if(comp instanceof XORComposite){
            isXORComp = true;
            XORComposite xcomp = (XORComposite) comp;
            xorcolor = xcomp.getXORColor();
        }else{
View Full Code Here

        int bgRGB = bgcolor == null ? 0 : bgcolor.getRGB();
        int srcRGB = 0, dstRGB = 0;
        Object srcVal = null, dstVal = null;
        if(comp instanceof AlphaComposite){
            compType = AlphaCompositeMode;
            AlphaComposite ac = (AlphaComposite) comp;
            rule = ac.getRule();
            srcConstAlpha = (int)(ac.getAlpha() * 255 + 0.5f);
        }else if(comp instanceof XORComposite){
            compType = XORMode;
            XORComposite xor = (XORComposite) comp;
            bgRGB = xor.getXORColor().getRGB();
        }
View Full Code Here

TOP

Related Classes of java.awt.AlphaComposite

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.