@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(); } }
public void DrawPolygons(SunGraphics2D sg2d, SurfaceData sData, int xPoints[], int yPoints[], int nPoints[], int numPolys, int transx, int transy, boolean close) { PixelWriter pw = GeneralRenderer.createXorPixelWriter(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; } }
public void doFillSpans(SunGraphics2D sg2d, SpanIterator si) { int box[] = new int[4]; GDIWindowSurfaceData sd; try { sd = (GDIWindowSurfaceData)sg2d.surfaceData; } catch (ClassCastException e) { throw new InvalidPipeException("wrong surface data type: " + sg2d.surfaceData); } Region clip = sg2d.getCompClip(); Composite comp = sg2d.composite; int eargb = sg2d.eargb; while (si.nextSpan(box)) { doFillRect(sd, clip, comp, eargb, box[0], box[1], box[2]-box[0], box[3]-box[1]); } }
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; } }
public void drawLine(SunGraphics2D sg2d, int x1, int y1, int x2, int y2) { Region compClip = sg2d.getCompClip(); int transX1 = Region.clipAdd(x1, sg2d.transX); int transY1 = Region.clipAdd(y1, sg2d.transY); int transX2 = Region.clipAdd(x2, sg2d.transX); int transY2 = Region.clipAdd(y2, sg2d.transY); SunToolkit.awtLock(); try { validateSurface(sg2d); lineGen.rasterizeLine(rectBuffer, transX1, transY1, transX2, transY2, compClip.getLoX(), compClip.getLoY(), compClip.getHiX(), compClip.getHiY(), true, true); tileManager.fillMask((XRSurfaceData) sg2d.surfaceData); } finally { SunToolkit.awtUnlock(); } }
public void Blit(SurfaceData src, SurfaceData dst, Composite comp, Region clip, int srcx, int srcy, int dstx, int dsty, int width, int height) { tracePrimitive(target); target.Blit(src, dst, comp, clip, srcx, srcy, dstx, dsty, width, height); }
void doDrawArc(GDIWindowSurfaceData sData, Region clip, Composite comp, int color, int x, int y, int w, int h, int angleStart, int angleExtent) { GraphicsPrimitive.tracePrimitive("GDIDrawArc"); super.doDrawArc(sData, clip, comp, color, x, y, w, h, angleStart, angleExtent); }
final void recursiveSubtractAndApplyShape(Region shape, int fromZorder, int toZorder) { checkTreeLock(); if (mixingLog.isLoggable(PlatformLogger.Level.FINE)) { mixingLog.fine("this = " + this + "; shape=" + shape + "; fromZ=" + fromZorder + "; toZ=" + toZorder); } if (fromZorder == -1) { return; } if (shape.isEmpty()) { return; } // An invalid container with not-null layout should be ignored // by the mixing code, the container will be validated later // and the mixing code will be executed later. if (getLayout() != null && !isValid()) { return; } for (int index = fromZorder; index <= toZorder; index++) { Component comp = getComponent(index); if (!comp.isLightweight()) { comp.subtractAndApplyShape(shape); } else if (comp instanceof Container && ((Container)comp).hasHeavyweightDescendants() && comp.isShowing()) { ((Container)comp).recursiveSubtractAndApplyShape(shape); } } }
void doFillOval(GDIWindowSurfaceData sData, Region clip, Composite comp, int color, int x, int y, int w, int h) { GraphicsPrimitive.tracePrimitive("GDIFillOval"); super.doFillOval(sData, clip, comp, color, x, y, w, h); }
void doDrawPoly(GDIWindowSurfaceData sData, Region clip, Composite comp, int color, int transx, int transy, int[] xpoints, int[] ypoints, int npoints, boolean isclosed) { GraphicsPrimitive.tracePrimitive("GDIDrawPoly"); super.doDrawPoly(sData, clip, comp, color, transx, transy, xpoints, ypoints, npoints, isclosed); }
void doFillRoundRect(GDIWindowSurfaceData sData, Region clip, Composite comp, int color, int x, int y, int w, int h, int arcW, int arcH) { GraphicsPrimitive.tracePrimitive("GDIFillRoundRect"); super.doFillRoundRect(sData, clip, comp, color, x, y, w, h, arcW, arcH); }
@Override public void BlitBg(SurfaceData src, SurfaceData dst, Composite comp, Region clip, int bgColor, int srcx, int srcy, int dstx, int dsty, int width, int height) { tracePrimitive(target); target.BlitBg(src, dst, comp, clip, bgColor, srcx, srcy, dstx, dsty, width, height); }
public void Scale(SurfaceData src, SurfaceData dst, Composite comp, Region clip, int sx1, int sy1, int sx2, int sy2, double dx1, double dy1, double dx2, double dy2) { OGLBlitLoops.IsoBlit(src, dst, null, null, comp, clip, null, AffineTransformOp.TYPE_NEAREST_NEIGHBOR, sx1, sy1, sx2, sy2, dx1, dy1, dx2, dy2, true); }
void doFillArc(GDIWindowSurfaceData sData, Region clip, Composite comp, int color, int x, int y, int w, int h, int angleStart, int angleExtent) { GraphicsPrimitive.tracePrimitive("GDIFillArc"); super.doFillArc(sData, clip, comp, color, x, y, w, h, angleStart, angleExtent); }
void doFillRect(GDIWindowSurfaceData sData, Region clip, Composite comp, int color, int x, int y, int w, int h) { GraphicsPrimitive.tracePrimitive("GDIFillRect"); super.doFillRect(sData, clip, comp, color, x, y, w, h); }
void doDrawRect(GDIWindowSurfaceData sData, Region clip, Composite comp, int color, int x, int y, int w, int h) { GraphicsPrimitive.tracePrimitive("GDIDrawRect"); super.doDrawRect(sData, clip, comp, color, x, y, w, h); }
public void Blit(SurfaceData src, SurfaceData dst, Composite comp, Region clip, int sx, int sy, int dx, int dy, int w, int h) { OGLBlitLoops.Blit(src, dst, comp, clip, null, AffineTransformOp.TYPE_NEAREST_NEIGHBOR, sx, sy, sx+w, sy+h, dx, dy, dx+w, dy+h, typeval, false); }
public Region getCompClip() { if (!surfaceData.isValid()) { // revalidateAll() implicitly recalculcates the composite clip revalidateAll(); } return clipRegion; }
public void MaskBlit(SurfaceData src, SurfaceData dst, Composite comp, Region clip, int srcx, int srcy, int dstx, int dsty, int width, int height, byte[] mask, int maskoff, int maskscan) { tracePrimitive(target); target.MaskBlit(src, dst, comp, clip, srcx, srcy, dstx, dsty, width, height, mask, maskoff, maskscan); }
@Override void initializeImpl() { super.initializeImpl(); if (getTarget() instanceof Frame) { setTitle(((Frame) getTarget()).getTitle()); setState(((Frame) getTarget()).getExtendedState()); } else if (getTarget() instanceof Dialog) { setTitle(((Dialog) getTarget()).getTitle()); } updateAlwaysOnTopState(); updateMinimumSize(); updateFocusableWindowState(); final Shape shape = getTarget().getShape(); if (shape != null) { applyShape(Region.getInstance(shape, null)); } final float opacity = getTarget().getOpacity(); if (opacity < 1.0f) { setOpacity(opacity); } setOpaque(getTarget().isOpaque()); updateInsets(platformWindow.getInsets()); if (getSurfaceData() == null) { replaceSurfaceData(false); } activateDisplayListener(); }
protected void validateCompClip() { int origClipState = clipState; if (usrClip == null) { clipState = CLIP_DEVICE; clipRegion = devClip; } else if (usrClip instanceof Rectangle2D) { clipState = CLIP_RECTANGULAR; clipRegion = devClip.getIntersection((Rectangle2D) usrClip); } else { PathIterator cpi = usrClip.getPathIterator(null); int box[] = new int[4]; ShapeSpanIterator sr = LoopPipe.getFillSSI(this); try { sr.setOutputArea(devClip); sr.appendPath(cpi); sr.getPathBox(box); Region r = Region.getInstance(box, sr); clipRegion = r; clipState = r.isRectangular() ? CLIP_RECTANGULAR : CLIP_SHAPE; } finally { sr.dispose(); } } if (origClipState != clipState && (clipState == CLIP_SHAPE || origClipState == CLIP_SHAPE)) { validFontInfo = false; invalidatePipe(); } }
public void Blit(SurfaceData src, SurfaceData dst, Composite comp, Region clip, int sx, int sy, int dx, int dy, int w, int h) { OGLBlitLoops.Blit(src, dst, comp, clip, null, AffineTransformOp.TYPE_NEAREST_NEIGHBOR, sx, sy, sx+w, sy+h, dx, dy, dx+w, dy+h, typeval, true); }
public void addRect(int lox, int loy, int hix, int hiy) { Region r2 = Region.getInstanceXYXY(lox, loy, hix, hiy); if (theRegion == null) { theRegion = r2; } else { theRegion = theRegion.getUnion(r2); } }
public void Blit(SurfaceData src, SurfaceData dst, Composite comp, Region clip, int sx, int sy, int dx, int dy, int w, int h) { D3DBlitLoops.IsoBlit(src, dst, null, null, comp, clip, null, AffineTransformOp.TYPE_NEAREST_NEIGHBOR, sx, sy, sx+w, sy+h, dx, dy, dx+w, dy+h, false); }
public void Scale(SurfaceData src, SurfaceData dst, Composite comp, Region clip, int sx1, int sy1, int sx2, int sy2, double dx1, double dy1, double dx2, double dy2) { D3DBlitLoops.IsoBlit(src, dst, null, null, comp, clip, null, AffineTransformOp.TYPE_NEAREST_NEIGHBOR, sx1, sy1, sx2, sy2, dx1, dy1, dx2, dy2, true); }
public void Blit(SurfaceData src, SurfaceData dst, Composite comp, Region clip, int sx, int sy, int dx, int dy, int w, int h) { D3DBlitLoops.IsoBlit(src, dst, null, null, comp, clip, null, AffineTransformOp.TYPE_NEAREST_NEIGHBOR, sx, sy, sx+w, sy+h, dx, dy, dx+w, dy+h, true); }
public void Blit(SurfaceData srcData, SurfaceData dstData, Composite comp, Region clip, int srcx, int srcy, int dstx, int dsty, int width, int height) { performop.MaskBlit(srcData, dstData, comp, clip, srcx, srcy, dstx, dsty, width, height, null, 0, 0); }
public synchronized void Blit(SurfaceData src, SurfaceData dst, Composite comp, Region clip, int sx, int sy, int dx, int dy, int w, int h) { Blit convertsrc = Blit.getFromCache(src.getSurfaceType(), CompositeType.SrcNoEa, SurfaceType.IntArgbPre); SurfaceData cachedSrc = null; if (srcTmp != null) { // use cached intermediate surface, if available cachedSrc = srcTmp.get(); } // convert source to IntArgbPre src = convertFrom(convertsrc, src, sx, sy, w, h, cachedSrc, BufferedImage.TYPE_INT_ARGB_PRE); // copy IntArgbPre intermediate surface to OpenGL surface performop.Blit(src, dst, comp, clip, 0, 0, dx, dy, w, h); if (src != cachedSrc) { // cache the intermediate surface srcTmp = new WeakReference<>(src); } }
public native void Transform(MaskBlit output, SurfaceData src, SurfaceData dst, Composite comp, Region clip, AffineTransform itx, int txtype, int sx1, int sy1, int sx2, int sy2, int dx1, int dy1, int dx2, int dy2, int edges[], int dxoff, int dyoff);
public void Transform(MaskBlit output, SurfaceData src, SurfaceData dst, Composite comp, Region clip, AffineTransform itx, int txtype, int sx1, int sy1, int sx2, int sy2, int dx1, int dy1, int dx2, int dy2, int edges[], int dxoff, int dyoff) { tracePrimitive(target); target.Transform(output, src, dst, comp, clip, itx, txtype, sx1, sy1, sx2, sy2, dx1, dy1, dx2, dy2, edges, dxoff, dyoff); }
@Override protected void validateContext(SurfaceData dstData, Composite comp, Region clip) { D3DSurfaceData d3dDst = (D3DSurfaceData)dstData; D3DContext.validateContext(d3dDst, d3dDst, clip, comp, null, null, null, D3DContext.NO_CONTEXT_FLAGS); }
@Override protected void validateContext(SurfaceData dstData, Composite comp, Region clip) { OGLSurfaceData oglDst = (OGLSurfaceData)dstData; OGLContext.validateContext(oglDst, oglDst, clip, comp, null, null, null, OGLContext.NO_CONTEXT_FLAGS); }
/** * 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(); } }
/** * All MaskBlit implementors must have this invoker method */ public native void MaskBlit(SurfaceData src, SurfaceData dst, Composite comp, Region clip, int srcx, int srcy, int dstx, int dsty, int width, int height, byte[] mask, int maskoff, int maskscan);
@Override public void Scale(SurfaceData src, SurfaceData dst, Composite comp, Region clip, int sx1, int sy1, int sx2, int sy2, double dx1, double dy1, double dx2, double dy2) { // see comment above D3DVolatileSurfaceManager.handleVItoScreenOp(src, dst); }