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] Updated: (HARMONY-1659) [classlib][awt] Caching of images prevents from showing animation.
Date Wed, 08 Nov 2006 13:48:52 GMT
     [ http://issues.apache.org/jira/browse/HARMONY-1659?page=all ]

Oleg Khaschansky updated HARMONY-1659:
--------------------------------------

    Patch Info: [Patch Available]

> [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, harmony-1659.patch
>
>
> 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