Java Code Examples for sun.java2d.SurfaceData#pixelFor()

The following examples show how to use sun.java2d.SurfaceData#pixelFor() . 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: MaskFill.java    From jdk8u_jdk with GNU General Public License v2.0 6 votes vote down vote up
public void MaskFill(SunGraphics2D sg2d,
                     SurfaceData sData,
                     Composite comp,
                     int x, int y, int w, int h,
                     byte mask[], int offset, int scan)
{
    BufferedImage dstBI =
        new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB);
    SurfaceData tmpData = BufImgSurfaceData.createData(dstBI);

    // REMIND: This is not pretty.  It would be nicer if we
    // passed a "FillData" object to the Pixel loops, instead
    // of a SunGraphics2D parameter...
    Region clip = sg2d.clipRegion;
    sg2d.clipRegion = null;
    int pixel = sg2d.pixel;
    sg2d.pixel = tmpData.pixelFor(sg2d.getColor());
    fillop.FillRect(sg2d, tmpData, 0, 0, w, h);
    sg2d.pixel = pixel;
    sg2d.clipRegion = clip;

    maskop.MaskBlit(tmpData, sData, comp, null,
                    0, 0, x, y, w, h,
                    mask, offset, scan);
}
 
Example 2
Source File: X11PMBlitBgLoops.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
@Override
public void BlitBg(SurfaceData src, SurfaceData dst,
                   Composite comp, Region clip, int bgColor,
                   int sx, int sy,
                   int dx, int dy,
                   int w, int h)
{
    SunToolkit.awtLock();
    try {
        int pixel = dst.pixelFor(bgColor);
        X11SurfaceData x11sd = (X11SurfaceData)dst;
        // use false for needExposures since we clip to the pixmap
        long xgc = x11sd.getBlitGC(clip, false);
        nativeBlitBg(src.getNativeOps(), dst.getNativeOps(),
                     xgc, pixel,
                     sx, sy, dx, dy, w, h);
    } finally {
        SunToolkit.awtUnlock();
    }
}
 
Example 3
Source File: X11PMBlitBgLoops.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
@Override
public void BlitBg(SurfaceData src, SurfaceData dst,
                   Composite comp, Region clip, int bgColor,
                   int sx, int sy,
                   int dx, int dy,
                   int w, int h)
{
    SunToolkit.awtLock();
    try {
        int pixel = dst.pixelFor(bgColor);
        X11SurfaceData x11sd = (X11SurfaceData)dst;
        // use false for needExposures since we clip to the pixmap
        long xgc = x11sd.getBlitGC(clip, false);
        nativeBlitBg(src.getNativeOps(), dst.getNativeOps(),
                     xgc, pixel,
                     sx, sy, dx, dy, w, h);
    } finally {
        SunToolkit.awtUnlock();
    }
}
 
Example 4
Source File: MaskFill.java    From Bytecoder with Apache License 2.0 6 votes vote down vote up
public void MaskFill(SunGraphics2D sg2d,
                     SurfaceData sData,
                     Composite comp,
                     int x, int y, int w, int h,
                     byte[] mask, int offset, int scan)
{
    BufferedImage dstBI =
        new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB);
    SurfaceData tmpData = BufImgSurfaceData.createData(dstBI);

    // REMIND: This is not pretty.  It would be nicer if we
    // passed a "FillData" object to the Pixel loops, instead
    // of a SunGraphics2D parameter...
    Region clip = sg2d.clipRegion;
    sg2d.clipRegion = null;
    int pixel = sg2d.pixel;
    sg2d.pixel = tmpData.pixelFor(sg2d.getColor());
    fillop.FillRect(sg2d, tmpData, 0, 0, w, h);
    sg2d.pixel = pixel;
    sg2d.clipRegion = clip;

    maskop.MaskBlit(tmpData, sData, comp, null,
                    0, 0, x, y, w, h,
                    mask, offset, scan);
}
 
Example 5
Source File: MaskFill.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
public void MaskFill(SunGraphics2D sg2d,
                     SurfaceData sData,
                     Composite comp,
                     int x, int y, int w, int h,
                     byte mask[], int offset, int scan)
{
    BufferedImage dstBI =
        new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB);
    SurfaceData tmpData = BufImgSurfaceData.createData(dstBI);

    // REMIND: This is not pretty.  It would be nicer if we
    // passed a "FillData" object to the Pixel loops, instead
    // of a SunGraphics2D parameter...
    Region clip = sg2d.clipRegion;
    sg2d.clipRegion = null;
    int pixel = sg2d.pixel;
    sg2d.pixel = tmpData.pixelFor(sg2d.getColor());
    fillop.FillRect(sg2d, tmpData, 0, 0, w, h);
    sg2d.pixel = pixel;
    sg2d.clipRegion = clip;

    maskop.MaskBlit(tmpData, sData, comp, null,
                    0, 0, x, y, w, h,
                    mask, offset, scan);
}
 
