Java Code Examples for sun.java2d.pipe.Region#getIntersectionXYWH()

The following examples show how to use sun.java2d.pipe.Region#getIntersectionXYWH() . 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: SunGraphics2D.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
public void setDevClip(int x, int y, int w, int h) {
    Region c = constrainClip;
    if (c == null) {
        devClip = Region.getInstanceXYWH(x, y, w, h);
    } else {
        devClip = c.getIntersectionXYWH(x, y, w, h);
    }
    validateCompClip();
}
 
Example 2
Source File: SunGraphics2D.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
public void setDevClip(int x, int y, int w, int h) {
    Region c = constrainClip;
    if (c == null) {
        devClip = Region.getInstanceXYWH(x, y, w, h);
    } else {
        devClip = c.getIntersectionXYWH(x, y, w, h);
    }
    validateCompClip();
}
 
Example 3
Source File: SunGraphics2D.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public void setDevClip(int x, int y, int w, int h) {
    Region c = constrainClip;
    if (c == null) {
        devClip = Region.getInstanceXYWH(x, y, w, h);
    } else {
        devClip = c.getIntersectionXYWH(x, y, w, h);
    }
    validateCompClip();
}
 
Example 4
Source File: SunGraphics2D.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
public void setDevClip(int x, int y, int w, int h) {
    Region c = constrainClip;
    if (c == null) {
        devClip = Region.getInstanceXYWH(x, y, w, h);
    } else {
        devClip = c.getIntersectionXYWH(x, y, w, h);
    }
    validateCompClip();
}
 
Example 5
Source File: SunGraphics2D.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public void setDevClip(int x, int y, int w, int h) {
    Region c = constrainClip;
    if (c == null) {
        devClip = Region.getInstanceXYWH(x, y, w, h);
    } else {
        devClip = c.getIntersectionXYWH(x, y, w, h);
    }
    validateCompClip();
}
 
Example 6
Source File: SunGraphics2D.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
public void setDevClip(int x, int y, int w, int h) {
    Region c = constrainClip;
    if (c == null) {
        devClip = Region.getInstanceXYWH(x, y, w, h);
    } else {
        devClip = c.getIntersectionXYWH(x, y, w, h);
    }
    validateCompClip();
}
 
Example 7
Source File: SunGraphics2D.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public void setDevClip(int x, int y, int w, int h) {
    Region c = constrainClip;
    if (c == null) {
        devClip = Region.getInstanceXYWH(x, y, w, h);
    } else {
        devClip = c.getIntersectionXYWH(x, y, w, h);
    }
    validateCompClip();
}
 
Example 8
Source File: SunGraphics2D.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public void setDevClip(int x, int y, int w, int h) {
    Region c = constrainClip;
    if (c == null) {
        devClip = Region.getInstanceXYWH(x, y, w, h);
    } else {
        devClip = c.getIntersectionXYWH(x, y, w, h);
    }
    validateCompClip();
}
 
Example 9
Source File: SunGraphics2D.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public void setDevClip(int x, int y, int w, int h) {
    Region c = constrainClip;
    if (c == null) {
        devClip = Region.getInstanceXYWH(x, y, w, h);
    } else {
        devClip = c.getIntersectionXYWH(x, y, w, h);
    }
    validateCompClip();
}
 
Example 10
Source File: SunGraphics2D.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
public void setDevClip(int x, int y, int w, int h) {
    Region c = constrainClip;
    if (c == null) {
        devClip = Region.getInstanceXYWH(x, y, w, h);
    } else {
        devClip = c.getIntersectionXYWH(x, y, w, h);
    }
    validateCompClip();
}
 
