sun.java2d.loops.XORComposite Java Examples

The following examples show how to use sun.java2d.loops.XORComposite. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: BufferedContext.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
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);
        buf.putInt(xorPixel);
    } else {
        throw new InternalError("not yet implemented");
    }
}
 
Example #2
Source File: BufferedContext.java    From jdk8u_jdk with GNU General Public License v2.0 6 votes vote down vote up
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);
        buf.putInt(xorPixel);
    } else {
        throw new InternalError("not yet implemented");
    }
}
 
Example #3
Source File: BufferedContext.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
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);
        buf.putInt(xorPixel);
    } else {
        throw new InternalError("not yet implemented");
    }
}
 
Example #4
Source File: BufferedContext.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
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);
        buf.putInt(xorPixel);
    } else {
        throw new InternalError("not yet implemented");
    }
}
 
Example #5
Source File: BufferedContext.java    From jdk8u-dev-jdk with GNU General Public License v2.0 6 votes vote down vote up
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);
        buf.putInt(xorPixel);
    } else {
        throw new InternalError("not yet implemented");
    }
}
 
Example #6
Source File: BufferedContext.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
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);
        buf.putInt(xorPixel);
    } else {
        throw new InternalError("not yet implemented");
    }
}
 
Example #7
Source File: BufferedContext.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
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);
        buf.putInt(xorPixel);
    } else {
        throw new InternalError("not yet implemented");
    }
}
 
Example #8
Source File: BufferedContext.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
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);
        buf.putInt(xorPixel);
    } else {
        throw new InternalError("not yet implemented");
    }
}
 
Example #9
Source File: BufferedContext.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
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);
        buf.putInt(xorPixel);
    } else {
        throw new InternalError("not yet implemented");
    }
}
 
Example #10
Source File: BufferedContext.java    From Bytecoder with Apache License 2.0 6 votes vote down vote up
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);
        buf.putInt(xorPixel);
    } else {
        throw new InternalError("not yet implemented");
    }
}
 
Example #11
Source File: BufferedContext.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
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);
        buf.putInt(xorPixel);
    } else {
        throw new InternalError("not yet implemented");
    }
}
 
Example #12
Source File: BufferedContext.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
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);
        buf.putInt(xorPixel);
    } else {
        throw new InternalError("not yet implemented");
    }
}
 
Example #13
Source File: BufferedContext.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
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);
        buf.putInt(xorPixel);
    } else {
        throw new InternalError("not yet implemented");
    }
}
 
Example #14
Source File: BufferedContext.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
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);
        buf.putInt(xorPixel);
    } else {
        throw new InternalError("not yet implemented");
    }
}
 
Example #15
Source File: SunCompositeContext.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
public SunCompositeContext(XORComposite xc,
                           ColorModel s, ColorModel d)
{
    if (s == null) {
        throw new NullPointerException("Source color model cannot be null");
    }
    if (d == null) {
        throw new NullPointerException("Destination color model cannot be null");
    }
    srcCM = s;
    dstCM = d;
    this.composite = xc;
    this.comptype = CompositeType.Xor;
}
 
Example #16
Source File: SunCompositeContext.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public SunCompositeContext(XORComposite xc,
                           ColorModel s, ColorModel d)
{
    if (s == null) {
        throw new NullPointerException("Source color model cannot be null");
    }
    if (d == null) {
        throw new NullPointerException("Destination color model cannot be null");
    }
    srcCM = s;
    dstCM = d;
    this.composite = xc;
    this.comptype = CompositeType.Xor;
}
 
Example #17
Source File: SunGraphics2D.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
private void revalidateAll() {
    try {
        // REMIND: This locking needs to be done around the
        // caller of this method so that the pipe stays valid
        // long enough to call the new primitive.
        // REMIND: No locking yet in screen SurfaceData objects!
        // surfaceData.lock();
        surfaceData = surfaceData.getReplacement();
        if (surfaceData == null) {
            surfaceData = NullSurfaceData.theInstance;
        }

        invalidatePipe();

        // this will recalculate the composite clip
        setDevClip(surfaceData.getBounds());

        if (paintState <= PAINT_ALPHACOLOR) {
            validateColor();
        }
        if (composite instanceof XORComposite) {
            Color c = ((XORComposite) composite).getXorColor();
            setComposite(new XORComposite(c, surfaceData));
        }
        validatePipe();
    } finally {
        // REMIND: No locking yet in screen SurfaceData objects!
        // surfaceData.unlock();
    }
}
 
