Mir
display_buffer.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2013 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_DISPLAY_BUFFER_H_
20 #define MIR_GRAPHICS_DISPLAY_BUFFER_H_
21 
22 #include <mir/geometry/rectangle.h>
24 #include <mir_toolkit/common.h>
25 
26 #include <memory>
27 
28 namespace mir
29 {
30 namespace graphics
31 {
32 
33 class Buffer;
34 
39 {
40 public:
41  virtual ~DisplayBuffer() {}
42 
44  virtual geometry::Rectangle view_area() const = 0;
46  virtual void make_current() = 0;
48  virtual void release_current() = 0;
49 
55  virtual void gl_swap_buffers() = 0;
56 
69  virtual void flip() = 0;
70 
76  __attribute__((__deprecated__("Use gl_swap_buffers() and flip(), remembering to release all compositor buffers in the middle.")))
77  void post_update() { gl_swap_buffers(); flip(); }
78 
94  virtual bool post_renderables_if_optimizable(RenderableList const& renderlist) = 0;
95 
104  virtual MirOrientation orientation() const = 0;
105 
110  virtual bool uses_alpha() const = 0;
111 
112 protected:
113  DisplayBuffer() = default;
114  DisplayBuffer(DisplayBuffer const& c) = delete;
115  DisplayBuffer& operator=(DisplayBuffer const& c) = delete;
116 };
117 
118 }
119 }
120 
121 #endif /* MIR_GRAPHICS_DISPLAY_BUFFER_H_ */
All things Mir.
Definition: buffer_stream.h:37
virtual ~DisplayBuffer()
Definition: display_buffer.h:41
virtual void release_current()=0
Releases the current GL rendering target.
__attribute__((__deprecated__("Use gl_swap_buffers() and flip(), remembering to release all compositor buffers in the middle."))) void post_update()
Definition: display_buffer.h:76
Interface to an output framebuffer.
Definition: display_buffer.h:38
MirOrientation
Direction relative to the "natural" orientation of the display.
Definition: common.h:142
virtual void flip()=0
After gl_swap_buffers, flip the new front buffer to the screen This most likely involves a wait for v...
std::list< std::shared_ptr< Renderable > > RenderableList
Definition: renderable.h:80
virtual bool post_renderables_if_optimizable(RenderableList const &renderlist)=0
This will render renderlist to the screen and post the result to the screen if there is a hardware op...
virtual geometry::Rectangle view_area() const =0
The area the DisplayBuffer occupies in the virtual screen space.
Definition: rectangle.h:33
DisplayBuffer & operator=(DisplayBuffer const &c)=delete
virtual bool uses_alpha() const =0
Returns true if the display buffer has an alpha channel and the alpha channel will be read from at so...
virtual void make_current()=0
Makes the DisplayBuffer the current GL rendering target.
virtual void gl_swap_buffers()=0
Swap buffers for OpenGL rendering.
virtual MirOrientation orientation() const =0
Returns the orientation of the display buffer relative to how the user should see it (the orientation...

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