Merge lp:~kdub/mir/plumb-android-shader-creation into lp:mir
- plumb-android-shader-creation
- Merge into development-branch
Status: | Merged |
---|---|
Approved by: | Alexandros Frantzis |
Approved revision: | no longer in the source branch. |
Merged at revision: | 1575 |
Proposed branch: | lp:~kdub/mir/plumb-android-shader-creation |
Merge into: | lp:mir |
Prerequisite: | lp:~kdub/mir/gl-program-creation-factory |
Diff against target: |
1198 lines (+360/-62) 39 files modified
examples/render_overlays.cpp (+1/-3) include/platform/mir/graphics/gl_program.h (+3/-3) include/platform/mir/graphics/platform.h (+2/-0) include/test/mir_test_doubles/null_platform.h (+1/-0) include/test/mir_test_doubles/stub_display_builder.h (+1/-0) include/test/mir_test_doubles/stub_gl_program_factory.h (+43/-0) src/platform/graphics/android/CMakeLists.txt (+1/-0) src/platform/graphics/android/android_display.cpp (+2/-1) src/platform/graphics/android/android_display.h (+2/-0) src/platform/graphics/android/android_platform.cpp (+3/-2) src/platform/graphics/android/android_platform.h (+1/-1) src/platform/graphics/android/display_buffer.cpp (+3/-1) src/platform/graphics/android/display_buffer.h (+5/-1) src/platform/graphics/android/display_builder.h (+2/-1) src/platform/graphics/android/output_builder.cpp (+2/-1) src/platform/graphics/android/output_builder.h (+1/-0) src/platform/graphics/android/overlay_gl_compositor.cpp (+49/-0) src/platform/graphics/android/overlay_gl_compositor.h (+47/-0) src/platform/graphics/mesa/platform.cpp (+1/-0) src/platform/graphics/mesa/platform.h (+1/-0) src/server/graphics/default_configuration.cpp (+1/-0) src/server/graphics/nested/nested_platform.cpp (+1/-0) src/server/graphics/nested/nested_platform.h (+1/-0) tests/acceptance-tests/test_display_configuration.cpp (+1/-0) tests/acceptance-tests/test_surfaces_with_output_id.cpp (+1/-0) tests/integration-tests/graphics/android/test_display_integration.cpp (+3/-1) tests/integration-tests/graphics/mesa/test_buffer_integration.cpp (+2/-0) tests/integration-tests/test_display_info.cpp (+1/-0) tests/integration-tests/test_surfaceloop.cpp (+2/-0) tests/mir_test_framework/stubbed_server_configuration.cpp (+1/-0) tests/unit-tests/frontend/test_session_mediator.cpp (+3/-2) tests/unit-tests/graphics/android/CMakeLists.txt (+1/-0) tests/unit-tests/graphics/android/test_android_fb.cpp (+44/-9) tests/unit-tests/graphics/android/test_hwc_display.cpp (+46/-31) tests/unit-tests/graphics/android/test_output_builder.cpp (+7/-5) tests/unit-tests/graphics/android/test_overlay_compositor.cpp (+67/-0) tests/unit-tests/graphics/mesa/test_display_configuration.cpp (+2/-0) tests/unit-tests/graphics/mesa/test_display_multi_monitor.cpp (+3/-0) tests/unit-tests/graphics/test_display.cpp (+2/-0) |
To merge this branch: | bzr merge lp:~kdub/mir/plumb-android-shader-creation |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Alexandros Frantzis (community) | Approve | ||
PS Jenkins bot (community) | continuous-integration | Approve | |
Cemil Azizoglu (community) | Approve | ||
Chris Halse Rogers | Approve | ||
Review via email: mp+216779@code.launchpad.net |
Commit message
android: plumb getting the gl program factory down to the android platform, and use it to make a simple placeholder shader program.
Description of the change
android: plumb getting the gl program factory down to the android platform, and use it to make a simple placeholder shader program.
The program will be expanded to provide the fallback rendering when the HWC rejects an overlay in a subsequent review.
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:1570
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Alexandros Frantzis (afrantzis) wrote : | # |
61 +++ include/
Our current practice is to put stubs and mocks in different files. Breaking this convention here will make it harder to track down StubGLProgramFa
Otherwise looks good.
Kevin DuBois (kdub) wrote : | # |
fixed!
Cemil Azizoglu (cemil-azizoglu) wrote : | # |
Looks good.
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:1571
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Preview Diff
1 | === modified file 'examples/render_overlays.cpp' | |||
2 | --- examples/render_overlays.cpp 2014-04-15 05:31:19 +0000 | |||
3 | +++ examples/render_overlays.cpp 2014-04-24 20:07:52 +0000 | |||
4 | @@ -173,9 +173,7 @@ | |||
5 | 173 | mir::DefaultServerConfiguration conf{argc, argv}; | 173 | mir::DefaultServerConfiguration conf{argc, argv}; |
6 | 174 | 174 | ||
7 | 175 | auto platform = conf.the_graphics_platform(); | 175 | auto platform = conf.the_graphics_platform(); |
11 | 176 | auto display = platform->create_display( | 176 | auto display = conf.the_display(); |
9 | 177 | conf.the_display_configuration_policy(), | ||
10 | 178 | conf.the_gl_config()); | ||
12 | 179 | auto buffer_allocator = platform->create_buffer_allocator(conf.the_buffer_initializer()); | 177 | auto buffer_allocator = platform->create_buffer_allocator(conf.the_buffer_initializer()); |
13 | 180 | 178 | ||
14 | 181 | mg::BufferProperties buffer_properties{ | 179 | mg::BufferProperties buffer_properties{ |
15 | 182 | 180 | ||
16 | === renamed file 'include/server/mir/graphics/gl_program.h' => 'include/platform/mir/graphics/gl_program.h' | |||
17 | --- include/server/mir/graphics/gl_program.h 2014-04-16 18:40:45 +0000 | |||
18 | +++ include/platform/mir/graphics/gl_program.h 2014-04-24 20:07:52 +0000 | |||
19 | @@ -2,15 +2,15 @@ | |||
20 | 2 | * Copyright © 2013-2014 Canonical Ltd. | 2 | * Copyright © 2013-2014 Canonical Ltd. |
21 | 3 | * | 3 | * |
22 | 4 | * This program is free software: you can redistribute it and/or modify it | 4 | * This program is free software: you can redistribute it and/or modify it |
24 | 5 | * under the terms of the GNU General Public License version 3, | 5 | * under the terms of the GNU Lesser General Public License version 3, |
25 | 6 | * as published by the Free Software Foundation. | 6 | * as published by the Free Software Foundation. |
26 | 7 | * | 7 | * |
27 | 8 | * This program is distributed in the hope that it will be useful, | 8 | * This program is distributed in the hope that it will be useful, |
28 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
29 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
31 | 11 | * GNU General Public License for more details. | 11 | * GNU Lesser General Public License for more details. |
32 | 12 | * | 12 | * |
34 | 13 | * You should have received a copy of the GNU General Public License | 13 | * You should have received a copy of the GNU Lesser General Public License |
35 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
36 | 15 | * | 15 | * |
37 | 16 | * Authored by: Kevin DuBois <kevin.dubois@canonical.com> | 16 | * Authored by: Kevin DuBois <kevin.dubois@canonical.com> |
38 | 17 | 17 | ||
39 | === modified file 'include/platform/mir/graphics/platform.h' | |||
40 | --- include/platform/mir/graphics/platform.h 2014-03-27 09:52:04 +0000 | |||
41 | +++ include/platform/mir/graphics/platform.h 2014-04-24 20:07:52 +0000 | |||
42 | @@ -50,6 +50,7 @@ | |||
43 | 50 | class DisplayConfigurationPolicy; | 50 | class DisplayConfigurationPolicy; |
44 | 51 | class GraphicBufferAllocator; | 51 | class GraphicBufferAllocator; |
45 | 52 | class GLConfig; | 52 | class GLConfig; |
46 | 53 | class GLProgramFactory; | ||
47 | 53 | 54 | ||
48 | 54 | /** | 55 | /** |
49 | 55 | * \defgroup platform_enablement Mir platform enablement | 56 | * \defgroup platform_enablement Mir platform enablement |
50 | @@ -84,6 +85,7 @@ | |||
51 | 84 | */ | 85 | */ |
52 | 85 | virtual std::shared_ptr<Display> create_display( | 86 | virtual std::shared_ptr<Display> create_display( |
53 | 86 | std::shared_ptr<DisplayConfigurationPolicy> const& initial_conf_policy, | 87 | std::shared_ptr<DisplayConfigurationPolicy> const& initial_conf_policy, |
54 | 88 | std::shared_ptr<GLProgramFactory> const& gl_program_factory, | ||
55 | 87 | std::shared_ptr<GLConfig> const& gl_config) = 0; | 89 | std::shared_ptr<GLConfig> const& gl_config) = 0; |
56 | 88 | 90 | ||
57 | 89 | /** | 91 | /** |
58 | 90 | 92 | ||
59 | === modified file 'include/test/mir_test_doubles/null_platform.h' | |||
60 | --- include/test/mir_test_doubles/null_platform.h 2014-03-27 09:46:09 +0000 | |||
61 | +++ include/test/mir_test_doubles/null_platform.h 2014-04-24 20:07:52 +0000 | |||
62 | @@ -40,6 +40,7 @@ | |||
63 | 40 | 40 | ||
64 | 41 | std::shared_ptr<graphics::Display> create_display( | 41 | std::shared_ptr<graphics::Display> create_display( |
65 | 42 | std::shared_ptr<graphics::DisplayConfigurationPolicy> const&, | 42 | std::shared_ptr<graphics::DisplayConfigurationPolicy> const&, |
66 | 43 | std::shared_ptr<graphics::GLProgramFactory> const&, | ||
67 | 43 | std::shared_ptr<graphics::GLConfig> const&) | 44 | std::shared_ptr<graphics::GLConfig> const&) |
68 | 44 | { | 45 | { |
69 | 45 | return std::make_shared<NullDisplay>(); | 46 | return std::make_shared<NullDisplay>(); |
70 | 46 | 47 | ||
71 | === modified file 'include/test/mir_test_doubles/stub_display_builder.h' | |||
72 | --- include/test/mir_test_doubles/stub_display_builder.h 2014-03-26 05:48:59 +0000 | |||
73 | +++ include/test/mir_test_doubles/stub_display_builder.h 2014-04-24 20:07:52 +0000 | |||
74 | @@ -79,6 +79,7 @@ | |||
75 | 79 | } | 79 | } |
76 | 80 | 80 | ||
77 | 81 | std::unique_ptr<graphics::android::ConfigurableDisplayBuffer> create_display_buffer( | 81 | std::unique_ptr<graphics::android::ConfigurableDisplayBuffer> create_display_buffer( |
78 | 82 | graphics::GLProgramFactory const&, | ||
79 | 82 | graphics::android::GLContext const&) | 83 | graphics::android::GLContext const&) |
80 | 83 | { | 84 | { |
81 | 84 | return std::unique_ptr<graphics::android::ConfigurableDisplayBuffer>( | 85 | return std::unique_ptr<graphics::android::ConfigurableDisplayBuffer>( |
82 | 85 | 86 | ||
83 | === added file 'include/test/mir_test_doubles/stub_gl_program_factory.h' | |||
84 | --- include/test/mir_test_doubles/stub_gl_program_factory.h 1970-01-01 00:00:00 +0000 | |||
85 | +++ include/test/mir_test_doubles/stub_gl_program_factory.h 2014-04-24 20:07:52 +0000 | |||
86 | @@ -0,0 +1,43 @@ | |||
87 | 1 | /* | ||
88 | 2 | * Copyright © 2014 Canonical Ltd. | ||
89 | 3 | * | ||
90 | 4 | * This program is free software: you can redistribute it and/or modify it | ||
91 | 5 | * under the terms of the GNU General Public License version 3, | ||
92 | 6 | * as published by the Free Software Foundation. | ||
93 | 7 | * | ||
94 | 8 | * This program is distributed in the hope that it will be useful, | ||
95 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
96 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
97 | 11 | * GNU General Public License for more details. | ||
98 | 12 | * | ||
99 | 13 | * You should have received a copy of the GNU General Public License | ||
100 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
101 | 15 | * | ||
102 | 16 | * Authored by: Kevin DuBois <kevin.dubois@canonical.com> | ||
103 | 17 | */ | ||
104 | 18 | #ifndef MIR_TEST_DOUBLES_STUB_GL_PROGRAM_FACTORY_H_ | ||
105 | 19 | #define MIR_TEST_DOUBLES_STUB_GL_PROGRAM_FACTORY_H_ | ||
106 | 20 | |||
107 | 21 | #include "mir/graphics/gl_program_factory.h" | ||
108 | 22 | |||
109 | 23 | namespace mir | ||
110 | 24 | { | ||
111 | 25 | namespace test | ||
112 | 26 | { | ||
113 | 27 | namespace doubles | ||
114 | 28 | { | ||
115 | 29 | |||
116 | 30 | class StubGLProgramFactory : public graphics::GLProgramFactory | ||
117 | 31 | { | ||
118 | 32 | public: | ||
119 | 33 | std::unique_ptr<graphics::GLProgram> create_gl_program(std::string const&, std::string const&) const | ||
120 | 34 | { | ||
121 | 35 | return nullptr; | ||
122 | 36 | } | ||
123 | 37 | }; | ||
124 | 38 | |||
125 | 39 | } | ||
126 | 40 | } | ||
127 | 41 | } // namespace mir | ||
128 | 42 | |||
129 | 43 | #endif /* MIR_TEST_DOUBLES_STUB_GL_PROGRAM_FACTORY_H_ */ | ||
130 | 0 | 44 | ||
131 | === modified file 'src/platform/graphics/android/CMakeLists.txt' | |||
132 | --- src/platform/graphics/android/CMakeLists.txt 2014-04-15 05:31:19 +0000 | |||
133 | +++ src/platform/graphics/android/CMakeLists.txt 2014-04-24 20:07:52 +0000 | |||
134 | @@ -34,6 +34,7 @@ | |||
135 | 34 | internal_client.cpp | 34 | internal_client.cpp |
136 | 35 | gl_context.cpp | 35 | gl_context.cpp |
137 | 36 | real_hwc_wrapper.cpp | 36 | real_hwc_wrapper.cpp |
138 | 37 | overlay_gl_compositor.cpp | ||
139 | 37 | ) | 38 | ) |
140 | 38 | 39 | ||
141 | 39 | set_target_properties( | 40 | set_target_properties( |
142 | 40 | 41 | ||
143 | === modified file 'src/platform/graphics/android/android_display.cpp' | |||
144 | --- src/platform/graphics/android/android_display.cpp 2014-04-15 05:31:19 +0000 | |||
145 | +++ src/platform/graphics/android/android_display.cpp 2014-04-24 20:07:52 +0000 | |||
146 | @@ -33,11 +33,12 @@ | |||
147 | 33 | namespace geom=mir::geometry; | 33 | namespace geom=mir::geometry; |
148 | 34 | 34 | ||
149 | 35 | mga::AndroidDisplay::AndroidDisplay(std::shared_ptr<mga::DisplayBuilder> const& display_builder, | 35 | mga::AndroidDisplay::AndroidDisplay(std::shared_ptr<mga::DisplayBuilder> const& display_builder, |
150 | 36 | std::shared_ptr<mg::GLProgramFactory> const& gl_program_factory, | ||
151 | 36 | std::shared_ptr<GLConfig> const& gl_config, | 37 | std::shared_ptr<GLConfig> const& gl_config, |
152 | 37 | std::shared_ptr<DisplayReport> const& display_report) | 38 | std::shared_ptr<DisplayReport> const& display_report) |
153 | 38 | : display_builder{display_builder}, | 39 | : display_builder{display_builder}, |
154 | 39 | gl_context{display_builder->display_format(), *gl_config, *display_report}, | 40 | gl_context{display_builder->display_format(), *gl_config, *display_report}, |
156 | 40 | display_buffer{display_builder->create_display_buffer(gl_context)} | 41 | display_buffer{display_builder->create_display_buffer(*gl_program_factory, gl_context)} |
157 | 41 | { | 42 | { |
158 | 42 | display_report->report_successful_setup_of_native_resources(); | 43 | display_report->report_successful_setup_of_native_resources(); |
159 | 43 | 44 | ||
160 | 44 | 45 | ||
161 | === modified file 'src/platform/graphics/android/android_display.h' | |||
162 | --- src/platform/graphics/android/android_display.h 2014-04-15 05:31:19 +0000 | |||
163 | +++ src/platform/graphics/android/android_display.h 2014-04-24 20:07:52 +0000 | |||
164 | @@ -32,6 +32,7 @@ | |||
165 | 32 | 32 | ||
166 | 33 | class DisplayReport; | 33 | class DisplayReport; |
167 | 34 | class GLConfig; | 34 | class GLConfig; |
168 | 35 | class GLProgramFactory; | ||
169 | 35 | 36 | ||
170 | 36 | namespace android | 37 | namespace android |
171 | 37 | { | 38 | { |
172 | @@ -43,6 +44,7 @@ | |||
173 | 43 | { | 44 | { |
174 | 44 | public: | 45 | public: |
175 | 45 | explicit AndroidDisplay(std::shared_ptr<DisplayBuilder> const& display_builder, | 46 | explicit AndroidDisplay(std::shared_ptr<DisplayBuilder> const& display_builder, |
176 | 47 | std::shared_ptr<GLProgramFactory> const& gl_program_factory, | ||
177 | 46 | std::shared_ptr<GLConfig> const& gl_config, | 48 | std::shared_ptr<GLConfig> const& gl_config, |
178 | 47 | std::shared_ptr<DisplayReport> const& display_report); | 49 | std::shared_ptr<DisplayReport> const& display_report); |
179 | 48 | 50 | ||
180 | 49 | 51 | ||
181 | === modified file 'src/platform/graphics/android/android_platform.cpp' | |||
182 | --- src/platform/graphics/android/android_platform.cpp 2014-03-27 13:38:00 +0000 | |||
183 | +++ src/platform/graphics/android/android_platform.cpp 2014-04-24 20:07:52 +0000 | |||
184 | @@ -83,11 +83,12 @@ | |||
185 | 83 | } | 83 | } |
186 | 84 | 84 | ||
187 | 85 | std::shared_ptr<mg::Display> mga::AndroidPlatform::create_display( | 85 | std::shared_ptr<mg::Display> mga::AndroidPlatform::create_display( |
189 | 86 | std::shared_ptr<graphics::DisplayConfigurationPolicy> const&, | 86 | std::shared_ptr<mg::DisplayConfigurationPolicy> const&, |
190 | 87 | std::shared_ptr<mg::GLProgramFactory> const& gl_program_factory, | ||
191 | 87 | std::shared_ptr<mg::GLConfig> const& gl_config) | 88 | std::shared_ptr<mg::GLConfig> const& gl_config) |
192 | 88 | { | 89 | { |
193 | 89 | return std::make_shared<mga::AndroidDisplay>( | 90 | return std::make_shared<mga::AndroidDisplay>( |
195 | 90 | display_builder, gl_config, display_report); | 91 | display_builder, gl_program_factory, gl_config, display_report); |
196 | 91 | } | 92 | } |
197 | 92 | 93 | ||
198 | 93 | std::shared_ptr<mg::PlatformIPCPackage> mga::AndroidPlatform::get_ipc_package() | 94 | std::shared_ptr<mg::PlatformIPCPackage> mga::AndroidPlatform::get_ipc_package() |
199 | 94 | 95 | ||
200 | === modified file 'src/platform/graphics/android/android_platform.h' | |||
201 | --- src/platform/graphics/android/android_platform.h 2014-03-27 09:46:09 +0000 | |||
202 | +++ src/platform/graphics/android/android_platform.h 2014-04-24 20:07:52 +0000 | |||
203 | @@ -45,6 +45,7 @@ | |||
204 | 45 | std::shared_ptr<BufferInitializer> const& buffer_initializer); | 45 | std::shared_ptr<BufferInitializer> const& buffer_initializer); |
205 | 46 | std::shared_ptr<Display> create_display( | 46 | std::shared_ptr<Display> create_display( |
206 | 47 | std::shared_ptr<graphics::DisplayConfigurationPolicy> const&, | 47 | std::shared_ptr<graphics::DisplayConfigurationPolicy> const&, |
207 | 48 | std::shared_ptr<graphics::GLProgramFactory> const&, | ||
208 | 48 | std::shared_ptr<graphics::GLConfig> const& /*gl_config*/); | 49 | std::shared_ptr<graphics::GLConfig> const& /*gl_config*/); |
209 | 49 | std::shared_ptr<PlatformIPCPackage> get_ipc_package(); | 50 | std::shared_ptr<PlatformIPCPackage> get_ipc_package(); |
210 | 50 | std::shared_ptr<InternalClient> create_internal_client(); | 51 | std::shared_ptr<InternalClient> create_internal_client(); |
211 | @@ -56,7 +57,6 @@ | |||
212 | 56 | 57 | ||
213 | 57 | void initialize(std::shared_ptr<NestedContext> const& nested_context) override; | 58 | void initialize(std::shared_ptr<NestedContext> const& nested_context) override; |
214 | 58 | 59 | ||
215 | 59 | // TODO a design that has this and create_buffer_allocator is missing simplicity | ||
216 | 60 | virtual std::shared_ptr<GraphicBufferAllocator> create_mga_buffer_allocator( | 60 | virtual std::shared_ptr<GraphicBufferAllocator> create_mga_buffer_allocator( |
217 | 61 | const std::shared_ptr<BufferInitializer>& buffer_initializer); | 61 | const std::shared_ptr<BufferInitializer>& buffer_initializer); |
218 | 62 | 62 | ||
219 | 63 | 63 | ||
220 | === modified file 'src/platform/graphics/android/display_buffer.cpp' | |||
221 | --- src/platform/graphics/android/display_buffer.cpp 2014-04-15 05:31:19 +0000 | |||
222 | +++ src/platform/graphics/android/display_buffer.cpp 2014-04-24 20:07:52 +0000 | |||
223 | @@ -34,11 +34,13 @@ | |||
224 | 34 | std::shared_ptr<FramebufferBundle> const& fb_bundle, | 34 | std::shared_ptr<FramebufferBundle> const& fb_bundle, |
225 | 35 | std::shared_ptr<DisplayDevice> const& display_device, | 35 | std::shared_ptr<DisplayDevice> const& display_device, |
226 | 36 | std::shared_ptr<ANativeWindow> const& native_window, | 36 | std::shared_ptr<ANativeWindow> const& native_window, |
228 | 37 | mga::GLContext const& shared_gl_context) | 37 | mga::GLContext const& shared_gl_context, |
229 | 38 | mg::GLProgramFactory const& program_factory) | ||
230 | 38 | : fb_bundle{fb_bundle}, | 39 | : fb_bundle{fb_bundle}, |
231 | 39 | display_device{display_device}, | 40 | display_device{display_device}, |
232 | 40 | native_window{native_window}, | 41 | native_window{native_window}, |
233 | 41 | gl_context{shared_gl_context, std::bind(mga::create_window_surface, std::placeholders::_1, std::placeholders::_2, native_window.get())}, | 42 | gl_context{shared_gl_context, std::bind(mga::create_window_surface, std::placeholders::_1, std::placeholders::_2, native_window.get())}, |
234 | 43 | overlay_program{program_factory, gl_context}, | ||
235 | 42 | current_configuration{ | 44 | current_configuration{ |
236 | 43 | mg::DisplayConfigurationOutputId{1}, | 45 | mg::DisplayConfigurationOutputId{1}, |
237 | 44 | mg::DisplayConfigurationCardId{0}, | 46 | mg::DisplayConfigurationCardId{0}, |
238 | 45 | 47 | ||
239 | === modified file 'src/platform/graphics/android/display_buffer.h' | |||
240 | --- src/platform/graphics/android/display_buffer.h 2014-03-26 05:48:59 +0000 | |||
241 | +++ src/platform/graphics/android/display_buffer.h 2014-04-24 20:07:52 +0000 | |||
242 | @@ -21,8 +21,10 @@ | |||
243 | 21 | 21 | ||
244 | 22 | #include "configurable_display_buffer.h" | 22 | #include "configurable_display_buffer.h" |
245 | 23 | #include "mir/graphics/egl_resources.h" | 23 | #include "mir/graphics/egl_resources.h" |
246 | 24 | #include "mir/graphics/gl_program_factory.h" | ||
247 | 24 | #include "android_display_configuration.h" | 25 | #include "android_display_configuration.h" |
248 | 25 | #include "gl_context.h" | 26 | #include "gl_context.h" |
249 | 27 | #include "overlay_gl_compositor.h" | ||
250 | 26 | #include <system/window.h> | 28 | #include <system/window.h> |
251 | 27 | 29 | ||
252 | 28 | namespace mir | 30 | namespace mir |
253 | @@ -41,7 +43,8 @@ | |||
254 | 41 | DisplayBuffer(std::shared_ptr<FramebufferBundle> const& fb_bundle, | 43 | DisplayBuffer(std::shared_ptr<FramebufferBundle> const& fb_bundle, |
255 | 42 | std::shared_ptr<DisplayDevice> const& display_device, | 44 | std::shared_ptr<DisplayDevice> const& display_device, |
256 | 43 | std::shared_ptr<ANativeWindow> const& native_window, | 45 | std::shared_ptr<ANativeWindow> const& native_window, |
258 | 44 | GLContext const& shared_gl_context); | 46 | GLContext const& shared_gl_context, |
259 | 47 | GLProgramFactory const& program_factory); | ||
260 | 45 | 48 | ||
261 | 46 | geometry::Rectangle view_area() const; | 49 | geometry::Rectangle view_area() const; |
262 | 47 | void make_current(); | 50 | void make_current(); |
263 | @@ -64,6 +67,7 @@ | |||
264 | 64 | std::shared_ptr<DisplayDevice> const display_device; | 67 | std::shared_ptr<DisplayDevice> const display_device; |
265 | 65 | std::shared_ptr<ANativeWindow> const native_window; | 68 | std::shared_ptr<ANativeWindow> const native_window; |
266 | 66 | GLContext gl_context; | 69 | GLContext gl_context; |
267 | 70 | OverlayGLProgram overlay_program; | ||
268 | 67 | bool prepared; | 71 | bool prepared; |
269 | 68 | DisplayConfigurationOutput current_configuration; | 72 | DisplayConfigurationOutput current_configuration; |
270 | 69 | MirOrientation rotation; | 73 | MirOrientation rotation; |
271 | 70 | 74 | ||
272 | === modified file 'src/platform/graphics/android/display_builder.h' | |||
273 | --- src/platform/graphics/android/display_builder.h 2014-03-06 06:05:17 +0000 | |||
274 | +++ src/platform/graphics/android/display_builder.h 2014-04-24 20:07:52 +0000 | |||
275 | @@ -27,6 +27,7 @@ | |||
276 | 27 | { | 27 | { |
277 | 28 | namespace graphics | 28 | namespace graphics |
278 | 29 | { | 29 | { |
279 | 30 | class GLProgramFactory; | ||
280 | 30 | namespace android | 31 | namespace android |
281 | 31 | { | 32 | { |
282 | 32 | class GLContext; | 33 | class GLContext; |
283 | @@ -38,7 +39,7 @@ | |||
284 | 38 | 39 | ||
285 | 39 | virtual MirPixelFormat display_format() = 0; | 40 | virtual MirPixelFormat display_format() = 0; |
286 | 40 | virtual std::unique_ptr<ConfigurableDisplayBuffer> create_display_buffer( | 41 | virtual std::unique_ptr<ConfigurableDisplayBuffer> create_display_buffer( |
288 | 41 | GLContext const& gl_context) = 0; | 42 | GLProgramFactory const& gl_program_factory, GLContext const& gl_context) = 0; |
289 | 42 | 43 | ||
290 | 43 | protected: | 44 | protected: |
291 | 44 | DisplayBuilder() = default; | 45 | DisplayBuilder() = default; |
292 | 45 | 46 | ||
293 | === modified file 'src/platform/graphics/android/output_builder.cpp' | |||
294 | --- src/platform/graphics/android/output_builder.cpp 2014-03-06 06:05:17 +0000 | |||
295 | +++ src/platform/graphics/android/output_builder.cpp 2014-04-24 20:07:52 +0000 | |||
296 | @@ -64,6 +64,7 @@ | |||
297 | 64 | } | 64 | } |
298 | 65 | 65 | ||
299 | 66 | std::unique_ptr<mga::ConfigurableDisplayBuffer> mga::OutputBuilder::create_display_buffer( | 66 | std::unique_ptr<mga::ConfigurableDisplayBuffer> mga::OutputBuilder::create_display_buffer( |
300 | 67 | GLProgramFactory const& gl_program_factory, | ||
301 | 67 | GLContext const& gl_context) | 68 | GLContext const& gl_context) |
302 | 68 | { | 69 | { |
303 | 69 | std::shared_ptr<mga::DisplayDevice> device; | 70 | std::shared_ptr<mga::DisplayDevice> device; |
304 | @@ -101,5 +102,5 @@ | |||
305 | 101 | 102 | ||
306 | 102 | auto native_window = res_factory->create_native_window(framebuffers); | 103 | auto native_window = res_factory->create_native_window(framebuffers); |
307 | 103 | return std::unique_ptr<mga::DisplayBuffer>( | 104 | return std::unique_ptr<mga::DisplayBuffer>( |
309 | 104 | new DisplayBuffer(framebuffers, device, native_window, gl_context)); | 105 | new DisplayBuffer(framebuffers, device, native_window, gl_context, gl_program_factory)); |
310 | 105 | } | 106 | } |
311 | 106 | 107 | ||
312 | === modified file 'src/platform/graphics/android/output_builder.h' | |||
313 | --- src/platform/graphics/android/output_builder.h 2014-03-11 13:44:57 +0000 | |||
314 | +++ src/platform/graphics/android/output_builder.h 2014-04-24 20:07:52 +0000 | |||
315 | @@ -45,6 +45,7 @@ | |||
316 | 45 | 45 | ||
317 | 46 | MirPixelFormat display_format(); | 46 | MirPixelFormat display_format(); |
318 | 47 | std::unique_ptr<ConfigurableDisplayBuffer> create_display_buffer( | 47 | std::unique_ptr<ConfigurableDisplayBuffer> create_display_buffer( |
319 | 48 | GLProgramFactory const& gl_program_factory, | ||
320 | 48 | GLContext const& gl_context); | 49 | GLContext const& gl_context); |
321 | 49 | 50 | ||
322 | 50 | private: | 51 | private: |
323 | 51 | 52 | ||
324 | === added file 'src/platform/graphics/android/overlay_gl_compositor.cpp' | |||
325 | --- src/platform/graphics/android/overlay_gl_compositor.cpp 1970-01-01 00:00:00 +0000 | |||
326 | +++ src/platform/graphics/android/overlay_gl_compositor.cpp 2014-04-24 20:07:52 +0000 | |||
327 | @@ -0,0 +1,49 @@ | |||
328 | 1 | /* | ||
329 | 2 | * Copyright © 2014 Canonical Ltd. | ||
330 | 3 | * | ||
331 | 4 | * This program is free software: you can redistribute it and/or modify it | ||
332 | 5 | * under the terms of the GNU Lesser General Public License version 3, | ||
333 | 6 | * as published by the Free Software Foundation. | ||
334 | 7 | * | ||
335 | 8 | * This program is distributed in the hope that it will be useful, | ||
336 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
337 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
338 | 11 | * GNU Lesser General Public License for more details. | ||
339 | 12 | * | ||
340 | 13 | * You should have received a copy of the GNU Lesser General Public License | ||
341 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
342 | 15 | * | ||
343 | 16 | * Authored by: Kevin DuBois <kevin.dubois@canonical.com> | ||
344 | 17 | */ | ||
345 | 18 | |||
346 | 19 | #include "mir/graphics/gl_program_factory.h" | ||
347 | 20 | #include "mir/graphics/gl_context.h" | ||
348 | 21 | #include "overlay_gl_compositor.h" | ||
349 | 22 | |||
350 | 23 | namespace mg = mir::graphics; | ||
351 | 24 | namespace mga = mir::graphics::android; | ||
352 | 25 | namespace | ||
353 | 26 | { | ||
354 | 27 | std::string const vertex_shader | ||
355 | 28 | { | ||
356 | 29 | "attribute vec4 position;\n" | ||
357 | 30 | "void main() {\n" | ||
358 | 31 | " gl_Position = position;\n" | ||
359 | 32 | "}\n" | ||
360 | 33 | }; | ||
361 | 34 | |||
362 | 35 | std::string const fragment_shader | ||
363 | 36 | { | ||
364 | 37 | "precision mediump float;\n" | ||
365 | 38 | "void main() {\n" | ||
366 | 39 | " gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0);\n" | ||
367 | 40 | "}\n" | ||
368 | 41 | }; | ||
369 | 42 | } | ||
370 | 43 | mga::OverlayGLProgram::OverlayGLProgram( | ||
371 | 44 | GLProgramFactory const& factory, GLContext const& context) | ||
372 | 45 | { | ||
373 | 46 | context.make_current(); | ||
374 | 47 | overlay_program = factory.create_gl_program(vertex_shader, fragment_shader); | ||
375 | 48 | context.release_current(); | ||
376 | 49 | } | ||
377 | 0 | 50 | ||
378 | === added file 'src/platform/graphics/android/overlay_gl_compositor.h' | |||
379 | --- src/platform/graphics/android/overlay_gl_compositor.h 1970-01-01 00:00:00 +0000 | |||
380 | +++ src/platform/graphics/android/overlay_gl_compositor.h 2014-04-24 20:07:52 +0000 | |||
381 | @@ -0,0 +1,47 @@ | |||
382 | 1 | /* | ||
383 | 2 | * Copyright © 2014 Canonical Ltd. | ||
384 | 3 | * | ||
385 | 4 | * This program is free software: you can redistribute it and/or modify it | ||
386 | 5 | * under the terms of the GNU Lesser General Public License version 3, | ||
387 | 6 | * as published by the Free Software Foundation. | ||
388 | 7 | * | ||
389 | 8 | * This program is distributed in the hope that it will be useful, | ||
390 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
391 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
392 | 11 | * GNU Lesser General Public License for more details. | ||
393 | 12 | * | ||
394 | 13 | * You should have received a copy of the GNU Lesser General Public License | ||
395 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
396 | 15 | * | ||
397 | 16 | * Authored by: Kevin DuBois <kevin.dubois@canonical.com> | ||
398 | 17 | */ | ||
399 | 18 | |||
400 | 19 | #ifndef MIR_GRAPHICS_ANDROID_OVERLAY_GL_PROGRAM_H_ | ||
401 | 20 | #define MIR_GRAPHICS_ANDROID_OVERLAY_GL_PROGRAM_H_ | ||
402 | 21 | |||
403 | 22 | #include "mir/graphics/gl_program.h" | ||
404 | 23 | #include <memory> | ||
405 | 24 | |||
406 | 25 | namespace mir | ||
407 | 26 | { | ||
408 | 27 | namespace graphics | ||
409 | 28 | { | ||
410 | 29 | class GLContext; | ||
411 | 30 | class GLProgramFactory; | ||
412 | 31 | |||
413 | 32 | namespace android | ||
414 | 33 | { | ||
415 | 34 | |||
416 | 35 | class OverlayGLProgram | ||
417 | 36 | { | ||
418 | 37 | public: | ||
419 | 38 | OverlayGLProgram(GLProgramFactory const& program_factory, graphics::GLContext const& gl_context); | ||
420 | 39 | private: | ||
421 | 40 | std::unique_ptr<graphics::GLProgram> overlay_program; | ||
422 | 41 | }; | ||
423 | 42 | |||
424 | 43 | } | ||
425 | 44 | } | ||
426 | 45 | } | ||
427 | 46 | |||
428 | 47 | #endif /* MIR_GRAPHICS_ANDROID_OVERLAY_GL_PROGRAM_H_ */ | ||
429 | 0 | 48 | ||
430 | === modified file 'src/platform/graphics/mesa/platform.cpp' | |||
431 | --- src/platform/graphics/mesa/platform.cpp 2014-03-27 09:52:04 +0000 | |||
432 | +++ src/platform/graphics/mesa/platform.cpp 2014-04-24 20:07:52 +0000 | |||
433 | @@ -148,6 +148,7 @@ | |||
434 | 148 | 148 | ||
435 | 149 | std::shared_ptr<mg::Display> mgm::Platform::create_display( | 149 | std::shared_ptr<mg::Display> mgm::Platform::create_display( |
436 | 150 | std::shared_ptr<DisplayConfigurationPolicy> const& initial_conf_policy, | 150 | std::shared_ptr<DisplayConfigurationPolicy> const& initial_conf_policy, |
437 | 151 | std::shared_ptr<GLProgramFactory> const&, | ||
438 | 151 | std::shared_ptr<GLConfig> const& gl_config) | 152 | std::shared_ptr<GLConfig> const& gl_config) |
439 | 152 | { | 153 | { |
440 | 153 | return std::make_shared<mgm::Display>( | 154 | return std::make_shared<mgm::Display>( |
441 | 154 | 155 | ||
442 | === modified file 'src/platform/graphics/mesa/platform.h' | |||
443 | --- src/platform/graphics/mesa/platform.h 2014-03-27 09:46:09 +0000 | |||
444 | +++ src/platform/graphics/mesa/platform.h 2014-04-24 20:07:52 +0000 | |||
445 | @@ -48,6 +48,7 @@ | |||
446 | 48 | const std::shared_ptr<BufferInitializer>& buffer_initializer); | 48 | const std::shared_ptr<BufferInitializer>& buffer_initializer); |
447 | 49 | std::shared_ptr<graphics::Display> create_display( | 49 | std::shared_ptr<graphics::Display> create_display( |
448 | 50 | std::shared_ptr<DisplayConfigurationPolicy> const& initial_conf_policy, | 50 | std::shared_ptr<DisplayConfigurationPolicy> const& initial_conf_policy, |
449 | 51 | std::shared_ptr<GLProgramFactory> const& program_factory, | ||
450 | 51 | std::shared_ptr<GLConfig> const& gl_config); | 52 | std::shared_ptr<GLConfig> const& gl_config); |
451 | 52 | std::shared_ptr<PlatformIPCPackage> get_ipc_package(); | 53 | std::shared_ptr<PlatformIPCPackage> get_ipc_package(); |
452 | 53 | std::shared_ptr<InternalClient> create_internal_client(); | 54 | std::shared_ptr<InternalClient> create_internal_client(); |
453 | 54 | 55 | ||
454 | === modified file 'src/server/graphics/default_configuration.cpp' | |||
455 | --- src/server/graphics/default_configuration.cpp 2014-04-23 15:24:13 +0000 | |||
456 | +++ src/server/graphics/default_configuration.cpp 2014-04-24 20:07:52 +0000 | |||
457 | @@ -110,6 +110,7 @@ | |||
458 | 110 | { | 110 | { |
459 | 111 | return the_graphics_platform()->create_display( | 111 | return the_graphics_platform()->create_display( |
460 | 112 | the_display_configuration_policy(), | 112 | the_display_configuration_policy(), |
461 | 113 | the_gl_program_factory(), | ||
462 | 113 | the_gl_config()); | 114 | the_gl_config()); |
463 | 114 | } | 115 | } |
464 | 115 | }); | 116 | }); |
465 | 116 | 117 | ||
466 | === modified file 'src/server/graphics/nested/nested_platform.cpp' | |||
467 | --- src/server/graphics/nested/nested_platform.cpp 2014-04-17 11:04:41 +0000 | |||
468 | +++ src/server/graphics/nested/nested_platform.cpp 2014-04-24 20:07:52 +0000 | |||
469 | @@ -82,6 +82,7 @@ | |||
470 | 82 | 82 | ||
471 | 83 | std::shared_ptr<mg::Display> mgn::NestedPlatform::create_display( | 83 | std::shared_ptr<mg::Display> mgn::NestedPlatform::create_display( |
472 | 84 | std::shared_ptr<mg::DisplayConfigurationPolicy> const& conf_policy, | 84 | std::shared_ptr<mg::DisplayConfigurationPolicy> const& conf_policy, |
473 | 85 | std::shared_ptr<mg::GLProgramFactory> const&, | ||
474 | 85 | std::shared_ptr<mg::GLConfig> const& gl_config) | 86 | std::shared_ptr<mg::GLConfig> const& gl_config) |
475 | 86 | { | 87 | { |
476 | 87 | return std::make_shared<mgn::NestedDisplay>( | 88 | return std::make_shared<mgn::NestedDisplay>( |
477 | 88 | 89 | ||
478 | === modified file 'src/server/graphics/nested/nested_platform.h' | |||
479 | --- src/server/graphics/nested/nested_platform.h 2014-03-27 09:46:09 +0000 | |||
480 | +++ src/server/graphics/nested/nested_platform.h 2014-04-24 20:07:52 +0000 | |||
481 | @@ -45,6 +45,7 @@ | |||
482 | 45 | std::shared_ptr<BufferInitializer> const& buffer_initializer) override; | 45 | std::shared_ptr<BufferInitializer> const& buffer_initializer) override; |
483 | 46 | std::shared_ptr<Display> create_display( | 46 | std::shared_ptr<Display> create_display( |
484 | 47 | std::shared_ptr<DisplayConfigurationPolicy> const& initial_conf_policy, | 47 | std::shared_ptr<DisplayConfigurationPolicy> const& initial_conf_policy, |
485 | 48 | std::shared_ptr<GLProgramFactory> const& gl_program_factory, | ||
486 | 48 | std::shared_ptr<GLConfig> const& gl_config); | 49 | std::shared_ptr<GLConfig> const& gl_config); |
487 | 49 | std::shared_ptr<PlatformIPCPackage> get_ipc_package() override; | 50 | std::shared_ptr<PlatformIPCPackage> get_ipc_package() override; |
488 | 50 | std::shared_ptr<InternalClient> create_internal_client() override; | 51 | std::shared_ptr<InternalClient> create_internal_client() override; |
489 | 51 | 52 | ||
490 | === modified file 'tests/acceptance-tests/test_display_configuration.cpp' | |||
491 | --- tests/acceptance-tests/test_display_configuration.cpp 2014-03-27 09:52:04 +0000 | |||
492 | +++ tests/acceptance-tests/test_display_configuration.cpp 2014-04-24 20:07:52 +0000 | |||
493 | @@ -145,6 +145,7 @@ | |||
494 | 145 | 145 | ||
495 | 146 | std::shared_ptr<mg::Display> create_display( | 146 | std::shared_ptr<mg::Display> create_display( |
496 | 147 | std::shared_ptr<mg::DisplayConfigurationPolicy> const&, | 147 | std::shared_ptr<mg::DisplayConfigurationPolicy> const&, |
497 | 148 | std::shared_ptr<mg::GLProgramFactory> const&, | ||
498 | 148 | std::shared_ptr<mg::GLConfig> const&) override | 149 | std::shared_ptr<mg::GLConfig> const&) override |
499 | 149 | { | 150 | { |
500 | 150 | return mt::fake_shared(mock_display); | 151 | return mt::fake_shared(mock_display); |
501 | 151 | 152 | ||
502 | === modified file 'tests/acceptance-tests/test_surfaces_with_output_id.cpp' | |||
503 | --- tests/acceptance-tests/test_surfaces_with_output_id.cpp 2014-04-15 05:31:19 +0000 | |||
504 | +++ tests/acceptance-tests/test_surfaces_with_output_id.cpp 2014-04-24 20:07:52 +0000 | |||
505 | @@ -89,6 +89,7 @@ | |||
506 | 89 | 89 | ||
507 | 90 | std::shared_ptr<mg::Display> create_display( | 90 | std::shared_ptr<mg::Display> create_display( |
508 | 91 | std::shared_ptr<mg::DisplayConfigurationPolicy> const&, | 91 | std::shared_ptr<mg::DisplayConfigurationPolicy> const&, |
509 | 92 | std::shared_ptr<mg::GLProgramFactory> const&, | ||
510 | 92 | std::shared_ptr<mg::GLConfig> const&) override | 93 | std::shared_ptr<mg::GLConfig> const&) override |
511 | 93 | { | 94 | { |
512 | 94 | return std::make_shared<StubDisplay>(display_rects()); | 95 | return std::make_shared<StubDisplay>(display_rects()); |
513 | 95 | 96 | ||
514 | === modified file 'tests/integration-tests/graphics/android/test_display_integration.cpp' | |||
515 | --- tests/integration-tests/graphics/android/test_display_integration.cpp 2014-03-27 13:38:00 +0000 | |||
516 | +++ tests/integration-tests/graphics/android/test_display_integration.cpp 2014-04-24 20:07:52 +0000 | |||
517 | @@ -22,6 +22,7 @@ | |||
518 | 22 | #include "src/platform/graphics/android/resource_factory.h" | 22 | #include "src/platform/graphics/android/resource_factory.h" |
519 | 23 | #include "src/platform/graphics/android/android_graphic_buffer_allocator.h" | 23 | #include "src/platform/graphics/android/android_graphic_buffer_allocator.h" |
520 | 24 | #include "src/platform/graphics/android/output_builder.h" | 24 | #include "src/platform/graphics/android/output_builder.h" |
521 | 25 | #include "src/server/graphics/program_factory.h" | ||
522 | 25 | #include "src/server/report/null_report_factory.h" | 26 | #include "src/server/report/null_report_factory.h" |
523 | 26 | 27 | ||
524 | 27 | #include "examples/graphics.h" | 28 | #include "examples/graphics.h" |
525 | @@ -78,7 +79,8 @@ | |||
526 | 78 | auto display_buffer_factory = std::make_shared<mga::OutputBuilder>( | 79 | auto display_buffer_factory = std::make_shared<mga::OutputBuilder>( |
527 | 79 | fb_allocator, display_resource_factory, null_display_report); | 80 | fb_allocator, display_resource_factory, null_display_report); |
528 | 80 | 81 | ||
530 | 81 | mga::AndroidDisplay display{display_buffer_factory, stub_gl_config, null_display_report}; | 82 | auto program_factory = std::make_shared<mg::ProgramFactory>(); |
531 | 83 | mga::AndroidDisplay display{display_buffer_factory, program_factory, stub_gl_config, null_display_report}; | ||
532 | 82 | 84 | ||
533 | 83 | display.for_each_display_buffer([this](mg::DisplayBuffer& buffer) | 85 | display.for_each_display_buffer([this](mg::DisplayBuffer& buffer) |
534 | 84 | { | 86 | { |
535 | 85 | 87 | ||
536 | === modified file 'tests/integration-tests/graphics/mesa/test_buffer_integration.cpp' | |||
537 | --- tests/integration-tests/graphics/mesa/test_buffer_integration.cpp 2014-03-27 09:46:09 +0000 | |||
538 | +++ tests/integration-tests/graphics/mesa/test_buffer_integration.cpp 2014-04-24 20:07:52 +0000 | |||
539 | @@ -26,6 +26,7 @@ | |||
540 | 26 | #include "mir_test_doubles/stub_buffer_allocator.h" | 26 | #include "mir_test_doubles/stub_buffer_allocator.h" |
541 | 27 | #include "mir_test_doubles/null_platform.h" | 27 | #include "mir_test_doubles/null_platform.h" |
542 | 28 | #include "mir_test_doubles/stub_gl_config.h" | 28 | #include "mir_test_doubles/stub_gl_config.h" |
543 | 29 | #include "mir_test_doubles/stub_gl_program_factory.h" | ||
544 | 29 | #include "src/server/graphics/default_display_configuration_policy.h" | 30 | #include "src/server/graphics/default_display_configuration_policy.h" |
545 | 30 | #include "src/server/report/null_report_factory.h" | 31 | #include "src/server/report/null_report_factory.h" |
546 | 31 | 32 | ||
547 | @@ -105,6 +106,7 @@ | |||
548 | 105 | auto conf_policy = std::make_shared<mg::DefaultDisplayConfigurationPolicy>(); | 106 | auto conf_policy = std::make_shared<mg::DefaultDisplayConfigurationPolicy>(); |
549 | 106 | display = platform->create_display( | 107 | display = platform->create_display( |
550 | 107 | conf_policy, | 108 | conf_policy, |
551 | 109 | std::make_shared<mtd::StubGLProgramFactory>(), | ||
552 | 108 | std::make_shared<mtd::StubGLConfig>()); | 110 | std::make_shared<mtd::StubGLConfig>()); |
553 | 109 | auto buffer_initializer = std::make_shared<mg::NullBufferInitializer>(); | 111 | auto buffer_initializer = std::make_shared<mg::NullBufferInitializer>(); |
554 | 110 | allocator = platform->create_buffer_allocator(buffer_initializer); | 112 | allocator = platform->create_buffer_allocator(buffer_initializer); |
555 | 111 | 113 | ||
556 | === modified file 'tests/integration-tests/test_display_info.cpp' | |||
557 | --- tests/integration-tests/test_display_info.cpp 2014-03-27 09:46:09 +0000 | |||
558 | +++ tests/integration-tests/test_display_info.cpp 2014-04-24 20:07:52 +0000 | |||
559 | @@ -118,6 +118,7 @@ | |||
560 | 118 | 118 | ||
561 | 119 | std::shared_ptr<mg::Display> create_display( | 119 | std::shared_ptr<mg::Display> create_display( |
562 | 120 | std::shared_ptr<mg::DisplayConfigurationPolicy> const&, | 120 | std::shared_ptr<mg::DisplayConfigurationPolicy> const&, |
563 | 121 | std::shared_ptr<mg::GLProgramFactory> const&, | ||
564 | 121 | std::shared_ptr<mg::GLConfig> const&) override | 122 | std::shared_ptr<mg::GLConfig> const&) override |
565 | 122 | { | 123 | { |
566 | 123 | if (!display) | 124 | if (!display) |
567 | 124 | 125 | ||
568 | === modified file 'tests/integration-tests/test_surfaceloop.cpp' | |||
569 | --- tests/integration-tests/test_surfaceloop.cpp 2014-03-27 09:46:09 +0000 | |||
570 | +++ tests/integration-tests/test_surfaceloop.cpp 2014-04-24 20:07:52 +0000 | |||
571 | @@ -249,6 +249,7 @@ | |||
572 | 249 | 249 | ||
573 | 250 | std::shared_ptr<mg::Display> create_display( | 250 | std::shared_ptr<mg::Display> create_display( |
574 | 251 | std::shared_ptr<mg::DisplayConfigurationPolicy> const&, | 251 | std::shared_ptr<mg::DisplayConfigurationPolicy> const&, |
575 | 252 | std::shared_ptr<mg::GLProgramFactory> const&, | ||
576 | 252 | std::shared_ptr<mg::GLConfig> const&) override | 253 | std::shared_ptr<mg::GLConfig> const&) override |
577 | 253 | { | 254 | { |
578 | 254 | return std::make_shared<StubDisplay>(); | 255 | return std::make_shared<StubDisplay>(); |
579 | @@ -365,6 +366,7 @@ | |||
580 | 365 | 366 | ||
581 | 366 | std::shared_ptr<mg::Display> create_display( | 367 | std::shared_ptr<mg::Display> create_display( |
582 | 367 | std::shared_ptr<mg::DisplayConfigurationPolicy> const&, | 368 | std::shared_ptr<mg::DisplayConfigurationPolicy> const&, |
583 | 369 | std::shared_ptr<mg::GLProgramFactory> const&, | ||
584 | 368 | std::shared_ptr<mg::GLConfig> const&) override | 370 | std::shared_ptr<mg::GLConfig> const&) override |
585 | 369 | { | 371 | { |
586 | 370 | return std::make_shared<StubDisplay>(); | 372 | return std::make_shared<StubDisplay>(); |
587 | 371 | 373 | ||
588 | === modified file 'tests/mir_test_framework/stubbed_server_configuration.cpp' | |||
589 | --- tests/mir_test_framework/stubbed_server_configuration.cpp 2014-03-27 09:46:09 +0000 | |||
590 | +++ tests/mir_test_framework/stubbed_server_configuration.cpp 2014-04-24 20:07:52 +0000 | |||
591 | @@ -200,6 +200,7 @@ | |||
592 | 200 | 200 | ||
593 | 201 | std::shared_ptr<mg::Display> create_display( | 201 | std::shared_ptr<mg::Display> create_display( |
594 | 202 | std::shared_ptr<mg::DisplayConfigurationPolicy> const&, | 202 | std::shared_ptr<mg::DisplayConfigurationPolicy> const&, |
595 | 203 | std::shared_ptr<mg::GLProgramFactory> const&, | ||
596 | 203 | std::shared_ptr<mg::GLConfig> const&) override | 204 | std::shared_ptr<mg::GLConfig> const&) override |
597 | 204 | { | 205 | { |
598 | 205 | return std::make_shared<StubDisplay>(); | 206 | return std::make_shared<StubDisplay>(); |
599 | 206 | 207 | ||
600 | === modified file 'tests/unit-tests/frontend/test_session_mediator.cpp' | |||
601 | --- tests/unit-tests/frontend/test_session_mediator.cpp 2014-04-15 05:31:19 +0000 | |||
602 | +++ tests/unit-tests/frontend/test_session_mediator.cpp 2014-04-24 20:07:52 +0000 | |||
603 | @@ -168,16 +168,17 @@ | |||
604 | 168 | using namespace testing; | 168 | using namespace testing; |
605 | 169 | ON_CALL(*this, create_buffer_allocator(_)) | 169 | ON_CALL(*this, create_buffer_allocator(_)) |
606 | 170 | .WillByDefault(Return(std::shared_ptr<mg::GraphicBufferAllocator>())); | 170 | .WillByDefault(Return(std::shared_ptr<mg::GraphicBufferAllocator>())); |
608 | 171 | ON_CALL(*this, create_display(_,_)) | 171 | ON_CALL(*this, create_display(_,_,_)) |
609 | 172 | .WillByDefault(Return(std::make_shared<mtd::NullDisplay>())); | 172 | .WillByDefault(Return(std::make_shared<mtd::NullDisplay>())); |
610 | 173 | ON_CALL(*this, get_ipc_package()) | 173 | ON_CALL(*this, get_ipc_package()) |
611 | 174 | .WillByDefault(Return(std::make_shared<mg::PlatformIPCPackage>())); | 174 | .WillByDefault(Return(std::make_shared<mg::PlatformIPCPackage>())); |
612 | 175 | } | 175 | } |
613 | 176 | 176 | ||
614 | 177 | MOCK_METHOD1(create_buffer_allocator, std::shared_ptr<mg::GraphicBufferAllocator>(std::shared_ptr<mg::BufferInitializer> const&)); | 177 | MOCK_METHOD1(create_buffer_allocator, std::shared_ptr<mg::GraphicBufferAllocator>(std::shared_ptr<mg::BufferInitializer> const&)); |
616 | 178 | MOCK_METHOD2(create_display, | 178 | MOCK_METHOD3(create_display, |
617 | 179 | std::shared_ptr<mg::Display>( | 179 | std::shared_ptr<mg::Display>( |
618 | 180 | std::shared_ptr<mg::DisplayConfigurationPolicy> const&, | 180 | std::shared_ptr<mg::DisplayConfigurationPolicy> const&, |
619 | 181 | std::shared_ptr<mg::GLProgramFactory> const&, | ||
620 | 181 | std::shared_ptr<mg::GLConfig> const&)); | 182 | std::shared_ptr<mg::GLConfig> const&)); |
621 | 182 | MOCK_METHOD0(get_ipc_package, std::shared_ptr<mg::PlatformIPCPackage>()); | 183 | MOCK_METHOD0(get_ipc_package, std::shared_ptr<mg::PlatformIPCPackage>()); |
622 | 183 | MOCK_METHOD0(create_internal_client, std::shared_ptr<mg::InternalClient>()); | 184 | MOCK_METHOD0(create_internal_client, std::shared_ptr<mg::InternalClient>()); |
623 | 184 | 185 | ||
624 | === modified file 'tests/unit-tests/graphics/android/CMakeLists.txt' | |||
625 | --- tests/unit-tests/graphics/android/CMakeLists.txt 2014-03-26 05:48:59 +0000 | |||
626 | +++ tests/unit-tests/graphics/android/CMakeLists.txt 2014-04-24 20:07:52 +0000 | |||
627 | @@ -26,6 +26,7 @@ | |||
628 | 26 | ${CMAKE_CURRENT_SOURCE_DIR}/test_external_refcount.cpp | 26 | ${CMAKE_CURRENT_SOURCE_DIR}/test_external_refcount.cpp |
629 | 27 | ${CMAKE_CURRENT_SOURCE_DIR}/test_output_builder.cpp | 27 | ${CMAKE_CURRENT_SOURCE_DIR}/test_output_builder.cpp |
630 | 28 | ${CMAKE_CURRENT_SOURCE_DIR}/test_hwc_wrapper.cpp | 28 | ${CMAKE_CURRENT_SOURCE_DIR}/test_hwc_wrapper.cpp |
631 | 29 | ${CMAKE_CURRENT_SOURCE_DIR}/test_overlay_compositor.cpp | ||
632 | 29 | ) | 30 | ) |
633 | 30 | 31 | ||
634 | 31 | set(UNIT_TEST_SOURCES ${UNIT_TEST_SOURCES} PARENT_SCOPE) | 32 | set(UNIT_TEST_SOURCES ${UNIT_TEST_SOURCES} PARENT_SCOPE) |
635 | 32 | 33 | ||
636 | === modified file 'tests/unit-tests/graphics/android/test_android_fb.cpp' | |||
637 | --- tests/unit-tests/graphics/android/test_android_fb.cpp 2014-03-27 13:38:00 +0000 | |||
638 | +++ tests/unit-tests/graphics/android/test_android_fb.cpp 2014-04-24 20:07:52 +0000 | |||
639 | @@ -28,6 +28,7 @@ | |||
640 | 28 | #include "mir_test_doubles/stub_display_builder.h" | 28 | #include "mir_test_doubles/stub_display_builder.h" |
641 | 29 | #include "mir_test_doubles/stub_gl_config.h" | 29 | #include "mir_test_doubles/stub_gl_config.h" |
642 | 30 | #include "mir_test_doubles/mock_gl_config.h" | 30 | #include "mir_test_doubles/mock_gl_config.h" |
643 | 31 | #include "mir_test_doubles/stub_gl_program_factory.h" | ||
644 | 31 | #include "mir/graphics/android/mir_native_window.h" | 32 | #include "mir/graphics/android/mir_native_window.h" |
645 | 32 | #include "mir_test_doubles/stub_driver_interpreter.h" | 33 | #include "mir_test_doubles/stub_driver_interpreter.h" |
646 | 33 | 34 | ||
647 | @@ -51,7 +52,8 @@ | |||
648 | 51 | dummy_config{mock_egl.fake_configs[0]}, | 52 | dummy_config{mock_egl.fake_configs[0]}, |
649 | 52 | null_display_report{mir::report::null_display_report()}, | 53 | null_display_report{mir::report::null_display_report()}, |
650 | 53 | stub_db_factory{std::make_shared<mtd::StubDisplayBuilder>()}, | 54 | stub_db_factory{std::make_shared<mtd::StubDisplayBuilder>()}, |
652 | 54 | stub_gl_config{std::make_shared<mtd::StubGLConfig>()} | 55 | stub_gl_config{std::make_shared<mtd::StubGLConfig>()}, |
653 | 56 | stub_gl_program_factory{std::make_shared<mtd::StubGLProgramFactory>()} | ||
654 | 55 | { | 57 | { |
655 | 56 | } | 58 | } |
656 | 57 | 59 | ||
657 | @@ -64,6 +66,7 @@ | |||
658 | 64 | std::shared_ptr<mg::DisplayReport> const null_display_report; | 66 | std::shared_ptr<mg::DisplayReport> const null_display_report; |
659 | 65 | std::shared_ptr<mtd::StubDisplayBuilder> const stub_db_factory; | 67 | std::shared_ptr<mtd::StubDisplayBuilder> const stub_db_factory; |
660 | 66 | std::shared_ptr<mtd::StubGLConfig> const stub_gl_config; | 68 | std::shared_ptr<mtd::StubGLConfig> const stub_gl_config; |
661 | 69 | std::shared_ptr<mtd::StubGLProgramFactory> const stub_gl_program_factory; | ||
662 | 67 | }; | 70 | }; |
663 | 68 | 71 | ||
664 | 69 | TEST_F(AndroidDisplay, creation_creates_egl_resources_properly) | 72 | TEST_F(AndroidDisplay, creation_creates_egl_resources_properly) |
665 | @@ -104,7 +107,11 @@ | |||
666 | 104 | EXPECT_CALL(mock_egl, eglTerminate(dummy_display)) | 107 | EXPECT_CALL(mock_egl, eglTerminate(dummy_display)) |
667 | 105 | .Times(1); | 108 | .Times(1); |
668 | 106 | 109 | ||
670 | 107 | mga::AndroidDisplay display(stub_db_factory, stub_gl_config, null_display_report); | 110 | mga::AndroidDisplay display( |
671 | 111 | stub_db_factory, | ||
672 | 112 | stub_gl_program_factory, | ||
673 | 113 | stub_gl_config, | ||
674 | 114 | null_display_report); | ||
675 | 108 | } | 115 | } |
676 | 109 | 116 | ||
677 | 110 | TEST_F(AndroidDisplay, selects_usable_configuration) | 117 | TEST_F(AndroidDisplay, selects_usable_configuration) |
678 | @@ -148,7 +155,11 @@ | |||
679 | 148 | .Times(1) | 155 | .Times(1) |
680 | 149 | .WillOnce(Invoke(config_filler)); | 156 | .WillOnce(Invoke(config_filler)); |
681 | 150 | 157 | ||
683 | 151 | mga::AndroidDisplay display(stub_db_factory, stub_gl_config, null_display_report); | 158 | mga::AndroidDisplay display( |
684 | 159 | stub_db_factory, | ||
685 | 160 | stub_gl_program_factory, | ||
686 | 161 | stub_gl_config, | ||
687 | 162 | null_display_report); | ||
688 | 152 | EXPECT_EQ(correct_config, selected_config); | 163 | EXPECT_EQ(correct_config, selected_config); |
689 | 153 | } | 164 | } |
690 | 154 | 165 | ||
691 | @@ -172,7 +183,11 @@ | |||
692 | 172 | mtd::EGLConfigContainsAttrib(EGL_STENCIL_SIZE, stencil_bits)), | 183 | mtd::EGLConfigContainsAttrib(EGL_STENCIL_SIZE, stencil_bits)), |
693 | 173 | _,_,_)); | 184 | _,_,_)); |
694 | 174 | 185 | ||
696 | 175 | mga::AndroidDisplay display(stub_db_factory, mock_gl_config, null_display_report); | 186 | mga::AndroidDisplay display( |
697 | 187 | stub_db_factory, | ||
698 | 188 | stub_gl_program_factory, | ||
699 | 189 | mock_gl_config, | ||
700 | 190 | null_display_report); | ||
701 | 176 | } | 191 | } |
702 | 177 | 192 | ||
703 | 178 | TEST_F(AndroidDisplay, logs_creation_events) | 193 | TEST_F(AndroidDisplay, logs_creation_events) |
704 | @@ -190,7 +205,11 @@ | |||
705 | 190 | EXPECT_CALL(*mock_display_report, report_successful_display_construction()) | 205 | EXPECT_CALL(*mock_display_report, report_successful_display_construction()) |
706 | 191 | .Times(1); | 206 | .Times(1); |
707 | 192 | 207 | ||
709 | 193 | mga::AndroidDisplay display(stub_db_factory, stub_gl_config, mock_display_report); | 208 | mga::AndroidDisplay display( |
710 | 209 | stub_db_factory, | ||
711 | 210 | stub_gl_program_factory, | ||
712 | 211 | stub_gl_config, | ||
713 | 212 | mock_display_report); | ||
714 | 194 | } | 213 | } |
715 | 195 | 214 | ||
716 | 196 | TEST_F(AndroidDisplay, throws_on_eglMakeCurrent_failure) | 215 | TEST_F(AndroidDisplay, throws_on_eglMakeCurrent_failure) |
717 | @@ -210,7 +229,11 @@ | |||
718 | 210 | .Times(0); | 229 | .Times(0); |
719 | 211 | 230 | ||
720 | 212 | EXPECT_THROW({ | 231 | EXPECT_THROW({ |
722 | 213 | mga::AndroidDisplay display(stub_db_factory, stub_gl_config, mock_display_report); | 232 | mga::AndroidDisplay display( |
723 | 233 | stub_db_factory, | ||
724 | 234 | stub_gl_program_factory, | ||
725 | 235 | stub_gl_config, | ||
726 | 236 | mock_display_report); | ||
727 | 214 | }, std::runtime_error); | 237 | }, std::runtime_error); |
728 | 215 | } | 238 | } |
729 | 216 | 239 | ||
730 | @@ -232,14 +255,22 @@ | |||
731 | 232 | .WillOnce(Return(EGL_NO_SURFACE)); | 255 | .WillOnce(Return(EGL_NO_SURFACE)); |
732 | 233 | 256 | ||
733 | 234 | EXPECT_THROW({ | 257 | EXPECT_THROW({ |
735 | 235 | mga::AndroidDisplay display(stub_db_factory, stub_gl_config, mock_display_report); | 258 | mga::AndroidDisplay display( |
736 | 259 | stub_db_factory, | ||
737 | 260 | stub_gl_program_factory, | ||
738 | 261 | stub_gl_config, | ||
739 | 262 | mock_display_report); | ||
740 | 236 | }, std::runtime_error); | 263 | }, std::runtime_error); |
741 | 237 | } | 264 | } |
742 | 238 | 265 | ||
743 | 239 | TEST_F(AndroidDisplay, configures_display_buffer) | 266 | TEST_F(AndroidDisplay, configures_display_buffer) |
744 | 240 | { | 267 | { |
745 | 241 | using namespace testing; | 268 | using namespace testing; |
747 | 242 | mga::AndroidDisplay display(stub_db_factory, stub_gl_config, null_display_report); | 269 | mga::AndroidDisplay display( |
748 | 270 | stub_db_factory, | ||
749 | 271 | stub_gl_program_factory, | ||
750 | 272 | stub_gl_config, | ||
751 | 273 | null_display_report); | ||
752 | 243 | 274 | ||
753 | 244 | auto configuration = display.configuration(); | 275 | auto configuration = display.configuration(); |
754 | 245 | configuration->for_each_output([&](mg::UserDisplayConfigurationOutput& output) | 276 | configuration->for_each_output([&](mg::UserDisplayConfigurationOutput& output) |
755 | @@ -270,7 +301,11 @@ | |||
756 | 270 | //we only have single display and single mode on android for the time being | 301 | //we only have single display and single mode on android for the time being |
757 | 271 | TEST_F(AndroidDisplay, supports_one_output_configuration) | 302 | TEST_F(AndroidDisplay, supports_one_output_configuration) |
758 | 272 | { | 303 | { |
760 | 273 | mga::AndroidDisplay display(stub_db_factory, stub_gl_config, null_display_report); | 304 | mga::AndroidDisplay display( |
761 | 305 | stub_db_factory, | ||
762 | 306 | stub_gl_program_factory, | ||
763 | 307 | stub_gl_config, | ||
764 | 308 | null_display_report); | ||
765 | 274 | auto config = display.configuration(); | 309 | auto config = display.configuration(); |
766 | 275 | 310 | ||
767 | 276 | size_t num_configs = 0; | 311 | size_t num_configs = 0; |
768 | 277 | 312 | ||
769 | === modified file 'tests/unit-tests/graphics/android/test_hwc_display.cpp' | |||
770 | --- tests/unit-tests/graphics/android/test_hwc_display.cpp 2014-04-15 05:31:19 +0000 | |||
771 | +++ tests/unit-tests/graphics/android/test_hwc_display.cpp 2014-04-24 20:07:52 +0000 | |||
772 | @@ -30,6 +30,7 @@ | |||
773 | 30 | #include "mir_test_doubles/stub_buffer.h" | 30 | #include "mir_test_doubles/stub_buffer.h" |
774 | 31 | #include "mir_test_doubles/stub_gl_config.h" | 31 | #include "mir_test_doubles/stub_gl_config.h" |
775 | 32 | #include "mir_test_doubles/mock_framebuffer_bundle.h" | 32 | #include "mir_test_doubles/mock_framebuffer_bundle.h" |
776 | 33 | #include "mir_test_doubles/stub_gl_program_factory.h" | ||
777 | 33 | #include <memory> | 34 | #include <memory> |
778 | 34 | 35 | ||
779 | 35 | namespace geom=mir::geometry; | 36 | namespace geom=mir::geometry; |
780 | @@ -67,6 +68,7 @@ | |||
781 | 67 | } | 68 | } |
782 | 68 | 69 | ||
783 | 69 | testing::NiceMock<mtd::MockEGL> mock_egl; | 70 | testing::NiceMock<mtd::MockEGL> mock_egl; |
784 | 71 | mtd::StubGLProgramFactory stub_program_factory; | ||
785 | 70 | 72 | ||
786 | 71 | int visual_id; | 73 | int visual_id; |
787 | 72 | EGLConfig dummy_config; | 74 | EGLConfig dummy_config; |
788 | @@ -96,7 +98,8 @@ | |||
789 | 96 | .Times(1); | 98 | .Times(1); |
790 | 97 | 99 | ||
791 | 98 | std::list<std::shared_ptr<mg::Renderable>> renderlist{}; | 100 | std::list<std::shared_ptr<mg::Renderable>> renderlist{}; |
793 | 99 | mga::DisplayBuffer db(mock_fb_bundle, mock_display_device, native_window, *gl_context); | 101 | mga::DisplayBuffer db( |
794 | 102 | mock_fb_bundle, mock_display_device, native_window, *gl_context, stub_program_factory); | ||
795 | 100 | db.post_update(); | 103 | db.post_update(); |
796 | 101 | } | 104 | } |
797 | 102 | 105 | ||
798 | @@ -104,7 +107,8 @@ | |||
799 | 104 | { | 107 | { |
800 | 105 | using namespace testing; | 108 | using namespace testing; |
801 | 106 | 109 | ||
803 | 107 | mga::DisplayBuffer db(mock_fb_bundle, mock_display_device, native_window, *gl_context); | 110 | mga::DisplayBuffer db( |
804 | 111 | mock_fb_bundle, mock_display_device, native_window, *gl_context, stub_program_factory); | ||
805 | 108 | 112 | ||
806 | 109 | InSequence seq; | 113 | InSequence seq; |
807 | 110 | EXPECT_CALL(*mock_display_device, render_gl(_)) | 114 | EXPECT_CALL(*mock_display_device, render_gl(_)) |
808 | @@ -137,22 +141,23 @@ | |||
809 | 137 | EXPECT_CALL(*mock_display_device, post(Ref(*stub_buffer))) | 141 | EXPECT_CALL(*mock_display_device, post(Ref(*stub_buffer))) |
810 | 138 | .Times(1); | 142 | .Times(1); |
811 | 139 | 143 | ||
813 | 140 | mga::DisplayBuffer db(mock_fb_bundle, mock_display_device, native_window, *gl_context); | 144 | mga::DisplayBuffer db( |
814 | 145 | mock_fb_bundle, mock_display_device, native_window, *gl_context, stub_program_factory); | ||
815 | 141 | db.render_and_post_update(renderlist, render_fn); | 146 | db.render_and_post_update(renderlist, render_fn); |
816 | 142 | } | 147 | } |
817 | 143 | 148 | ||
818 | 144 | TEST_F(AndroidDisplayBuffer, defaults_to_normal_orientation) | 149 | TEST_F(AndroidDisplayBuffer, defaults_to_normal_orientation) |
819 | 145 | { | 150 | { |
822 | 146 | mga::DisplayBuffer db(mock_fb_bundle, mock_display_device, native_window, | 151 | mga::DisplayBuffer db( |
823 | 147 | *gl_context); | 152 | mock_fb_bundle, mock_display_device, native_window, *gl_context, stub_program_factory); |
824 | 148 | 153 | ||
825 | 149 | EXPECT_EQ(mir_orientation_normal, db.orientation()); | 154 | EXPECT_EQ(mir_orientation_normal, db.orientation()); |
826 | 150 | } | 155 | } |
827 | 151 | 156 | ||
828 | 152 | TEST_F(AndroidDisplayBuffer, orientation_is_passed_through) | 157 | TEST_F(AndroidDisplayBuffer, orientation_is_passed_through) |
829 | 153 | { | 158 | { |
832 | 154 | mga::DisplayBuffer db(mock_fb_bundle, mock_display_device, native_window, | 159 | mga::DisplayBuffer db( |
833 | 155 | *gl_context); | 160 | mock_fb_bundle, mock_display_device, native_window, *gl_context, stub_program_factory); |
834 | 156 | 161 | ||
835 | 157 | for (auto const& ori : {mir_orientation_normal, | 162 | for (auto const& ori : {mir_orientation_normal, |
836 | 158 | mir_orientation_left, | 163 | mir_orientation_left, |
837 | @@ -178,8 +183,8 @@ | |||
838 | 178 | EXPECT_CALL(*mock_fb_bundle, fb_size()) | 183 | EXPECT_CALL(*mock_fb_bundle, fb_size()) |
839 | 179 | .WillRepeatedly(Return(normal)); | 184 | .WillRepeatedly(Return(normal)); |
840 | 180 | 185 | ||
843 | 181 | mga::DisplayBuffer db(mock_fb_bundle, mock_display_device, native_window, | 186 | mga::DisplayBuffer db( |
844 | 182 | *gl_context); | 187 | mock_fb_bundle, mock_display_device, native_window, *gl_context, stub_program_factory); |
845 | 183 | 188 | ||
846 | 184 | EXPECT_EQ(normal, db.view_area().size); | 189 | EXPECT_EQ(normal, db.view_area().size); |
847 | 185 | 190 | ||
848 | @@ -202,7 +207,8 @@ | |||
849 | 202 | { | 207 | { |
850 | 203 | using namespace testing; | 208 | using namespace testing; |
851 | 204 | 209 | ||
853 | 205 | mga::DisplayBuffer db(mock_fb_bundle, mock_display_device, native_window, *gl_context); | 210 | mga::DisplayBuffer db( |
854 | 211 | mock_fb_bundle, mock_display_device, native_window, *gl_context, stub_program_factory); | ||
855 | 206 | 212 | ||
856 | 207 | auto view_area = db.view_area(); | 213 | auto view_area = db.view_area(); |
857 | 208 | 214 | ||
858 | @@ -230,7 +236,8 @@ | |||
859 | 230 | EXPECT_CALL(mock_egl, eglDestroyContext(dummy_display, mock_egl.fake_egl_context)) | 236 | EXPECT_CALL(mock_egl, eglDestroyContext(dummy_display, mock_egl.fake_egl_context)) |
860 | 231 | .Times(AtLeast(1)); | 237 | .Times(AtLeast(1)); |
861 | 232 | 238 | ||
863 | 233 | mga::DisplayBuffer db(mock_fb_bundle, mock_display_device, native_window, *gl_context); | 239 | mga::DisplayBuffer db( |
864 | 240 | mock_fb_bundle, mock_display_device, native_window, *gl_context, stub_program_factory); | ||
865 | 234 | testing::Mock::VerifyAndClearExpectations(&mock_egl); | 241 | testing::Mock::VerifyAndClearExpectations(&mock_egl); |
866 | 235 | } | 242 | } |
867 | 236 | 243 | ||
868 | @@ -247,12 +254,14 @@ | |||
869 | 247 | 254 | ||
870 | 248 | EXPECT_THROW( | 255 | EXPECT_THROW( |
871 | 249 | { | 256 | { |
873 | 250 | mga::DisplayBuffer db(mock_fb_bundle, mock_display_device, native_window, *gl_context); | 257 | mga::DisplayBuffer db( |
874 | 258 | mock_fb_bundle, mock_display_device, native_window, *gl_context, stub_program_factory); | ||
875 | 251 | }, std::runtime_error); | 259 | }, std::runtime_error); |
876 | 252 | 260 | ||
877 | 253 | EXPECT_THROW( | 261 | EXPECT_THROW( |
878 | 254 | { | 262 | { |
880 | 255 | mga::DisplayBuffer db(mock_fb_bundle, mock_display_device, native_window, *gl_context); | 263 | mga::DisplayBuffer db( |
881 | 264 | mock_fb_bundle, mock_display_device, native_window, *gl_context, stub_program_factory); | ||
882 | 256 | }, std::runtime_error); | 265 | }, std::runtime_error); |
883 | 257 | } | 266 | } |
884 | 258 | 267 | ||
885 | @@ -261,20 +270,19 @@ | |||
886 | 261 | using namespace testing; | 270 | using namespace testing; |
887 | 262 | EGLContext fake_ctxt = reinterpret_cast<EGLContext>(0x4422); | 271 | EGLContext fake_ctxt = reinterpret_cast<EGLContext>(0x4422); |
888 | 263 | EGLSurface fake_surf = reinterpret_cast<EGLSurface>(0x33984); | 272 | EGLSurface fake_surf = reinterpret_cast<EGLSurface>(0x33984); |
897 | 264 | 273 | ON_CALL(mock_egl, eglCreateContext(_,_,_,_)) | |
898 | 265 | EXPECT_CALL(mock_egl, eglCreateContext(_,_,_,_)) | 274 | .WillByDefault(Return(fake_ctxt)); |
899 | 266 | .Times(1) | 275 | ON_CALL(mock_egl, eglCreateWindowSurface(_,_,_,_)) |
900 | 267 | .WillOnce(Return(fake_ctxt)); | 276 | .WillByDefault(Return(fake_surf)); |
901 | 268 | EXPECT_CALL(mock_egl, eglCreateWindowSurface(_,_,_,_)) | 277 | |
902 | 269 | .Times(1) | 278 | mga::DisplayBuffer db( |
903 | 270 | .WillOnce(Return(fake_surf)); | 279 | mock_fb_bundle, mock_display_device, native_window, *gl_context, stub_program_factory); |
904 | 271 | 280 | ||
905 | 272 | EXPECT_CALL(mock_egl, eglMakeCurrent(dummy_display, fake_surf, fake_surf, fake_ctxt)) | 281 | EXPECT_CALL(mock_egl, eglMakeCurrent(dummy_display, fake_surf, fake_surf, fake_ctxt)) |
906 | 273 | .Times(2) | 282 | .Times(2) |
907 | 274 | .WillOnce(Return(EGL_TRUE)) | 283 | .WillOnce(Return(EGL_TRUE)) |
908 | 275 | .WillOnce(Return(EGL_FALSE)); | 284 | .WillOnce(Return(EGL_FALSE)); |
909 | 276 | 285 | ||
910 | 277 | mga::DisplayBuffer db(mock_fb_bundle, mock_display_device, native_window, *gl_context); | ||
911 | 278 | db.make_current(); | 286 | db.make_current(); |
912 | 279 | EXPECT_THROW( | 287 | EXPECT_THROW( |
913 | 280 | { | 288 | { |
914 | @@ -285,18 +293,19 @@ | |||
915 | 285 | TEST_F(AndroidDisplayBuffer, release_current) | 293 | TEST_F(AndroidDisplayBuffer, release_current) |
916 | 286 | { | 294 | { |
917 | 287 | using namespace testing; | 295 | using namespace testing; |
918 | 296 | mga::DisplayBuffer db( | ||
919 | 297 | mock_fb_bundle, mock_display_device, native_window, *gl_context, stub_program_factory); | ||
920 | 288 | 298 | ||
921 | 289 | EXPECT_CALL(mock_egl, eglMakeCurrent(dummy_display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT)) | 299 | EXPECT_CALL(mock_egl, eglMakeCurrent(dummy_display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT)) |
922 | 290 | .Times(1); | 300 | .Times(1); |
923 | 291 | |||
924 | 292 | mga::DisplayBuffer db(mock_fb_bundle, mock_display_device, native_window, *gl_context); | ||
925 | 293 | db.release_current(); | 301 | db.release_current(); |
926 | 294 | } | 302 | } |
927 | 295 | 303 | ||
928 | 296 | TEST_F(AndroidDisplayBuffer, sets_display_power_mode_to_on_at_start) | 304 | TEST_F(AndroidDisplayBuffer, sets_display_power_mode_to_on_at_start) |
929 | 297 | { | 305 | { |
930 | 298 | using namespace testing; | 306 | using namespace testing; |
932 | 299 | mga::DisplayBuffer db(mock_fb_bundle, mock_display_device, native_window, *gl_context); | 307 | mga::DisplayBuffer db( |
933 | 308 | mock_fb_bundle, mock_display_device, native_window, *gl_context, stub_program_factory); | ||
934 | 300 | auto config = db.configuration(); | 309 | auto config = db.configuration(); |
935 | 301 | EXPECT_EQ(mir_power_mode_on, config.power_mode); | 310 | EXPECT_EQ(mir_power_mode_on, config.power_mode); |
936 | 302 | } | 311 | } |
937 | @@ -304,7 +313,8 @@ | |||
938 | 304 | TEST_F(AndroidDisplayBuffer, changes_display_power_mode) | 313 | TEST_F(AndroidDisplayBuffer, changes_display_power_mode) |
939 | 305 | { | 314 | { |
940 | 306 | using namespace testing; | 315 | using namespace testing; |
942 | 307 | mga::DisplayBuffer db(mock_fb_bundle, mock_display_device, native_window, *gl_context); | 316 | mga::DisplayBuffer db( |
943 | 317 | mock_fb_bundle, mock_display_device, native_window, *gl_context, stub_program_factory); | ||
944 | 308 | 318 | ||
945 | 309 | Sequence seq; | 319 | Sequence seq; |
946 | 310 | EXPECT_CALL(*mock_display_device, mode(mir_power_mode_off)) | 320 | EXPECT_CALL(*mock_display_device, mode(mir_power_mode_off)) |
947 | @@ -324,7 +334,8 @@ | |||
948 | 324 | TEST_F(AndroidDisplayBuffer, disregards_double_display_power_mode_request) | 334 | TEST_F(AndroidDisplayBuffer, disregards_double_display_power_mode_request) |
949 | 325 | { | 335 | { |
950 | 326 | using namespace testing; | 336 | using namespace testing; |
952 | 327 | mga::DisplayBuffer db(mock_fb_bundle, mock_display_device, native_window, *gl_context); | 337 | mga::DisplayBuffer db( |
953 | 338 | mock_fb_bundle, mock_display_device, native_window, *gl_context, stub_program_factory); | ||
954 | 328 | 339 | ||
955 | 329 | EXPECT_CALL(*mock_display_device, mode(mir_power_mode_off)) | 340 | EXPECT_CALL(*mock_display_device, mode(mir_power_mode_off)) |
956 | 330 | .Times(1); | 341 | .Times(1); |
957 | @@ -347,7 +358,8 @@ | |||
958 | 347 | .Times(1) | 358 | .Times(1) |
959 | 348 | .WillOnce(Return(true)); | 359 | .WillOnce(Return(true)); |
960 | 349 | 360 | ||
962 | 350 | mga::DisplayBuffer db(mock_fb_bundle, mock_display_device, native_window, *gl_context); | 361 | mga::DisplayBuffer db( |
963 | 362 | mock_fb_bundle, mock_display_device, native_window, *gl_context, stub_program_factory); | ||
964 | 351 | 363 | ||
965 | 352 | auto config = db.configuration(); | 364 | auto config = db.configuration(); |
966 | 353 | config.orientation = mir_orientation_left; | 365 | config.orientation = mir_orientation_left; |
967 | @@ -364,7 +376,8 @@ | |||
968 | 364 | .Times(1) | 376 | .Times(1) |
969 | 365 | .WillOnce(Return(false)); | 377 | .WillOnce(Return(false)); |
970 | 366 | 378 | ||
972 | 367 | mga::DisplayBuffer db(mock_fb_bundle, mock_display_device, native_window, *gl_context); | 379 | mga::DisplayBuffer db( |
973 | 380 | mock_fb_bundle, mock_display_device, native_window, *gl_context, stub_program_factory); | ||
974 | 368 | 381 | ||
975 | 369 | auto config = db.configuration(); | 382 | auto config = db.configuration(); |
976 | 370 | config.orientation = mir_orientation_left; | 383 | config.orientation = mir_orientation_left; |
977 | @@ -376,7 +389,8 @@ | |||
978 | 376 | 389 | ||
979 | 377 | TEST_F(AndroidDisplayBuffer, incorrect_display_configure_throws) | 390 | TEST_F(AndroidDisplayBuffer, incorrect_display_configure_throws) |
980 | 378 | { | 391 | { |
982 | 379 | mga::DisplayBuffer db(mock_fb_bundle, mock_display_device, native_window, *gl_context); | 392 | mga::DisplayBuffer db( |
983 | 393 | mock_fb_bundle, mock_display_device, native_window, *gl_context, stub_program_factory); | ||
984 | 380 | auto config = db.configuration(); | 394 | auto config = db.configuration(); |
985 | 381 | //error | 395 | //error |
986 | 382 | config.current_format = mir_pixel_format_invalid; | 396 | config.current_format = mir_pixel_format_invalid; |
987 | @@ -387,7 +401,8 @@ | |||
988 | 387 | 401 | ||
989 | 388 | TEST_F(AndroidDisplayBuffer, android_display_configuration_info) | 402 | TEST_F(AndroidDisplayBuffer, android_display_configuration_info) |
990 | 389 | { | 403 | { |
992 | 390 | mga::DisplayBuffer db(mock_fb_bundle, mock_display_device, native_window, *gl_context); | 404 | mga::DisplayBuffer db( |
993 | 405 | mock_fb_bundle, mock_display_device, native_window, *gl_context, stub_program_factory); | ||
994 | 391 | auto disp_conf = db.configuration(); | 406 | auto disp_conf = db.configuration(); |
995 | 392 | 407 | ||
996 | 393 | ASSERT_EQ(1u, disp_conf.modes.size()); | 408 | ASSERT_EQ(1u, disp_conf.modes.size()); |
997 | 394 | 409 | ||
998 | === modified file 'tests/unit-tests/graphics/android/test_output_builder.cpp' | |||
999 | --- tests/unit-tests/graphics/android/test_output_builder.cpp 2014-03-27 13:38:00 +0000 | |||
1000 | +++ tests/unit-tests/graphics/android/test_output_builder.cpp 2014-04-24 20:07:52 +0000 | |||
1001 | @@ -30,6 +30,7 @@ | |||
1002 | 30 | #include "mir_test_doubles/mock_egl.h" | 30 | #include "mir_test_doubles/mock_egl.h" |
1003 | 31 | #include "mir_test_doubles/mock_android_native_buffer.h" | 31 | #include "mir_test_doubles/mock_android_native_buffer.h" |
1004 | 32 | #include "mir_test_doubles/stub_gl_config.h" | 32 | #include "mir_test_doubles/stub_gl_config.h" |
1005 | 33 | #include "mir_test_doubles/stub_gl_program_factory.h" | ||
1006 | 33 | #include <system/window.h> | 34 | #include <system/window.h> |
1007 | 34 | #include <gtest/gtest.h> | 35 | #include <gtest/gtest.h> |
1008 | 35 | 36 | ||
1009 | @@ -105,6 +106,7 @@ | |||
1010 | 105 | mtd::StubGLConfig stub_gl_config; | 106 | mtd::StubGLConfig stub_gl_config; |
1011 | 106 | mga::GLContext gl_context{ | 107 | mga::GLContext gl_context{ |
1012 | 107 | mga::to_mir_format(mock_egl.fake_visual_id), stub_gl_config, mock_display_report}; | 108 | mga::to_mir_format(mock_egl.fake_visual_id), stub_gl_config, mock_display_report}; |
1013 | 109 | mtd::StubGLProgramFactory const stub_program_factory; | ||
1014 | 108 | }; | 110 | }; |
1015 | 109 | } | 111 | } |
1016 | 110 | TEST_F(OutputBuilder, hwc_version_10_success) | 112 | TEST_F(OutputBuilder, hwc_version_10_success) |
1017 | @@ -126,7 +128,7 @@ | |||
1018 | 126 | 128 | ||
1019 | 127 | mga::OutputBuilder factory( | 129 | mga::OutputBuilder factory( |
1020 | 128 | mt::fake_shared(mock_buffer_allocator),mock_resource_factory, mt::fake_shared(mock_display_report)); | 130 | mt::fake_shared(mock_buffer_allocator),mock_resource_factory, mt::fake_shared(mock_display_report)); |
1022 | 129 | factory.create_display_buffer(gl_context); | 131 | factory.create_display_buffer(stub_program_factory, gl_context); |
1023 | 130 | } | 132 | } |
1024 | 131 | 133 | ||
1025 | 132 | TEST_F(OutputBuilder, hwc_version_10_failure_uses_gpu) | 134 | TEST_F(OutputBuilder, hwc_version_10_failure_uses_gpu) |
1026 | @@ -149,7 +151,7 @@ | |||
1027 | 149 | 151 | ||
1028 | 150 | mga::OutputBuilder factory( | 152 | mga::OutputBuilder factory( |
1029 | 151 | mt::fake_shared(mock_buffer_allocator),mock_resource_factory, mt::fake_shared(mock_display_report)); | 153 | mt::fake_shared(mock_buffer_allocator),mock_resource_factory, mt::fake_shared(mock_display_report)); |
1031 | 152 | factory.create_display_buffer(gl_context); | 154 | factory.create_display_buffer(stub_program_factory, gl_context); |
1032 | 153 | } | 155 | } |
1033 | 154 | 156 | ||
1034 | 155 | TEST_F(OutputBuilder, hwc_version_11_success) | 157 | TEST_F(OutputBuilder, hwc_version_11_success) |
1035 | @@ -169,7 +171,7 @@ | |||
1036 | 169 | 171 | ||
1037 | 170 | mga::OutputBuilder factory( | 172 | mga::OutputBuilder factory( |
1038 | 171 | mt::fake_shared(mock_buffer_allocator),mock_resource_factory, mt::fake_shared(mock_display_report)); | 173 | mt::fake_shared(mock_buffer_allocator),mock_resource_factory, mt::fake_shared(mock_display_report)); |
1040 | 172 | factory.create_display_buffer(gl_context); | 174 | factory.create_display_buffer(stub_program_factory, gl_context); |
1041 | 173 | } | 175 | } |
1042 | 174 | 176 | ||
1043 | 175 | TEST_F(OutputBuilder, hwc_version_11_hwc_failure) | 177 | TEST_F(OutputBuilder, hwc_version_11_hwc_failure) |
1044 | @@ -192,7 +194,7 @@ | |||
1045 | 192 | 194 | ||
1046 | 193 | mga::OutputBuilder factory( | 195 | mga::OutputBuilder factory( |
1047 | 194 | mt::fake_shared(mock_buffer_allocator),mock_resource_factory, mt::fake_shared(mock_display_report)); | 196 | mt::fake_shared(mock_buffer_allocator),mock_resource_factory, mt::fake_shared(mock_display_report)); |
1049 | 195 | factory.create_display_buffer(gl_context); | 197 | factory.create_display_buffer(stub_program_factory, gl_context); |
1050 | 196 | } | 198 | } |
1051 | 197 | 199 | ||
1052 | 198 | TEST_F(OutputBuilder, hwc_version_11_hwc_and_fb_failure_fatal) | 200 | TEST_F(OutputBuilder, hwc_version_11_hwc_and_fb_failure_fatal) |
1053 | @@ -229,5 +231,5 @@ | |||
1054 | 229 | 231 | ||
1055 | 230 | mga::OutputBuilder factory( | 232 | mga::OutputBuilder factory( |
1056 | 231 | mt::fake_shared(mock_buffer_allocator),mock_resource_factory, mt::fake_shared(mock_display_report)); | 233 | mt::fake_shared(mock_buffer_allocator),mock_resource_factory, mt::fake_shared(mock_display_report)); |
1058 | 232 | factory.create_display_buffer(gl_context); | 234 | factory.create_display_buffer(stub_program_factory, gl_context); |
1059 | 233 | } | 235 | } |
1060 | 234 | 236 | ||
1061 | === added file 'tests/unit-tests/graphics/android/test_overlay_compositor.cpp' | |||
1062 | --- tests/unit-tests/graphics/android/test_overlay_compositor.cpp 1970-01-01 00:00:00 +0000 | |||
1063 | +++ tests/unit-tests/graphics/android/test_overlay_compositor.cpp 2014-04-24 20:07:52 +0000 | |||
1064 | @@ -0,0 +1,67 @@ | |||
1065 | 1 | /* | ||
1066 | 2 | * Copyright © 2014 Canonical Ltd. | ||
1067 | 3 | * | ||
1068 | 4 | * This program is free software: you can redistribute it and/or modify | ||
1069 | 5 | * it under the terms of the GNU General Public License version 3 as | ||
1070 | 6 | * published by the Free Software Foundation. | ||
1071 | 7 | * | ||
1072 | 8 | * This program is distributed in the hope that it will be useful, | ||
1073 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
1074 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
1075 | 11 | * GNU General Public License for more details. | ||
1076 | 12 | * | ||
1077 | 13 | * You should have received a copy of the GNU General Public License | ||
1078 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
1079 | 15 | * | ||
1080 | 16 | * Authored by: Kevin DuBois <kevin.dubois@canonical.com> | ||
1081 | 17 | */ | ||
1082 | 18 | |||
1083 | 19 | #include "src/platform/graphics/android/overlay_gl_compositor.h" | ||
1084 | 20 | #include "mir/graphics/gl_context.h" | ||
1085 | 21 | #include "mir/graphics/gl_program_factory.h" | ||
1086 | 22 | #include "mir_test_doubles/mock_gl.h" | ||
1087 | 23 | #include <gtest/gtest.h> | ||
1088 | 24 | #include <mir_test/gmock_fixes.h> | ||
1089 | 25 | |||
1090 | 26 | namespace mg=mir::graphics; | ||
1091 | 27 | namespace mga=mir::graphics::android; | ||
1092 | 28 | namespace mt=mir::test; | ||
1093 | 29 | namespace mtd=mir::test::doubles; | ||
1094 | 30 | |||
1095 | 31 | namespace | ||
1096 | 32 | { | ||
1097 | 33 | |||
1098 | 34 | class MockGLProgramFactory : public mg::GLProgramFactory | ||
1099 | 35 | { | ||
1100 | 36 | public: | ||
1101 | 37 | MOCK_CONST_METHOD2(create_gl_program, | ||
1102 | 38 | std::unique_ptr<mg::GLProgram>(std::string const&, std::string const&)); | ||
1103 | 39 | }; | ||
1104 | 40 | |||
1105 | 41 | class MockContext : public mg::GLContext | ||
1106 | 42 | { | ||
1107 | 43 | public: | ||
1108 | 44 | MOCK_CONST_METHOD0(make_current, void()); | ||
1109 | 45 | MOCK_CONST_METHOD0(release_current, void()); | ||
1110 | 46 | }; | ||
1111 | 47 | |||
1112 | 48 | class OverlayCompositor : public ::testing::Test | ||
1113 | 49 | { | ||
1114 | 50 | public: | ||
1115 | 51 | testing::NiceMock<MockGLProgramFactory> mock_gl_program_factory; | ||
1116 | 52 | testing::NiceMock<MockContext> mock_context; | ||
1117 | 53 | testing::NiceMock<mtd::MockGL> mock_gl; | ||
1118 | 54 | }; | ||
1119 | 55 | |||
1120 | 56 | } | ||
1121 | 57 | |||
1122 | 58 | TEST_F(OverlayCompositor, compiles_in_constructor) | ||
1123 | 59 | { | ||
1124 | 60 | using namespace testing; | ||
1125 | 61 | InSequence seq; | ||
1126 | 62 | EXPECT_CALL(mock_context, make_current()); | ||
1127 | 63 | EXPECT_CALL(mock_gl_program_factory, create_gl_program(_,_)); | ||
1128 | 64 | EXPECT_CALL(mock_context, release_current()); | ||
1129 | 65 | |||
1130 | 66 | mga::OverlayGLProgram glprogram(mock_gl_program_factory, mock_context); | ||
1131 | 67 | } | ||
1132 | 0 | 68 | ||
1133 | === modified file 'tests/unit-tests/graphics/mesa/test_display_configuration.cpp' | |||
1134 | --- tests/unit-tests/graphics/mesa/test_display_configuration.cpp 2014-03-27 09:46:09 +0000 | |||
1135 | +++ tests/unit-tests/graphics/mesa/test_display_configuration.cpp 2014-04-24 20:07:52 +0000 | |||
1136 | @@ -28,6 +28,7 @@ | |||
1137 | 28 | #include "src/server/report/null_report_factory.h" | 28 | #include "src/server/report/null_report_factory.h" |
1138 | 29 | #include "mir_test_doubles/null_virtual_terminal.h" | 29 | #include "mir_test_doubles/null_virtual_terminal.h" |
1139 | 30 | #include "mir_test_doubles/stub_gl_config.h" | 30 | #include "mir_test_doubles/stub_gl_config.h" |
1140 | 31 | #include "mir_test_doubles/stub_gl_program_factory.h" | ||
1141 | 31 | 32 | ||
1142 | 32 | #include "mir_test_framework/udev_environment.h" | 33 | #include "mir_test_framework/udev_environment.h" |
1143 | 33 | 34 | ||
1144 | @@ -102,6 +103,7 @@ | |||
1145 | 102 | { | 103 | { |
1146 | 103 | return platform->create_display( | 104 | return platform->create_display( |
1147 | 104 | std::make_shared<mg::DefaultDisplayConfigurationPolicy>(), | 105 | std::make_shared<mg::DefaultDisplayConfigurationPolicy>(), |
1148 | 106 | std::make_shared<mtd::StubGLProgramFactory>(), | ||
1149 | 105 | std::make_shared<mtd::StubGLConfig>()); | 107 | std::make_shared<mtd::StubGLConfig>()); |
1150 | 106 | } | 108 | } |
1151 | 107 | 109 | ||
1152 | 108 | 110 | ||
1153 | === modified file 'tests/unit-tests/graphics/mesa/test_display_multi_monitor.cpp' | |||
1154 | --- tests/unit-tests/graphics/mesa/test_display_multi_monitor.cpp 2014-03-27 09:52:04 +0000 | |||
1155 | +++ tests/unit-tests/graphics/mesa/test_display_multi_monitor.cpp 2014-04-24 20:07:52 +0000 | |||
1156 | @@ -27,6 +27,7 @@ | |||
1157 | 27 | #include "mir/graphics/display_configuration_policy.h" | 27 | #include "mir/graphics/display_configuration_policy.h" |
1158 | 28 | #include "mir_test_doubles/null_virtual_terminal.h" | 28 | #include "mir_test_doubles/null_virtual_terminal.h" |
1159 | 29 | #include "mir_test_doubles/stub_gl_config.h" | 29 | #include "mir_test_doubles/stub_gl_config.h" |
1160 | 30 | #include "mir_test_doubles/stub_gl_program_factory.h" | ||
1161 | 30 | 31 | ||
1162 | 31 | #include "mir_test_framework/udev_environment.h" | 32 | #include "mir_test_framework/udev_environment.h" |
1163 | 32 | 33 | ||
1164 | @@ -147,6 +148,7 @@ | |||
1165 | 147 | { | 148 | { |
1166 | 148 | return platform->create_display( | 149 | return platform->create_display( |
1167 | 149 | std::make_shared<ClonedDisplayConfigurationPolicy>(), | 150 | std::make_shared<ClonedDisplayConfigurationPolicy>(), |
1168 | 151 | std::make_shared<mtd::StubGLProgramFactory>(), | ||
1169 | 150 | std::make_shared<mtd::StubGLConfig>()); | 152 | std::make_shared<mtd::StubGLConfig>()); |
1170 | 151 | } | 153 | } |
1171 | 152 | 154 | ||
1172 | @@ -155,6 +157,7 @@ | |||
1173 | 155 | { | 157 | { |
1174 | 156 | return platform->create_display( | 158 | return platform->create_display( |
1175 | 157 | std::make_shared<SideBySideDisplayConfigurationPolicy>(), | 159 | std::make_shared<SideBySideDisplayConfigurationPolicy>(), |
1176 | 160 | std::make_shared<mtd::StubGLProgramFactory>(), | ||
1177 | 158 | std::make_shared<mtd::StubGLConfig>()); | 161 | std::make_shared<mtd::StubGLConfig>()); |
1178 | 159 | } | 162 | } |
1179 | 160 | 163 | ||
1180 | 161 | 164 | ||
1181 | === modified file 'tests/unit-tests/graphics/test_display.cpp' | |||
1182 | --- tests/unit-tests/graphics/test_display.cpp 2014-04-15 05:31:19 +0000 | |||
1183 | +++ tests/unit-tests/graphics/test_display.cpp 2014-04-24 20:07:52 +0000 | |||
1184 | @@ -24,6 +24,7 @@ | |||
1185 | 24 | #include "mir_test_doubles/mock_egl.h" | 24 | #include "mir_test_doubles/mock_egl.h" |
1186 | 25 | #include "mir_test_doubles/mock_gl.h" | 25 | #include "mir_test_doubles/mock_gl.h" |
1187 | 26 | #include "mir_test_doubles/stub_gl_config.h" | 26 | #include "mir_test_doubles/stub_gl_config.h" |
1188 | 27 | #include "mir_test_doubles/stub_gl_program_factory.h" | ||
1189 | 27 | #include "src/server/graphics/default_display_configuration_policy.h" | 28 | #include "src/server/graphics/default_display_configuration_policy.h" |
1190 | 28 | #ifndef ANDROID | 29 | #ifndef ANDROID |
1191 | 29 | #include "mir_test_doubles/mock_drm.h" | 30 | #include "mir_test_doubles/mock_drm.h" |
1192 | @@ -87,6 +88,7 @@ | |||
1193 | 87 | #endif | 88 | #endif |
1194 | 88 | return platform->create_display( | 89 | return platform->create_display( |
1195 | 89 | std::make_shared<mg::DefaultDisplayConfigurationPolicy>(), | 90 | std::make_shared<mg::DefaultDisplayConfigurationPolicy>(), |
1196 | 91 | std::make_shared<mtd::StubGLProgramFactory>(), | ||
1197 | 90 | std::make_shared<mtd::StubGLConfig>()); | 92 | std::make_shared<mtd::StubGLConfig>()); |
1198 | 91 | } | 93 | } |
1199 | 92 | 94 |
Seems sensible to me.