Example #18
Source File: SunCompositeContext.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public SunCompositeContext(XORComposite xc,
                           ColorModel s, ColorModel d)
{
    if (s == null) {
        throw new NullPointerException("Source color model cannot be null");
    }
    if (d == null) {
        throw new NullPointerException("Destination color model cannot be null");
    }
    srcCM = s;
    dstCM = d;
    this.composite = xc;
    this.comptype = CompositeType.Xor;
}
 
Example #19
Source File: SunGraphics2D.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
private void revalidateAll() {
    try {
        // REMIND: This locking needs to be done around the
        // caller of this method so that the pipe stays valid
        // long enough to call the new primitive.
        // REMIND: No locking yet in screen SurfaceData objects!
        // surfaceData.lock();
        surfaceData = surfaceData.getReplacement();
        if (surfaceData == null) {
            surfaceData = NullSurfaceData.theInstance;
        }

        // this will recalculate the composite clip
        setDevClip(surfaceData.getBounds());

        if (paintState <= PAINT_ALPHACOLOR) {
            validateColor();
        }
        if (composite instanceof XORComposite) {
            Color c = ((XORComposite) composite).getXorColor();
            setComposite(new XORComposite(c, surfaceData));
        }
        validatePipe();
    } finally {
        // REMIND: No locking yet in screen SurfaceData objects!
        // surfaceData.unlock();
    }
}
 
Example #20
Source File: SunGraphics2D.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
private void revalidateAll() {
    try {
        // REMIND: This locking needs to be done around the
        // caller of this method so that the pipe stays valid
        // long enough to call the new primitive.
        // REMIND: No locking yet in screen SurfaceData objects!
        // surfaceData.lock();
        surfaceData = surfaceData.getReplacement();
        if (surfaceData == null) {
            surfaceData = NullSurfaceData.theInstance;
        }

        // this will recalculate the composite clip
        setDevClip(surfaceData.getBounds());

        if (paintState <= PAINT_ALPHACOLOR) {
            validateColor();
        }
        if (composite instanceof XORComposite) {
            Color c = ((XORComposite) composite).getXorColor();
            setComposite(new XORComposite(c, surfaceData));
        }
        validatePipe();
    } finally {
        // REMIND: No locking yet in screen SurfaceData objects!
        // surfaceData.unlock();
    }
}
 
Example #21
Source File: SunCompositeContext.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
public SunCompositeContext(XORComposite xc,
                           ColorModel s, ColorModel d)
{
    if (s == null) {
        throw new NullPointerException("Source color model cannot be null");
    }
    if (d == null) {
        throw new NullPointerException("Destination color model cannot be null");
    }
    srcCM = s;
    dstCM = d;
    this.composite = xc;
    this.comptype = CompositeType.Xor;
}
 
Example #22
Source File: SunGraphics2D.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
private void revalidateAll() {
    try {
        // REMIND: This locking needs to be done around the
        // caller of this method so that the pipe stays valid
        // long enough to call the new primitive.
        // REMIND: No locking yet in screen SurfaceData objects!
        // surfaceData.lock();
        surfaceData = surfaceData.getReplacement();
        if (surfaceData == null) {
            surfaceData = NullSurfaceData.theInstance;
        }

        invalidatePipe();

        // this will recalculate the composite clip
        setDevClip(surfaceData.getBounds());

        if (paintState <= PAINT_ALPHACOLOR) {
            validateColor();
        }
        if (composite instanceof XORComposite) {
            Color c = ((XORComposite) composite).getXorColor();
            setComposite(new XORComposite(c, surfaceData));
        }
        validatePipe();
    } finally {
        // REMIND: No locking yet in screen SurfaceData objects!
        // surfaceData.unlock();
    }
}
 
Example #23
Source File: SunCompositeContext.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
public SunCompositeContext(XORComposite xc,
                           ColorModel s, ColorModel d)
{
    if (s == null) {
        throw new NullPointerException("Source color model cannot be null");
    }
    if (d == null) {
        throw new NullPointerException("Destination color model cannot be null");
    }
    srcCM = s;
    dstCM = d;
    this.composite = xc;
    this.comptype = CompositeType.Xor;
}
 
Example #24
Source File: SunGraphics2D.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
private void revalidateAll() {
    try {
        // REMIND: This locking needs to be done around the
        // caller of this method so that the pipe stays valid
        // long enough to call the new primitive.
        // REMIND: No locking yet in screen SurfaceData objects!
        // surfaceData.lock();
        surfaceData = surfaceData.getReplacement();
        if (surfaceData == null) {
            surfaceData = NullSurfaceData.theInstance;
        }

        invalidatePipe();

        // this will recalculate the composite clip
        setDevClip(surfaceData.getBounds());

        if (paintState <= PAINT_ALPHACOLOR) {
            validateColor();
        }
        if (composite instanceof XORComposite) {
            Color c = ((XORComposite) composite).getXorColor();
            setComposite(new XORComposite(c, surfaceData));
        }
        validatePipe();
    } finally {
        // REMIND: No locking yet in screen SurfaceData objects!
        // surfaceData.unlock();
    }
}
 