Example 11
Source File: OGLBlitLoops.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
public void Blit(SurfaceData src, SurfaceData dst,
                 Composite comp, Region clip,
                 int sx, int sy, int dx, int dy,
                 int w, int h)
{
    if (clip != null) {
        clip = clip.getIntersectionXYWH(dx, dy, w, h);
        // At the end this method will flush the RenderQueue, we should exit
        // from it as soon as possible.
        if (clip.isEmpty()) {
            return;
        }
        sx += clip.getLoX() - dx;
        sy += clip.getLoY() - dy;
        dx = clip.getLoX();
        dy = clip.getLoY();
        w = clip.getWidth();
        h = clip.getHeight();

        if (!clip.isRectangular()) {
            complexClipBlit(src, dst, comp, clip, sx, sy, dx, dy, w, h);
            return;
        }
    }

    OGLRenderQueue rq = OGLRenderQueue.getInstance();
    rq.lock();
    try {
        // make sure the RenderQueue keeps a hard reference to the
        // destination (sysmem) SurfaceData to prevent it from being
        // disposed while the operation is processed on the QFT
        rq.addReference(dst);

        RenderBuffer buf = rq.getBuffer();
        OGLContext.validateContext((OGLSurfaceData)src);

        rq.ensureCapacityAndAlignment(48, 32);
        buf.putInt(SURFACE_TO_SW_BLIT);
        buf.putInt(sx).putInt(sy);
        buf.putInt(dx).putInt(dy);
        buf.putInt(w).putInt(h);
        buf.putInt(typeval);
        buf.putLong(src.getNativeOps());
        buf.putLong(dst.getNativeOps());

        // always flush immediately
        rq.flushNow();
    } finally {
        rq.unlock();
    }
}
 
Example 12
Source File: OGLBlitLoops.java    From jdk8u-dev-jdk with GNU General Public License v2.0 4 votes vote down vote up
public void Blit(SurfaceData src, SurfaceData dst,
                 Composite comp, Region clip,
                 int sx, int sy, int dx, int dy,
                 int w, int h)
{
    if (clip != null) {
        clip = clip.getIntersectionXYWH(dx, dy, w, h);
        // At the end this method will flush the RenderQueue, we should exit
        // from it as soon as possible.
        if (clip.isEmpty()) {
            return;
        }
        sx += clip.getLoX() - dx;
        sy += clip.getLoY() - dy;
        dx = clip.getLoX();
        dy = clip.getLoY();
        w = clip.getWidth();
        h = clip.getHeight();

        if (!clip.isRectangular()) {
            complexClipBlit(src, dst, comp, clip, sx, sy, dx, dy, w, h);
            return;
        }
    }

    OGLRenderQueue rq = OGLRenderQueue.getInstance();
    rq.lock();
    try {
        // make sure the RenderQueue keeps a hard reference to the
        // destination (sysmem) SurfaceData to prevent it from being
        // disposed while the operation is processed on the QFT
        rq.addReference(dst);

        RenderBuffer buf = rq.getBuffer();
        OGLContext.validateContext((OGLSurfaceData)src);

        rq.ensureCapacityAndAlignment(48, 32);
        buf.putInt(SURFACE_TO_SW_BLIT);
        buf.putInt(sx).putInt(sy);
        buf.putInt(dx).putInt(dy);
        buf.putInt(w).putInt(h);
        buf.putInt(typeval);
        buf.putLong(src.getNativeOps());
        buf.putLong(dst.getNativeOps());

        // always flush immediately
        rq.flushNow();
    } finally {
        rq.unlock();
    }
}
 
Example 13
Source File: OGLBlitLoops.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
public void Blit(SurfaceData src, SurfaceData dst,
                 Composite comp, Region clip,
                 int sx, int sy, int dx, int dy,
                 int w, int h)
{
    if (clip != null) {
        clip = clip.getIntersectionXYWH(dx, dy, w, h);
        // At the end this method will flush the RenderQueue, we should exit
        // from it as soon as possible.
        if (clip.isEmpty()) {
            return;
        }
        sx += clip.getLoX() - dx;
        sy += clip.getLoY() - dy;
        dx = clip.getLoX();
        dy = clip.getLoY();
        w = clip.getWidth();
        h = clip.getHeight();

        if (!clip.isRectangular()) {
            complexClipBlit(src, dst, comp, clip, sx, sy, dx, dy, w, h);
            return;
        }
    }

    OGLRenderQueue rq = OGLRenderQueue.getInstance();
    rq.lock();
    try {
        // make sure the RenderQueue keeps a hard reference to the
        // destination (sysmem) SurfaceData to prevent it from being
        // disposed while the operation is processed on the QFT
        rq.addReference(dst);

        RenderBuffer buf = rq.getBuffer();
        OGLContext.validateContext((OGLSurfaceData)src);

        rq.ensureCapacityAndAlignment(48, 32);
        buf.putInt(SURFACE_TO_SW_BLIT);
        buf.putInt(sx).putInt(sy);
        buf.putInt(dx).putInt(dy);
        buf.putInt(w).putInt(h);
        buf.putInt(typeval);
        buf.putLong(src.getNativeOps());
        buf.putLong(dst.getNativeOps());

        // always flush immediately
        rq.flushNow();
    } finally {
        rq.unlock();
    }
}
 
