Bug 177847 - In Java BufferedImage gets an exception when calling getGraphics
Summary: In Java BufferedImage gets an exception when calling getGraphics
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: java-1.4.2-gcj-compat
Version: rawhide
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Thomas Fitzsimmons
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-01-15 14:13 UTC by Dennis Payne
Modified: 2007-11-30 22:11 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2006-07-26 17:58:09 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Dennis Payne 2006-01-15 14:13:45 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20050922 Fedora/1.0.7-1.1.fc4 Firefox/1.0.7

Description of problem:
I noticed that createImage doesn't create a BufferedImage so I modified my code to create a BufferedImage instead of using createImage.  Unfortunately this causes an exception when calling getGraphics.  I've included a simple example of the problem.

Version-Release number of selected component (if applicable):
libgcj-4.0.2-8.fc4

How reproducible:
Always

Steps to Reproduce:
1. Compile this program with gcj -C

import java.awt.image.BufferedImage;
import java.awt.*;

class TestMe
{
  public static void main(String [] args)
  {
    BufferedImage imgMonster = new BufferedImage(20, 20, BufferedImage.TYPE_INT_ARGB);
    Graphics gImg = imgMonster.getGraphics();
    gImg.setColor(Color.white);
    gImg.fillRect(0, 0, 20, 20);
    gImg.dispose();
  }
}


2. Run it 'gij TestMe'
  

Actual Results:  Exception in thread "main" java.lang.UnsatisfiedLinkError: initState
   at gnu.java.awt.peer.gtk.GdkGraphics2D.initState(int[], int, int) (/usr/lib/lib-gnu-java-awt-peer-gtk.so.6.0.0)
   at gnu.java.awt.peer.gtk.GdkGraphics2D.GdkGraphics2D(java.awt.image.BufferedImage) (/usr/lib/lib-gnu-java-awt-peer-gtk.so.6.0.0)
   at gnu.java.awt.peer.gtk.GdkGraphicsEnvironment.createGraphics(java.awt.image.BufferedImage) (/usr/lib/lib-gnu-java-awt-peer-gtk.so.6.0.0)
   at java.awt.image.BufferedImage.createGraphics() (/usr/lib/libgcj.so.6.0.0)
   at java.awt.image.BufferedImage.getGraphics() (/usr/lib/libgcj.so.6.0.0)
   at TestMe.main(java.lang.String[]) (Unknown Source)
   at gnu.java.lang.MainThread.call_main() (/usr/lib/libgcj.so.6.0.0)
   at gnu.java.lang.MainThread.run() (/usr/lib/libgcj.so.6.0.0)


Expected Results:  Nothing.  It should run without error.

Additional info:

Comment 1 Thomas Fitzsimmons 2006-02-04 01:28:51 UTC
Graphics2D requires the Cairo backend which we didn't enable for FC4 because
Cairo was missing.  I'll look into enabling it for FC5.


Comment 2 Thomas Fitzsimmons 2006-03-02 16:41:16 UTC
I couldn't enable this in time for FC5 final.  I'll try to do a merge of the
updated GUI packages from GNU Classpath to libgcj, for a future FC5 gcc update.


Comment 3 Thomas Fitzsimmons 2006-07-26 17:58:09 UTC
Fixed in Rawhide by libgcj backport.



Note You need to log in before you can comment on or make changes to this bug.