2
* Copyright © 2016 Canonical Ltd.
4
* This program is free software: you can redistribute it and/or modify
5
* it under the terms of the GNU Lesser General Public License version 3 as
6
* 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 Lesser General Public License for more details.
13
* You should have received a copy of the GNU Lesser 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_CLIENT_MIR_BUFFER_H
20
#define MIR_CLIENT_MIR_BUFFER_H
22
#include "mir_toolkit/mir_buffer.h"
23
#include "mir/geometry/size.h"
37
virtual ~MirBuffer() = default;
38
virtual int rpc_id() const = 0;
39
virtual void submitted() = 0;
40
virtual void received() = 0;
41
virtual void received(MirBufferPackage const& update_message) = 0;
42
virtual MirNativeBuffer* as_mir_native_buffer() const = 0;
43
virtual std::shared_ptr<ClientBuffer> client_buffer() const = 0;
44
virtual MirGraphicsRegion map_region() = 0;
46
virtual void set_fence(MirNativeFence*, MirBufferAccess) = 0;
47
virtual MirNativeFence* get_fence() const = 0;
48
virtual bool wait_fence(MirBufferAccess, std::chrono::nanoseconds) = 0;
50
virtual MirBufferUsage buffer_usage() const = 0;
51
virtual MirPixelFormat pixel_format() const = 0;
52
virtual geometry::Size size() const = 0;
53
virtual MirConnection* allocating_connection() const = 0;
54
virtual void increment_age() = 0;
55
virtual bool valid() const = 0;
56
virtual char const* error_message() const = 0;
57
virtual void set_callback(mir_buffer_callback callback, void* context) = 0;
59
MirBuffer() = default;
60
MirBuffer(MirBuffer const&) = delete;
61
MirBuffer& operator=(MirBuffer const&) = delete;
65
#endif /* MIR_CLIENT_BUFFER_H_ */