Skip to content
This repository has been archived by the owner on Aug 27, 2022. It is now read-only.
/ lanai Public archive

Commit

Permalink
8262091: Add RenderPerfTest for XOR mode rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
aghaisas committed Feb 21, 2021
1 parent d207aca commit 2d7ccff
Showing 1 changed file with 33 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -760,6 +760,15 @@ private boolean isAlmostEqual(Color c1, Color c2) {
g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,
RenderingHints.VALUE_TEXT_ANTIALIAS_ON);

private static final Configurable XORMode = (Graphics2D g2d) ->
{g2d.setXORMode(Color.WHITE);};

private static final Configurable XORModeLCDText = (Graphics2D g2d) ->
{g2d.setXORMode(Color.WHITE);
g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,
RenderingHints.VALUE_TEXT_ANTIALIAS_LCD_HRGB);};


public void testFlatOval() throws Exception {
(new PerfMeter("FlatOval")).exec(createPR(flatRenderer)).report();
}
Expand Down Expand Up @@ -931,6 +940,30 @@ public void testBgrSurfaceBlitImage() throws Exception {
(new PerfMeter("BgrSurfaceBlitImage")).exec(createPR(bgrSurfaceBlitImageRenderer)).report();
}

public void testFlatOval_XOR() throws Exception {
(new PerfMeter("FlatOval_XOR")).exec(createPR(flatRenderer).configure(XORMode)).report();
}

public void testRotatedBox_XOR() throws Exception {
(new PerfMeter("RotatedBox_XOR")).exec(createPR(flatBoxRotRenderer).configure(XORMode)).report();
}

public void testLines_XOR() throws Exception {
(new PerfMeter("Lines_XOR")).exec(createPR(segRenderer).configure(XORMode)).report();
}

public void testImage_XOR() throws Exception {
(new PerfMeter("Image_XOR")).exec(createPR(imgRenderer).configure(XORMode)).report();
}

public void testTextNoAA_XOR() throws Exception {
(new PerfMeter("TextNoAA_XOR")).exec(createPR(textRenderer).configure(XORMode)).report();
}

public void testTextLCD_XOR() throws Exception {
(new PerfMeter("TextLCD_XOR")).exec(createPR(textRenderer).configure(XORModeLCDText)).report();
}

public static void main(String[] args)
throws InvocationTargetException, IllegalAccessException, NoSuchMethodException
{
Expand Down

0 comments on commit 2d7ccff

Please sign in to comment.