You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Oleg Khaschansky (JIRA)" <ji...@apache.org> on 2006/10/02 16:19:20 UTC
[jira] Updated: (HARMONY-1659) [classlib][awt] Caching of images
prevents from showing animation.
[ http://issues.apache.org/jira/browse/HARMONY-1659?page=all ]
Oleg Khaschansky updated HARMONY-1659:
--------------------------------------
Attachment: anim.gif
> [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