Example 6
Source File: MaskFill.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
public void MaskFill(SunGraphics2D sg2d,
                     SurfaceData sData,
                     Composite comp,
                     int x, int y, int w, int h,
                     byte mask[], int offset, int scan)
{
    BufferedImage dstBI =
        new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB);
    SurfaceData tmpData = BufImgSurfaceData.createData(dstBI);

    // REMIND: This is not pretty.  It would be nicer if we
    // passed a "FillData" object to the Pixel loops, instead
    // of a SunGraphics2D parameter...
    Region clip = sg2d.clipRegion;
    sg2d.clipRegion = null;
    int pixel = sg2d.pixel;
    sg2d.pixel = tmpData.pixelFor(sg2d.getColor());
    fillop.FillRect(sg2d, tmpData, 0, 0, w, h);
    sg2d.pixel = pixel;
    sg2d.clipRegion = clip;

    maskop.MaskBlit(tmpData, sData, comp, null,
                    0, 0, x, y, w, h,
                    mask, offset, scan);
}
 
Example 7
Source File: MaskFill.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
public void MaskFill(SunGraphics2D sg2d,
                     SurfaceData sData,
                     Composite comp,
                     int x, int y, int w, int h,
                     byte mask[], int offset, int scan)
{
    BufferedImage dstBI =
        new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB);
    SurfaceData tmpData = BufImgSurfaceData.createData(dstBI);

    // REMIND: This is not pretty.  It would be nicer if we
    // passed a "FillData" object to the Pixel loops, instead
    // of a SunGraphics2D parameter...
    Region clip = sg2d.clipRegion;
    sg2d.clipRegion = null;
    int pixel = sg2d.pixel;
    sg2d.pixel = tmpData.pixelFor(sg2d.getColor());
    fillop.FillRect(sg2d, tmpData, 0, 0, w, h);
    sg2d.pixel = pixel;
    sg2d.clipRegion = clip;

    maskop.MaskBlit(tmpData, sData, comp, null,
                    0, 0, x, y, w, h,
                    mask, offset, scan);
}
 
Example 8
Source File: X11PMBlitBgLoops.java    From jdk8u_jdk with GNU General Public License v2.0 6 votes vote down vote up
@Override
public void BlitBg(SurfaceData src, SurfaceData dst,
                   Composite comp, Region clip, int bgColor,
                   int sx, int sy,
                   int dx, int dy,
                   int w, int h)
{
    SunToolkit.awtLock();
    try {
        int pixel = dst.pixelFor(bgColor);
        X11SurfaceData x11sd = (X11SurfaceData)dst;
        // use false for needExposures since we clip to the pixmap
        long xgc = x11sd.getBlitGC(clip, false);
        nativeBlitBg(src.getNativeOps(), dst.getNativeOps(),
                     xgc, pixel,
                     sx, sy, dx, dy, w, h);
    } finally {
        SunToolkit.awtUnlock();
    }
}
 
Example 9
Source File: X11PMBlitBgLoops.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
@Override
public void BlitBg(SurfaceData src, SurfaceData dst,
                   Composite comp, Region clip, int bgColor,
                   int sx, int sy,
                   int dx, int dy,
                   int w, int h)
{
    SunToolkit.awtLock();
    try {
        int pixel = dst.pixelFor(bgColor);
        X11SurfaceData x11sd = (X11SurfaceData)dst;
        // use false for needExposures since we clip to the pixmap
        long xgc = x11sd.getBlitGC(clip, false);
        nativeBlitBg(src.getNativeOps(), dst.getNativeOps(),
                     xgc, pixel,
                     sx, sy, dx, dy, w, h);
    } finally {
        SunToolkit.awtUnlock();
    }
}
 
