Mir
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Groups
Pages
src
client
client_buffer.h
Go to the documentation of this file.
1
/*
2
* Copyright © 2012 Canonical Ltd.
3
*
4
* This program is free software: you can redistribute it and/or modify it
5
* under the terms of the GNU Lesser General Public License version 3,
6
* as 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:
17
* Kevin DuBois <kevin.dubois@canonical.com>
18
*/
19
20
#ifndef MIR_CLIENT_CLIENT_BUFFER_H_
21
#define MIR_CLIENT_CLIENT_BUFFER_H_
22
23
#include "
mir/graphics/native_buffer.h
"
24
#include "
mir_toolkit/common.h
"
25
#include "
mir/geometry/pixel_format.h
"
26
#include "
mir/geometry/size.h
"
27
28
#include <memory>
29
34
struct
MirBufferPackage
;
37
namespace
mir
38
{
39
40
namespace
client
41
{
42
43
/* vaddr is valid from vaddr[0] to vaddr[stride.as_uint32_t() * height.as_uint32_t() - 1] */
44
struct
MemoryRegion
45
{
46
geometry::Width
width
;
47
geometry::Height
height
;
48
geometry::Stride
stride
;
49
geometry::PixelFormat
format
;
50
std::shared_ptr<char>
vaddr
;
51
};
52
53
class
ClientBuffer
54
{
55
public
:
56
virtual
~ClientBuffer
() =
default
;
57
virtual
std::shared_ptr<MemoryRegion>
secure_for_cpu_write
() = 0;
58
virtual
geometry::Size
size
()
const
= 0;
59
virtual
geometry::Stride
stride
()
const
= 0;
60
virtual
geometry::PixelFormat
pixel_format
()
const
= 0;
61
virtual
uint32_t
age
()
const
= 0;
62
virtual
void
increment_age
() = 0;
63
virtual
void
mark_as_submitted
() = 0;
64
virtual
std::shared_ptr<graphics::NativeBuffer>
native_buffer_handle
()
const
= 0;
65
};
66
67
}
68
}
69
70
#endif
/* MIR_CLIENT_CLIENT_BUFFER_H_ */
Copyright © 2012,2013 Canonical Ltd.
Generated on Tue Oct 15 00:23:28 UTC 2013