harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Oleg Khaschansky (JIRA)" <j...@apache.org>
Subject [jira] Created: (HARMONY-1659) [classlib][awt] Caching of images prevents from showing animation.
Date Mon, 02 Oct 2006 14:19:19 GMT
[classlib][awt] Caching of images prevents from showing animation.
------------------------------------------------------------------

                 Key: HARMONY-1659
                 URL: http://issues.apache.org/jira/browse/HARMONY-1659
             Project: Harmony
          Issue Type: Bug
          Components: Classlib
            Reporter: Oleg Khaschansky
         Attachments: anim.gif

Current implementation of the class org.apache.harmony.awt.gl.image.OffscreenImage doesn't
invalidate its cached surface. As a result, when animated image is updated, blitter will draw
cached data, i.e. the first frame. OffscreenImage should invalidate the native cache when
it accepts new pixel data.

I am going to provide a patch for this issue.

The following test reveals this issue (requires an attached image):
------------------------------------------------------------------------------------
import java.awt.*;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;

public class test {
    static Image im;

    private static void init() {
        im = Toolkit.getDefaultToolkit().getImage("anim.gif");
    }

    public static void main(String[] args) {
        Frame f = new Frame("TestDrawImage");

        Canvas c = new Canvas(){
            public void paint(Graphics g) {
                g.drawImage(im, 0, 0, 200, 200, this);
            }

            public boolean imageUpdate(Image img, int infoflags, int x, int y, int w, int
h) {
                if ((infoflags & ALLBITS) != 0)
                    repaint();
                if ((infoflags & FRAMEBITS) != 0)
                    repaint();
                return isShowing();
            }
        };

        init();
        f.add(c);

        f.addWindowListener(new WindowAdapter() {
           public void windowClosing(WindowEvent we) {
               we.getWindow().dispose();
           }
        });

        f.setSize(300, 300);
        f.show();
    }
}
------------------------------------------------------------------------------------


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message