Rendering artifacts occur when the below code is run with metal pipeline with uiScale=1.0 (or on external monitor)
Please note that it is not a bug in XOR mode implementation. It is found while working on XOR mode.
g2d.setXORMode(Color.LIGHT_GRAY);
GradientPaint blueToRed = new GradientPaint(10, 600, Color.BLUE,
250, 700, Color.RED);
g2d.setPaint(blueToRed);
g2d.fill(new Rectangle2D.Double(10, texturePaintSectionY, 240, 100));
GradientPaint blackToGray = new GradientPaint(10, 800, Color.BLACK,
250, 700, Color.LIGHT_GRAY);
g2d.setPaint(blackToGray);
g2d.fill(new Rectangle2D.Double(10, texturePaintSectionY + 100, 240, 100));
See output screenshot generated with OpenGL and Metal pipeline.
I have debugged a bit, it looks like - method MTLBlitLoops_SurfaceToSwBlit has a bug. I could not conclude what needs to be fixed.
Please note that it is not a bug in XOR mode implementation. It is found while working on XOR mode.
g2d.setXORMode(Color.LIGHT_GRAY);
GradientPaint blueToRed = new GradientPaint(10, 600, Color.BLUE,
250, 700, Color.RED);
g2d.setPaint(blueToRed);
g2d.fill(new Rectangle2D.Double(10, texturePaintSectionY, 240, 100));
GradientPaint blackToGray = new GradientPaint(10, 800, Color.BLACK,
250, 700, Color.LIGHT_GRAY);
g2d.setPaint(blackToGray);
g2d.fill(new Rectangle2D.Double(10, texturePaintSectionY + 100, 240, 100));
See output screenshot generated with OpenGL and Metal pipeline.
I have debugged a bit, it looks like - method MTLBlitLoops_SurfaceToSwBlit has a bug. I could not conclude what needs to be fixed.