~alan-griffiths/mir/workaround-lp1602199

« back to all changes in this revision

Viewing changes to src/server/compositor/buffer_map.h

  • Committer: Tarmac
  • Author(s): Kevin DuBois
  • Date: 2016-05-03 09:49:54 UTC
  • mfrom: (3369.2.31 server-side-alloc)
  • Revision ID: tarmac-20160503094954-6l9jtr20mydxs3l7
server: Change point of frontend-facing buffer allocation from the mf::BufferStream to the msc::Session to prepare for NBS connection-allocated buffers.

We were previously allocating from the streams, but to accommodate mir_connection_allocate_buffer(), we will have to allocate via msc::Session.

This exposes mf::ClientBuffers(), as the streams need to reflect that buffers came from the same Session/connection. (cross-connection/cross-process mirclient-allocated-buffers are not supported). render_surfaces has an example of a 'floating' shell buffer stream that didn't originate from IPC.

Approved by mir-ci-bot, Cemil Azizoglu, Chris Halse Rogers.

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
#ifndef MIR_COMPOSITOR_BUFFER_MAP_H_
20
20
#define MIR_COMPOSITOR_BUFFER_MAP_H_
21
21
 
22
 
#include "mir/frontend/buffer_stream_id.h"
23
22
#include "mir/frontend/client_buffers.h"
24
23
#include <mutex>
25
24
#include <map>
34
33
{
35
34
public:
36
35
    BufferMap(
37
 
        frontend::BufferStreamId id,
38
36
        std::shared_ptr<frontend::BufferSink> const& sink,
39
37
        std::shared_ptr<graphics::GraphicBufferAllocator> const& allocator);
40
38
 
60
58
    Map buffers;
61
59
    Map::iterator checked_buffers_find(graphics::BufferID, std::unique_lock<std::mutex> const&);
62
60
 
63
 
    frontend::BufferStreamId const stream_id;
64
61
    std::shared_ptr<frontend::BufferSink> const sink;
65
62
    std::shared_ptr<graphics::GraphicBufferAllocator> const allocator;
66
63
};