Lines Matching refs:sg2d
84 public void validatePipe(SunGraphics2D sg2d) {
86 if (sg2d.compositeState <= SunGraphics2D.COMP_ALPHA) {
91 sg2d.imagepipe = sQuartzPipe;
92 sg2d.drawpipe = sQuartzPipe;
93 sg2d.fillpipe = sQuartzPipe;
94 sg2d.shapepipe = sQuartzPipe;
95 sg2d.textpipe = sCocoaTextPipe;
97 setPipesToQuartzComposite(sg2d);
101 protected void setPipesToQuartzComposite(SunGraphics2D sg2d) {
110 sg2d.imagepipe = sQuartzCompositePipe;
111 sg2d.drawpipe = sQuartzCompositePipe;
112 sg2d.fillpipe = sQuartzCompositePipe;
113 sg2d.shapepipe = sQuartzCompositePipe;
114 sg2d.textpipe = sCocoaTextPipe;
131 public abstract BufferedImage copyArea(SunGraphics2D sg2d, int x, int y, int w, int h, BufferedImage image);
133 public abstract boolean xorSurfacePixels(SunGraphics2D sg2d, BufferedImage srcPixels, int x, int y, int w, int h, int colorXOR);
369 void setUserBounds(SunGraphics2D sg2d, int x, int y, int width, int height) {
403 void setupClip(SunGraphics2D sg2d) {
404 switch (sg2d.clipState) {
407 Region clip = sg2d.getCompClip();
435 // if (lastClipShape != sg2d.usrClip) shapes are mutable!, and doing "equals" traverses all
437 lastClipShape = sg2d.usrClip;
441 if (sg2d.usrClip instanceof GeneralPath) {
442 gp = (GeneralPath) sg2d.usrClip;
444 gp = new GeneralPath(sg2d.usrClip);
481 void setupTransform(SunGraphics2D sg2d) {
482 sg2d.transform.getMatrix(lastCTM);
523 void setupPaint(SunGraphics2D sg2d, int x, int y, int w, int h) {
524 if (sg2d.paint instanceof SystemColor) {
525 SystemColor color = (SystemColor) sg2d.paint;
537 } else if (sg2d.paint instanceof Color) {
538 Color color = (Color) sg2d.paint;
550 } else if (sg2d.paint instanceof GradientPaint) {
551 if ((this.fGraphicsStatesInt.get(kColorStateIndex) != kColorGradient) || (lastPaint != sg2d.paint)) {
552 GradientPaint color = (GradientPaint) sg2d.paint;
568 } else if (sg2d.paint instanceof TexturePaint) {
569 if ((this.fGraphicsStatesInt.get(kColorStateIndex) != kColorTexture) || (lastPaint != sg2d.paint)) {
570 TexturePaint color = (TexturePaint) sg2d.paint;
588 if ((this.fGraphicsStatesInt.get(kColorStateIndex) != kColorTexture) || (lastPaint != sg2d.paint) || ((this.fChangeFlag & kBoundsChangedBit) != 0)) {
589 PaintContext context = sg2d.paint.createContext(sg2d.getDeviceColorModel(), userBounds, userBounds, sIdentityMatrix, sg2d.getRenderingHints());
610 lastPaint = sg2d.paint;
617 void setupComposite(SunGraphics2D sg2d) {
618 Composite composite = sg2d.composite;
629 if ((sg2d.compositeState <= SunGraphics2D.COMP_ALPHA) && (composite != null)) {
658 void setupStroke(SunGraphics2D sg2d) {
661 if (sg2d.stroke instanceof BasicStroke) {
662 stroke = (BasicStroke) sg2d.stroke;
701 void setupRenderingHints(SunGraphics2D sg2d) {
705 int antialiasHint = sg2d.antialiasHint;
712 int textAntialiasHint = sg2d.textAntialiasHint;
719 int fractionalMetricsHint = sg2d.fractionalMetricsHint;
726 int renderHint = sg2d.renderHint;
733 Object hintValue = sg2d.getRenderingHint(RenderingHints.KEY_INTERPOLATION);
750 void setupGraphicsState(SunGraphics2D sg2d, int primitiveType) {
751 setupGraphicsState(sg2d, primitiveType, sg2d.font, 0, 0, fBounds.width, fBounds.height); // deviceBounds into userBounds
754 void setupGraphicsState(SunGraphics2D sg2d, int primitiveType, int x, int y, int w, int h) {
755 setupGraphicsState(sg2d, primitiveType, sg2d.font, x, y, w, h);
760 void setupGraphicsState(SunGraphics2D sg2d, int primitiveType, Font font, int x, int y, int w, int h) {
763 setUserBounds(sg2d, x, y, w, h);
766 if ((this.sg2dCurrent != sg2d) || (this.threadCurrent != thread)) {
767 this.sg2dCurrent = sg2d;
770 setupClip(sg2d);
771 setupTransform(sg2d);
772 setupPaint(sg2d, x, y, w, h);
773 setupComposite(sg2d);
774 setupStroke(sg2d);
775 setupFont(font, sg2d.paint);
776 setupRenderingHints(sg2d);
782 setupClip(sg2d);
783 setupTransform(sg2d);
786 setupComposite(sg2d);
787 setupRenderingHints(sg2d);
790 setupPaint(sg2d, x, y, w, h);
791 setupStroke(sg2d);
794 setupFont(font, sg2d.paint);
803 boolean isCustomPaint(SunGraphics2D sg2d) {
804 if ((sg2d.paint instanceof Color) || (sg2d.paint instanceof SystemColor) || (sg2d.paint instanceof GradientPaint) || (sg2d.paint instanceof TexturePaint)) { return false; }
905 public void doLine(CRenderer renderer, SunGraphics2D sg2d, float x1, float y1, float x2, float y2) {
906 // System.err.println("-- doLine x1="+x1+" y1="+y1+" x2="+x2+" y2="+y2+" paint="+sg2d.paint);
907 setupGraphicsState(sg2d, kLine, sg2d.font, 0, 0, fBounds.width, fBounds.height);
911 public void doRect(CRenderer renderer, SunGraphics2D sg2d, float x, float y, float width, float height, boolean isfill) {
912 // System.err.println("-- doRect x="+x+" y="+y+" w="+width+" h="+height+" isfill="+isfill+" paint="+sg2d.paint);
913 if ((isfill) && (isCustomPaint(sg2d))) {
914 setupGraphicsState(sg2d, kRect, (int) x, (int) y, (int) width, (int) height);
916 setupGraphicsState(sg2d, kRect, sg2d.font, 0, 0, fBounds.width, fBounds.height);
921 public void doRoundRect(CRenderer renderer, SunGraphics2D sg2d, float x, float y, float width, float height, float arcW, float arcH, boolean isfill) {
923 if ((isfill) && (isCustomPaint(sg2d))) {
924 setupGraphicsState(sg2d, kRoundRect, (int) x, (int) y, (int) width, (int) height);
926 setupGraphicsState(sg2d, kRoundRect, sg2d.font, 0, 0, fBounds.width, fBounds.height);
931 public void doOval(CRenderer renderer, SunGraphics2D sg2d, float x, float y, float width, float height, boolean isfill) {
933 if ((isfill) && (isCustomPaint(sg2d))) {
934 setupGraphicsState(sg2d, kOval, (int) x, (int) y, (int) width, (int) height);
936 setupGraphicsState(sg2d, kOval, sg2d.font, 0, 0, fBounds.width, fBounds.height);
941 public void doArc(CRenderer renderer, SunGraphics2D sg2d, float x, float y, float width, float height, float startAngle, float arcAngle, int type, boolean isfill) {
943 if ((isfill) && (isCustomPaint(sg2d))) {
944 setupGraphicsState(sg2d, kArc, (int) x, (int) y, (int) width, (int) height);
946 setupGraphicsState(sg2d, kArc, sg2d.font, 0, 0, fBounds.width, fBounds.height);
952 public void doPolygon(CRenderer renderer, SunGraphics2D sg2d, int xpoints[], int ypoints[], int npoints, boolean ispolygon, boolean isfill) {
955 if ((isfill) && (isCustomPaint(sg2d))) {
975 setupGraphicsState(sg2d, kPolygon, minx, miny, maxx - minx, maxy - miny);
977 setupGraphicsState(sg2d, kPolygon, sg2d.font, 0, 0, fBounds.width, fBounds.height);
985 public void drawfillShape(CRenderer renderer, SunGraphics2D sg2d, GeneralPath gp, boolean isfill, boolean shouldApplyOffset) {
988 if ((isfill) && (isCustomPaint(sg2d))) {
990 setupGraphicsState(sg2d, kShape, bounds.x, bounds.y, bounds.width, bounds.height);
992 setupGraphicsState(sg2d, kShape, sg2d.font, 0, 0, fBounds.width, fBounds.height);
1010 public void blitImage(CRenderer renderer, SunGraphics2D sg2d, SurfaceData img, boolean fliph, boolean flipv, int sx, int sy, int sw, int sh, int dx, int dy, int dw, int dh, Color bgColor) {
1018 setupGraphicsState(sg2d, kImage, sg2d.font, 0, 0, fBounds.width, fBounds.height);
1033 public void drawString(CTextPipe renderer, SunGraphics2D sg2d, long nativeStrikePtr, String str, double x, double y) {
1038 setupGraphicsState(sg2d, kString, sg2d.font, 0, 0, fBounds.width, fBounds.height);
1042 public void drawGlyphs(CTextPipe renderer, SunGraphics2D sg2d, long nativeStrikePtr, GlyphVector gv, float x, float y) {
1044 setupGraphicsState(sg2d, kGlyphs, gv.getFont(), 0, 0, fBounds.width, fBounds.height);
1048 public void drawUnicodes(CTextPipe renderer, SunGraphics2D sg2d, long nativeStrikePtr, char unicodes[], int offset, int length, float x, float y) {
1050 setupGraphicsState(sg2d, kUnicodes, sg2d.font, 0, 0, fBounds.width, fBounds.height);
1096 * passed arguments x, y are in the coordinate space of the sg2d/lightweight comp. In order to do the clipping we
1100 protected Rectangle clipCopyArea(SunGraphics2D sg2d, int x, int y, int w, int h, int dx, int dy) {
1102 copyAreaBounds.setBounds(sg2d.devClip.getLoX(), sg2d.devClip.getLoY(), sg2d.devClip.getWidth(), sg2d.devClip.getHeight());
1105 x += sg2d.transX;
1106 y += sg2d.transY;
1145 public boolean canRenderLCDText(SunGraphics2D sg2d) {
1146 if (sg2d.compositeState <= SunGraphics2D.COMP_ISCOPY &&
1147 sg2d.paintState <= SunGraphics2D.PAINT_ALPHACOLOR &&
1148 sg2d.clipState <= SunGraphics2D.CLIP_RECTANGULAR &&
1149 // sg2d.surfaceData.getTransparency() == Transparency.OPAQUE &&
1152 sg2d.antialiasHint != SunHints.INTVAL_ANTIALIAS_ON) { return true; }