aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/orrery
diff options
context:
space:
mode:
authorMartin Jansa <Martin.Jansa@gmail.com>2010-11-15 22:39:46 +0100
committerMartin Jansa <Martin.Jansa@gmail.com>2010-11-15 22:47:10 +0100
commit664ad859bca00d27c18fc39953fd7730de42ed7d (patch)
tree354a88df6644c6769e1335a5c01276f22eef3566 /recipes/orrery
parent08b1bf363f581cfbd4a6c45a5441206546863e7e (diff)
downloadopenembedded-664ad859bca00d27c18fc39953fd7730de42ed7d.tar.gz
orrery: use GdkPixbuf for more effective drawing
* also s/files/orrery/ for faster lookup Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Diffstat (limited to 'recipes/orrery')
-rw-r--r--recipes/orrery/orrery/orrery.png (renamed from recipes/orrery/files/orrery.png)bin19475 -> 19475 bytes
-rw-r--r--recipes/orrery/orrery/use.GdkPixbuf.patch59
-rw-r--r--recipes/orrery/orrery_2.7.bb3
3 files changed, 61 insertions, 1 deletions
diff --git a/recipes/orrery/files/orrery.png b/recipes/orrery/orrery/orrery.png
index d9865b70ce..d9865b70ce 100644
--- a/recipes/orrery/files/orrery.png
+++ b/recipes/orrery/orrery/orrery.png
Binary files differ
diff --git a/recipes/orrery/orrery/use.GdkPixbuf.patch b/recipes/orrery/orrery/use.GdkPixbuf.patch
new file mode 100644
index 0000000000..92d194de08
--- /dev/null
+++ b/recipes/orrery/orrery/use.GdkPixbuf.patch
@@ -0,0 +1,59 @@
+From: Benjamin Deering
+Subject: orrery crashing X
+Date: Thursday, September 2, 2010 - 5:25 pm
+Link: http://kerneltrap.org/mailarchive/openmoko-community/2010/9/3/13218
+
+diff -uNr orrery.orig//orrery.c orrery/orrery.c
+--- orrery.orig//orrery.c 2009-11-30 06:59:44.000000000 +0100
++++ orrery/orrery.c 2010-11-15 22:33:17.000000000 +0100
+@@ -1238,12 +1238,44 @@
+ }
+ currentEntry = currentEntry->forwardPointer;
+ }
+- if (nDarkGreyPoints > 0)
+- gdk_draw_points(pixmap, darkGreyGC, darkGreyPoints, nDarkGreyPoints);
+- if (nGreyPoints > 0)
+- gdk_draw_points(pixmap, greyGC, greyPoints, nGreyPoints);
+- if (nWhitePoints > 0)
+- gdk_draw_points(pixmap, whiteGC, whitePoints, nWhitePoints);
++ GdkPixbuf* starDrawingBuf = gdk_pixbuf_get_from_drawable( NULL,
++ pixmap,
++ gdk_colormap_get_system()
++ , 0, 0, 0, 0, displayWidth, displayHeight);
++ g_assert (gdk_pixbuf_get_bits_per_sample (starDrawingBuf) == 8);
++ guchar* p;
++ int rowstride = gdk_pixbuf_get_rowstride (starDrawingBuf);
++ guchar* pixels = gdk_pixbuf_get_pixels (starDrawingBuf);
++ int n_channels = gdk_pixbuf_get_n_channels (starDrawingBuf);
++ GdkGCValues starGCval;
++ GdkColor starColor;
++ int pointNum;
++ gdk_gc_get_values(darkGreyGC, &starGCval);
++ gdk_colormap_query_color( gdk_gc_get_colormap(darkGreyGC),starGCval.foreground.pixel, &starColor );
++ for( pointNum = 0; pointNum < nDarkGreyPoints; pointNum++) {
++ p = pixels + darkGreyPoints[pointNum].y * rowstride + darkGreyPoints[pointNum].x * n_channels;
++ p[0] = starColor.red & 0xff;
++ p[1] = starColor.green & 0xff;
++ p[2] = starColor.blue & 0xff;
++ }
++ gdk_gc_get_values(greyGC, &starGCval);
++ gdk_colormap_query_color( gdk_gc_get_colormap(greyGC), starGCval.foreground.pixel, &starColor );
++ for( pointNum = 0; pointNum < nGreyPoints; pointNum++) {
++ p = pixels + greyPoints[pointNum].y * rowstride + greyPoints[pointNum].x * n_channels;
++ p[0] = starColor.red & 0xff;
++ p[1] = starColor.green & 0xff;
++ p[2] = starColor.blue & 0xff;
++ }
++ gdk_gc_get_values(whiteGC, &starGCval);
++ gdk_colormap_query_color( gdk_gc_get_colormap(whiteGC), starGCval.foreground.pixel, &starColor );
++ for( pointNum = 0; pointNum < nWhitePoints; pointNum++) {
++ p = pixels + whitePoints[pointNum].y * rowstride + whitePoints[pointNum].x * n_channels;
++ p[0] = starColor.red & 0xff;
++ p[1] = starColor.green & 0xff;
++ p[2] = starColor.blue & 0xff;
++ }
++ gdk_draw_pixbuf ( pixmap , NULL , starDrawingBuf,
++ 0, 0, 0, 0, displayWidth, displayHeight, GDK_RGB_DITHER_NORMAL, 0, 0 ) ;
+ }
+
+ void makeTimeString(char *string)
diff --git a/recipes/orrery/orrery_2.7.bb b/recipes/orrery/orrery_2.7.bb
index 7b93ee97bf..86a916fde1 100644
--- a/recipes/orrery/orrery_2.7.bb
+++ b/recipes/orrery/orrery_2.7.bb
@@ -2,11 +2,12 @@ DESCRIPTION = "Astronomical application which displays the night sky"
HOMEPAGE = "http://projects.openmoko.org/projects/orrery/"
SECTION = "x11/scientific"
PV = "2.7"
-PR = "r0"
+PR = "r1"
inherit autotools
SRC_URI = "http://projects.openmoko.org/frs/download.php/923/orrery_2.7_clean.tar.gz;name=tarball \
file://orrery.png \
+ file://use.GdkPixbuf.patch \
"
SRC_URI[tarball.md5sum] = "bd62a33e7554ee1030313dfcdefcda8b"