730 /* Return the text pipe to be used based on the graphics AA hint setting, 731 * and the rest of the graphics state is compatible with these loops. 732 * If the text AA hint is "DEFAULT", then the AA graphics hint requests 733 * the AA text renderer, else it requests the B&W text renderer. 734 */ 735 private TextPipe getTextPipe(SunGraphics2D sg2d, boolean aaHintIsOn) { 736 737 /* Try to avoid calling getFontInfo() unless its needed to 738 * resolve one of the new AA types. 739 */ 740 switch (sg2d.textAntialiasHint) { 741 case SunHints.INTVAL_TEXT_ANTIALIAS_DEFAULT: 742 if (aaHintIsOn) { 743 return aaTextRenderer; 744 } else { 745 return solidTextRenderer; 746 } 747 case SunHints.INTVAL_TEXT_ANTIALIAS_OFF: 748 return solidTextRenderer; 749 750 case SunHints.INTVAL_TEXT_ANTIALIAS_ON: 751 return aaTextRenderer; 752 753 default: 754 switch (sg2d.getFontInfo().aaHint) { 755 756 case SunHints.INTVAL_TEXT_ANTIALIAS_LCD_HRGB: 757 case SunHints.INTVAL_TEXT_ANTIALIAS_LCD_VRGB: 758 return lcdTextRenderer; 759 760 case SunHints.INTVAL_TEXT_ANTIALIAS_ON: 761 return aaTextRenderer; 762 763 case SunHints.INTVAL_TEXT_ANTIALIAS_OFF: 764 return solidTextRenderer; 765 766 /* This should not be reached as the FontInfo will 767 * always explicitly set its hint value. So whilst 768 * this could be collapsed to returning say just 769 * solidTextRenderer, or even removed, its left 770 * here in case DEFAULT is ever passed in. 771 */ | 730 /* Return the text pipe to be used based on the graphics AA hint setting, 731 * and the rest of the graphics state is compatible with these loops. 732 * If the text AA hint is "DEFAULT", then the AA graphics hint requests 733 * the AA text renderer, else it requests the B&W text renderer. 734 */ 735 private TextPipe getTextPipe(SunGraphics2D sg2d, boolean aaHintIsOn) { 736 737 /* Try to avoid calling getFontInfo() unless its needed to 738 * resolve one of the new AA types. 739 */ 740 switch (sg2d.textAntialiasHint) { 741 case SunHints.INTVAL_TEXT_ANTIALIAS_DEFAULT: 742 if (aaHintIsOn) { 743 return aaTextRenderer; 744 } else { 745 return solidTextRenderer; 746 } 747 case SunHints.INTVAL_TEXT_ANTIALIAS_OFF: 748 return solidTextRenderer; 749 750 // TODO: we have to take into account aaHint on macosx 751 //case SunHints.INTVAL_TEXT_ANTIALIAS_ON: 752 // return aaTextRenderer; 753 754 default: 755 switch (sg2d.getFontInfo().aaHint) { 756 757 case SunHints.INTVAL_TEXT_ANTIALIAS_LCD_HRGB: 758 case SunHints.INTVAL_TEXT_ANTIALIAS_LCD_VRGB: 759 return lcdTextRenderer; 760 761 case SunHints.INTVAL_TEXT_ANTIALIAS_ON: 762 return aaTextRenderer; 763 764 case SunHints.INTVAL_TEXT_ANTIALIAS_OFF: 765 return solidTextRenderer; 766 767 /* This should not be reached as the FontInfo will 768 * always explicitly set its hint value. So whilst 769 * this could be collapsed to returning say just 770 * solidTextRenderer, or even removed, its left 771 * here in case DEFAULT is ever passed in. 772 */ |