Example 14
Source File: OGLBlitLoops.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
public void Blit(SurfaceData src, SurfaceData dst,
                 Composite comp, Region clip,
                 int sx, int sy, int dx, int dy,
                 int w, int h)
{
    if (clip != null) {
        clip = clip.getIntersectionXYWH(dx, dy, w, h);
        // At the end this method will flush the RenderQueue, we should exit
        // from it as soon as possible.
        if (clip.isEmpty()) {
            return;
        }
        sx += clip.getLoX() - dx;
        sy += clip.getLoY() - dy;
        dx = clip.getLoX();
        dy = clip.getLoY();
        w = clip.getWidth();
        h = clip.getHeight();

        if (!clip.isRectangular()) {
            complexClipBlit(src, dst, comp, clip, sx, sy, dx, dy, w, h);
            return;
        }
    }

    OGLRenderQueue rq = OGLRenderQueue.getInstance();
    rq.lock();
    try {
        // make sure the RenderQueue keeps a hard reference to the
        // destination (sysmem) SurfaceData to prevent it from being
        // disposed while the operation is processed on the QFT
        rq.addReference(dst);

        RenderBuffer buf = rq.getBuffer();
        OGLContext.validateContext((OGLSurfaceData)src);

        rq.ensureCapacityAndAlignment(48, 32);
        buf.putInt(SURFACE_TO_SW_BLIT);
        buf.putInt(sx).putInt(sy);
        buf.putInt(dx).putInt(dy);
        buf.putInt(w).putInt(h);
        buf.putInt(typeval);
        buf.putLong(src.getNativeOps());
        buf.putLong(dst.getNativeOps());

        // always flush immediately
        rq.flushNow();
    } finally {
        rq.unlock();
    }
}
 
Example 15
Source File: OGLBlitLoops.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
public void Blit(SurfaceData src, SurfaceData dst,
                 Composite comp, Region clip,
                 int sx, int sy, int dx, int dy,
                 int w, int h)
{
    if (clip != null) {
        clip = clip.getIntersectionXYWH(dx, dy, w, h);
        // At the end this method will flush the RenderQueue, we should exit
        // from it as soon as possible.
        if (clip.isEmpty()) {
            return;
        }
        sx += clip.getLoX() - dx;
        sy += clip.getLoY() - dy;
        dx = clip.getLoX();
        dy = clip.getLoY();
        w = clip.getWidth();
        h = clip.getHeight();

        if (!clip.isRectangular()) {
            complexClipBlit(src, dst, comp, clip, sx, sy, dx, dy, w, h);
            return;
        }
    }

    OGLRenderQueue rq = OGLRenderQueue.getInstance();
    rq.lock();
    try {
        // make sure the RenderQueue keeps a hard reference to the
        // destination (sysmem) SurfaceData to prevent it from being
        // disposed while the operation is processed on the QFT
        rq.addReference(dst);

        RenderBuffer buf = rq.getBuffer();
        OGLContext.validateContext((OGLSurfaceData)src);

        rq.ensureCapacityAndAlignment(48, 32);
        buf.putInt(SURFACE_TO_SW_BLIT);
        buf.putInt(sx).putInt(sy);
        buf.putInt(dx).putInt(dy);
        buf.putInt(w).putInt(h);
        buf.putInt(typeval);
        buf.putLong(src.getNativeOps());
        buf.putLong(dst.getNativeOps());

        // always flush immediately
        rq.flushNow();
    } finally {
        rq.unlock();
    }
}
 
