489 // and unclipped on two separate rendering passes.
490 // Unfortunately, all of the clipped glyph rendering
491 // pipelines rely on the use of the MaskBlit operation
492 // which is not defined for XOR.
493 sg2d.textpipe = outlineTextRenderer;
494 } else {
495 if (sg2d.transformState >= sg2d.TRANSFORM_TRANSLATESCALE) {
496 sg2d.drawpipe = colorViaShape;
497 sg2d.fillpipe = colorViaShape;
498 } else {
499 if (sg2d.strokeState != sg2d.STROKE_THIN) {
500 sg2d.drawpipe = colorViaShape;
501 } else {
502 sg2d.drawpipe = colorPrimitives;
503 }
504 sg2d.fillpipe = colorPrimitives;
505 }
506 sg2d.textpipe = solidTextRenderer;
507 }
508 sg2d.shapepipe = colorPrimitives;
509 sg2d.loops = getRenderLoops(sg2d);
510 // assert(sg2d.surfaceData == this);
511 }
512 } else if (sg2d.compositeState == sg2d.COMP_CUSTOM) {
513 if (sg2d.antialiasHint == SunHints.INTVAL_ANTIALIAS_ON) {
514 if (sg2d.clipState == sg2d.CLIP_SHAPE) {
515 sg2d.drawpipe = AAClipCompViaShape;
516 sg2d.fillpipe = AAClipCompViaShape;
517 sg2d.shapepipe = AAClipCompShape;
518 sg2d.textpipe = clipCompText;
519 } else {
520 sg2d.drawpipe = AACompViaShape;
521 sg2d.fillpipe = AACompViaShape;
522 sg2d.shapepipe = AACompShape;
523 sg2d.textpipe = compText;
524 }
525 } else {
526 sg2d.drawpipe = compViaShape;
527 sg2d.fillpipe = compViaShape;
528 sg2d.shapepipe = compShape;
529 if (sg2d.clipState == sg2d.CLIP_SHAPE) {
586 sg2d.textpipe = clipPaintText;
587 } else {
588 sg2d.textpipe = paintText;
589 }
590 }
591 } else {
592 if (sg2d.transformState >= sg2d.TRANSFORM_TRANSLATESCALE) {
593 sg2d.drawpipe = colorViaShape;
594 sg2d.fillpipe = colorViaShape;
595 } else {
596 if (sg2d.strokeState != sg2d.STROKE_THIN) {
597 sg2d.drawpipe = colorViaShape;
598 } else {
599 sg2d.drawpipe = colorPrimitives;
600 }
601 sg2d.fillpipe = colorPrimitives;
602 }
603
604 sg2d.textpipe = getTextPipe(sg2d, false /* AA==OFF */);
605 sg2d.shapepipe = colorPrimitives;
606 sg2d.loops = getRenderLoops(sg2d);
607 // assert(sg2d.surfaceData == this);
608 }
609 }
610
611 /* Return the text pipe to be used based on the graphics AA hint setting,
612 * and the rest of the graphics state is compatible with these loops.
613 * If the text AA hint is "DEFAULT", then the AA graphics hint requests
614 * the AA text renderer, else it requests the B&W text renderer.
615 */
616 private TextPipe getTextPipe(SunGraphics2D sg2d, boolean aaHintIsOn) {
617
618 /* Try to avoid calling getFontInfo() unless its needed to
619 * resolve one of the new AA types.
620 */
621 switch (sg2d.textAntialiasHint) {
622 case SunHints.INTVAL_TEXT_ANTIALIAS_DEFAULT:
623 if (aaHintIsOn) {
624 return aaTextRenderer;
625 } else {
626 return solidTextRenderer;
627 }
628 case SunHints.INTVAL_TEXT_ANTIALIAS_OFF:
629 return solidTextRenderer;
630
631 case SunHints.INTVAL_TEXT_ANTIALIAS_ON:
632 return aaTextRenderer;
633
634 default:
635 switch (sg2d.getFontInfo().aaHint) {
636
637 case SunHints.INTVAL_TEXT_ANTIALIAS_LCD_HRGB:
|
489 // and unclipped on two separate rendering passes.
490 // Unfortunately, all of the clipped glyph rendering
491 // pipelines rely on the use of the MaskBlit operation
492 // which is not defined for XOR.
493 sg2d.textpipe = outlineTextRenderer;
494 } else {
495 if (sg2d.transformState >= sg2d.TRANSFORM_TRANSLATESCALE) {
496 sg2d.drawpipe = colorViaShape;
497 sg2d.fillpipe = colorViaShape;
498 } else {
499 if (sg2d.strokeState != sg2d.STROKE_THIN) {
500 sg2d.drawpipe = colorViaShape;
501 } else {
502 sg2d.drawpipe = colorPrimitives;
503 }
504 sg2d.fillpipe = colorPrimitives;
505 }
506 sg2d.textpipe = solidTextRenderer;
507 }
508 sg2d.shapepipe = colorPrimitives;
509 sg2d.setLoops(getRenderLoops(sg2d));
510 // assert(sg2d.surfaceData == this);
511 }
512 } else if (sg2d.compositeState == sg2d.COMP_CUSTOM) {
513 if (sg2d.antialiasHint == SunHints.INTVAL_ANTIALIAS_ON) {
514 if (sg2d.clipState == sg2d.CLIP_SHAPE) {
515 sg2d.drawpipe = AAClipCompViaShape;
516 sg2d.fillpipe = AAClipCompViaShape;
517 sg2d.shapepipe = AAClipCompShape;
518 sg2d.textpipe = clipCompText;
519 } else {
520 sg2d.drawpipe = AACompViaShape;
521 sg2d.fillpipe = AACompViaShape;
522 sg2d.shapepipe = AACompShape;
523 sg2d.textpipe = compText;
524 }
525 } else {
526 sg2d.drawpipe = compViaShape;
527 sg2d.fillpipe = compViaShape;
528 sg2d.shapepipe = compShape;
529 if (sg2d.clipState == sg2d.CLIP_SHAPE) {
586 sg2d.textpipe = clipPaintText;
587 } else {
588 sg2d.textpipe = paintText;
589 }
590 }
591 } else {
592 if (sg2d.transformState >= sg2d.TRANSFORM_TRANSLATESCALE) {
593 sg2d.drawpipe = colorViaShape;
594 sg2d.fillpipe = colorViaShape;
595 } else {
596 if (sg2d.strokeState != sg2d.STROKE_THIN) {
597 sg2d.drawpipe = colorViaShape;
598 } else {
599 sg2d.drawpipe = colorPrimitives;
600 }
601 sg2d.fillpipe = colorPrimitives;
602 }
603
604 sg2d.textpipe = getTextPipe(sg2d, false /* AA==OFF */);
605 sg2d.shapepipe = colorPrimitives;
606 // assert(sg2d.surfaceData == this);
607 }
608 }
609
610 /* Return the text pipe to be used based on the graphics AA hint setting,
611 * and the rest of the graphics state is compatible with these loops.
612 * If the text AA hint is "DEFAULT", then the AA graphics hint requests
613 * the AA text renderer, else it requests the B&W text renderer.
614 */
615 private TextPipe getTextPipe(SunGraphics2D sg2d, boolean aaHintIsOn) {
616
617 if (sg2d.getLoops() == null) {
618 sg2d.setLoops(getRenderLoops(sg2d));
619 }
620
621 /* Try to avoid calling getFontInfo() unless its needed to
622 * resolve one of the new AA types.
623 */
624 switch (sg2d.textAntialiasHint) {
625 case SunHints.INTVAL_TEXT_ANTIALIAS_DEFAULT:
626 if (aaHintIsOn) {
627 return aaTextRenderer;
628 } else {
629 return solidTextRenderer;
630 }
631 case SunHints.INTVAL_TEXT_ANTIALIAS_OFF:
632 return solidTextRenderer;
633
634 case SunHints.INTVAL_TEXT_ANTIALIAS_ON:
635 return aaTextRenderer;
636
637 default:
638 switch (sg2d.getFontInfo().aaHint) {
639
640 case SunHints.INTVAL_TEXT_ANTIALIAS_LCD_HRGB:
|