~mir-team/mir/trunk

« back to all changes in this revision

Viewing changes to tests/unit-tests/compositor/test_default_display_buffer_compositor.cpp

  • Committer: Tarmac
  • Author(s): Daniel van Vugt
  • Date: 2013-08-21 09:35:28 UTC
  • mfrom: (985.2.4 lockable-scene)
  • Revision ID: tarmac-20130821093528-rhrpfv6vm574kyif
Make compositor::Scene lockable.

This allows us to do multiple operations on a scene atomically using a nice
simple: std::lock_guard<Scene> lock(scene);

In the short term, this is required by the bypass branch. In the longer term
it will also be useful if/when Scene gets an iterator.

Approved by Robert Ancell, PS Jenkins bot, Alan Griffiths.

Show diffs side-by-side

added added

removed removed

Lines of Context:
46
46
{
47
47
    MOCK_METHOD2(for_each_if, void(mc::FilterForScene&, mc::OperatorForScene&));
48
48
    MOCK_METHOD1(set_change_callback, void(std::function<void()> const&));
 
49
    MOCK_METHOD0(lock, void());
 
50
    MOCK_METHOD0(unlock, void());
49
51
};
50
52
 
51
53
struct MockOverlayRenderer : public mc::OverlayRenderer
74
76
 
75
77
    void set_change_callback(std::function<void()> const&) {}
76
78
 
 
79
    void lock() {}
 
80
    void unlock() {}
 
81
 
77
82
    mtd::MockBufferStream stub_stream;
78
83
    std::vector<mc::CompositingCriteria*> surfaces;
79
84
};