Mir
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
renderable.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2014 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: Kevin DuBois <kevin.dubois@canonical.com>
17  */
18 
19 #ifndef MIR_GRAPHICS_RENDERABLE_H_
20 #define MIR_GRAPHICS_RENDERABLE_H_
21 
22 #include <mir/geometry/rectangle.h>
23 #include <glm/glm.hpp>
24 #include <memory>
25 #include <list>
26 
27 namespace mir
28 {
29 namespace graphics
30 {
31 
32 class Buffer;
34 {
35 public:
47  virtual std::shared_ptr<Buffer> buffer(void const* user_id) const = 0;
48 
49  virtual bool alpha_enabled() const = 0;
50  virtual geometry::Rectangle screen_position() const = 0;
51 
52  // These are from the old CompositingCriteria. There is a little bit
53  // of function overlap with the above functions still.
54  virtual float alpha() const = 0;
55 
68  virtual glm::mat4 transformation() const = 0;
69 
75  virtual bool visible() const = 0;
76 
77  virtual bool shaped() const = 0; // meaning the pixel format has alpha
78  virtual int buffers_ready_for_compositor() const = 0;
79 
80 protected:
81  Renderable() = default;
82  virtual ~Renderable() = default;
83  Renderable(Renderable const&) = delete;
84  Renderable& operator=(Renderable const&) = delete;
85 };
86 
87 // XXX Would performance be better with a vector?
88 typedef std::list<std::shared_ptr<Renderable>> RenderableList;
89 
90 }
91 }
92 
93 #endif /* MIR_GRAPHICS_RENDERABLE_H_ */
virtual float alpha() const =0
Renderable & operator=(Renderable const &)=delete
virtual std::shared_ptr< Buffer > buffer(void const *user_id) const =0
Return the next buffer that should be composited/rendered.
virtual glm::mat4 transformation() const =0
Transformation returns the transformation matrix that should be applied to the surface.
virtual int buffers_ready_for_compositor() const =0
virtual bool shaped() const =0
virtual bool alpha_enabled() const =0
std::list< std::shared_ptr< Renderable > > RenderableList
Definition: renderable.h:88
Definition: renderable.h:33
virtual ~Renderable()=default
virtual geometry::Rectangle screen_position() const =0
Definition: rectangle.h:33
virtual bool visible() const =0
TODO: Its a bit questionable that we have this member function, why not just trim the renderable from...

Copyright © 2012,2013 Canonical Ltd.
Generated on Fri Apr 11 21:14:53 UTC 2014