[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [cp-patches] FYI: Only prepare GtkImages in GtkToolkit
From: |
Robert Schuster |
Subject: |
Re: [cp-patches] FYI: Only prepare GtkImages in GtkToolkit |
Date: |
Mon, 02 May 2005 09:26:33 +0200 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; de-AT; rv:1.7.7) Gecko/20050427 |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi Mark,
isnt that considered a hack?
I would like to see it documented like one if so. This would IMHO help
the brave persons who will tear current AWT implementation apart and
re-engineer it. :)
cu
Robert
Mark Wielaard wrote:
> Hi,
>
> Robert pointed out a regression that happened with almost any free swing
> based application when using cairo with gnu.java.awt.peer.gtk.Graphics
> set to Graphics2D. A cast to GtkImage made all calls to prepareImage
> fail. This patch only prepares GtkImages and just assumes all other
> images are already prepared.
>
> 2005-04-30 Mark Wielaard <address@hidden>
>
> * gnu/java/awt/peer/gtk/GtkToolkit.java (prepareImage): Only prepare
> GtkImages.
>
> This makes things like JEdit start up again.
>
> Committed,
>
> Mark
>
>
> ------------------------------------------------------------------------
>
> Index: gnu/java/awt/peer/gtk/GtkToolkit.java
> ===================================================================
> RCS file: /cvsroot/classpath/classpath/gnu/java/awt/peer/gtk/GtkToolkit.java,v
> retrieving revision 1.67
> diff -u -r1.67 GtkToolkit.java
> --- gnu/java/awt/peer/gtk/GtkToolkit.java 16 Feb 2005 13:59:03 -0000
> 1.67
> +++ gnu/java/awt/peer/gtk/GtkToolkit.java 30 Apr 2005 11:55:45 -0000
> @@ -403,32 +403,41 @@
> return systemClipboard;
> }
>
> + /**
> + * Prepares a GtkImage. For every other kind of Image it just
> + * assumes the image is already prepared for rendering.
> + */
> public boolean prepareImage (Image image, int width, int height,
> ImageObserver observer)
> {
> - GtkImage i = (GtkImage) image;
> -
> - if (i.isLoaded ()) return true;
> -
> - class PrepareImage extends Thread
> - {
> - GtkImage image;
> - ImageObserver observer;
> -
> - PrepareImage (GtkImage image, ImageObserver observer)
> + if (image instanceof GtkImage)
> {
> - this.image = image;
> - image.setObserver (observer);
> - }
> -
> - public void run ()
> - {
> - image.source.startProduction (image);
> + GtkImage i = (GtkImage) image;
> +
> + if (i.isLoaded ()) return true;
> +
> + class PrepareImage extends Thread
> + {
> + GtkImage image;
> + ImageObserver observer;
> +
> + PrepareImage (GtkImage image, ImageObserver observer)
> + {
> + this.image = image;
> + image.setObserver (observer);
> + }
> +
> + public void run ()
> + {
> + image.source.startProduction (image);
> + }
> + }
> +
> + new PrepareImage (i, observer).start ();
> + return false;
> }
> - }
> -
> - new PrepareImage (i, observer).start ();
> - return false;
> + else
> + return true;
> }
>
> public native void sync();
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Classpath-patches mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/classpath-patches
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFCddYpG9cfwmwwEtoRAt2oAKCEKPO6U0Cq7FyfNZI6E9Lx45OdXACeNQEr
aM5yrKvRA1NqTgE8nSCJ2uk=
=HS6H
-----END PGP SIGNATURE-----