Mir
temporary_buffers.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 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 General Public License for more details.
12  *
13  * You should have received a copy of the GNU 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_COMPOSITOR_TEMPORARY_BUFFERS_H_
20 #define MIR_COMPOSITOR_TEMPORARY_BUFFERS_H_
21 
22 #include "mir/graphics/buffer.h"
23 #include "mir/graphics/buffer_id.h"
24 
25 namespace mg = mir::graphics;
26 
27 namespace mir
28 {
29 namespace compositor
30 {
31 
32 class BufferBundle;
33 class BackBufferStrategy;
34 
36 {
37 public:
38  geometry::Size size() const override;
39  geometry::Stride stride() const override;
40  MirPixelFormat pixel_format() const override;
41  mg::BufferID id() const override;
42  void gl_bind_to_texture() override;
43  std::shared_ptr<mg::NativeBuffer> native_buffer_handle() const override;
44  bool can_bypass() const override;
45 
46  void write (unsigned char const* data, size_t size) override;
47 
48 protected:
49  explicit TemporaryBuffer(std::shared_ptr<mg::Buffer> const& real_buffer);
50  std::shared_ptr<mg::Buffer> const buffer;
51 };
52 
54 {
55 public:
57  std::shared_ptr<BufferBundle> const& bun, void const* user_id);
59 
60 private:
61  std::shared_ptr<BufferBundle> const bundle;
62 };
63 
65 {
66 public:
67  explicit TemporarySnapshotBuffer(
68  std::shared_ptr<BufferBundle> const& bun);
70 
71 private:
72  std::shared_ptr<BufferBundle> const bundle;
73 };
74 
75 }
76 }
77 
78 #endif /* MIR_COMPOSITOR_TEMPORARY_BUFFERS_H_ */
Definition: size.h:30
Definition: temporary_buffers.h:35
All things Mir.
Definition: buffer_stream.h:37
std::shared_ptr< mg::Buffer > const buffer
Definition: temporary_buffers.h:50
~TemporarySnapshotBuffer()
Definition: temporary_buffers.cpp:53
geometry::Size size() const override
Definition: temporary_buffers.cpp:58
bool can_bypass() const override
Definition: temporary_buffers.cpp:88
Graphics subsystem. Mediates interaction between core system and the graphics environment.
Definition: android_driver_interpreter.h:28
geometry::Stride stride() const override
Definition: temporary_buffers.cpp:63
std::shared_ptr< mg::NativeBuffer > native_buffer_handle() const override
Definition: temporary_buffers.cpp:83
Definition: temporary_buffers.h:53
MirPixelFormat pixel_format() const override
Definition: temporary_buffers.cpp:68
Definition: temporary_buffers.h:64
TemporaryBuffer(std::shared_ptr< mg::Buffer > const &real_buffer)
Definition: temporary_buffers.cpp:29
TemporaryCompositorBuffer(std::shared_ptr< BufferBundle > const &bun, void const *user_id)
Definition: temporary_buffers.cpp:34
void gl_bind_to_texture() override
Definition: temporary_buffers.cpp:78
TemporarySnapshotBuffer(std::shared_ptr< BufferBundle > const &bun)
Definition: temporary_buffers.cpp:46
MirPixelFormat
The order of components in a format enum matches the order of the components as they would be written...
Definition: common.h:127
~TemporaryCompositorBuffer()
Definition: temporary_buffers.cpp:41
mg::BufferID id() const override
Definition: temporary_buffers.cpp:73
void write(unsigned char const *data, size_t size) override
Definition: temporary_buffers.cpp:93
Definition: buffer.h:34
Definition: dimensions.h:38

Copyright © 2012,2013 Canonical Ltd.
Generated on Tue Mar 24 16:15:19 UTC 2015