After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 68801 - Make gdk_pixbuf_render_to_drawable() use the alpha channel
Make gdk_pixbuf_render_to_drawable() use the alpha channel
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Backend: X11
1.3.x
Other All
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2002-01-15 22:43 UTC by Havoc Pennington
Modified: 2011-02-04 16:09 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Havoc Pennington 2002-01-15 22:43:05 UTC
Sort of an API change, but won't actually break anything, and 
this would be very useful to avoid writing dumb custom clipping code all
over the place. Browsing LXR, the function is rarely used, and when it is
it's used because people are sure the image has no alpha channel - and in
those 
cases nothing will change.
Comment 1 Owen Taylor 2002-01-17 21:16:41 UTC
The one exception to the idea that it wouldn't break anything
is when it is being used for threshold alpha rendering - then
you get a mix between real alpha and threshold alpha
which is probably not what was intended. (But if the source
image was bilevel, there won't be a problem except for 
possible slowness.)
Comment 2 Owen Taylor 2002-01-28 05:01:52 UTC
Another issue is that if you know you don't want to draw
alpha, you can frequently draw a lot faster; even if alpha
compositing can be made fast, not alpha compositing is faster.

The pixbuf-engine could use this for opaque sections; of course,
in a special case like this, it could also use GdkRGB directly
instead of gdk_pixbuf_render()
Comment 3 Havoc Pennington 2002-01-28 05:40:52 UTC
I can't think of many examples where you know the image is opaque but
create a pixbuf with an alpha channel anyhow - after all if you're
being efficiency-minded, presumably you don't want to waste those bytes...

The final desired API is probably:
 gdk_draw_pixbuf ()
and maybe:
 gdk_draw_pixbuf_ignoring_alpha ()
since render_to_drawable() is just a stopgap thing it makes sense to
me to have it be equivalent to gdk_draw_pixbuf().

Plus I need it for the GtkImage desensitization patch. ;-)
Comment 4 Owen Taylor 2002-01-29 22:46:24 UTC
Well, pixbuf-engine is an excellent example of such. It
frequently cuts up an image into some areas that have
alpha, and some that don't. But yes, it's probably a
fairly uncommon case.

Tue Jan 29 17:40:02 2002  Owen Taylor  <otaylor@redhat.com>

	* gdk/gdkpixbuf-render.c (gdk_pixbuf_render_to_drawable):
	Call _gdk_draw_pixbuf(), thus enabling using this function
	for pixbufs with alpha. (#68801)

	* gdk/gdkdraw.c (gdk_drawable_real_draw_pixbuf): Move
	implementation of gdk_pixbuf_render_to_drawable()
	to here.