Mir
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
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;
39  geometry::Stride stride() const;
41  mg::BufferID id() const;
42  void bind_to_texture();
43  std::shared_ptr<mg::NativeBuffer> native_buffer_handle() const;
44  bool can_bypass() const override;
45 
46 protected:
47  explicit TemporaryBuffer(std::shared_ptr<mg::Buffer> const& real_buffer);
48  std::shared_ptr<mg::Buffer> const buffer;
49 };
50 
52 {
53 public:
54  explicit TemporaryClientBuffer(std::shared_ptr<BufferBundle> const& buffer_swapper);
56 
57 private:
58  std::weak_ptr<BufferBundle> const allocating_swapper;
59 };
60 
62 {
63 public:
65  std::shared_ptr<BufferBundle> const& bun, unsigned long frameno);
67 
68 private:
69  std::shared_ptr<BufferBundle> const bundle;
70 };
71 
73 {
74 public:
75  explicit TemporarySnapshotBuffer(
76  std::shared_ptr<BufferBundle> const& bun);
78 
79 private:
80  std::shared_ptr<BufferBundle> const bundle;
81 };
82 
83 }
84 }
85 
86 #endif /* MIR_COMPOSITOR_TEMPORARY_BUFFERS_H_ */

Copyright © 2012,2013 Canonical Ltd.
Generated on Tue Oct 15 00:23:28 UTC 2013