[cairo-commit] gtkcairo/gtkcairo gtkcairo.c,1.14,1.15
OEyvind Kolaas
commit at pdx.freedesktop.org
Sun Jun 20 14:15:32 PDT 2004
Committed by: pippin
Update of /cvs/cairo/gtkcairo/gtkcairo
In directory pdx:/tmp/cvs-serv26538/gtkcairo
Modified Files:
gtkcairo.c
Log Message:
added a non public, function to query if current backend is "gl", need better interface in the future
Index: gtkcairo.c
===================================================================
RCS file: /cvs/cairo/gtkcairo/gtkcairo/gtkcairo.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** gtkcairo.c 23 May 2004 22:30:21 -0000 1.14
--- gtkcairo.c 20 Jun 2004 21:15:29 -0000 1.15
***************
*** 200,204 ****
}
-
void
gtk_cairo_set_gdk_color (cairo_t *cr,
--- 200,203 ----
***************
*** 214,216 ****
--- 213,251 ----
}
+ int
+ gtk_cairo_backend_is_gl (GtkCairo *gtkcairo)
+ {
+ if (((gdkcairo_t*)gtkcairo->gdkcairo)->backend == GDKCAIRO_BACKEND_GL)
+ return 1;
+ return 0;
+ }
+
+ #if 0
+ /* FIXME: premultiply the buffer, but who should own it?
+ */
+
+ cairo_surface_t *
+ gtk_cairo_surface_create_for_gdk_pixbuf (const GdkPixbuf *pixbuf)
+ {
+ cairo_surface_t *self;
+ char *data;
+ cairo_format_t format;
+ int width;
+ int height;
+ int stride;
+
+ if (!pixbuf)
+ return NULL;
+ data = gdk_pixbuf_get_pixels (pixbuf);
+ width = gdk_pixbuf_get_width (pixbuf);
+ height = gdk_pixbuf_get_height (pixbuf);
+ format = CAIRO_FORMAT_ARGB32;
+ stride = gdk_pixbuf_get_rowstride (pixbuf);
+
+ self = cairo_surface_create_for_image (
+ data, format, width, height, stride);
+ return self;
+ }
+ #endif
+
/* vim: set ts=4 sw=4 noet : */
More information about the cairo-commit
mailing list