Example 16
Source File: OGLBlitLoops.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
public void Blit(SurfaceData src, SurfaceData dst,
                 Composite comp, Region clip,
                 int sx, int sy, int dx, int dy,
                 int w, int h)
{
    if (clip != null) {
        clip = clip.getIntersectionXYWH(dx, dy, w, h);
        // At the end this method will flush the RenderQueue, we should exit
        // from it as soon as possible.
        if (clip.isEmpty()) {
            return;
        }
        sx += clip.getLoX() - dx;
        sy += clip.getLoY() - dy;
        dx = clip.getLoX();
        dy = clip.getLoY();
        w = clip.getWidth();
        h = clip.getHeight();

        if (!clip.isRectangular()) {
            complexClipBlit(src, dst, comp, clip, sx, sy, dx, dy, w, h);
            return;
        }
    }

    OGLRenderQueue rq = OGLRenderQueue.getInstance();
    rq.lock();
    try {
        // make sure the RenderQueue keeps a hard reference to the
        // destination (sysmem) SurfaceData to prevent it from being
        // disposed while the operation is processed on the QFT
        rq.addReference(dst);

        RenderBuffer buf = rq.getBuffer();
        OGLContext.validateContext((OGLSurfaceData)src);

        rq.ensureCapacityAndAlignment(48, 32);
        buf.putInt(SURFACE_TO_SW_BLIT);
        buf.putInt(sx).putInt(sy);
        buf.putInt(dx).putInt(dy);
        buf.putInt(w).putInt(h);
        buf.putInt(typeval);
        buf.putLong(src.getNativeOps());
        buf.putLong(dst.getNativeOps());

        // always flush immediately
        rq.flushNow();
    } finally {
        rq.unlock();
    }
}
 
Example 17
Source File: D3DBlitLoops.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
public void Blit(SurfaceData src, SurfaceData dst,
                 Composite comp, Region clip,
                 int sx, int sy, int dx, int dy,
                 int w, int h)
{
    if (clip != null) {
        clip = clip.getIntersectionXYWH(dx, dy, w, h);
        // At the end this method will flush the RenderQueue, we should exit
        // from it as soon as possible.
        if (clip.isEmpty()) {
            return;
        }

        // Adjust final dst(x,y) and src(x,y) based on the clip. The
        // logic is that, when clip limits drawing on the destination,
        // corresponding pixels from the src should be skipped.
        sx += clip.getLoX() - dx;
        sy += clip.getLoY() - dy;
        dx = clip.getLoX();
        dy = clip.getLoY();
        w = clip.getWidth();
        h = clip.getHeight();

        // Check if the clip is Rectangular. For non-rectangular clips
        // complexClipBlit will convert Surface To Sysmem and perform
        // regular Blit.
        if (!clip.isRectangular()) {
            complexClipBlit(src, dst, comp, clip,
                            sx, sy, dx, dy,
                            w, h);
            return;
        }
    }

    D3DRenderQueue rq = D3DRenderQueue.getInstance();
    rq.lock();
    try {
        // make sure the RenderQueue keeps a hard reference to the
        // destination (sysmem) SurfaceData to prevent it from being
        // disposed while the operation is processed on the QFT
        rq.addReference(dst);

        RenderBuffer buf = rq.getBuffer();
        D3DContext.setScratchSurface(((D3DSurfaceData)src).getContext());

        rq.ensureCapacityAndAlignment(48, 32);
        buf.putInt(SURFACE_TO_SW_BLIT);
        buf.putInt(sx).putInt(sy);
        buf.putInt(dx).putInt(dy);
        buf.putInt(w).putInt(h);
        buf.putInt(typeval);
        buf.putLong(src.getNativeOps());
        buf.putLong(dst.getNativeOps());

        // always flush immediately
        rq.flushNow();
    } finally {
        rq.unlock();
    }
}
 
Example 18
Source File: OGLBlitLoops.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
public void Blit(SurfaceData src, SurfaceData dst,
                 Composite comp, Region clip,
                 int sx, int sy, int dx, int dy,
                 int w, int h)
{
    if (clip != null) {
        clip = clip.getIntersectionXYWH(dx, dy, w, h);
        // At the end this method will flush the RenderQueue, we should exit
        // from it as soon as possible.
        if (clip.isEmpty()) {
            return;
        }
        sx += clip.getLoX() - dx;
        sy += clip.getLoY() - dy;
        dx = clip.getLoX();
        dy = clip.getLoY();
        w = clip.getWidth();
        h = clip.getHeight();

        if (!clip.isRectangular()) {
            complexClipBlit(src, dst, comp, clip, sx, sy, dx, dy, w, h);
            return;
        }
    }

    OGLRenderQueue rq = OGLRenderQueue.getInstance();
    rq.lock();
    try {
        // make sure the RenderQueue keeps a hard reference to the
        // destination (sysmem) SurfaceData to prevent it from being
        // disposed while the operation is processed on the QFT
        rq.addReference(dst);

        RenderBuffer buf = rq.getBuffer();
        OGLContext.validateContext((OGLSurfaceData)src);

        rq.ensureCapacityAndAlignment(48, 32);
        buf.putInt(SURFACE_TO_SW_BLIT);
        buf.putInt(sx).putInt(sy);
        buf.putInt(dx).putInt(dy);
        buf.putInt(w).putInt(h);
        buf.putInt(typeval);
        buf.putLong(src.getNativeOps());
        buf.putLong(dst.getNativeOps());

        // always flush immediately
        rq.flushNow();
    } finally {
        rq.unlock();
    }
}
 
