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)
commit8f1edb69f4fc4b6b0c098f0c9d11a6f32bdd738b
tree43639dc8866838f8cb296eb16334e10b9e06df71
parent2c7c82d748c57e15bb307a4bfbe437c7f18b41f7
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