[SCM] calf/master: + Knob: test implementation of drawing using pixmaps and not pixbufs
js at users.alioth.debian.org
js at users.alioth.debian.org
Tue May 7 15:39:12 UTC 2013
The following commit has been merged in the master branch:
commit ec92fd56bf8047673006b1a5e3ffcc14f328ab3e
Author: Krzysztof Foltman <wdev at foltman.com>
Date: Sun Jan 25 21:32:31 2009 +0000
+ Knob: test implementation of drawing using pixmaps and not pixbufs
diff --git a/src/custom_ctl.cpp b/src/custom_ctl.cpp
index fb282a8..31bb0bf 100644
--- a/src/custom_ctl.cpp
+++ b/src/custom_ctl.cpp
@@ -618,7 +618,16 @@ calf_knob_expose (GtkWidget *widget, GdkEventExpose *event)
if (diff < -0.0001)
phase = (phase + 63) % 64;
}
- gdk_draw_pixbuf(GDK_DRAWABLE(widget->window), widget->style->fg_gc[0], CALF_KNOB_CLASS(GTK_OBJECT_GET_CLASS(widget))->knob_image, phase * 40, self->knob_type * 40, ox, oy, 40, 40, GDK_RGB_DITHER_NORMAL, 0, 0);
+ static GdkPixmap *pixmap = NULL;
+ if (!pixmap)
+ {
+ GdkPixbuf *pbuf = CALF_KNOB_CLASS(GTK_OBJECT_GET_CLASS(widget))->knob_image;
+ pixmap = gdk_pixmap_new(GDK_DRAWABLE(widget->window), gdk_pixbuf_get_width(pbuf), gdk_pixbuf_get_height(pbuf), -1);
+ gdk_draw_rectangle(GDK_DRAWABLE(pixmap), widget->style->bg_gc[0], TRUE, 0, 0, gdk_pixbuf_get_width(pbuf), gdk_pixbuf_get_height(pbuf));
+ // gdk_drawable_set_colormap(GDK_DRAWABLE(pixmap), gdk_colormap_get_system());
+ gdk_draw_pixbuf(GDK_DRAWABLE(pixmap), NULL, pbuf, 0, 0, 0, 0, gdk_pixbuf_get_width(pbuf), gdk_pixbuf_get_height(pbuf), GDK_RGB_DITHER_NORMAL, 0, 0);
+ }
+ gdk_draw_drawable(GDK_DRAWABLE(widget->window), widget->style->bg_gc[0], pixmap, phase * 40, self->knob_type * 40, ox, oy, 40, 40);
// printf("exposed %p %d+%d\n", widget->window, widget->allocation.x, widget->allocation.y);
if (gtk_widget_is_focus(widget))
{
--
calf audio plugins packaging
More information about the pkg-multimedia-commits
mailing list