~kdub/mir/fix-1301040

« back to all changes in this revision

Viewing changes to src/server/scene/surface_stack.cpp

provide a renderlist generated from the SurfaceStack.

This is not the final version of the interface. It is a first step towards that goal, as well as being the first step to integrating hardware optimization support down to the DisplayBuffer/HWC.

This implements a pretty shallow copy of the list. I suspect the optimal answer to 'how deep to copy' lies somewhere between a shallow copy and a deep copy, and will be hashed out in the future.

Approved by Daniel van Vugt, PS Jenkins bot, Alberto Aguirre.

Show diffs side-by-side

added added

removed removed

Lines of Context:
60
60
{
61
61
}
62
62
 
 
63
mg::RenderableList ms::SurfaceStack::generate_renderable_list() const
 
64
{
 
65
    std::lock_guard<std::recursive_mutex> lg(guard);
 
66
    mg::RenderableList list;
 
67
    for (auto &layer : layers_by_depth)
 
68
        std::copy(layer.second.begin(), layer.second.end(), std::back_inserter(list));
 
69
    return list;
 
70
}
 
71
 
63
72
void ms::SurfaceStack::for_each_if(mc::FilterForScene& filter, mc::OperatorForScene& op)
64
73
{
65
74
    std::lock_guard<std::recursive_mutex> lg(guard);