Mir
buffer_properties.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: Alexandros Frantzis <alexandros.frantzis@canonical.com>
17  */
18 
19 #ifndef MIR_GRAPHICS_BUFFER_PROPERTIES_H_
20 #define MIR_GRAPHICS_BUFFER_PROPERTIES_H_
21 
22 #include "mir/geometry/size.h"
23 #include "mir_toolkit/common.h"
24 
25 namespace mir
26 {
27 namespace graphics
28 {
29 
36 enum class BufferUsage
37 {
38  undefined,
40  hardware,
42  software
43 };
44 
49 {
51  size(),
53  usage(BufferUsage::undefined)
54  {
55  }
56 
58  const MirPixelFormat& format,
59  BufferUsage usage) :
60  size{size},
61  format{format},
62  usage{usage}
63  {
64  }
65 
69 };
70 
71 inline bool operator==(BufferProperties const& lhs, BufferProperties const& rhs)
72 {
73  return lhs.size == rhs.size &&
74  lhs.format == rhs.format &&
75  lhs.usage == rhs.usage;
76 }
77 
78 inline bool operator!=(BufferProperties const& lhs, BufferProperties const& rhs)
79 {
80  return !(lhs == rhs);
81 }
82 
83 }
84 }
85 #endif // MIR_GRAPHICS_BUFFER_PROPERTIES_H_
Definition: size.h:30
BufferProperties()
Definition: buffer_properties.h:50
Definition: as_render_target.h:27
MirPixelFormat format
Definition: buffer_properties.h:67
bool operator==(BufferProperties const &lhs, BufferProperties const &rhs)
Definition: buffer_properties.h:71
geometry::Size size
Definition: buffer_properties.h:66
Definition: common.h:243
BufferUsage usage
Definition: buffer_properties.h:68
bool operator!=(BufferProperties const &lhs, BufferProperties const &rhs)
Definition: buffer_properties.h:78
BufferUsage
How a buffer is going to be used.
Definition: buffer_properties.h:36
MirPixelFormat
32-bit pixel formats (8888): The order of components in the enum matches the order of the components ...
Definition: common.h:241
rendering using direct pixel access
Buffer creation properties.
Definition: buffer_properties.h:48
BufferProperties(const geometry::Size &size, const MirPixelFormat &format, BufferUsage usage)
Definition: buffer_properties.h:57

Copyright © 2012-2016 Canonical Ltd.
Generated on Tue Oct 31 05:57:28 UTC 2017