~alan-griffiths/mir/fix-1716436

« back to all changes in this revision

Viewing changes to src/server/compositor/stream.cpp

  • Committer: Tarmac
  • Author(s): Christopher James Halse Rogers
  • Date: 2017-08-16 13:04:42 UTC
  • mfrom: (4201.6.5 further-plumbing-followup)
  • Revision ID: tarmac-20170816130442-9rhjwglquxn14r9c
Remove even more manual reference counting of mg::Buffer-s. .

Approved by mir-ci-bot, Alan Griffiths, Brandon Schaefer.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
#include "stream.h"
21
21
#include "queueing_schedule.h"
22
22
#include "dropping_schedule.h"
23
 
#include "temporary_buffers.h"
24
23
#include "mir/graphics/buffer.h"
25
24
#include <boost/throw_exception.hpp>
26
25
 
65
64
void mc::Stream::with_most_recent_buffer_do(std::function<void(mg::Buffer&)> const& fn)
66
65
{
67
66
    std::lock_guard<decltype(mutex)> lk(mutex); 
68
 
    TemporarySnapshotBuffer buffer(arbiter);
69
 
    fn(buffer);
 
67
    fn(*arbiter->snapshot_acquire());
70
68
}
71
69
 
72
70
MirPixelFormat mc::Stream::pixel_format() const
88
86
 
89
87
std::shared_ptr<mg::Buffer> mc::Stream::lock_compositor_buffer(void const* id)
90
88
{
91
 
    return std::make_shared<mc::TemporaryCompositorBuffer>(arbiter, id);
 
89
    return arbiter->compositor_acquire(id);
92
90
}
93
91
 
94
92
geom::Size mc::Stream::stream_size()