Example #25
Source File: SunCompositeContext.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public SunCompositeContext(XORComposite xc,
                           ColorModel s, ColorModel d)
{
    if (s == null) {
        throw new NullPointerException("Source color model cannot be null");
    }
    if (d == null) {
        throw new NullPointerException("Destination color model cannot be null");
    }
    srcCM = s;
    dstCM = d;
    this.composite = xc;
    this.comptype = CompositeType.Xor;
}
 
Example #26
Source File: SunGraphics2D.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
private void revalidateAll() {
    try {
        // REMIND: This locking needs to be done around the
        // caller of this method so that the pipe stays valid
        // long enough to call the new primitive.
        // REMIND: No locking yet in screen SurfaceData objects!
        // surfaceData.lock();
        surfaceData = surfaceData.getReplacement();
        if (surfaceData == null) {
            surfaceData = NullSurfaceData.theInstance;
        }

        invalidatePipe();

        // this will recalculate the composite clip
        setDevClip(surfaceData.getBounds());

        if (paintState <= PAINT_ALPHACOLOR) {
            validateColor();
        }
        if (composite instanceof XORComposite) {
            Color c = ((XORComposite) composite).getXorColor();
            setComposite(new XORComposite(c, surfaceData));
        }
        validatePipe();
    } finally {
        // REMIND: No locking yet in screen SurfaceData objects!
        // surfaceData.unlock();
    }
}
 
Example #27
Source File: SunGraphics2D.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
private void revalidateAll() {
    try {
        // REMIND: This locking needs to be done around the
        // caller of this method so that the pipe stays valid
        // long enough to call the new primitive.
        // REMIND: No locking yet in screen SurfaceData objects!
        // surfaceData.lock();
        surfaceData = surfaceData.getReplacement();
        if (surfaceData == null) {
            surfaceData = NullSurfaceData.theInstance;
        }

        invalidatePipe();

        // this will recalculate the composite clip
        setDevClip(surfaceData.getBounds());

        if (paintState <= PAINT_ALPHACOLOR) {
            validateColor();
        }
        if (composite instanceof XORComposite) {
            Color c = ((XORComposite) composite).getXorColor();
            setComposite(new XORComposite(c, surfaceData));
        }
        validatePipe();
    } finally {
        // REMIND: No locking yet in screen SurfaceData objects!
        // surfaceData.unlock();
    }
}
 
Example #28
Source File: SunGraphics2D.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
private void revalidateAll() {
    try {
        // REMIND: This locking needs to be done around the
        // caller of this method so that the pipe stays valid
        // long enough to call the new primitive.
        // REMIND: No locking yet in screen SurfaceData objects!
        // surfaceData.lock();
        surfaceData = surfaceData.getReplacement();
        if (surfaceData == null) {
            surfaceData = NullSurfaceData.theInstance;
        }

        invalidatePipe();

        // this will recalculate the composite clip
        setDevClip(surfaceData.getBounds());

        if (paintState <= PAINT_ALPHACOLOR) {
            validateColor();
        }
        if (composite instanceof XORComposite) {
            Color c = ((XORComposite) composite).getXorColor();
            setComposite(new XORComposite(c, surfaceData));
        }
        validatePipe();
    } finally {
        // REMIND: No locking yet in screen SurfaceData objects!
        // surfaceData.unlock();
    }
}
 
Example #29
Source File: SunCompositeContext.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
public SunCompositeContext(XORComposite xc,
                           ColorModel s, ColorModel d)
{
    if (s == null) {
        throw new NullPointerException("Source color model cannot be null");
    }
    if (d == null) {
        throw new NullPointerException("Destination color model cannot be null");
    }
    srcCM = s;
    dstCM = d;
    this.composite = xc;
    this.comptype = CompositeType.Xor;
}
 
Example #30
Source File: SunCompositeContext.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
public SunCompositeContext(XORComposite xc,
                           ColorModel s, ColorModel d)
{
    if (s == null) {
        throw new NullPointerException("Source color model cannot be null");
    }
    if (d == null) {
        throw new NullPointerException("Destination color model cannot be null");
    }
    srcCM = s;
    dstCM = d;
    this.composite = xc;
    this.comptype = CompositeType.Xor;
}