Java Code Examples for sun.java2d.pipe.Region#dimAdd()
The following examples show how to use
sun.java2d.pipe.Region#dimAdd() .
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 openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
/** * Constrain rendering for lightweight objects. */ public void constrain(int x, int y, int w, int h, Region region) { if ((x | y) != 0) { translate(x, y); } if (transformState > TRANSFORM_TRANSLATESCALE) { clipRect(0, 0, w, h); return; } // changes parameters according to the current scale and translate. final double scaleX = transform.getScaleX(); final double scaleY = transform.getScaleY(); x = constrainX = (int) transform.getTranslateX(); y = constrainY = (int) transform.getTranslateY(); w = Region.dimAdd(x, Region.clipScale(w, scaleX)); h = Region.dimAdd(y, Region.clipScale(h, scaleY)); Region c = constrainClip; if (c == null) { c = Region.getInstanceXYXY(x, y, w, h); } else { c = c.getIntersectionXYXY(x, y, w, h); } if (region != null) { region = region.getScaledRegion(scaleX, scaleY); region = region.getTranslatedRegion(x, y); c = c.getIntersection(region); } if (c == constrainClip) { // Common case to ignore return; } constrainClip = c; if (!devClip.isInsideQuickCheck(c)) { devClip = devClip.getIntersection(c); validateCompClip(); } }
Example 2
Source File: SunGraphics2D.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
/** * Constrain rendering for lightweight objects. */ public void constrain(int x, int y, int w, int h, Region region) { if ((x | y) != 0) { translate(x, y); } if (transformState > TRANSFORM_TRANSLATESCALE) { clipRect(0, 0, w, h); return; } // changes parameters according to the current scale and translate. final double scaleX = transform.getScaleX(); final double scaleY = transform.getScaleY(); x = constrainX = (int) transform.getTranslateX(); y = constrainY = (int) transform.getTranslateY(); w = Region.dimAdd(x, Region.clipScale(w, scaleX)); h = Region.dimAdd(y, Region.clipScale(h, scaleY)); Region c = constrainClip; if (c == null) { c = Region.getInstanceXYXY(x, y, w, h); } else { c = c.getIntersectionXYXY(x, y, w, h); } if (region != null) { region = region.getScaledRegion(scaleX, scaleY); region = region.getTranslatedRegion(x, y); c = c.getIntersection(region); } if (c == constrainClip) { // Common case to ignore return; } constrainClip = c; if (!devClip.isInsideQuickCheck(c)) { devClip = devClip.getIntersection(c); validateCompClip(); } }
Example 3
Source File: SunGraphics2D.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
/** * Constrain rendering for lightweight objects. */ public void constrain(int x, int y, int w, int h, Region region) { if ((x | y) != 0) { translate(x, y); } if (transformState > TRANSFORM_TRANSLATESCALE) { clipRect(0, 0, w, h); return; } // changes parameters according to the current scale and translate. final double scaleX = transform.getScaleX(); final double scaleY = transform.getScaleY(); x = constrainX = (int) transform.getTranslateX(); y = constrainY = (int) transform.getTranslateY(); w = Region.dimAdd(x, Region.clipScale(w, scaleX)); h = Region.dimAdd(y, Region.clipScale(h, scaleY)); Region c = constrainClip; if (c == null) { c = Region.getInstanceXYXY(x, y, w, h); } else { c = c.getIntersectionXYXY(x, y, w, h); } if (region != null) { region = region.getScaledRegion(scaleX, scaleY); region = region.getTranslatedRegion(x, y); c = c.getIntersection(region); } if (c == constrainClip) { // Common case to ignore return; } constrainClip = c; if (!devClip.isInsideQuickCheck(c)) { devClip = devClip.getIntersection(c); validateCompClip(); } }
Example 4
Source File: XRRenderer.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
public void fillRect(SunGraphics2D sg2d, int x, int y, int width, int height) { x = Region.clipAdd(x, sg2d.transX); y = Region.clipAdd(y, sg2d.transY); /* * Limit x/y to signed short, width/height to unsigned short, * to match the X11 coordinate limits for rectangles. * Correct width/height in case x/y have been modified by clipping. */ if (x > Short.MAX_VALUE || y > Short.MAX_VALUE) { return; } int x2 = Region.dimAdd(x, width); int y2 = Region.dimAdd(y, height); if (x2 < Short.MIN_VALUE || y2 < Short.MIN_VALUE) { return; } x = clampToShort(x); y = clampToShort(y); width = clampToUShort(x2 - x); height = clampToUShort(y2 - y); if (width == 0 || height == 0) { return; } SunToolkit.awtLock(); try { validateSurface(sg2d); rectBuffer.pushRectValues(x, y, width, height); tileManager.fillMask((XRSurfaceData) sg2d.surfaceData); } finally { SunToolkit.awtUnlock(); } }
Example 5
Source File: SunGraphics2D.java From Bytecoder with Apache License 2.0 | 5 votes |
/** * Constrain rendering for lightweight objects. */ public void constrain(int x, int y, int w, int h, Region region) { if ((x | y) != 0) { translate(x, y); } if (transformState > TRANSFORM_TRANSLATESCALE) { clipRect(0, 0, w, h); return; } // changes parameters according to the current scale and translate. final double scaleX = transform.getScaleX(); final double scaleY = transform.getScaleY(); x = constrainX = (int) transform.getTranslateX(); y = constrainY = (int) transform.getTranslateY(); w = Region.dimAdd(x, Region.clipScale(w, scaleX)); h = Region.dimAdd(y, Region.clipScale(h, scaleY)); Region c = constrainClip; if (c == null) { c = Region.getInstanceXYXY(x, y, w, h); } else { c = c.getIntersectionXYXY(x, y, w, h); } if (region != null) { region = region.getScaledRegion(scaleX, scaleY); region = region.getTranslatedRegion(x, y); c = c.getIntersection(region); } if (c == constrainClip) { // Common case to ignore return; } constrainClip = c; if (!devClip.isInsideQuickCheck(c)) { devClip = devClip.getIntersection(c); validateCompClip(); } }
Example 6
Source File: GeneralRenderer.java From Bytecoder with Apache License 2.0 | 5 votes |
public static void doDrawRect(PixelWriter pw, SunGraphics2D sg2d, SurfaceData sData, int x, int y, int w, int h) { if (w < 0 || h < 0) { return; } int x2 = Region.dimAdd(Region.dimAdd(x, w), 1); int y2 = Region.dimAdd(Region.dimAdd(y, h), 1); Region r = sg2d.getCompClip().getBoundsIntersectionXYXY(x, y, x2, y2); if (r.isEmpty()) { return; } int cx1 = r.getLoX(); int cy1 = r.getLoY(); int cx2 = r.getHiX(); int cy2 = r.getHiY(); if (w < 2 || h < 2) { doSetRect(sData, pw, cx1, cy1, cx2, cy2); return; } if (cy1 == y) { doSetRect(sData, pw, cx1, cy1, cx2, cy1+1); } if (cx1 == x) { doSetRect(sData, pw, cx1, cy1+1, cx1+1, cy2-1); } if (cx2 == x2) { doSetRect(sData, pw, cx2-1, cy1+1, cx2, cy2-1); } if (cy2 == y2) { doSetRect(sData, pw, cx1, cy2-1, cx2, cy2); } }
Example 7
Source File: XRRenderer.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
public void fillRect(SunGraphics2D sg2d, int x, int y, int width, int height) { x = Region.clipAdd(x, sg2d.transX); y = Region.clipAdd(y, sg2d.transY); /* * Limit x/y to signed short, width/height to unsigned short, * to match the X11 coordinate limits for rectangles. * Correct width/height in case x/y have been modified by clipping. */ if (x > Short.MAX_VALUE || y > Short.MAX_VALUE) { return; } int x2 = Region.dimAdd(x, width); int y2 = Region.dimAdd(y, height); if (x2 < Short.MIN_VALUE || y2 < Short.MIN_VALUE) { return; } x = clampToShort(x); y = clampToShort(y); width = clampToUShort(x2 - x); height = clampToUShort(y2 - y); if (width == 0 || height == 0) { return; } SunToolkit.awtLock(); try { validateSurface(sg2d); rectBuffer.pushRectValues(x, y, width, height); tileManager.fillMask((XRSurfaceData) sg2d.surfaceData); } finally { SunToolkit.awtUnlock(); } }
Example 8
Source File: SunGraphics2D.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
/** * Constrain rendering for lightweight objects. */ public void constrain(int x, int y, int w, int h, Region region) { if ((x | y) != 0) { translate(x, y); } if (transformState > TRANSFORM_TRANSLATESCALE) { clipRect(0, 0, w, h); return; } // changes parameters according to the current scale and translate. final double scaleX = transform.getScaleX(); final double scaleY = transform.getScaleY(); x = constrainX = (int) transform.getTranslateX(); y = constrainY = (int) transform.getTranslateY(); w = Region.dimAdd(x, Region.clipScale(w, scaleX)); h = Region.dimAdd(y, Region.clipScale(h, scaleY)); Region c = constrainClip; if (c == null) { c = Region.getInstanceXYXY(x, y, w, h); } else { c = c.getIntersectionXYXY(x, y, w, h); } if (region != null) { region = region.getScaledRegion(scaleX, scaleY); region = region.getTranslatedRegion(x, y); c = c.getIntersection(region); } if (c == constrainClip) { // Common case to ignore return; } constrainClip = c; if (!devClip.isInsideQuickCheck(c)) { devClip = devClip.getIntersection(c); validateCompClip(); } }
Example 9
Source File: GeneralRenderer.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
public static void doDrawRect(PixelWriter pw, SunGraphics2D sg2d, SurfaceData sData, int x, int y, int w, int h) { if (w < 0 || h < 0) { return; } int x2 = Region.dimAdd(Region.dimAdd(x, w), 1); int y2 = Region.dimAdd(Region.dimAdd(y, h), 1); Region r = sg2d.getCompClip().getBoundsIntersectionXYXY(x, y, x2, y2); if (r.isEmpty()) { return; } int cx1 = r.getLoX(); int cy1 = r.getLoY(); int cx2 = r.getHiX(); int cy2 = r.getHiY(); if (w < 2 || h < 2) { doSetRect(sData, pw, cx1, cy1, cx2, cy2); return; } if (cy1 == y) { doSetRect(sData, pw, cx1, cy1, cx2, cy1+1); } if (cx1 == x) { doSetRect(sData, pw, cx1, cy1+1, cx1+1, cy2-1); } if (cx2 == x2) { doSetRect(sData, pw, cx2-1, cy1+1, cx2, cy2-1); } if (cy2 == y2) { doSetRect(sData, pw, cx1, cy2-1, cx2, cy2); } }
Example 10
Source File: XRRenderer.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
public void fillRect(SunGraphics2D sg2d, int x, int y, int width, int height) { x = Region.clipAdd(x, sg2d.transX); y = Region.clipAdd(y, sg2d.transY); /* * Limit x/y to signed short, width/height to unsigned short, * to match the X11 coordinate limits for rectangles. * Correct width/height in case x/y have been modified by clipping. */ if (x > Short.MAX_VALUE || y > Short.MAX_VALUE) { return; } int x2 = Region.dimAdd(x, width); int y2 = Region.dimAdd(y, height); if (x2 < Short.MIN_VALUE || y2 < Short.MIN_VALUE) { return; } x = clampToShort(x); y = clampToShort(y); width = clampToUShort(x2 - x); height = clampToUShort(y2 - y); if (width == 0 || height == 0) { return; } SunToolkit.awtLock(); try { validateSurface(sg2d); rectBuffer.pushRectValues(x, y, width, height); tileManager.fillMask((XRSurfaceData) sg2d.surfaceData); } finally { SunToolkit.awtUnlock(); } }
Example 11
Source File: GeneralRenderer.java From dragonwell8_jdk with GNU General Public License v2.0 | 5 votes |
public static void doDrawRect(PixelWriter pw, SunGraphics2D sg2d, SurfaceData sData, int x, int y, int w, int h) { if (w < 0 || h < 0) { return; } int x2 = Region.dimAdd(Region.dimAdd(x, w), 1); int y2 = Region.dimAdd(Region.dimAdd(y, h), 1); Region r = sg2d.getCompClip().getBoundsIntersectionXYXY(x, y, x2, y2); if (r.isEmpty()) { return; } int cx1 = r.getLoX(); int cy1 = r.getLoY(); int cx2 = r.getHiX(); int cy2 = r.getHiY(); if (w < 2 || h < 2) { doSetRect(sData, pw, cx1, cy1, cx2, cy2); return; } if (cy1 == y) { doSetRect(sData, pw, cx1, cy1, cx2, cy1+1); } if (cx1 == x) { doSetRect(sData, pw, cx1, cy1+1, cx1+1, cy2-1); } if (cx2 == x2) { doSetRect(sData, pw, cx2-1, cy1+1, cx2, cy2-1); } if (cy2 == y2) { doSetRect(sData, pw, cx1, cy2-1, cx2, cy2); } }
Example 12
Source File: GeneralRenderer.java From jdk8u-jdk with GNU General Public License v2.0 | 5 votes |
public static void doDrawRect(PixelWriter pw, SunGraphics2D sg2d, SurfaceData sData, int x, int y, int w, int h) { if (w < 0 || h < 0) { return; } int x2 = Region.dimAdd(Region.dimAdd(x, w), 1); int y2 = Region.dimAdd(Region.dimAdd(y, h), 1); Region r = sg2d.getCompClip().getBoundsIntersectionXYXY(x, y, x2, y2); if (r.isEmpty()) { return; } int cx1 = r.getLoX(); int cy1 = r.getLoY(); int cx2 = r.getHiX(); int cy2 = r.getHiY(); if (w < 2 || h < 2) { doSetRect(sData, pw, cx1, cy1, cx2, cy2); return; } if (cy1 == y) { doSetRect(sData, pw, cx1, cy1, cx2, cy1+1); } if (cx1 == x) { doSetRect(sData, pw, cx1, cy1+1, cx1+1, cy2-1); } if (cx2 == x2) { doSetRect(sData, pw, cx2-1, cy1+1, cx2, cy2-1); } if (cy2 == y2) { doSetRect(sData, pw, cx1, cy2-1, cx2, cy2); } }
Example 13
Source File: XRRenderer.java From hottub with GNU General Public License v2.0 | 5 votes |
public void fillRect(SunGraphics2D sg2d, int x, int y, int width, int height) { x = Region.clipAdd(x, sg2d.transX); y = Region.clipAdd(y, sg2d.transY); /* * Limit x/y to signed short, width/height to unsigned short, * to match the X11 coordinate limits for rectangles. * Correct width/height in case x/y have been modified by clipping. */ if (x > Short.MAX_VALUE || y > Short.MAX_VALUE) { return; } int x2 = Region.dimAdd(x, width); int y2 = Region.dimAdd(y, height); if (x2 < Short.MIN_VALUE || y2 < Short.MIN_VALUE) { return; } x = clampToShort(x); y = clampToShort(y); width = clampToUShort(x2 - x); height = clampToUShort(y2 - y); if (width == 0 || height == 0) { return; } SunToolkit.awtLock(); try { validateSurface(sg2d); rectBuffer.pushRectValues(x, y, width, height); tileManager.fillMask((XRSurfaceData) sg2d.surfaceData); } finally { SunToolkit.awtUnlock(); } }
Example 14
Source File: SunGraphics2D.java From jdk8u60 with GNU General Public License v2.0 | 5 votes |
/** * Constrain rendering for lightweight objects. */ public void constrain(int x, int y, int w, int h, Region region) { if ((x | y) != 0) { translate(x, y); } if (transformState > TRANSFORM_TRANSLATESCALE) { clipRect(0, 0, w, h); return; } // changes parameters according to the current scale and translate. final double scaleX = transform.getScaleX(); final double scaleY = transform.getScaleY(); x = constrainX = (int) transform.getTranslateX(); y = constrainY = (int) transform.getTranslateY(); w = Region.dimAdd(x, Region.clipScale(w, scaleX)); h = Region.dimAdd(y, Region.clipScale(h, scaleY)); Region c = constrainClip; if (c == null) { c = Region.getInstanceXYXY(x, y, w, h); } else { c = c.getIntersectionXYXY(x, y, w, h); } if (region != null) { region = region.getScaledRegion(scaleX, scaleY); region = region.getTranslatedRegion(x, y); c = c.getIntersection(region); } if (c == constrainClip) { // Common case to ignore return; } constrainClip = c; if (!devClip.isInsideQuickCheck(c)) { devClip = devClip.getIntersection(c); validateCompClip(); } }
Example 15
Source File: GeneralRenderer.java From jdk8u60 with GNU General Public License v2.0 | 5 votes |
public static void doDrawRect(PixelWriter pw, SunGraphics2D sg2d, SurfaceData sData, int x, int y, int w, int h) { if (w < 0 || h < 0) { return; } int x2 = Region.dimAdd(Region.dimAdd(x, w), 1); int y2 = Region.dimAdd(Region.dimAdd(y, h), 1); Region r = sg2d.getCompClip().getBoundsIntersectionXYXY(x, y, x2, y2); if (r.isEmpty()) { return; } int cx1 = r.getLoX(); int cy1 = r.getLoY(); int cx2 = r.getHiX(); int cy2 = r.getHiY(); if (w < 2 || h < 2) { doSetRect(sData, pw, cx1, cy1, cx2, cy2); return; } if (cy1 == y) { doSetRect(sData, pw, cx1, cy1, cx2, cy1+1); } if (cx1 == x) { doSetRect(sData, pw, cx1, cy1+1, cx1+1, cy2-1); } if (cx2 == x2) { doSetRect(sData, pw, cx2-1, cy1+1, cx2, cy2-1); } if (cy2 == y2) { doSetRect(sData, pw, cx1, cy2-1, cx2, cy2); } }
Example 16
Source File: XRRenderer.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
public void fillRect(SunGraphics2D sg2d, int x, int y, int width, int height) { x = Region.clipAdd(x, sg2d.transX); y = Region.clipAdd(y, sg2d.transY); /* * Limit x/y to signed short, width/height to unsigned short, * to match the X11 coordinate limits for rectangles. * Correct width/height in case x/y have been modified by clipping. */ if (x > Short.MAX_VALUE || y > Short.MAX_VALUE) { return; } int x2 = Region.dimAdd(x, width); int y2 = Region.dimAdd(y, height); if (x2 < Short.MIN_VALUE || y2 < Short.MIN_VALUE) { return; } x = clampToShort(x); y = clampToShort(y); width = clampToUShort(x2 - x); height = clampToUShort(y2 - y); if (width == 0 || height == 0) { return; } SunToolkit.awtLock(); try { validateSurface(sg2d); rectBuffer.pushRectValues(x, y, width, height); tileManager.fillMask((XRSurfaceData) sg2d.surfaceData); } finally { SunToolkit.awtUnlock(); } }
Example 17
Source File: XRRenderer.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
public void fillRect(SunGraphics2D sg2d, int x, int y, int width, int height) { x = Region.clipAdd(x, sg2d.transX); y = Region.clipAdd(y, sg2d.transY); /* * Limit x/y to signed short, width/height to unsigned short, * to match the X11 coordinate limits for rectangles. * Correct width/height in case x/y have been modified by clipping. */ if (x > Short.MAX_VALUE || y > Short.MAX_VALUE) { return; } int x2 = Region.dimAdd(x, width); int y2 = Region.dimAdd(y, height); if (x2 < Short.MIN_VALUE || y2 < Short.MIN_VALUE) { return; } x = clampToShort(x); y = clampToShort(y); width = clampToUShort(x2 - x); height = clampToUShort(y2 - y); if (width == 0 || height == 0) { return; } SunToolkit.awtLock(); try { validateSurface(sg2d); rectBuffer.pushRectValues(x, y, width, height); tileManager.fillMask((XRSurfaceData) sg2d.surfaceData); } finally { SunToolkit.awtUnlock(); } }
Example 18
Source File: GeneralRenderer.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
public static void doDrawRect(PixelWriter pw, SunGraphics2D sg2d, SurfaceData sData, int x, int y, int w, int h) { if (w < 0 || h < 0) { return; } int x2 = Region.dimAdd(Region.dimAdd(x, w), 1); int y2 = Region.dimAdd(Region.dimAdd(y, h), 1); Region r = sg2d.getCompClip().getBoundsIntersectionXYXY(x, y, x2, y2); if (r.isEmpty()) { return; } int cx1 = r.getLoX(); int cy1 = r.getLoY(); int cx2 = r.getHiX(); int cy2 = r.getHiY(); if (w < 2 || h < 2) { doSetRect(sData, pw, cx1, cy1, cx2, cy2); return; } if (cy1 == y) { doSetRect(sData, pw, cx1, cy1, cx2, cy1+1); } if (cx1 == x) { doSetRect(sData, pw, cx1, cy1+1, cx1+1, cy2-1); } if (cx2 == x2) { doSetRect(sData, pw, cx2-1, cy1+1, cx2, cy2-1); } if (cy2 == y2) { doSetRect(sData, pw, cx1, cy2-1, cx2, cy2); } }
Example 19
Source File: SunGraphics2D.java From jdk8u-jdk with GNU General Public License v2.0 | 5 votes |
/** * Constrain rendering for lightweight objects. */ public void constrain(int x, int y, int w, int h, Region region) { if ((x | y) != 0) { translate(x, y); } if (transformState > TRANSFORM_TRANSLATESCALE) { clipRect(0, 0, w, h); return; } // changes parameters according to the current scale and translate. final double scaleX = transform.getScaleX(); final double scaleY = transform.getScaleY(); x = constrainX = (int) transform.getTranslateX(); y = constrainY = (int) transform.getTranslateY(); w = Region.dimAdd(x, Region.clipScale(w, scaleX)); h = Region.dimAdd(y, Region.clipScale(h, scaleY)); Region c = constrainClip; if (c == null) { c = Region.getInstanceXYXY(x, y, w, h); } else { c = c.getIntersectionXYXY(x, y, w, h); } if (region != null) { region = region.getScaledRegion(scaleX, scaleY); region = region.getTranslatedRegion(x, y); c = c.getIntersection(region); } if (c == constrainClip) { // Common case to ignore return; } constrainClip = c; if (!devClip.isInsideQuickCheck(c)) { devClip = devClip.getIntersection(c); validateCompClip(); } }
Example 20
Source File: GeneralRenderer.java From jdk8u_jdk with GNU General Public License v2.0 | 5 votes |
public static void doDrawRect(PixelWriter pw, SunGraphics2D sg2d, SurfaceData sData, int x, int y, int w, int h) { if (w < 0 || h < 0) { return; } int x2 = Region.dimAdd(Region.dimAdd(x, w), 1); int y2 = Region.dimAdd(Region.dimAdd(y, h), 1); Region r = sg2d.getCompClip().getBoundsIntersectionXYXY(x, y, x2, y2); if (r.isEmpty()) { return; } int cx1 = r.getLoX(); int cy1 = r.getLoY(); int cx2 = r.getHiX(); int cy2 = r.getHiY(); if (w < 2 || h < 2) { doSetRect(sData, pw, cx1, cy1, cx2, cy2); return; } if (cy1 == y) { doSetRect(sData, pw, cx1, cy1, cx2, cy1+1); } if (cx1 == x) { doSetRect(sData, pw, cx1, cy1+1, cx1+1, cy2-1); } if (cx2 == x2) { doSetRect(sData, pw, cx2-1, cy1+1, cx2, cy2-1); } if (cy2 == y2) { doSetRect(sData, pw, cx1, cy2-1, cx2, cy2); } }