Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8264353

In aarch64 draw a Ellipse2D is not OK

    XMLWordPrintable

    Details

    • Subcomponent:
      2d
    • CPU:
      aarch64
    • OS:
      linux

      Description

      ADDITIONAL SYSTEM INFORMATION :
      linux aarch64

      A DESCRIPTION OF THE PROBLEM :
      code is below´╝î it is working ok in jdk8u281 x86_64 . but could not work in aarch64 version.


      import javax.imageio.ImageIO;
      import java.awt.*;
      import java.awt.geom.Ellipse2D;
      import java.awt.image.BufferedImage;
      import java.io.File;
      import java.io.IOException;
      import javax.imageio.ImageIO;

      public class Test {
          private static BufferedImage bufferedImage;
          private static Graphics2D g2d;
          private static int width;
          private static int height;
          private static float alpha;
          private static int x;
          private static int y;
          private static Color color;
          private static int stroke = 10;




          public static void begin() {
              g2d = bufferedImage.createGraphics();
              AlphaComposite newComposite = AlphaComposite.getInstance(3, alpha);
               g2d.setComposite(newComposite);

               g2d.setPaint( color);

               g2d.fillRect( x, y, width, height);
          }
          public static void end() {
               g2d.dispose();
          }
          public static void draw( ) {
              BasicStroke oldStroke = (BasicStroke) g2d.getStroke();
               g2d.setStroke(new BasicStroke( stroke));

              Object oldRenderingHint = g2d.getRenderingHint(RenderingHints.KEY_ANTIALIASING);
               g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);




              Color oldColor = (Color) g2d.getPaint();
               g2d.setPaint( Color.RED);

              AlphaComposite newComposite = AlphaComposite.getInstance(3, 1.0f);

               g2d.setComposite(newComposite);

              Ellipse2D ellipse2d = new Ellipse2D.Double( stroke/2, stroke/2, width -stroke, height -stroke);
               g2d.draw(ellipse2d);




              g2d.setStroke(oldStroke);
               g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, oldRenderingHint);
               g2d.setPaint(oldColor);

               g2d.setComposite(AlphaComposite.getInstance(3));
          }
          public static void main(String[] args) {
               x = 0;
               y = 0;
               width = 100 ;
               height = 100;
               color = Color.WHITE;
               alpha = 0;
               bufferedImage = new BufferedImage(width, height, 2);
              begin();
              draw();
              end();
              File outputfile = new File("save.png");
              try {
                  ImageIO.write(bufferedImage,"png", outputfile);
              } catch (IOException e) {
                  e.printStackTrace();
              }


          }

      }



      FREQUENCY : always


        Attachments

        1. Test.java
          2 kB
          Praveen Narayanaswamy

          Activity

            People

            Assignee:
            prr Philip Race
            Reporter:
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: