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 60582 - render_to_drawable_alpha can't be clipped
render_to_drawable_alpha can't be clipped
Status: RESOLVED FIXED
Product: gdk-pixbuf
Classification: Platform
Component: general
git master
Other Linux
: Normal enhancement
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2001-09-15 23:55 UTC by Havoc Pennington
Modified: 2010-07-10 04:04 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Havoc Pennington 2001-09-15 23:55:17 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.)
Comment 1 Owen Taylor 2002-03-12 20:47:55 UTC
gdk_pixbuf_render_to_drawable () does alpha now, so this has
been mostly fixed. A public gdk_draw_pixbuf() is still an
open item.
Comment 2 Matthias Clasen 2002-04-17 12:37:51 UTC
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.
Comment 3 Owen Taylor 2002-09-24 22:11:01 UTC
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.
Comment 4 Owen Taylor 2002-10-02 22:29:05 UTC
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.