2
* Copyright © 2012 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>
19
#ifndef MIR_TEST_DOUBLES_STUB_DRIVER_INTERPRETER_H_
20
#define MIR_TEST_DOUBLES_STUB_DRIVER_INTERPRETER_H_
22
#include "mir/graphics/android/android_driver_interpreter.h"
31
class StubDriverInterpreter : public graphics::android::AndroidDriverInterpreter
34
StubDriverInterpreter(mir::geometry::Size sz, int visual_id)
40
StubDriverInterpreter()
41
: StubDriverInterpreter(mir::geometry::Size{44,22}, 5)
45
mir::graphics::NativeBuffer* driver_requests_buffer()
49
void driver_returns_buffer(ANativeWindowBuffer*, int)
52
void dispatch_driver_request_format(int)
55
int driver_requests_info(int index) const
57
if (index == NATIVE_WINDOW_WIDTH)
58
return sz.width.as_uint32_t();
59
if (index == NATIVE_WINDOW_HEIGHT)
60
return sz.height.as_uint32_t();
61
if (index == NATIVE_WINDOW_FORMAT)
65
void sync_to_display(bool)
69
mir::geometry::Size sz;
75
#endif /* MIR_TEST_DOUBLES_STUB_BUFFER_H_ */