Example 19
Source File: OGLBlitLoops.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
public void Blit(SurfaceData src, SurfaceData dst,
                 Composite comp, Region clip,
                 int sx, int sy, int dx, int dy,
                 int w, int h)
{
    if (clip != null) {
        clip = clip.getIntersectionXYWH(dx, dy, w, h);
        // At the end this method will flush the RenderQueue, we should exit
        // from it as soon as possible.
        if (clip.isEmpty()) {
            return;
        }
        sx += clip.getLoX() - dx;
        sy += clip.getLoY() - dy;
        dx = clip.getLoX();
        dy = clip.getLoY();
        w = clip.getWidth();
        h = clip.getHeight();

        if (!clip.isRectangular()) {
            complexClipBlit(src, dst, comp, clip, sx, sy, dx, dy, w, h);
            return;
        }
    }

    OGLRenderQueue rq = OGLRenderQueue.getInstance();
    rq.lock();
    try {
        // make sure the RenderQueue keeps a hard reference to the
        // destination (sysmem) SurfaceData to prevent it from being
        // disposed while the operation is processed on the QFT
        rq.addReference(dst);

        RenderBuffer buf = rq.getBuffer();
        OGLContext.validateContext((OGLSurfaceData)src);

        rq.ensureCapacityAndAlignment(48, 32);
        buf.putInt(SURFACE_TO_SW_BLIT);
        buf.putInt(sx).putInt(sy);
        buf.putInt(dx).putInt(dy);
        buf.putInt(w).putInt(h);
        buf.putInt(typeval);
        buf.putLong(src.getNativeOps());
        buf.putLong(dst.getNativeOps());

        // always flush immediately
        rq.flushNow();
    } finally {
        rq.unlock();
    }
}
 
Example 20
Source File: OGLBlitLoops.java    From jdk8u_jdk with GNU General Public License v2.0 4 votes vote down vote up
public void Blit(SurfaceData src, SurfaceData dst,
                 Composite comp, Region clip,
                 int sx, int sy, int dx, int dy,
                 int w, int h)
{
    if (clip != null) {
        clip = clip.getIntersectionXYWH(dx, dy, w, h);
        // At the end this method will flush the RenderQueue, we should exit
        // from it as soon as possible.
        if (clip.isEmpty()) {
            return;
        }
        sx += clip.getLoX() - dx;
        sy += clip.getLoY() - dy;
        dx = clip.getLoX();
        dy = clip.getLoY();
        w = clip.getWidth();
        h = clip.getHeight();

        if (!clip.isRectangular()) {
            complexClipBlit(src, dst, comp, clip, sx, sy, dx, dy, w, h);
            return;
        }
    }

    OGLRenderQueue rq = OGLRenderQueue.getInstance();
    rq.lock();
    try {
        // make sure the RenderQueue keeps a hard reference to the
        // destination (sysmem) SurfaceData to prevent it from being
        // disposed while the operation is processed on the QFT
        rq.addReference(dst);

        RenderBuffer buf = rq.getBuffer();
        OGLContext.validateContext((OGLSurfaceData)src);

        rq.ensureCapacityAndAlignment(48, 32);
        buf.putInt(SURFACE_TO_SW_BLIT);
        buf.putInt(sx).putInt(sy);
        buf.putInt(dx).putInt(dy);
        buf.putInt(w).putInt(h);
        buf.putInt(typeval);
        buf.putLong(src.getNativeOps());
        buf.putLong(dst.getNativeOps());

        // always flush immediately
        rq.flushNow();
    } finally {
        rq.unlock();
    }
}