Mir
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 
24 #include "mir_toolkit/common.h"
25 #include "mir/geometry/size.h"
26 
27 #include <memory>
28 
33 struct MirBufferPackage;
36 namespace mir
37 {
38 
39 namespace client
40 {
41 
42 /* vaddr is valid from vaddr[0] to vaddr[stride.as_uint32_t() * height.as_uint32_t() - 1] */
44 {
49  std::shared_ptr<char> vaddr;
50 };
51 
53 {
54 public:
55  virtual ~ClientBuffer() = default;
56 
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 MirPixelFormat 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 protected:
67  ClientBuffer() = default;
68  ClientBuffer(ClientBuffer const&) = delete;
69  ClientBuffer& operator=(ClientBuffer const&) = delete;
70 };
71 
72 }
73 }
74 
75 #endif /* MIR_CLIENT_CLIENT_BUFFER_H_ */
Definition: size.h:30
virtual MirPixelFormat pixel_format() const =0
virtual void increment_age()=0
virtual void mark_as_submitted()=0
virtual ~ClientBuffer()=default
geometry::Stride stride
Definition: client_buffer.h:47
std::shared_ptr< char > vaddr
Definition: client_buffer.h:49
Definition: mir_native_buffer.h:30
geometry::Height height
Definition: client_buffer.h:46
MirPixelFormat format
Definition: client_buffer.h:48
virtual geometry::Size size() const =0
virtual std::shared_ptr< graphics::NativeBuffer > native_buffer_handle() const =0
virtual std::shared_ptr< MemoryRegion > secure_for_cpu_write()=0
Definition: client_buffer.h:43
MirPixelFormat
The order of components in a format enum matches the order of the components as they would be written...
Definition: common.h:99
geometry::Width width
Definition: client_buffer.h:45
Definition: client_buffer.h:52
virtual uint32_t age() const =0
virtual geometry::Stride stride() const =0
ClientBuffer & operator=(ClientBuffer const &)=delete

Copyright © 2012,2013 Canonical Ltd.
Generated on Fri Apr 11 21:14:53 UTC 2014