Example 10
Source File: MaskFill.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
public void MaskFill(SunGraphics2D sg2d,
                     SurfaceData sData,
                     Composite comp,
                     int x, int y, int w, int h,
                     byte mask[], int offset, int scan)
{
    BufferedImage dstBI =
        new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB);
    SurfaceData tmpData = BufImgSurfaceData.createData(dstBI);

    // REMIND: This is not pretty.  It would be nicer if we
    // passed a "FillData" object to the Pixel loops, instead
    // of a SunGraphics2D parameter...
    Region clip = sg2d.clipRegion;
    sg2d.clipRegion = null;
    int pixel = sg2d.pixel;
    sg2d.pixel = tmpData.pixelFor(sg2d.getColor());
    fillop.FillRect(sg2d, tmpData, 0, 0, w, h);
    sg2d.pixel = pixel;
    sg2d.clipRegion = clip;

    maskop.MaskBlit(tmpData, sData, comp, null,
                    0, 0, x, y, w, h,
                    mask, offset, scan);
}
 
Example 11
Source File: MaskFill.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
public void MaskFill(SunGraphics2D sg2d,
                     SurfaceData sData,
                     Composite comp,
                     int x, int y, int w, int h,
                     byte mask[], int offset, int scan)
{
    BufferedImage dstBI =
        new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB);
    SurfaceData tmpData = BufImgSurfaceData.createData(dstBI);

    // REMIND: This is not pretty.  It would be nicer if we
    // passed a "FillData" object to the Pixel loops, instead
    // of a SunGraphics2D parameter...
    Region clip = sg2d.clipRegion;
    sg2d.clipRegion = null;
    int pixel = sg2d.pixel;
    sg2d.pixel = tmpData.pixelFor(sg2d.getColor());
    fillop.FillRect(sg2d, tmpData, 0, 0, w, h);
    sg2d.pixel = pixel;
    sg2d.clipRegion = clip;

    maskop.MaskBlit(tmpData, sData, comp, null,
                    0, 0, x, y, w, h,
                    mask, offset, scan);
}
 
Example 12
Source File: XORComposite.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public XORComposite(Color xorColor, SurfaceData sd) {
    this.xorColor = xorColor;

    SurfaceType sType = sd.getSurfaceType();

    this.xorPixel = sd.pixelFor(xorColor.getRGB());
    this.alphaMask = sType.getAlphaMask();
}
 
Example 13
Source File: XORComposite.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public XORComposite(Color xorColor, SurfaceData sd) {
    this.xorColor = xorColor;

    SurfaceType sType = sd.getSurfaceType();

    this.xorPixel = sd.pixelFor(xorColor.getRGB());
    this.alphaMask = sType.getAlphaMask();
}
 
Example 14
Source File: XORComposite.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
public XORComposite(Color xorColor, SurfaceData sd) {
    this.xorColor = xorColor;

    SurfaceType sType = sd.getSurfaceType();

    this.xorPixel = sd.pixelFor(xorColor.getRGB());
    this.alphaMask = sType.getAlphaMask();
}
 
Example 15
Source File: XORComposite.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public XORComposite(Color xorColor, SurfaceData sd) {
    this.xorColor = xorColor;

    SurfaceType sType = sd.getSurfaceType();

    this.xorPixel = sd.pixelFor(xorColor.getRGB());
    this.alphaMask = sType.getAlphaMask();
}
 
Example 16
Source File: XORComposite.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public XORComposite(Color xorColor, SurfaceData sd) {
    this.xorColor = xorColor;

    SurfaceType sType = sd.getSurfaceType();

    this.xorPixel = sd.pixelFor(xorColor.getRGB());
    this.alphaMask = sType.getAlphaMask();
}
 
Example 17
Source File: XORComposite.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
public XORComposite(Color xorColor, SurfaceData sd) {
    this.xorColor = xorColor;

    SurfaceType sType = sd.getSurfaceType();

    this.xorPixel = sd.pixelFor(xorColor.getRGB());
    this.alphaMask = sType.getAlphaMask();
}
 
Example 18
Source File: XORComposite.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
public XORComposite(Color xorColor, SurfaceData sd) {
    this.xorColor = xorColor;

    SurfaceType sType = sd.getSurfaceType();

    this.xorPixel = sd.pixelFor(xorColor.getRGB());
    this.alphaMask = sType.getAlphaMask();
}
 
Example 19
Source File: XORComposite.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public XORComposite(Color xorColor, SurfaceData sd) {
    this.xorColor = xorColor;

    SurfaceType sType = sd.getSurfaceType();

    this.xorPixel = sd.pixelFor(xorColor.getRGB());
    this.alphaMask = sType.getAlphaMask();
}
 
Example 20
Source File: XORComposite.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
public XORComposite(Color xorColor, SurfaceData sd) {
    this.xorColor = xorColor;

    SurfaceType sType = sd.getSurfaceType();

    this.xorPixel = sd.pixelFor(xorColor.getRGB());
    this.alphaMask = sType.getAlphaMask();
}