Mir
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
stub_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 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_TEST_DOUBLES_STUB_RENDERABLE_H_
20 #define MIR_TEST_DOUBLES_STUB_RENDERABLE_H_
21 
24 #include <memory>
25 
26 namespace mir
27 {
28 namespace test
29 {
30 namespace doubles
31 {
32 
34 {
35 public:
36  std::shared_ptr<graphics::Buffer> buffer(void const*) const override
37  {
38  return std::make_shared<StubBuffer>();
39  }
40  bool alpha_enabled() const
41  {
42  return false;
43  }
45  {
46  return {{},{}};
47  }
48  float alpha() const override
49  {
50  return 1.0f;
51  }
52  glm::mat4 transformation() const override
53  {
54  return trans;
55  }
56  bool visible() const
57  {
58  return true;
59  }
60  bool shaped() const override
61  {
62  return false;
63  }
64 
65  int buffers_ready_for_compositor() const override
66  {
67  return 1;
68  }
69 
70 private:
71  glm::mat4 trans;
72 };
73 
74 }
75 }
76 }
77 
78 #endif /* MIR_TEST_DOUBLES_STUB_RENDERABLE_H_ */
geometry::Rectangle screen_position() const
Definition: stub_renderable.h:44
float alpha() const override
Definition: stub_renderable.h:48
std::shared_ptr< graphics::Buffer > buffer(void const *) const override
Return the next buffer that should be composited/rendered.
Definition: stub_renderable.h:36
bool visible() const
TODO: Its a bit questionable that we have this member function, why not just trim the renderable from...
Definition: stub_renderable.h:56
Definition: renderable.h:33
int buffers_ready_for_compositor() const override
Definition: stub_renderable.h:65
bool alpha_enabled() const
Definition: stub_renderable.h:40
glm::mat4 transformation() const override
Transformation returns the transformation matrix that should be applied to the surface.
Definition: stub_renderable.h:52
Definition: rectangle.h:33
bool shaped() const override
Definition: stub_renderable.h:60
Definition: stub_renderable.h:33

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