[gui][patch] fixes to buffered image painting
graydon hoare
graydon@redhat.com
Tue Dec 7 02:31:00 GMT 2004
hi,
this patch, which I've committed to java-gui-branch, fixes the
BufferedImage Graphics2D paint performance problem Ziga reported last
week. with this change, Graphics2D objects built on BufferedImages will
construct a client-side cairo context which paints directly into the
java int[] inside the image's Raster, accessed through JNI. the speed
now ranges between "the same" and "twice as fast" as sun's
BufferedImage-target painting (on gcj). it might be slower on systems in
which JNI array access involves copying arrays.
unfortunately since there's still some incomplete parts of
javax.imageio, we can't quite run bootchart yet. but it should be alive
within the next week or two.
(for the curious: the old system seemed *horribly* slow for good reason.
it involved painting to an X-server resident pixmap, copying the pixmap
back, byte swapping, and doing a color-conversion loop on the entire
image.. for each drawing operation!)
-graydon
2004-12-06 Graydon Hoare <graydon@redhat.com>
* gnu/java/awt/peer/gtk/GdkGraphics2D.java:
Rework painting into BufferedImages
* gnu/java/awt/peer/gtk/GdkPixbufDecoder.java:
Construct BufferedImage with alpha only when alpha is
present in colormodel.
* jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics2D.c:
Rework painting into client-side jint arrays.
* jni/gtk-peer/gtkcairopeer.h:
Likewise.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: j2d-buffered-image-painting.patch
URL: <http://gcc.gnu.org/pipermail/java-patches/attachments/20041207/5d1ea7d2/attachment.ksh>
More information about the Java-patches
mailing list