mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-28 03:45:39 +00:00
compositor: Alpha inputs with the SOURCE operator can be considered opaque
We don't have to look at each pixel's alpha component because we will directly write it over the background.
This commit is contained in:
parent
c7a9a966b0
commit
18ee5e57fd
1 changed files with 6 additions and 5 deletions
|
@ -324,11 +324,12 @@ _pad_obscures_rectangle (GstVideoAggregator * vagg, GstVideoAggregatorPad * pad,
|
|||
if (!gst_video_aggregator_pad_has_current_buffer (pad))
|
||||
return FALSE;
|
||||
|
||||
/* Can't obscure if it's transparent and if the format has an alpha component
|
||||
* we'd have to inspect every pixel to know if the frame is opaque, so assume
|
||||
* it doesn't obscure. As a bonus, if the rectangle is fully transparent, we
|
||||
* can also obscure it if we have alpha components on the pad */
|
||||
if (!rect_transparent &&
|
||||
/* Can't obscure if it's transparent and if the format has an alpha
|
||||
* component we'd have to inspect every pixel to know if the frame is
|
||||
* opaque, so assume it doesn't obscure unless it uses the SOURCE operator.
|
||||
* As a bonus, if the rectangle is fully transparent, we can also obscure it
|
||||
* if we have alpha components on the pad */
|
||||
if (cpad->op != COMPOSITOR_OPERATOR_SOURCE && !rect_transparent &&
|
||||
(cpad->alpha != 1.0 || GST_VIDEO_INFO_HAS_ALPHA (&pad->info)))
|
||||
return FALSE;
|
||||
|
||||
|
|
Loading…
Reference in a new issue