compositor: Skip pads that are completely obscured by a higher zorder pad
authorNirbheek Chauhan <nirbheek@centricular.com>
Sat, 18 Apr 2015 09:39:02 +0000 (15:09 +0530)
committerTim-Philipp Müller <tim@centricular.com>
Fri, 1 May 2015 09:56:32 +0000 (10:56 +0100)
commite0fd23cb23726c13c50d51842d67ad2f78ab64ef
tree3f37fbd682f6b74a4525dfb4fd77b1d39f4405a8
parent6fc55a997e57d8a4547b58680b390a8f1394a2b8
compositor: Skip pads that are completely obscured by a higher zorder pad

For each frame, compare the frame boundaries, check if the format contains an
alpha channel, check opacity, and skip the frame if it's going to be completely
overwritten by a higher zorder frame. The check is O(n^2), but that doesn't
matter here because the number of sinkpads is small.

More can be done to avoid needless drawing, but this covers the majority of
cases. See TODOs. Ideally, a reverse painter's algorithm should be used for
optimal drawing, but memcpy during compositing is small compared to the CPU used
for frame conversion on each pad.

https://bugzilla.gnome.org/show_bug.cgi?id=746147
gst/compositor/compositor.c