2
* Copyright © 2013 Canonical Ltd.
4
* This program is free software: you can redistribute it and/or modify it
5
* under the terms of the GNU General Public License version 3,
6
* as published by the Free Software Foundation.
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU General Public License for more details.
13
* You should have received a copy of the GNU General Public License
14
* along with this program. If not, see <http://www.gnu.org/licenses/>.
16
* Authored by: Kevin DuBois <kevin.dubois@canonical.com>
18
#ifndef MIR_TEST_DOUBLES_MOCK_BUFFER_BUNDLE_H_
19
#define MIR_TEST_DOUBLES_MOCK_BUFFER_BUNDLE_H_
21
#include "src/server/compositor/buffer_bundle.h"
23
#include <gmock/gmock.h>
32
struct MockBufferBundle : public compositor::BufferBundle
37
ON_CALL(*this, buffers_ready_for_compositor(testing::_))
38
.WillByDefault(testing::Return(1));
39
ON_CALL(*this, properties())
40
.WillByDefault(testing::Return(
41
graphics::BufferProperties{geometry::Size{1,1},
42
mir_pixel_format_abgr_8888, graphics::BufferUsage::hardware}));
45
MOCK_METHOD1(client_acquire, void(std::function<void(graphics::Buffer*)>));
46
MOCK_METHOD1(client_release, void(graphics::Buffer*));
47
MOCK_METHOD1(compositor_acquire, std::shared_ptr<graphics::Buffer>(void const*));
48
MOCK_METHOD1(compositor_release, void(std::shared_ptr<graphics::Buffer> const&));
49
MOCK_METHOD0(snapshot_acquire, std::shared_ptr<graphics::Buffer>());
50
MOCK_METHOD1(snapshot_release, void(std::shared_ptr<graphics::Buffer> const&));
51
MOCK_METHOD1(allow_framedropping, void(bool));
52
MOCK_METHOD1(set_mode, void(compositor::MultiMonitorMode));
53
MOCK_CONST_METHOD0(properties, graphics::BufferProperties());
54
MOCK_METHOD0(force_client_abort, void());
55
MOCK_METHOD0(force_requests_to_complete, void());
56
MOCK_METHOD1(resize, void(const geometry::Size &));
57
MOCK_METHOD0(drop_old_buffers, void());
58
MOCK_CONST_METHOD1(buffers_ready_for_compositor, int(void const*));
59
int buffers_free_for_client() const override { return 1; }
60
void drop_client_requests() override {}
67
#endif /* MIR_TEST_DOUBLES_MOCK_BUFFER_BUNDLE_H_ */