~alan-griffiths/mir/fix-1654023

« back to all changes in this revision

Viewing changes to src/client/mir_buffer.h

  • Committer: Daniel van Vugt
  • Date: 2016-07-18 07:38:38 UTC
  • mfrom: (3595 development-branch)
  • mto: This revision was merged to the branch mainline in revision 3748.
  • Revision ID: daniel.van.vugt@canonical.com-20160718073838-tclt9c441h505wck
Merge latest trunk.  No conflicts in 7+ weeks?!

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright © 2016 Canonical Ltd.
 
3
 *
 
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.
 
7
 *
 
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.
 
12
 *
 
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/>.
 
15
 *
 
16
 * Authored by: Kevin DuBois <kevin.dubois@canonical.com>
 
17
 */
 
18
 
 
19
#ifndef MIR_CLIENT_MIR_BUFFER_H
 
20
#define MIR_CLIENT_MIR_BUFFER_H
 
21
 
 
22
#include "mir_toolkit/mir_buffer.h"
 
23
#include "mir/geometry/size.h"
 
24
#include <memory>
 
25
#include <chrono>
 
26
 
 
27
namespace mir
 
28
{
 
29
namespace client
 
30
{
 
31
class ClientBuffer;
 
32
class MemoryRegion;
 
33
 
 
34
class MirBuffer
 
35
{
 
36
public:
 
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;
 
45
 
 
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;
 
49
 
 
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;
 
58
protected:
 
59
    MirBuffer() = default;
 
60
    MirBuffer(MirBuffer const&) = delete;
 
61
    MirBuffer& operator=(MirBuffer const&) = delete;
 
62
};
 
63
}
 
64
}
 
65
#endif /* MIR_CLIENT_BUFFER_H_ */