[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[cp-patches] RFC: Fixes for the Cairo bindings
From: |
Ziga Mahkovec |
Subject: |
[cp-patches] RFC: Fixes for the Cairo bindings |
Date: |
Sat, 25 Jun 2005 16:53:31 +0200 |
This patch fixes some of the problems[1] Mark was having when running
the Swing demo with Java2D/Cairo. No text is shown yet due to some
Pango issues, but at least the drawing part looks OK now:
http://bootchart.org/misc/classpath/swing-j2d.png
It turned out the gdk_cairo_create calls were not really used, so this
patch also removes the gtk-2.7 dependency. The screenshot was made
using gtk-2.6.7 and cairo-0.5.1.
Note that when running the Swing demo with jamvm, I had to increase the
initial heap size (jamvm -Xms64m). Otherwise it deadlocked in JNI when
calling NewIntArray (I sent additional information to Robert). The
drawing is currently very slow, since Swing double buffering results in
lots of GtkImage to BufferedImage conversions.
The patch also includes the MODE_JAVA_ARRAY fixes I posted[2] last week.
OK to commit?
--
Ziga
[1] http://lists.gnu.org/archive/html/classpath/2005-06/msg00089.html
[2] http://lists.gnu.org/archive/html/classpath/2005-06/msg00079.html
2005-06-25 Ziga Mahkovec <address@hidden>
* native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics2D.c
(Java_gnu_java_awt_peer_gtk_GdkGraphics2D_copyState):
(Java_gnu_java_awt_peer_gtk_GdkGraphics2D_initState___3III):
(Java_gnu_java_awt_peer_gtk_GdkGraphics2D_initState__II):
(Java_gnu_java_awt_peer_gtk_GdkGraphics2D_initState__Lgnu_java_awt_peer_gtk_GtkComponentPeer_2):
Remove gdk_cairo_create calls.
Obtain dimension for the cairo surface.
(init_graphics2d_as_renderable): Fix cairo_xlib_surface_create
invocation by passing dimension.
(Java_gnu_java_awt_peer_gtk_GdkGraphics2D_drawPixels): Fix translation
matrix sign.
Use cairo_set_source for applying patterns.
(Java_gnu_java_awt_peer_gtk_GdkGraphics2D_gdkDrawDrawable): Fix
cairo_set_source_surface invocation by passing position instead of
dimension.
(Java_gnu_java_awt_peer_gtk_GdkGraphics2D_initState___3III):
(begin_drawing_operation):
(end_drawing_operation): In MODE_JAVA_ARRAY mode, only initialize the
cairo context once. Use GetPrimitiveArrayCritical for pinning down
pixel buffers and maintain a buffer copy if necessary.
* native/jni/gtk-peer/gtkcairopeer.h (javabuf_copy): New field.
cairo.patch
Description: Text Data
- [cp-patches] RFC: Fixes for the Cairo bindings,
Ziga Mahkovec <=