Mir
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: Alan Griffiths <alan@octopull.co.uk>
17  */
18 
19 #ifndef MIR_GRAPHICS_BUFFER_H_
20 #define MIR_GRAPHICS_BUFFER_H_
21 
23 #include "mir/graphics/buffer_id.h"
24 #include "mir/geometry/size.h"
25 #include "mir_toolkit/common.h"
26 
27 #include <memory>
28 #include <functional>
29 
30 namespace mir
31 {
32 namespace graphics
33 {
34 
36 {
37 protected:
38  NativeBufferBase() = default;
39  virtual ~NativeBufferBase() = default;
40  NativeBufferBase(NativeBuffer const&) = delete;
41  NativeBufferBase operator=(NativeBuffer const&) = delete;
42 };
43 
44 class Buffer
45 {
46 public:
47  virtual ~Buffer() {}
48 
49  virtual std::shared_ptr<NativeBuffer> native_buffer_handle() const = 0;
50  virtual BufferID id() const = 0;
51  virtual geometry::Size size() const = 0;
52  virtual MirPixelFormat pixel_format() const = 0;
53 
54  virtual NativeBufferBase* native_buffer_base() = 0;
55 
56 protected:
57  Buffer() = default;
58 };
59 
60 }
61 }
62 #endif // MIR_GRAPHICS_BUFFER_H_
Definition: size.h:30
Definition: as_render_target.h:27
Definition: buffer.h:35
Definition: native_buffer.h:26
NativeBufferBase operator=(NativeBuffer const &)=delete
MirPixelFormat
32-bit pixel formats (8888): The order of components in the enum matches the order of the components ...
Definition: common.h:156
Definition: int_wrapper.h:27
virtual ~NativeBufferBase()=default
Definition: buffer.h:44
virtual ~Buffer()
Definition: buffer.h:47

Copyright © 2012-2016 Canonical Ltd.
Generated on Sat Dec 3 12:48:59 UTC 2016