Mir
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
stub_display_builder.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 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_DISPLAY_BUILDER_H_
20 #define MIR_TEST_DOUBLES_STUB_DISPLAY_BUILDER_H_
21 
24 #include <gmock/gmock.h>
25 
26 namespace mir
27 {
28 namespace test
29 {
30 namespace doubles
31 {
32 
33 struct StubConfigurableDisplayBuffer : public graphics::android::ConfigurableDisplayBuffer
34 {
36  : rect(rect)
37  {
38  }
39 
40  geometry::Rectangle view_area() const { return rect; }
41  void make_current() {}
42  void release_current() {}
43  void post_update() {}
44  bool can_bypass() const override { return false; }
47  std::function<void(graphics::Renderable const&)> const&) {}
48  MirOrientation orientation() const override { return mir_orientation_normal; }
51  {
56  {}, {}, 0, {}, false, false, {}, 0, mir_pixel_format_abgr_8888,
59  }
60 private:
62 };
63 
64 struct StubDisplayBuilder : public graphics::android::DisplayBuilder
65 {
67  : sz(sz)
68  {
69  }
70 
72  : StubDisplayBuilder(geometry::Size{0,0})
73  {
74  }
75 
77  {
79  }
80 
81  std::unique_ptr<graphics::android::ConfigurableDisplayBuffer> create_display_buffer(
82  graphics::android::GLContext const&)
83  {
84  return std::unique_ptr<graphics::android::ConfigurableDisplayBuffer>(
86  }
87 
89 };
90 }
91 }
92 } // namespace mir
93 
94 #endif /* MIR_TEST_DOUBLES_STUB_DISPLAY_BUILDER_H_ */
Definition: size.h:30
void configure(graphics::DisplayConfigurationOutput const &)
Definition: stub_display_builder.h:49
graphics::DisplayConfigurationOutput configuration() const
Definition: stub_display_builder.h:50
MirPixelFormat display_format()
Definition: stub_display_builder.h:76
void post_update()
This will trigger OpenGL rendering and post the result to the screen.
Definition: stub_display_builder.h:43
StubDisplayBuilder(geometry::Size sz)
Definition: stub_display_builder.h:66
bool can_bypass() const override
to be deprecated
Definition: stub_display_builder.h:44
std::unique_ptr< graphics::android::ConfigurableDisplayBuffer > create_display_buffer(graphics::android::GLContext const &)
Definition: stub_display_builder.h:81
Definition: common.h:87
MirOrientation
Definition: common.h:113
StubDisplayBuilder()
Definition: stub_display_builder.h:71
std::list< std::shared_ptr< Renderable > > RenderableList
Definition: renderable.h:88
void make_current()
Makes the DisplayBuffer the current GL rendering target.
Definition: stub_display_builder.h:41
mir_orientation_normal
Definition: display_configuration.cpp:33
Definition: renderable.h:33
StubConfigurableDisplayBuffer(geometry::Rectangle rect)
Definition: stub_display_builder.h:35
MirPixelFormat
The order of components in a format enum matches the order of the components as they would be written...
Definition: common.h:99
Definition: stub_display_builder.h:64
Configuration information for a display output.
Definition: display_configuration.h:84
Definition: common.h:102
Definition: rectangle.h:33
geometry::Size sz
Definition: stub_display_builder.h:88
MirOrientation orientation() const override
Returns the orientation of the display buffer relative to how the user should see it (the orientation...
Definition: stub_display_builder.h:48
Definition: stub_display_builder.h:33
void render_and_post_update(graphics::RenderableList const &, std::function< void(graphics::Renderable const &)> const &)
Definition: stub_display_builder.h:45
geometry::Rectangle view_area() const
The area the DisplayBuffer occupies in the virtual screen space.
Definition: stub_display_builder.h:40
void release_current()
Releases the current GL rendering target.
Definition: stub_display_builder.h:42

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