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 735879 - basetetxtoverlay: make shading_value a property
basetetxtoverlay: make shading_value a property
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
1.x
Other Linux
: Normal enhancement
: 1.5.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-09-02 11:17 UTC by Nicola
Modified: 2014-09-08 20:28 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
make shading_value a property (5.75 KB, patch)
2014-09-02 11:17 UTC, Nicola
committed Details | Review

Description Nicola 2014-09-02 11:17:22 UTC
Created attachment 285129 [details] [review]
make shading_value a property

shading_value is hardcoded to 80 (1-255 range), this patch make it configurable.

I don't understand this code:

http://cgit.freedesktop.org/gstreamer/gst-plugins-base/tree/ext/pango/gstbasetextoverlay.c#n1554

cairo_paint_with_alpha require a double while shading_value is an integer

however background shading is done in methods like these:

http://cgit.freedesktop.org/gstreamer/gst-plugins-base/tree/ext/pango/gstbasetextoverlay.c#n1633

http://cgit.freedesktop.org/gstreamer/gst-plugins-base/tree/ext/pango/gstbasetextoverlay.c#n1652
Comment 1 Sebastian Dröge (slomo) 2014-09-04 08:18:47 UTC
One makes the subpicture (that is overlayed) transparent with that value, the other darkens it.

commit ad16f15ee420ed32cf436efc309b2ae08d78fa2f
Author: Nicola Murino <nicola.murino@gmail.com>
Date:   Tue Sep 2 13:10:34 2014 +0200

    basetextoverlay: Make shading_value a property
    
    https://bugzilla.gnome.org/show_bug.cgi?id=735879
Comment 2 Nicola 2014-09-04 08:40:00 UTC
ok but from cairo docs:

"
void                cairo_paint_with_alpha              (cairo_t *cr,
                                                         double alpha);

alpha :

alpha value, between 0 (transparent) and 1 (opaque)
"

we now pass a negative integer between -1 and -255 (before this patch we passed -80), maybe we should do something like this (not tested):

cairo_paint_with_alpha (cr, overlay->shading_value/255.0);

instead of:

cairo_paint_with_alpha (cr, -overlay->shading_value);
Comment 3 Sebastian Dröge (slomo) 2014-09-04 08:47:46 UTC
Can you create a new bug for that?
Comment 4 Nicola 2014-09-04 08:50:03 UTC
ok, if you confirm that I'm right I'll attach a patch to the new bug too
Comment 5 Nicola 2014-09-08 20:28:30 UTC
can you please push to 1.4 please?