Mir
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 <vector>
26 
27 namespace mir
28 {
29 namespace graphics
30 {
31 
32 class Buffer;
34 {
35 public:
36  virtual ~Renderable() = default;
37 
38  typedef void const* ID; // Mostly opaque, but zero is reserved as "invalid"
39 
44  virtual ID id() const = 0;
45 
49  virtual std::shared_ptr<Buffer> buffer() const = 0;
50 
51  virtual geometry::Rectangle screen_position() const = 0;
52 
53  // These are from the old CompositingCriteria. There is a little bit
54  // of function overlap with the above functions still.
55  virtual float alpha() const = 0;
56 
69  virtual glm::mat4 transformation() const = 0;
70 
71  virtual bool shaped() const = 0; // meaning the pixel format has alpha
72 
73 protected:
74  Renderable() = default;
75  Renderable(Renderable const&) = delete;
76  Renderable& operator=(Renderable const&) = delete;
77 };
78 
79 typedef std::vector<std::shared_ptr<Renderable>> RenderableList;
80 
81 }
82 }
83 
84 #endif /* MIR_GRAPHICS_RENDERABLE_H_ */
All things Mir.
Definition: atomic_callback.h:25
virtual ID id() const =0
Return a unique ID for the renderable, which may or may not be based on the underlying surface ID...
virtual float alpha() const =0
Renderable & operator=(Renderable const &)=delete
virtual glm::mat4 transformation() const =0
Transformation returns the transformation matrix that should be applied to the surface.
virtual std::shared_ptr< Buffer > buffer() const =0
Return the buffer that should be composited/rendered.
virtual bool shaped() const =0
void const * ID
Definition: renderable.h:38
Definition: renderable.h:33
virtual ~Renderable()=default
virtual geometry::Rectangle screen_position() const =0
std::vector< std::shared_ptr< Renderable > > RenderableList
Definition: renderable.h:79
Definition: rectangle.h:33

Copyright © 2012-2015 Canonical Ltd.
Generated on Wed Mar 30 00:29:56 UTC 2016