GNOME Bugzilla – Bug 60582
render_to_drawable_alpha can't be clipped
Last modified: 2010-07-10 04:04:49 UTC
Because BILEVEL requires a mask, FULL can't be clipped because the function doesn't take a GC. (Also, we should probably have gdk_draw_pixbuf() that is always alpha and always uses src_x = 0 src_y = 0, because these render functions are inconsistent with gdk_draw_* and have an annoying number of arguments.)
gdk_pixbuf_render_to_drawable () does alpha now, so this has been mostly fixed. A public gdk_draw_pixbuf() is still an open item.
Looking at gdk/gdkpixbuf-render.c, it seems that gdk_pixbuf_render_to_drawable is more general than gdk_pixbuf_render_to_drawable_alpha (the former takes a gc, while the latter always uses NULL). Shouldn't the _alpha variant be deprecated ? I also notice that gdk_pixbuf_render_to_drawable checks its width and height arguments against -1. This is unnecessary, since the same check is also done in _gdk_draw_pixbuf.
Yse gdk_pixbuf_render_to_drawable_alpha() should be deprecated for 2.4. I don't see a src_x/src_y == 0 function as being useful - gdk_draw_pixbuf() should be fully general, and that isn't (at least without complicated mucking with the clipping rect). A more interesting question about whether arguments can be removed are the GdkRgbDither dither, int x_dither, int y_dither arguments. Dithering doesn't make a lot of sense when alpha compositing (you need to dither the final image, not the intermediate pieces) But if we do want to make gdk_pixbuf_draw() a full replacement for gdk_pixbuf_render_to_drawable(), we do need these arguments.
About to commit: Wed Oct 2 17:46:53 2002 Owen Taylor <otaylor@redhat.com> * gdk/gdkdrawable.h gdk/gdkinternals.h gdk/gdkdraw.c gdk/gdkwindow.c gdk/gdkdrawable.c: Export _gdk_draw_pixbuf as gdk_draw_pixbuf(), rename the _draw_pixbuf virtual function to draw_pixbuf. (#60582) * gdk/gdkpixbuf-render.c (gdk_pixbuf_render_to_drawable[_alpha]): Note that these functions are obsolete in the docs. * gdk/gdkpixbuf-render.c (gdk_pixbuf_render_to_drawable): Remove all the sanity checks now we make it clear that it is obsolete name for gdk_draw_pixbuf(). * gdk/gdkpixmap.c gtk/gtkcellrendererpixbuf.c gtk/gtkimage.c gtk/gtkpixmap.c demos/testpixbuf-scale.c demos/testpixbuf.c tests/testrgb.c: Use gdk_draw_pixbuf() everywhere. The remaining pieces is to actually deprecate the two gdk_pixbuf_render_to_... functions - putting on 2.4 API freeze milestone for that.