~alan-griffiths/mir/revert-c2238

« back to all changes in this revision

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

  • Committer: Tarmac
  • Author(s): Alan Griffiths
  • Date: 2015-01-22 11:58:57 UTC
  • mfrom: (2242.1.3 mir3)
  • Revision ID: tarmac-20150122115857-jh60f72v7ii1on92
tests: deduplicate NullDisplayBufferCompositorFactory.

Approved by PS Jenkins bot, Alberto Aguirre, Robert Carr.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
#include "mir/geometry/rectangle.h"
26
26
 
27
27
#include "mir_test_doubles/null_display.h"
 
28
#include "mir_test_doubles/null_display_buffer_compositor_factory.h"
28
29
#include "mir_test_doubles/stub_display_configuration.h"
29
30
#include "mir_test_doubles/stub_buffer_allocator.h"
30
31
#include "mir_test_doubles/mock_buffer.h"
88
89
bool const StubDisplay::connected{true};
89
90
bool const StubDisplay::used{true};
90
91
 
91
 
class NullDisplayBufferCompositorFactory : public mc::DisplayBufferCompositorFactory
92
 
{
93
 
public:
94
 
    std::unique_ptr<mc::DisplayBufferCompositor> create_compositor_for(mg::DisplayBuffer&)
95
 
    {
96
 
        struct NullDisplayBufferCompositor : mc::DisplayBufferCompositor
97
 
        {
98
 
            void composite(mc::SceneElementSequence&&) {}
99
 
        };
100
 
 
101
 
        auto raw = new NullDisplayBufferCompositor{};
102
 
        return std::unique_ptr<NullDisplayBufferCompositor>(raw);
103
 
    }
104
 
};
105
 
 
106
92
struct MockDisplayBufferCompositor : mc::DisplayBufferCompositor
107
93
{
108
94
    void composite(mc::SceneElementSequence&& seq)
185
171
    mtd::StubScene stub_scene;
186
172
    StubDisplay stub_display;
187
173
    mtd::StubBufferAllocator stub_buffer_allocator;
188
 
    NullDisplayBufferCompositorFactory stub_db_compositor_factory;
 
174
    mtd::NullDisplayBufferCompositorFactory stub_db_compositor_factory;
189
175
    mc::CompositingScreencast screencast;
190
176
    geom::Size const default_size;
191
177
    geom::Rectangle const default_region;