use of sun.java2d.pipe.Region in project jdk8u_jdk by JetBrains.
the class LWContainerPeer method cutChildren.
/**
* Removes bounds of children above specific child from the region. If above
* is null removes all bounds of children.
*/
final Region cutChildren(Region r, final LWComponentPeer<?, ?> above) {
boolean aboveFound = above == null;
for (final LWComponentPeer<?, ?> child : getChildren()) {
if (!aboveFound && child == above) {
aboveFound = true;
continue;
}
if (aboveFound) {
if (child.isVisible()) {
final Rectangle cb = child.getBounds();
final Region cr = child.getRegion();
final Region tr = cr.getTranslatedRegion(cb.x, cb.y);
r = r.getDifference(tr.getIntersection(getContentSize()));
}
}
}
return r;
}
use of sun.java2d.pipe.Region in project jdk8u_jdk by JetBrains.
the class XorPixelWriter method DrawPolygons.
public void DrawPolygons(SunGraphics2D sg2d, SurfaceData sData, int[] xPoints, int[] yPoints, int[] nPoints, int numPolys, int transx, int transy, boolean close) {
PixelWriter pw = GeneralRenderer.createSolidPixelWriter(sg2d, sData);
int off = 0;
Region clip = sg2d.getCompClip();
for (int i = 0; i < numPolys; i++) {
int numpts = nPoints[i];
GeneralRenderer.doDrawPoly(sData, pw, xPoints, yPoints, off, numpts, clip, transx, transy, close);
off += numpts;
}
}
use of sun.java2d.pipe.Region in project jdk8u_jdk by JetBrains.
the class X11TextRenderer method drawGlyphList.
protected void drawGlyphList(SunGraphics2D sg2d, GlyphList gl) {
SunToolkit.awtLock();
try {
X11SurfaceData x11sd = (X11SurfaceData) sg2d.surfaceData;
Region clip = sg2d.getCompClip();
long xgc = x11sd.getRenderGC(clip, SunGraphics2D.COMP_ISCOPY, null, sg2d.pixel);
doDrawGlyphList(x11sd.getNativeOps(), xgc, clip, gl);
} finally {
SunToolkit.awtUnlock();
}
}
use of sun.java2d.pipe.Region in project jdk8u_jdk by JetBrains.
the class XRRenderer method fill.
public void fill(SunGraphics2D sg2d, Shape s) {
int transx, transy;
if (sg2d.strokeState == SunGraphics2D.STROKE_THIN) {
// Here we are able to use fillPath() for
// high-quality fills.
Path2D.Float p2df;
if (sg2d.transformState <= SunGraphics2D.TRANSFORM_INT_TRANSLATE) {
if (s instanceof Path2D.Float) {
p2df = (Path2D.Float) s;
} else {
p2df = new Path2D.Float(s);
}
transx = sg2d.transX;
transy = sg2d.transY;
} else {
p2df = new Path2D.Float(s, sg2d.transform);
transx = 0;
transy = 0;
}
fillPath(sg2d, p2df, transx, transy);
return;
}
AffineTransform at;
if (sg2d.transformState <= SunGraphics2D.TRANSFORM_INT_TRANSLATE) {
// Transform (translation) will be done by FillSpans
at = null;
transx = sg2d.transX;
transy = sg2d.transY;
} else {
// Transform will be done by the PathIterator
at = sg2d.transform;
transx = transy = 0;
}
ShapeSpanIterator ssi = LoopPipe.getFillSSI(sg2d);
try {
// Subtract transx/y from the SSI clip to match the
// (potentially untranslated) geometry fed to it
Region clip = sg2d.getCompClip();
ssi.setOutputAreaXYXY(clip.getLoX() - transx, clip.getLoY() - transy, clip.getHiX() - transx, clip.getHiY() - transy);
ssi.appendPath(s.getPathIterator(at));
fillSpans(sg2d, ssi, transx, transy);
} finally {
ssi.dispose();
}
}
use of sun.java2d.pipe.Region in project jdk8u_jdk by JetBrains.
the class X11Renderer method fill.
public void fill(SunGraphics2D sg2d, Shape s) {
if (sg2d.strokeState == SunGraphics2D.STROKE_THIN) {
// Delegate to fillPolygon() if possible...
if (s instanceof Polygon && sg2d.transformState < SunGraphics2D.TRANSFORM_TRANSLATESCALE) {
Polygon p = (Polygon) s;
fillPolygon(sg2d, p.xpoints, p.ypoints, p.npoints);
return;
}
// Otherwise we will use fillPath() for
// high-quality fills.
doPath(sg2d, s, true);
return;
}
AffineTransform at;
int transx, transy;
if (sg2d.transformState < SunGraphics2D.TRANSFORM_TRANSLATESCALE) {
// Transform (translation) will be done by XFillSpans
at = null;
transx = sg2d.transX;
transy = sg2d.transY;
} else {
// Transform will be done by the PathIterator
at = sg2d.transform;
transx = transy = 0;
}
ShapeSpanIterator ssi = LoopPipe.getFillSSI(sg2d);
try {
// Subtract transx/y from the SSI clip to match the
// (potentially untranslated) geometry fed to it
Region clip = sg2d.getCompClip();
ssi.setOutputAreaXYXY(clip.getLoX() - transx, clip.getLoY() - transy, clip.getHiX() - transx, clip.getHiY() - transy);
ssi.appendPath(s.getPathIterator(at));
SunToolkit.awtLock();
try {
long xgc = validate(sg2d);
XFillSpans(sg2d.surfaceData.getNativeOps(), xgc, ssi, ssi.getNativeIterator(), transx, transy);
} finally {
SunToolkit.awtUnlock();
}
} finally {
ssi.dispose();
}
}
Aggregations