Mir

Merge lp:~kdub/mir/plumb-android-shader-creation into lp:mir

Proposed by Kevin DuBois
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
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.

To post a comment you must log in.
Revision history for this message
Chris Halse Rogers (raof) wrote :

Seems sensible to me.

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Alexandros Frantzis (afrantzis) wrote :

61 +++ include/test/mir_test_doubles/mock_gl_program_factory.h

Our current practice is to put stubs and mocks in different files. Breaking this convention here will make it harder to track down StubGLProgramFactory (and perhaps cause someone to rewrite the stub).

Otherwise looks good.

review: Needs Fixing
Revision history for this message
Kevin DuBois (kdub) wrote :

fixed!

Revision history for this message
Cemil Azizoglu (cemil-azizoglu) wrote :

Looks good.

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Alexandros Frantzis (afrantzis) wrote :

OK.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'examples/render_overlays.cpp'
--- examples/render_overlays.cpp 2014-04-15 05:31:19 +0000
+++ examples/render_overlays.cpp 2014-04-24 20:07:52 +0000
@@ -173,9 +173,7 @@
173 mir::DefaultServerConfiguration conf{argc, argv};173 mir::DefaultServerConfiguration conf{argc, argv};
174174
175 auto platform = conf.the_graphics_platform();175 auto platform = conf.the_graphics_platform();
176 auto display = platform->create_display(176 auto display = conf.the_display();
177 conf.the_display_configuration_policy(),
178 conf.the_gl_config());
179 auto buffer_allocator = platform->create_buffer_allocator(conf.the_buffer_initializer());177 auto buffer_allocator = platform->create_buffer_allocator(conf.the_buffer_initializer());
180178
181 mg::BufferProperties buffer_properties{179 mg::BufferProperties buffer_properties{
182180
=== renamed file 'include/server/mir/graphics/gl_program.h' => 'include/platform/mir/graphics/gl_program.h'
--- include/server/mir/graphics/gl_program.h 2014-04-16 18:40:45 +0000
+++ include/platform/mir/graphics/gl_program.h 2014-04-24 20:07:52 +0000
@@ -2,15 +2,15 @@
2 * Copyright © 2013-2014 Canonical Ltd.2 * Copyright © 2013-2014 Canonical Ltd.
3 *3 *
4 * This program is free software: you can redistribute it and/or modify it4 * 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,5 * under the terms of the GNU Lesser General Public License version 3,
6 * as published by the Free Software Foundation.6 * as published by the Free Software Foundation.
7 *7 *
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,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.11 * GNU Lesser General Public License for more details.
12 *12 *
13 * You should have received a copy of the GNU General Public License13 * 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/>.14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *15 *
16 * Authored by: Kevin DuBois <kevin.dubois@canonical.com>16 * Authored by: Kevin DuBois <kevin.dubois@canonical.com>
1717
=== modified file 'include/platform/mir/graphics/platform.h'
--- include/platform/mir/graphics/platform.h 2014-03-27 09:52:04 +0000
+++ include/platform/mir/graphics/platform.h 2014-04-24 20:07:52 +0000
@@ -50,6 +50,7 @@
50class DisplayConfigurationPolicy;50class DisplayConfigurationPolicy;
51class GraphicBufferAllocator;51class GraphicBufferAllocator;
52class GLConfig;52class GLConfig;
53class GLProgramFactory;
5354
54/**55/**
55 * \defgroup platform_enablement Mir platform enablement56 * \defgroup platform_enablement Mir platform enablement
@@ -84,6 +85,7 @@
84 */85 */
85 virtual std::shared_ptr<Display> create_display(86 virtual std::shared_ptr<Display> create_display(
86 std::shared_ptr<DisplayConfigurationPolicy> const& initial_conf_policy,87 std::shared_ptr<DisplayConfigurationPolicy> const& initial_conf_policy,
88 std::shared_ptr<GLProgramFactory> const& gl_program_factory,
87 std::shared_ptr<GLConfig> const& gl_config) = 0;89 std::shared_ptr<GLConfig> const& gl_config) = 0;
8890
89 /**91 /**
9092
=== modified file 'include/test/mir_test_doubles/null_platform.h'
--- include/test/mir_test_doubles/null_platform.h 2014-03-27 09:46:09 +0000
+++ include/test/mir_test_doubles/null_platform.h 2014-04-24 20:07:52 +0000
@@ -40,6 +40,7 @@
4040
41 std::shared_ptr<graphics::Display> create_display(41 std::shared_ptr<graphics::Display> create_display(
42 std::shared_ptr<graphics::DisplayConfigurationPolicy> const&,42 std::shared_ptr<graphics::DisplayConfigurationPolicy> const&,
43 std::shared_ptr<graphics::GLProgramFactory> const&,
43 std::shared_ptr<graphics::GLConfig> const&)44 std::shared_ptr<graphics::GLConfig> const&)
44 {45 {
45 return std::make_shared<NullDisplay>();46 return std::make_shared<NullDisplay>();
4647
=== modified file 'include/test/mir_test_doubles/stub_display_builder.h'
--- include/test/mir_test_doubles/stub_display_builder.h 2014-03-26 05:48:59 +0000
+++ include/test/mir_test_doubles/stub_display_builder.h 2014-04-24 20:07:52 +0000
@@ -79,6 +79,7 @@
79 }79 }
8080
81 std::unique_ptr<graphics::android::ConfigurableDisplayBuffer> create_display_buffer(81 std::unique_ptr<graphics::android::ConfigurableDisplayBuffer> create_display_buffer(
82 graphics::GLProgramFactory const&,
82 graphics::android::GLContext const&)83 graphics::android::GLContext const&)
83 {84 {
84 return std::unique_ptr<graphics::android::ConfigurableDisplayBuffer>(85 return std::unique_ptr<graphics::android::ConfigurableDisplayBuffer>(
8586
=== added file 'include/test/mir_test_doubles/stub_gl_program_factory.h'
--- include/test/mir_test_doubles/stub_gl_program_factory.h 1970-01-01 00:00:00 +0000
+++ include/test/mir_test_doubles/stub_gl_program_factory.h 2014-04-24 20:07:52 +0000
@@ -0,0 +1,43 @@
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#ifndef MIR_TEST_DOUBLES_STUB_GL_PROGRAM_FACTORY_H_
19#define MIR_TEST_DOUBLES_STUB_GL_PROGRAM_FACTORY_H_
20
21#include "mir/graphics/gl_program_factory.h"
22
23namespace mir
24{
25namespace test
26{
27namespace doubles
28{
29
30class StubGLProgramFactory : public graphics::GLProgramFactory
31{
32public:
33 std::unique_ptr<graphics::GLProgram> create_gl_program(std::string const&, std::string const&) const
34 {
35 return nullptr;
36 }
37};
38
39}
40}
41} // namespace mir
42
43#endif /* MIR_TEST_DOUBLES_STUB_GL_PROGRAM_FACTORY_H_ */
044
=== modified file 'src/platform/graphics/android/CMakeLists.txt'
--- src/platform/graphics/android/CMakeLists.txt 2014-04-15 05:31:19 +0000
+++ src/platform/graphics/android/CMakeLists.txt 2014-04-24 20:07:52 +0000
@@ -34,6 +34,7 @@
34 internal_client.cpp34 internal_client.cpp
35 gl_context.cpp35 gl_context.cpp
36 real_hwc_wrapper.cpp36 real_hwc_wrapper.cpp
37 overlay_gl_compositor.cpp
37)38)
3839
39set_target_properties(40set_target_properties(
4041
=== modified file 'src/platform/graphics/android/android_display.cpp'
--- src/platform/graphics/android/android_display.cpp 2014-04-15 05:31:19 +0000
+++ src/platform/graphics/android/android_display.cpp 2014-04-24 20:07:52 +0000
@@ -33,11 +33,12 @@
33namespace geom=mir::geometry;33namespace geom=mir::geometry;
3434
35mga::AndroidDisplay::AndroidDisplay(std::shared_ptr<mga::DisplayBuilder> const& display_builder,35mga::AndroidDisplay::AndroidDisplay(std::shared_ptr<mga::DisplayBuilder> const& display_builder,
36 std::shared_ptr<mg::GLProgramFactory> const& gl_program_factory,
36 std::shared_ptr<GLConfig> const& gl_config,37 std::shared_ptr<GLConfig> const& gl_config,
37 std::shared_ptr<DisplayReport> const& display_report)38 std::shared_ptr<DisplayReport> const& display_report)
38 : display_builder{display_builder},39 : display_builder{display_builder},
39 gl_context{display_builder->display_format(), *gl_config, *display_report},40 gl_context{display_builder->display_format(), *gl_config, *display_report},
40 display_buffer{display_builder->create_display_buffer(gl_context)}41 display_buffer{display_builder->create_display_buffer(*gl_program_factory, gl_context)}
41{42{
42 display_report->report_successful_setup_of_native_resources();43 display_report->report_successful_setup_of_native_resources();
4344
4445
=== modified file 'src/platform/graphics/android/android_display.h'
--- src/platform/graphics/android/android_display.h 2014-04-15 05:31:19 +0000
+++ src/platform/graphics/android/android_display.h 2014-04-24 20:07:52 +0000
@@ -32,6 +32,7 @@
3232
33class DisplayReport;33class DisplayReport;
34class GLConfig;34class GLConfig;
35class GLProgramFactory;
3536
36namespace android37namespace android
37{38{
@@ -43,6 +44,7 @@
43{44{
44public:45public:
45 explicit AndroidDisplay(std::shared_ptr<DisplayBuilder> const& display_builder,46 explicit AndroidDisplay(std::shared_ptr<DisplayBuilder> const& display_builder,
47 std::shared_ptr<GLProgramFactory> const& gl_program_factory,
46 std::shared_ptr<GLConfig> const& gl_config,48 std::shared_ptr<GLConfig> const& gl_config,
47 std::shared_ptr<DisplayReport> const& display_report);49 std::shared_ptr<DisplayReport> const& display_report);
4850
4951
=== modified file 'src/platform/graphics/android/android_platform.cpp'
--- src/platform/graphics/android/android_platform.cpp 2014-03-27 13:38:00 +0000
+++ src/platform/graphics/android/android_platform.cpp 2014-04-24 20:07:52 +0000
@@ -83,11 +83,12 @@
83}83}
8484
85std::shared_ptr<mg::Display> mga::AndroidPlatform::create_display(85std::shared_ptr<mg::Display> mga::AndroidPlatform::create_display(
86 std::shared_ptr<graphics::DisplayConfigurationPolicy> const&,86 std::shared_ptr<mg::DisplayConfigurationPolicy> const&,
87 std::shared_ptr<mg::GLProgramFactory> const& gl_program_factory,
87 std::shared_ptr<mg::GLConfig> const& gl_config)88 std::shared_ptr<mg::GLConfig> const& gl_config)
88{89{
89 return std::make_shared<mga::AndroidDisplay>(90 return std::make_shared<mga::AndroidDisplay>(
90 display_builder, gl_config, display_report);91 display_builder, gl_program_factory, gl_config, display_report);
91}92}
9293
93std::shared_ptr<mg::PlatformIPCPackage> mga::AndroidPlatform::get_ipc_package()94std::shared_ptr<mg::PlatformIPCPackage> mga::AndroidPlatform::get_ipc_package()
9495
=== modified file 'src/platform/graphics/android/android_platform.h'
--- src/platform/graphics/android/android_platform.h 2014-03-27 09:46:09 +0000
+++ src/platform/graphics/android/android_platform.h 2014-04-24 20:07:52 +0000
@@ -45,6 +45,7 @@
45 std::shared_ptr<BufferInitializer> const& buffer_initializer);45 std::shared_ptr<BufferInitializer> const& buffer_initializer);
46 std::shared_ptr<Display> create_display(46 std::shared_ptr<Display> create_display(
47 std::shared_ptr<graphics::DisplayConfigurationPolicy> const&,47 std::shared_ptr<graphics::DisplayConfigurationPolicy> const&,
48 std::shared_ptr<graphics::GLProgramFactory> const&,
48 std::shared_ptr<graphics::GLConfig> const& /*gl_config*/);49 std::shared_ptr<graphics::GLConfig> const& /*gl_config*/);
49 std::shared_ptr<PlatformIPCPackage> get_ipc_package();50 std::shared_ptr<PlatformIPCPackage> get_ipc_package();
50 std::shared_ptr<InternalClient> create_internal_client();51 std::shared_ptr<InternalClient> create_internal_client();
@@ -56,7 +57,6 @@
5657
57 void initialize(std::shared_ptr<NestedContext> const& nested_context) override;58 void initialize(std::shared_ptr<NestedContext> const& nested_context) override;
5859
59 // TODO a design that has this and create_buffer_allocator is missing simplicity
60 virtual std::shared_ptr<GraphicBufferAllocator> create_mga_buffer_allocator(60 virtual std::shared_ptr<GraphicBufferAllocator> create_mga_buffer_allocator(
61 const std::shared_ptr<BufferInitializer>& buffer_initializer);61 const std::shared_ptr<BufferInitializer>& buffer_initializer);
6262
6363
=== modified file 'src/platform/graphics/android/display_buffer.cpp'
--- src/platform/graphics/android/display_buffer.cpp 2014-04-15 05:31:19 +0000
+++ src/platform/graphics/android/display_buffer.cpp 2014-04-24 20:07:52 +0000
@@ -34,11 +34,13 @@
34 std::shared_ptr<FramebufferBundle> const& fb_bundle,34 std::shared_ptr<FramebufferBundle> const& fb_bundle,
35 std::shared_ptr<DisplayDevice> const& display_device,35 std::shared_ptr<DisplayDevice> const& display_device,
36 std::shared_ptr<ANativeWindow> const& native_window,36 std::shared_ptr<ANativeWindow> const& native_window,
37 mga::GLContext const& shared_gl_context)37 mga::GLContext const& shared_gl_context,
38 mg::GLProgramFactory const& program_factory)
38 : fb_bundle{fb_bundle},39 : fb_bundle{fb_bundle},
39 display_device{display_device},40 display_device{display_device},
40 native_window{native_window},41 native_window{native_window},
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())},
43 overlay_program{program_factory, gl_context},
42 current_configuration{44 current_configuration{
43 mg::DisplayConfigurationOutputId{1},45 mg::DisplayConfigurationOutputId{1},
44 mg::DisplayConfigurationCardId{0},46 mg::DisplayConfigurationCardId{0},
4547
=== modified file 'src/platform/graphics/android/display_buffer.h'
--- src/platform/graphics/android/display_buffer.h 2014-03-26 05:48:59 +0000
+++ src/platform/graphics/android/display_buffer.h 2014-04-24 20:07:52 +0000
@@ -21,8 +21,10 @@
2121
22#include "configurable_display_buffer.h"22#include "configurable_display_buffer.h"
23#include "mir/graphics/egl_resources.h"23#include "mir/graphics/egl_resources.h"
24#include "mir/graphics/gl_program_factory.h"
24#include "android_display_configuration.h"25#include "android_display_configuration.h"
25#include "gl_context.h"26#include "gl_context.h"
27#include "overlay_gl_compositor.h"
26#include <system/window.h>28#include <system/window.h>
2729
28namespace mir30namespace mir
@@ -41,7 +43,8 @@
41 DisplayBuffer(std::shared_ptr<FramebufferBundle> const& fb_bundle,43 DisplayBuffer(std::shared_ptr<FramebufferBundle> const& fb_bundle,
42 std::shared_ptr<DisplayDevice> const& display_device,44 std::shared_ptr<DisplayDevice> const& display_device,
43 std::shared_ptr<ANativeWindow> const& native_window,45 std::shared_ptr<ANativeWindow> const& native_window,
44 GLContext const& shared_gl_context);46 GLContext const& shared_gl_context,
47 GLProgramFactory const& program_factory);
4548
46 geometry::Rectangle view_area() const;49 geometry::Rectangle view_area() const;
47 void make_current();50 void make_current();
@@ -64,6 +67,7 @@
64 std::shared_ptr<DisplayDevice> const display_device;67 std::shared_ptr<DisplayDevice> const display_device;
65 std::shared_ptr<ANativeWindow> const native_window;68 std::shared_ptr<ANativeWindow> const native_window;
66 GLContext gl_context;69 GLContext gl_context;
70 OverlayGLProgram overlay_program;
67 bool prepared;71 bool prepared;
68 DisplayConfigurationOutput current_configuration;72 DisplayConfigurationOutput current_configuration;
69 MirOrientation rotation;73 MirOrientation rotation;
7074
=== modified file 'src/platform/graphics/android/display_builder.h'
--- src/platform/graphics/android/display_builder.h 2014-03-06 06:05:17 +0000
+++ src/platform/graphics/android/display_builder.h 2014-04-24 20:07:52 +0000
@@ -27,6 +27,7 @@
27{27{
28namespace graphics28namespace graphics
29{29{
30class GLProgramFactory;
30namespace android31namespace android
31{32{
32class GLContext;33class GLContext;
@@ -38,7 +39,7 @@
3839
39 virtual MirPixelFormat display_format() = 0;40 virtual MirPixelFormat display_format() = 0;
40 virtual std::unique_ptr<ConfigurableDisplayBuffer> create_display_buffer(41 virtual std::unique_ptr<ConfigurableDisplayBuffer> create_display_buffer(
41 GLContext const& gl_context) = 0;42 GLProgramFactory const& gl_program_factory, GLContext const& gl_context) = 0;
4243
43protected:44protected:
44 DisplayBuilder() = default;45 DisplayBuilder() = default;
4546
=== modified file 'src/platform/graphics/android/output_builder.cpp'
--- src/platform/graphics/android/output_builder.cpp 2014-03-06 06:05:17 +0000
+++ src/platform/graphics/android/output_builder.cpp 2014-04-24 20:07:52 +0000
@@ -64,6 +64,7 @@
64}64}
6565
66std::unique_ptr<mga::ConfigurableDisplayBuffer> mga::OutputBuilder::create_display_buffer(66std::unique_ptr<mga::ConfigurableDisplayBuffer> mga::OutputBuilder::create_display_buffer(
67 GLProgramFactory const& gl_program_factory,
67 GLContext const& gl_context)68 GLContext const& gl_context)
68{69{
69 std::shared_ptr<mga::DisplayDevice> device;70 std::shared_ptr<mga::DisplayDevice> device;
@@ -101,5 +102,5 @@
101102
102 auto native_window = res_factory->create_native_window(framebuffers);103 auto native_window = res_factory->create_native_window(framebuffers);
103 return std::unique_ptr<mga::DisplayBuffer>(104 return std::unique_ptr<mga::DisplayBuffer>(
104 new DisplayBuffer(framebuffers, device, native_window, gl_context));105 new DisplayBuffer(framebuffers, device, native_window, gl_context, gl_program_factory));
105}106}
106107
=== modified file 'src/platform/graphics/android/output_builder.h'
--- src/platform/graphics/android/output_builder.h 2014-03-11 13:44:57 +0000
+++ src/platform/graphics/android/output_builder.h 2014-04-24 20:07:52 +0000
@@ -45,6 +45,7 @@
4545
46 MirPixelFormat display_format();46 MirPixelFormat display_format();
47 std::unique_ptr<ConfigurableDisplayBuffer> create_display_buffer(47 std::unique_ptr<ConfigurableDisplayBuffer> create_display_buffer(
48 GLProgramFactory const& gl_program_factory,
48 GLContext const& gl_context);49 GLContext const& gl_context);
4950
50private:51private:
5152
=== added file 'src/platform/graphics/android/overlay_gl_compositor.cpp'
--- src/platform/graphics/android/overlay_gl_compositor.cpp 1970-01-01 00:00:00 +0000
+++ src/platform/graphics/android/overlay_gl_compositor.cpp 2014-04-24 20:07:52 +0000
@@ -0,0 +1,49 @@
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#include "mir/graphics/gl_program_factory.h"
20#include "mir/graphics/gl_context.h"
21#include "overlay_gl_compositor.h"
22
23namespace mg = mir::graphics;
24namespace mga = mir::graphics::android;
25namespace
26{
27std::string const vertex_shader
28{
29 "attribute vec4 position;\n"
30 "void main() {\n"
31 " gl_Position = position;\n"
32 "}\n"
33};
34
35std::string const fragment_shader
36{
37 "precision mediump float;\n"
38 "void main() {\n"
39 " gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0);\n"
40 "}\n"
41};
42}
43mga::OverlayGLProgram::OverlayGLProgram(
44 GLProgramFactory const& factory, GLContext const& context)
45{
46 context.make_current();
47 overlay_program = factory.create_gl_program(vertex_shader, fragment_shader);
48 context.release_current();
49}
050
=== added file 'src/platform/graphics/android/overlay_gl_compositor.h'
--- src/platform/graphics/android/overlay_gl_compositor.h 1970-01-01 00:00:00 +0000
+++ src/platform/graphics/android/overlay_gl_compositor.h 2014-04-24 20:07:52 +0000
@@ -0,0 +1,47 @@
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_ANDROID_OVERLAY_GL_PROGRAM_H_
20#define MIR_GRAPHICS_ANDROID_OVERLAY_GL_PROGRAM_H_
21
22#include "mir/graphics/gl_program.h"
23#include <memory>
24
25namespace mir
26{
27namespace graphics
28{
29class GLContext;
30class GLProgramFactory;
31
32namespace android
33{
34
35class OverlayGLProgram
36{
37public:
38 OverlayGLProgram(GLProgramFactory const& program_factory, graphics::GLContext const& gl_context);
39private:
40 std::unique_ptr<graphics::GLProgram> overlay_program;
41};
42
43}
44}
45}
46
47#endif /* MIR_GRAPHICS_ANDROID_OVERLAY_GL_PROGRAM_H_ */
048
=== modified file 'src/platform/graphics/mesa/platform.cpp'
--- src/platform/graphics/mesa/platform.cpp 2014-03-27 09:52:04 +0000
+++ src/platform/graphics/mesa/platform.cpp 2014-04-24 20:07:52 +0000
@@ -148,6 +148,7 @@
148148
149std::shared_ptr<mg::Display> mgm::Platform::create_display(149std::shared_ptr<mg::Display> mgm::Platform::create_display(
150 std::shared_ptr<DisplayConfigurationPolicy> const& initial_conf_policy,150 std::shared_ptr<DisplayConfigurationPolicy> const& initial_conf_policy,
151 std::shared_ptr<GLProgramFactory> const&,
151 std::shared_ptr<GLConfig> const& gl_config)152 std::shared_ptr<GLConfig> const& gl_config)
152{153{
153 return std::make_shared<mgm::Display>(154 return std::make_shared<mgm::Display>(
154155
=== modified file 'src/platform/graphics/mesa/platform.h'
--- src/platform/graphics/mesa/platform.h 2014-03-27 09:46:09 +0000
+++ src/platform/graphics/mesa/platform.h 2014-04-24 20:07:52 +0000
@@ -48,6 +48,7 @@
48 const std::shared_ptr<BufferInitializer>& buffer_initializer);48 const std::shared_ptr<BufferInitializer>& buffer_initializer);
49 std::shared_ptr<graphics::Display> create_display(49 std::shared_ptr<graphics::Display> create_display(
50 std::shared_ptr<DisplayConfigurationPolicy> const& initial_conf_policy,50 std::shared_ptr<DisplayConfigurationPolicy> const& initial_conf_policy,
51 std::shared_ptr<GLProgramFactory> const& program_factory,
51 std::shared_ptr<GLConfig> const& gl_config);52 std::shared_ptr<GLConfig> const& gl_config);
52 std::shared_ptr<PlatformIPCPackage> get_ipc_package();53 std::shared_ptr<PlatformIPCPackage> get_ipc_package();
53 std::shared_ptr<InternalClient> create_internal_client();54 std::shared_ptr<InternalClient> create_internal_client();
5455
=== modified file 'src/server/graphics/default_configuration.cpp'
--- src/server/graphics/default_configuration.cpp 2014-04-23 15:24:13 +0000
+++ src/server/graphics/default_configuration.cpp 2014-04-24 20:07:52 +0000
@@ -110,6 +110,7 @@
110 {110 {
111 return the_graphics_platform()->create_display(111 return the_graphics_platform()->create_display(
112 the_display_configuration_policy(),112 the_display_configuration_policy(),
113 the_gl_program_factory(),
113 the_gl_config());114 the_gl_config());
114 }115 }
115 });116 });
116117
=== modified file 'src/server/graphics/nested/nested_platform.cpp'
--- src/server/graphics/nested/nested_platform.cpp 2014-04-17 11:04:41 +0000
+++ src/server/graphics/nested/nested_platform.cpp 2014-04-24 20:07:52 +0000
@@ -82,6 +82,7 @@
8282
83std::shared_ptr<mg::Display> mgn::NestedPlatform::create_display(83std::shared_ptr<mg::Display> mgn::NestedPlatform::create_display(
84 std::shared_ptr<mg::DisplayConfigurationPolicy> const& conf_policy,84 std::shared_ptr<mg::DisplayConfigurationPolicy> const& conf_policy,
85 std::shared_ptr<mg::GLProgramFactory> const&,
85 std::shared_ptr<mg::GLConfig> const& gl_config)86 std::shared_ptr<mg::GLConfig> const& gl_config)
86{87{
87 return std::make_shared<mgn::NestedDisplay>(88 return std::make_shared<mgn::NestedDisplay>(
8889
=== modified file 'src/server/graphics/nested/nested_platform.h'
--- src/server/graphics/nested/nested_platform.h 2014-03-27 09:46:09 +0000
+++ src/server/graphics/nested/nested_platform.h 2014-04-24 20:07:52 +0000
@@ -45,6 +45,7 @@
45 std::shared_ptr<BufferInitializer> const& buffer_initializer) override;45 std::shared_ptr<BufferInitializer> const& buffer_initializer) override;
46 std::shared_ptr<Display> create_display(46 std::shared_ptr<Display> create_display(
47 std::shared_ptr<DisplayConfigurationPolicy> const& initial_conf_policy,47 std::shared_ptr<DisplayConfigurationPolicy> const& initial_conf_policy,
48 std::shared_ptr<GLProgramFactory> const& gl_program_factory,
48 std::shared_ptr<GLConfig> const& gl_config);49 std::shared_ptr<GLConfig> const& gl_config);
49 std::shared_ptr<PlatformIPCPackage> get_ipc_package() override;50 std::shared_ptr<PlatformIPCPackage> get_ipc_package() override;
50 std::shared_ptr<InternalClient> create_internal_client() override;51 std::shared_ptr<InternalClient> create_internal_client() override;
5152
=== modified file 'tests/acceptance-tests/test_display_configuration.cpp'
--- tests/acceptance-tests/test_display_configuration.cpp 2014-03-27 09:52:04 +0000
+++ tests/acceptance-tests/test_display_configuration.cpp 2014-04-24 20:07:52 +0000
@@ -145,6 +145,7 @@
145145
146 std::shared_ptr<mg::Display> create_display(146 std::shared_ptr<mg::Display> create_display(
147 std::shared_ptr<mg::DisplayConfigurationPolicy> const&,147 std::shared_ptr<mg::DisplayConfigurationPolicy> const&,
148 std::shared_ptr<mg::GLProgramFactory> const&,
148 std::shared_ptr<mg::GLConfig> const&) override149 std::shared_ptr<mg::GLConfig> const&) override
149 {150 {
150 return mt::fake_shared(mock_display);151 return mt::fake_shared(mock_display);
151152
=== modified file 'tests/acceptance-tests/test_surfaces_with_output_id.cpp'
--- tests/acceptance-tests/test_surfaces_with_output_id.cpp 2014-04-15 05:31:19 +0000
+++ tests/acceptance-tests/test_surfaces_with_output_id.cpp 2014-04-24 20:07:52 +0000
@@ -89,6 +89,7 @@
8989
90 std::shared_ptr<mg::Display> create_display(90 std::shared_ptr<mg::Display> create_display(
91 std::shared_ptr<mg::DisplayConfigurationPolicy> const&,91 std::shared_ptr<mg::DisplayConfigurationPolicy> const&,
92 std::shared_ptr<mg::GLProgramFactory> const&,
92 std::shared_ptr<mg::GLConfig> const&) override93 std::shared_ptr<mg::GLConfig> const&) override
93 {94 {
94 return std::make_shared<StubDisplay>(display_rects());95 return std::make_shared<StubDisplay>(display_rects());
9596
=== modified file 'tests/integration-tests/graphics/android/test_display_integration.cpp'
--- tests/integration-tests/graphics/android/test_display_integration.cpp 2014-03-27 13:38:00 +0000
+++ tests/integration-tests/graphics/android/test_display_integration.cpp 2014-04-24 20:07:52 +0000
@@ -22,6 +22,7 @@
22#include "src/platform/graphics/android/resource_factory.h"22#include "src/platform/graphics/android/resource_factory.h"
23#include "src/platform/graphics/android/android_graphic_buffer_allocator.h"23#include "src/platform/graphics/android/android_graphic_buffer_allocator.h"
24#include "src/platform/graphics/android/output_builder.h"24#include "src/platform/graphics/android/output_builder.h"
25#include "src/server/graphics/program_factory.h"
25#include "src/server/report/null_report_factory.h"26#include "src/server/report/null_report_factory.h"
2627
27#include "examples/graphics.h"28#include "examples/graphics.h"
@@ -78,7 +79,8 @@
78 auto display_buffer_factory = std::make_shared<mga::OutputBuilder>(79 auto display_buffer_factory = std::make_shared<mga::OutputBuilder>(
79 fb_allocator, display_resource_factory, null_display_report);80 fb_allocator, display_resource_factory, null_display_report);
8081
81 mga::AndroidDisplay display{display_buffer_factory, stub_gl_config, null_display_report};82 auto program_factory = std::make_shared<mg::ProgramFactory>();
83 mga::AndroidDisplay display{display_buffer_factory, program_factory, stub_gl_config, null_display_report};
8284
83 display.for_each_display_buffer([this](mg::DisplayBuffer& buffer)85 display.for_each_display_buffer([this](mg::DisplayBuffer& buffer)
84 {86 {
8587
=== modified file 'tests/integration-tests/graphics/mesa/test_buffer_integration.cpp'
--- tests/integration-tests/graphics/mesa/test_buffer_integration.cpp 2014-03-27 09:46:09 +0000
+++ tests/integration-tests/graphics/mesa/test_buffer_integration.cpp 2014-04-24 20:07:52 +0000
@@ -26,6 +26,7 @@
26#include "mir_test_doubles/stub_buffer_allocator.h"26#include "mir_test_doubles/stub_buffer_allocator.h"
27#include "mir_test_doubles/null_platform.h"27#include "mir_test_doubles/null_platform.h"
28#include "mir_test_doubles/stub_gl_config.h"28#include "mir_test_doubles/stub_gl_config.h"
29#include "mir_test_doubles/stub_gl_program_factory.h"
29#include "src/server/graphics/default_display_configuration_policy.h"30#include "src/server/graphics/default_display_configuration_policy.h"
30#include "src/server/report/null_report_factory.h"31#include "src/server/report/null_report_factory.h"
3132
@@ -105,6 +106,7 @@
105 auto conf_policy = std::make_shared<mg::DefaultDisplayConfigurationPolicy>();106 auto conf_policy = std::make_shared<mg::DefaultDisplayConfigurationPolicy>();
106 display = platform->create_display(107 display = platform->create_display(
107 conf_policy,108 conf_policy,
109 std::make_shared<mtd::StubGLProgramFactory>(),
108 std::make_shared<mtd::StubGLConfig>());110 std::make_shared<mtd::StubGLConfig>());
109 auto buffer_initializer = std::make_shared<mg::NullBufferInitializer>();111 auto buffer_initializer = std::make_shared<mg::NullBufferInitializer>();
110 allocator = platform->create_buffer_allocator(buffer_initializer);112 allocator = platform->create_buffer_allocator(buffer_initializer);
111113
=== modified file 'tests/integration-tests/test_display_info.cpp'
--- tests/integration-tests/test_display_info.cpp 2014-03-27 09:46:09 +0000
+++ tests/integration-tests/test_display_info.cpp 2014-04-24 20:07:52 +0000
@@ -118,6 +118,7 @@
118118
119 std::shared_ptr<mg::Display> create_display(119 std::shared_ptr<mg::Display> create_display(
120 std::shared_ptr<mg::DisplayConfigurationPolicy> const&,120 std::shared_ptr<mg::DisplayConfigurationPolicy> const&,
121 std::shared_ptr<mg::GLProgramFactory> const&,
121 std::shared_ptr<mg::GLConfig> const&) override122 std::shared_ptr<mg::GLConfig> const&) override
122 {123 {
123 if (!display)124 if (!display)
124125
=== modified file 'tests/integration-tests/test_surfaceloop.cpp'
--- tests/integration-tests/test_surfaceloop.cpp 2014-03-27 09:46:09 +0000
+++ tests/integration-tests/test_surfaceloop.cpp 2014-04-24 20:07:52 +0000
@@ -249,6 +249,7 @@
249249
250 std::shared_ptr<mg::Display> create_display(250 std::shared_ptr<mg::Display> create_display(
251 std::shared_ptr<mg::DisplayConfigurationPolicy> const&,251 std::shared_ptr<mg::DisplayConfigurationPolicy> const&,
252 std::shared_ptr<mg::GLProgramFactory> const&,
252 std::shared_ptr<mg::GLConfig> const&) override253 std::shared_ptr<mg::GLConfig> const&) override
253 {254 {
254 return std::make_shared<StubDisplay>();255 return std::make_shared<StubDisplay>();
@@ -365,6 +366,7 @@
365366
366 std::shared_ptr<mg::Display> create_display(367 std::shared_ptr<mg::Display> create_display(
367 std::shared_ptr<mg::DisplayConfigurationPolicy> const&,368 std::shared_ptr<mg::DisplayConfigurationPolicy> const&,
369 std::shared_ptr<mg::GLProgramFactory> const&,
368 std::shared_ptr<mg::GLConfig> const&) override370 std::shared_ptr<mg::GLConfig> const&) override
369 {371 {
370 return std::make_shared<StubDisplay>();372 return std::make_shared<StubDisplay>();
371373
=== modified file 'tests/mir_test_framework/stubbed_server_configuration.cpp'
--- tests/mir_test_framework/stubbed_server_configuration.cpp 2014-03-27 09:46:09 +0000
+++ tests/mir_test_framework/stubbed_server_configuration.cpp 2014-04-24 20:07:52 +0000
@@ -200,6 +200,7 @@
200200
201 std::shared_ptr<mg::Display> create_display(201 std::shared_ptr<mg::Display> create_display(
202 std::shared_ptr<mg::DisplayConfigurationPolicy> const&,202 std::shared_ptr<mg::DisplayConfigurationPolicy> const&,
203 std::shared_ptr<mg::GLProgramFactory> const&,
203 std::shared_ptr<mg::GLConfig> const&) override204 std::shared_ptr<mg::GLConfig> const&) override
204 {205 {
205 return std::make_shared<StubDisplay>();206 return std::make_shared<StubDisplay>();
206207
=== modified file 'tests/unit-tests/frontend/test_session_mediator.cpp'
--- tests/unit-tests/frontend/test_session_mediator.cpp 2014-04-15 05:31:19 +0000
+++ tests/unit-tests/frontend/test_session_mediator.cpp 2014-04-24 20:07:52 +0000
@@ -168,16 +168,17 @@
168 using namespace testing;168 using namespace testing;
169 ON_CALL(*this, create_buffer_allocator(_))169 ON_CALL(*this, create_buffer_allocator(_))
170 .WillByDefault(Return(std::shared_ptr<mg::GraphicBufferAllocator>()));170 .WillByDefault(Return(std::shared_ptr<mg::GraphicBufferAllocator>()));
171 ON_CALL(*this, create_display(_,_))171 ON_CALL(*this, create_display(_,_,_))
172 .WillByDefault(Return(std::make_shared<mtd::NullDisplay>()));172 .WillByDefault(Return(std::make_shared<mtd::NullDisplay>()));
173 ON_CALL(*this, get_ipc_package())173 ON_CALL(*this, get_ipc_package())
174 .WillByDefault(Return(std::make_shared<mg::PlatformIPCPackage>()));174 .WillByDefault(Return(std::make_shared<mg::PlatformIPCPackage>()));
175 }175 }
176176
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&));
178 MOCK_METHOD2(create_display,178 MOCK_METHOD3(create_display,
179 std::shared_ptr<mg::Display>(179 std::shared_ptr<mg::Display>(
180 std::shared_ptr<mg::DisplayConfigurationPolicy> const&,180 std::shared_ptr<mg::DisplayConfigurationPolicy> const&,
181 std::shared_ptr<mg::GLProgramFactory> const&,
181 std::shared_ptr<mg::GLConfig> const&));182 std::shared_ptr<mg::GLConfig> const&));
182 MOCK_METHOD0(get_ipc_package, std::shared_ptr<mg::PlatformIPCPackage>());183 MOCK_METHOD0(get_ipc_package, std::shared_ptr<mg::PlatformIPCPackage>());
183 MOCK_METHOD0(create_internal_client, std::shared_ptr<mg::InternalClient>());184 MOCK_METHOD0(create_internal_client, std::shared_ptr<mg::InternalClient>());
184185
=== modified file 'tests/unit-tests/graphics/android/CMakeLists.txt'
--- tests/unit-tests/graphics/android/CMakeLists.txt 2014-03-26 05:48:59 +0000
+++ tests/unit-tests/graphics/android/CMakeLists.txt 2014-04-24 20:07:52 +0000
@@ -26,6 +26,7 @@
26 ${CMAKE_CURRENT_SOURCE_DIR}/test_external_refcount.cpp26 ${CMAKE_CURRENT_SOURCE_DIR}/test_external_refcount.cpp
27 ${CMAKE_CURRENT_SOURCE_DIR}/test_output_builder.cpp27 ${CMAKE_CURRENT_SOURCE_DIR}/test_output_builder.cpp
28 ${CMAKE_CURRENT_SOURCE_DIR}/test_hwc_wrapper.cpp28 ${CMAKE_CURRENT_SOURCE_DIR}/test_hwc_wrapper.cpp
29 ${CMAKE_CURRENT_SOURCE_DIR}/test_overlay_compositor.cpp
29)30)
3031
31set(UNIT_TEST_SOURCES ${UNIT_TEST_SOURCES} PARENT_SCOPE)32set(UNIT_TEST_SOURCES ${UNIT_TEST_SOURCES} PARENT_SCOPE)
3233
=== modified file 'tests/unit-tests/graphics/android/test_android_fb.cpp'
--- tests/unit-tests/graphics/android/test_android_fb.cpp 2014-03-27 13:38:00 +0000
+++ tests/unit-tests/graphics/android/test_android_fb.cpp 2014-04-24 20:07:52 +0000
@@ -28,6 +28,7 @@
28#include "mir_test_doubles/stub_display_builder.h"28#include "mir_test_doubles/stub_display_builder.h"
29#include "mir_test_doubles/stub_gl_config.h"29#include "mir_test_doubles/stub_gl_config.h"
30#include "mir_test_doubles/mock_gl_config.h"30#include "mir_test_doubles/mock_gl_config.h"
31#include "mir_test_doubles/stub_gl_program_factory.h"
31#include "mir/graphics/android/mir_native_window.h"32#include "mir/graphics/android/mir_native_window.h"
32#include "mir_test_doubles/stub_driver_interpreter.h"33#include "mir_test_doubles/stub_driver_interpreter.h"
3334
@@ -51,7 +52,8 @@
51 dummy_config{mock_egl.fake_configs[0]},52 dummy_config{mock_egl.fake_configs[0]},
52 null_display_report{mir::report::null_display_report()},53 null_display_report{mir::report::null_display_report()},
53 stub_db_factory{std::make_shared<mtd::StubDisplayBuilder>()},54 stub_db_factory{std::make_shared<mtd::StubDisplayBuilder>()},
54 stub_gl_config{std::make_shared<mtd::StubGLConfig>()}55 stub_gl_config{std::make_shared<mtd::StubGLConfig>()},
56 stub_gl_program_factory{std::make_shared<mtd::StubGLProgramFactory>()}
55 {57 {
56 }58 }
5759
@@ -64,6 +66,7 @@
64 std::shared_ptr<mg::DisplayReport> const null_display_report;66 std::shared_ptr<mg::DisplayReport> const null_display_report;
65 std::shared_ptr<mtd::StubDisplayBuilder> const stub_db_factory;67 std::shared_ptr<mtd::StubDisplayBuilder> const stub_db_factory;
66 std::shared_ptr<mtd::StubGLConfig> const stub_gl_config;68 std::shared_ptr<mtd::StubGLConfig> const stub_gl_config;
69 std::shared_ptr<mtd::StubGLProgramFactory> const stub_gl_program_factory;
67};70};
6871
69TEST_F(AndroidDisplay, creation_creates_egl_resources_properly)72TEST_F(AndroidDisplay, creation_creates_egl_resources_properly)
@@ -104,7 +107,11 @@
104 EXPECT_CALL(mock_egl, eglTerminate(dummy_display))107 EXPECT_CALL(mock_egl, eglTerminate(dummy_display))
105 .Times(1);108 .Times(1);
106109
107 mga::AndroidDisplay display(stub_db_factory, stub_gl_config, null_display_report);110 mga::AndroidDisplay display(
111 stub_db_factory,
112 stub_gl_program_factory,
113 stub_gl_config,
114 null_display_report);
108}115}
109116
110TEST_F(AndroidDisplay, selects_usable_configuration)117TEST_F(AndroidDisplay, selects_usable_configuration)
@@ -148,7 +155,11 @@
148 .Times(1)155 .Times(1)
149 .WillOnce(Invoke(config_filler));156 .WillOnce(Invoke(config_filler));
150157
151 mga::AndroidDisplay display(stub_db_factory, stub_gl_config, null_display_report);158 mga::AndroidDisplay display(
159 stub_db_factory,
160 stub_gl_program_factory,
161 stub_gl_config,
162 null_display_report);
152 EXPECT_EQ(correct_config, selected_config);163 EXPECT_EQ(correct_config, selected_config);
153}164}
154165
@@ -172,7 +183,11 @@
172 mtd::EGLConfigContainsAttrib(EGL_STENCIL_SIZE, stencil_bits)),183 mtd::EGLConfigContainsAttrib(EGL_STENCIL_SIZE, stencil_bits)),
173 _,_,_));184 _,_,_));
174185
175 mga::AndroidDisplay display(stub_db_factory, mock_gl_config, null_display_report);186 mga::AndroidDisplay display(
187 stub_db_factory,
188 stub_gl_program_factory,
189 mock_gl_config,
190 null_display_report);
176}191}
177192
178TEST_F(AndroidDisplay, logs_creation_events)193TEST_F(AndroidDisplay, logs_creation_events)
@@ -190,7 +205,11 @@
190 EXPECT_CALL(*mock_display_report, report_successful_display_construction())205 EXPECT_CALL(*mock_display_report, report_successful_display_construction())
191 .Times(1);206 .Times(1);
192207
193 mga::AndroidDisplay display(stub_db_factory, stub_gl_config, mock_display_report);208 mga::AndroidDisplay display(
209 stub_db_factory,
210 stub_gl_program_factory,
211 stub_gl_config,
212 mock_display_report);
194}213}
195214
196TEST_F(AndroidDisplay, throws_on_eglMakeCurrent_failure)215TEST_F(AndroidDisplay, throws_on_eglMakeCurrent_failure)
@@ -210,7 +229,11 @@
210 .Times(0);229 .Times(0);
211230
212 EXPECT_THROW({231 EXPECT_THROW({
213 mga::AndroidDisplay display(stub_db_factory, stub_gl_config, mock_display_report);232 mga::AndroidDisplay display(
233 stub_db_factory,
234 stub_gl_program_factory,
235 stub_gl_config,
236 mock_display_report);
214 }, std::runtime_error);237 }, std::runtime_error);
215}238}
216239
@@ -232,14 +255,22 @@
232 .WillOnce(Return(EGL_NO_SURFACE));255 .WillOnce(Return(EGL_NO_SURFACE));
233256
234 EXPECT_THROW({257 EXPECT_THROW({
235 mga::AndroidDisplay display(stub_db_factory, stub_gl_config, mock_display_report);258 mga::AndroidDisplay display(
259 stub_db_factory,
260 stub_gl_program_factory,
261 stub_gl_config,
262 mock_display_report);
236 }, std::runtime_error);263 }, std::runtime_error);
237}264}
238265
239TEST_F(AndroidDisplay, configures_display_buffer)266TEST_F(AndroidDisplay, configures_display_buffer)
240{267{
241 using namespace testing;268 using namespace testing;
242 mga::AndroidDisplay display(stub_db_factory, stub_gl_config, null_display_report);269 mga::AndroidDisplay display(
270 stub_db_factory,
271 stub_gl_program_factory,
272 stub_gl_config,
273 null_display_report);
243274
244 auto configuration = display.configuration();275 auto configuration = display.configuration();
245 configuration->for_each_output([&](mg::UserDisplayConfigurationOutput& output)276 configuration->for_each_output([&](mg::UserDisplayConfigurationOutput& output)
@@ -270,7 +301,11 @@
270//we only have single display and single mode on android for the time being301//we only have single display and single mode on android for the time being
271TEST_F(AndroidDisplay, supports_one_output_configuration)302TEST_F(AndroidDisplay, supports_one_output_configuration)
272{303{
273 mga::AndroidDisplay display(stub_db_factory, stub_gl_config, null_display_report);304 mga::AndroidDisplay display(
305 stub_db_factory,
306 stub_gl_program_factory,
307 stub_gl_config,
308 null_display_report);
274 auto config = display.configuration();309 auto config = display.configuration();
275310
276 size_t num_configs = 0;311 size_t num_configs = 0;
277312
=== modified file 'tests/unit-tests/graphics/android/test_hwc_display.cpp'
--- tests/unit-tests/graphics/android/test_hwc_display.cpp 2014-04-15 05:31:19 +0000
+++ tests/unit-tests/graphics/android/test_hwc_display.cpp 2014-04-24 20:07:52 +0000
@@ -30,6 +30,7 @@
30#include "mir_test_doubles/stub_buffer.h"30#include "mir_test_doubles/stub_buffer.h"
31#include "mir_test_doubles/stub_gl_config.h"31#include "mir_test_doubles/stub_gl_config.h"
32#include "mir_test_doubles/mock_framebuffer_bundle.h"32#include "mir_test_doubles/mock_framebuffer_bundle.h"
33#include "mir_test_doubles/stub_gl_program_factory.h"
33#include <memory>34#include <memory>
3435
35namespace geom=mir::geometry;36namespace geom=mir::geometry;
@@ -67,6 +68,7 @@
67 }68 }
6869
69 testing::NiceMock<mtd::MockEGL> mock_egl;70 testing::NiceMock<mtd::MockEGL> mock_egl;
71 mtd::StubGLProgramFactory stub_program_factory;
7072
71 int visual_id;73 int visual_id;
72 EGLConfig dummy_config;74 EGLConfig dummy_config;
@@ -96,7 +98,8 @@
96 .Times(1);98 .Times(1);
9799
98 std::list<std::shared_ptr<mg::Renderable>> renderlist{};100 std::list<std::shared_ptr<mg::Renderable>> renderlist{};
99 mga::DisplayBuffer db(mock_fb_bundle, mock_display_device, native_window, *gl_context);101 mga::DisplayBuffer db(
102 mock_fb_bundle, mock_display_device, native_window, *gl_context, stub_program_factory);
100 db.post_update();103 db.post_update();
101}104}
102105
@@ -104,7 +107,8 @@
104{107{
105 using namespace testing;108 using namespace testing;
106109
107 mga::DisplayBuffer db(mock_fb_bundle, mock_display_device, native_window, *gl_context);110 mga::DisplayBuffer db(
111 mock_fb_bundle, mock_display_device, native_window, *gl_context, stub_program_factory);
108112
109 InSequence seq;113 InSequence seq;
110 EXPECT_CALL(*mock_display_device, render_gl(_))114 EXPECT_CALL(*mock_display_device, render_gl(_))
@@ -137,22 +141,23 @@
137 EXPECT_CALL(*mock_display_device, post(Ref(*stub_buffer)))141 EXPECT_CALL(*mock_display_device, post(Ref(*stub_buffer)))
138 .Times(1);142 .Times(1);
139143
140 mga::DisplayBuffer db(mock_fb_bundle, mock_display_device, native_window, *gl_context);144 mga::DisplayBuffer db(
145 mock_fb_bundle, mock_display_device, native_window, *gl_context, stub_program_factory);
141 db.render_and_post_update(renderlist, render_fn); 146 db.render_and_post_update(renderlist, render_fn);
142}147}
143148
144TEST_F(AndroidDisplayBuffer, defaults_to_normal_orientation)149TEST_F(AndroidDisplayBuffer, defaults_to_normal_orientation)
145{150{
146 mga::DisplayBuffer db(mock_fb_bundle, mock_display_device, native_window,151 mga::DisplayBuffer db(
147 *gl_context);152 mock_fb_bundle, mock_display_device, native_window, *gl_context, stub_program_factory);
148153
149 EXPECT_EQ(mir_orientation_normal, db.orientation());154 EXPECT_EQ(mir_orientation_normal, db.orientation());
150}155}
151156
152TEST_F(AndroidDisplayBuffer, orientation_is_passed_through)157TEST_F(AndroidDisplayBuffer, orientation_is_passed_through)
153{158{
154 mga::DisplayBuffer db(mock_fb_bundle, mock_display_device, native_window,159 mga::DisplayBuffer db(
155 *gl_context);160 mock_fb_bundle, mock_display_device, native_window, *gl_context, stub_program_factory);
156161
157 for (auto const& ori : {mir_orientation_normal,162 for (auto const& ori : {mir_orientation_normal,
158 mir_orientation_left,163 mir_orientation_left,
@@ -178,8 +183,8 @@
178 EXPECT_CALL(*mock_fb_bundle, fb_size())183 EXPECT_CALL(*mock_fb_bundle, fb_size())
179 .WillRepeatedly(Return(normal));184 .WillRepeatedly(Return(normal));
180185
181 mga::DisplayBuffer db(mock_fb_bundle, mock_display_device, native_window,186 mga::DisplayBuffer db(
182 *gl_context);187 mock_fb_bundle, mock_display_device, native_window, *gl_context, stub_program_factory);
183188
184 EXPECT_EQ(normal, db.view_area().size);189 EXPECT_EQ(normal, db.view_area().size);
185190
@@ -202,7 +207,8 @@
202{207{
203 using namespace testing;208 using namespace testing;
204209
205 mga::DisplayBuffer db(mock_fb_bundle, mock_display_device, native_window, *gl_context);210 mga::DisplayBuffer db(
211 mock_fb_bundle, mock_display_device, native_window, *gl_context, stub_program_factory);
206212
207 auto view_area = db.view_area();213 auto view_area = db.view_area();
208214
@@ -230,7 +236,8 @@
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))
231 .Times(AtLeast(1));237 .Times(AtLeast(1));
232238
233 mga::DisplayBuffer db(mock_fb_bundle, mock_display_device, native_window, *gl_context);239 mga::DisplayBuffer db(
240 mock_fb_bundle, mock_display_device, native_window, *gl_context, stub_program_factory);
234 testing::Mock::VerifyAndClearExpectations(&mock_egl);241 testing::Mock::VerifyAndClearExpectations(&mock_egl);
235}242}
236243
@@ -247,12 +254,14 @@
247254
248 EXPECT_THROW(255 EXPECT_THROW(
249 {256 {
250 mga::DisplayBuffer db(mock_fb_bundle, mock_display_device, native_window, *gl_context);257 mga::DisplayBuffer db(
258 mock_fb_bundle, mock_display_device, native_window, *gl_context, stub_program_factory);
251 }, std::runtime_error);259 }, std::runtime_error);
252260
253 EXPECT_THROW(261 EXPECT_THROW(
254 {262 {
255 mga::DisplayBuffer db(mock_fb_bundle, mock_display_device, native_window, *gl_context);263 mga::DisplayBuffer db(
264 mock_fb_bundle, mock_display_device, native_window, *gl_context, stub_program_factory);
256 }, std::runtime_error);265 }, std::runtime_error);
257}266}
258267
@@ -261,20 +270,19 @@
261 using namespace testing;270 using namespace testing;
262 EGLContext fake_ctxt = reinterpret_cast<EGLContext>(0x4422);271 EGLContext fake_ctxt = reinterpret_cast<EGLContext>(0x4422);
263 EGLSurface fake_surf = reinterpret_cast<EGLSurface>(0x33984);272 EGLSurface fake_surf = reinterpret_cast<EGLSurface>(0x33984);
264273 ON_CALL(mock_egl, eglCreateContext(_,_,_,_))
265 EXPECT_CALL(mock_egl, eglCreateContext(_,_,_,_))274 .WillByDefault(Return(fake_ctxt));
266 .Times(1)275 ON_CALL(mock_egl, eglCreateWindowSurface(_,_,_,_))
267 .WillOnce(Return(fake_ctxt));276 .WillByDefault(Return(fake_surf));
268 EXPECT_CALL(mock_egl, eglCreateWindowSurface(_,_,_,_))277
269 .Times(1)278 mga::DisplayBuffer db(
270 .WillOnce(Return(fake_surf));279 mock_fb_bundle, mock_display_device, native_window, *gl_context, stub_program_factory);
271280
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))
273 .Times(2)282 .Times(2)
274 .WillOnce(Return(EGL_TRUE))283 .WillOnce(Return(EGL_TRUE))
275 .WillOnce(Return(EGL_FALSE));284 .WillOnce(Return(EGL_FALSE));
276285
277 mga::DisplayBuffer db(mock_fb_bundle, mock_display_device, native_window, *gl_context);
278 db.make_current();286 db.make_current();
279 EXPECT_THROW(287 EXPECT_THROW(
280 {288 {
@@ -285,18 +293,19 @@
285TEST_F(AndroidDisplayBuffer, release_current)293TEST_F(AndroidDisplayBuffer, release_current)
286{294{
287 using namespace testing;295 using namespace testing;
296 mga::DisplayBuffer db(
297 mock_fb_bundle, mock_display_device, native_window, *gl_context, stub_program_factory);
288298
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))
290 .Times(1);300 .Times(1);
291
292 mga::DisplayBuffer db(mock_fb_bundle, mock_display_device, native_window, *gl_context);
293 db.release_current();301 db.release_current();
294}302}
295303
296TEST_F(AndroidDisplayBuffer, sets_display_power_mode_to_on_at_start)304TEST_F(AndroidDisplayBuffer, sets_display_power_mode_to_on_at_start)
297{305{
298 using namespace testing;306 using namespace testing;
299 mga::DisplayBuffer db(mock_fb_bundle, mock_display_device, native_window, *gl_context);307 mga::DisplayBuffer db(
308 mock_fb_bundle, mock_display_device, native_window, *gl_context, stub_program_factory);
300 auto config = db.configuration();309 auto config = db.configuration();
301 EXPECT_EQ(mir_power_mode_on, config.power_mode);310 EXPECT_EQ(mir_power_mode_on, config.power_mode);
302}311}
@@ -304,7 +313,8 @@
304TEST_F(AndroidDisplayBuffer, changes_display_power_mode)313TEST_F(AndroidDisplayBuffer, changes_display_power_mode)
305{314{
306 using namespace testing;315 using namespace testing;
307 mga::DisplayBuffer db(mock_fb_bundle, mock_display_device, native_window, *gl_context);316 mga::DisplayBuffer db(
317 mock_fb_bundle, mock_display_device, native_window, *gl_context, stub_program_factory);
308318
309 Sequence seq;319 Sequence seq;
310 EXPECT_CALL(*mock_display_device, mode(mir_power_mode_off))320 EXPECT_CALL(*mock_display_device, mode(mir_power_mode_off))
@@ -324,7 +334,8 @@
324TEST_F(AndroidDisplayBuffer, disregards_double_display_power_mode_request)334TEST_F(AndroidDisplayBuffer, disregards_double_display_power_mode_request)
325{335{
326 using namespace testing;336 using namespace testing;
327 mga::DisplayBuffer db(mock_fb_bundle, mock_display_device, native_window, *gl_context);337 mga::DisplayBuffer db(
338 mock_fb_bundle, mock_display_device, native_window, *gl_context, stub_program_factory);
328339
329 EXPECT_CALL(*mock_display_device, mode(mir_power_mode_off))340 EXPECT_CALL(*mock_display_device, mode(mir_power_mode_off))
330 .Times(1);341 .Times(1);
@@ -347,7 +358,8 @@
347 .Times(1)358 .Times(1)
348 .WillOnce(Return(true));359 .WillOnce(Return(true));
349360
350 mga::DisplayBuffer db(mock_fb_bundle, mock_display_device, native_window, *gl_context);361 mga::DisplayBuffer db(
362 mock_fb_bundle, mock_display_device, native_window, *gl_context, stub_program_factory);
351363
352 auto config = db.configuration();364 auto config = db.configuration();
353 config.orientation = mir_orientation_left;365 config.orientation = mir_orientation_left;
@@ -364,7 +376,8 @@
364 .Times(1)376 .Times(1)
365 .WillOnce(Return(false));377 .WillOnce(Return(false));
366378
367 mga::DisplayBuffer db(mock_fb_bundle, mock_display_device, native_window, *gl_context);379 mga::DisplayBuffer db(
380 mock_fb_bundle, mock_display_device, native_window, *gl_context, stub_program_factory);
368381
369 auto config = db.configuration();382 auto config = db.configuration();
370 config.orientation = mir_orientation_left;383 config.orientation = mir_orientation_left;
@@ -376,7 +389,8 @@
376389
377TEST_F(AndroidDisplayBuffer, incorrect_display_configure_throws)390TEST_F(AndroidDisplayBuffer, incorrect_display_configure_throws)
378{391{
379 mga::DisplayBuffer db(mock_fb_bundle, mock_display_device, native_window, *gl_context);392 mga::DisplayBuffer db(
393 mock_fb_bundle, mock_display_device, native_window, *gl_context, stub_program_factory);
380 auto config = db.configuration();394 auto config = db.configuration();
381 //error395 //error
382 config.current_format = mir_pixel_format_invalid;396 config.current_format = mir_pixel_format_invalid;
@@ -387,7 +401,8 @@
387401
388TEST_F(AndroidDisplayBuffer, android_display_configuration_info)402TEST_F(AndroidDisplayBuffer, android_display_configuration_info)
389{403{
390 mga::DisplayBuffer db(mock_fb_bundle, mock_display_device, native_window, *gl_context);404 mga::DisplayBuffer db(
405 mock_fb_bundle, mock_display_device, native_window, *gl_context, stub_program_factory);
391 auto disp_conf = db.configuration();406 auto disp_conf = db.configuration();
392407
393 ASSERT_EQ(1u, disp_conf.modes.size());408 ASSERT_EQ(1u, disp_conf.modes.size());
394409
=== modified file 'tests/unit-tests/graphics/android/test_output_builder.cpp'
--- tests/unit-tests/graphics/android/test_output_builder.cpp 2014-03-27 13:38:00 +0000
+++ tests/unit-tests/graphics/android/test_output_builder.cpp 2014-04-24 20:07:52 +0000
@@ -30,6 +30,7 @@
30#include "mir_test_doubles/mock_egl.h"30#include "mir_test_doubles/mock_egl.h"
31#include "mir_test_doubles/mock_android_native_buffer.h"31#include "mir_test_doubles/mock_android_native_buffer.h"
32#include "mir_test_doubles/stub_gl_config.h"32#include "mir_test_doubles/stub_gl_config.h"
33#include "mir_test_doubles/stub_gl_program_factory.h"
33#include <system/window.h>34#include <system/window.h>
34#include <gtest/gtest.h>35#include <gtest/gtest.h>
3536
@@ -105,6 +106,7 @@
105 mtd::StubGLConfig stub_gl_config;106 mtd::StubGLConfig stub_gl_config;
106 mga::GLContext gl_context{107 mga::GLContext gl_context{
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};
109 mtd::StubGLProgramFactory const stub_program_factory;
108};110};
109}111}
110TEST_F(OutputBuilder, hwc_version_10_success)112TEST_F(OutputBuilder, hwc_version_10_success)
@@ -126,7 +128,7 @@
126128
127 mga::OutputBuilder factory(129 mga::OutputBuilder factory(
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));
129 factory.create_display_buffer(gl_context);131 factory.create_display_buffer(stub_program_factory, gl_context);
130}132}
131133
132TEST_F(OutputBuilder, hwc_version_10_failure_uses_gpu)134TEST_F(OutputBuilder, hwc_version_10_failure_uses_gpu)
@@ -149,7 +151,7 @@
149151
150 mga::OutputBuilder factory(152 mga::OutputBuilder factory(
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));
152 factory.create_display_buffer(gl_context);154 factory.create_display_buffer(stub_program_factory, gl_context);
153}155}
154156
155TEST_F(OutputBuilder, hwc_version_11_success)157TEST_F(OutputBuilder, hwc_version_11_success)
@@ -169,7 +171,7 @@
169171
170 mga::OutputBuilder factory(172 mga::OutputBuilder factory(
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));
172 factory.create_display_buffer(gl_context);174 factory.create_display_buffer(stub_program_factory, gl_context);
173}175}
174176
175TEST_F(OutputBuilder, hwc_version_11_hwc_failure)177TEST_F(OutputBuilder, hwc_version_11_hwc_failure)
@@ -192,7 +194,7 @@
192194
193 mga::OutputBuilder factory(195 mga::OutputBuilder factory(
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));
195 factory.create_display_buffer(gl_context);197 factory.create_display_buffer(stub_program_factory, gl_context);
196}198}
197199
198TEST_F(OutputBuilder, hwc_version_11_hwc_and_fb_failure_fatal)200TEST_F(OutputBuilder, hwc_version_11_hwc_and_fb_failure_fatal)
@@ -229,5 +231,5 @@
229231
230 mga::OutputBuilder factory(232 mga::OutputBuilder factory(
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));
232 factory.create_display_buffer(gl_context);234 factory.create_display_buffer(stub_program_factory, gl_context);
233}235}
234236
=== added file 'tests/unit-tests/graphics/android/test_overlay_compositor.cpp'
--- tests/unit-tests/graphics/android/test_overlay_compositor.cpp 1970-01-01 00:00:00 +0000
+++ tests/unit-tests/graphics/android/test_overlay_compositor.cpp 2014-04-24 20:07:52 +0000
@@ -0,0 +1,67 @@
1/*
2 * Copyright © 2014 Canonical Ltd.
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 3 as
6 * 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#include "src/platform/graphics/android/overlay_gl_compositor.h"
20#include "mir/graphics/gl_context.h"
21#include "mir/graphics/gl_program_factory.h"
22#include "mir_test_doubles/mock_gl.h"
23#include <gtest/gtest.h>
24#include <mir_test/gmock_fixes.h>
25
26namespace mg=mir::graphics;
27namespace mga=mir::graphics::android;
28namespace mt=mir::test;
29namespace mtd=mir::test::doubles;
30
31namespace
32{
33
34class MockGLProgramFactory : public mg::GLProgramFactory
35{
36public:
37 MOCK_CONST_METHOD2(create_gl_program,
38 std::unique_ptr<mg::GLProgram>(std::string const&, std::string const&));
39};
40
41class MockContext : public mg::GLContext
42{
43public:
44 MOCK_CONST_METHOD0(make_current, void());
45 MOCK_CONST_METHOD0(release_current, void());
46};
47
48class OverlayCompositor : public ::testing::Test
49{
50public:
51 testing::NiceMock<MockGLProgramFactory> mock_gl_program_factory;
52 testing::NiceMock<MockContext> mock_context;
53 testing::NiceMock<mtd::MockGL> mock_gl;
54};
55
56}
57
58TEST_F(OverlayCompositor, compiles_in_constructor)
59{
60 using namespace testing;
61 InSequence seq;
62 EXPECT_CALL(mock_context, make_current());
63 EXPECT_CALL(mock_gl_program_factory, create_gl_program(_,_));
64 EXPECT_CALL(mock_context, release_current());
65
66 mga::OverlayGLProgram glprogram(mock_gl_program_factory, mock_context);
67}
068
=== modified file 'tests/unit-tests/graphics/mesa/test_display_configuration.cpp'
--- tests/unit-tests/graphics/mesa/test_display_configuration.cpp 2014-03-27 09:46:09 +0000
+++ tests/unit-tests/graphics/mesa/test_display_configuration.cpp 2014-04-24 20:07:52 +0000
@@ -28,6 +28,7 @@
28#include "src/server/report/null_report_factory.h"28#include "src/server/report/null_report_factory.h"
29#include "mir_test_doubles/null_virtual_terminal.h"29#include "mir_test_doubles/null_virtual_terminal.h"
30#include "mir_test_doubles/stub_gl_config.h"30#include "mir_test_doubles/stub_gl_config.h"
31#include "mir_test_doubles/stub_gl_program_factory.h"
3132
32#include "mir_test_framework/udev_environment.h"33#include "mir_test_framework/udev_environment.h"
3334
@@ -102,6 +103,7 @@
102 {103 {
103 return platform->create_display(104 return platform->create_display(
104 std::make_shared<mg::DefaultDisplayConfigurationPolicy>(),105 std::make_shared<mg::DefaultDisplayConfigurationPolicy>(),
106 std::make_shared<mtd::StubGLProgramFactory>(),
105 std::make_shared<mtd::StubGLConfig>());107 std::make_shared<mtd::StubGLConfig>());
106 }108 }
107109
108110
=== modified file 'tests/unit-tests/graphics/mesa/test_display_multi_monitor.cpp'
--- tests/unit-tests/graphics/mesa/test_display_multi_monitor.cpp 2014-03-27 09:52:04 +0000
+++ tests/unit-tests/graphics/mesa/test_display_multi_monitor.cpp 2014-04-24 20:07:52 +0000
@@ -27,6 +27,7 @@
27#include "mir/graphics/display_configuration_policy.h"27#include "mir/graphics/display_configuration_policy.h"
28#include "mir_test_doubles/null_virtual_terminal.h"28#include "mir_test_doubles/null_virtual_terminal.h"
29#include "mir_test_doubles/stub_gl_config.h"29#include "mir_test_doubles/stub_gl_config.h"
30#include "mir_test_doubles/stub_gl_program_factory.h"
3031
31#include "mir_test_framework/udev_environment.h"32#include "mir_test_framework/udev_environment.h"
3233
@@ -147,6 +148,7 @@
147 {148 {
148 return platform->create_display(149 return platform->create_display(
149 std::make_shared<ClonedDisplayConfigurationPolicy>(),150 std::make_shared<ClonedDisplayConfigurationPolicy>(),
151 std::make_shared<mtd::StubGLProgramFactory>(),
150 std::make_shared<mtd::StubGLConfig>());152 std::make_shared<mtd::StubGLConfig>());
151 }153 }
152154
@@ -155,6 +157,7 @@
155 {157 {
156 return platform->create_display(158 return platform->create_display(
157 std::make_shared<SideBySideDisplayConfigurationPolicy>(),159 std::make_shared<SideBySideDisplayConfigurationPolicy>(),
160 std::make_shared<mtd::StubGLProgramFactory>(),
158 std::make_shared<mtd::StubGLConfig>());161 std::make_shared<mtd::StubGLConfig>());
159 }162 }
160163
161164
=== modified file 'tests/unit-tests/graphics/test_display.cpp'
--- tests/unit-tests/graphics/test_display.cpp 2014-04-15 05:31:19 +0000
+++ tests/unit-tests/graphics/test_display.cpp 2014-04-24 20:07:52 +0000
@@ -24,6 +24,7 @@
24#include "mir_test_doubles/mock_egl.h"24#include "mir_test_doubles/mock_egl.h"
25#include "mir_test_doubles/mock_gl.h"25#include "mir_test_doubles/mock_gl.h"
26#include "mir_test_doubles/stub_gl_config.h"26#include "mir_test_doubles/stub_gl_config.h"
27#include "mir_test_doubles/stub_gl_program_factory.h"
27#include "src/server/graphics/default_display_configuration_policy.h"28#include "src/server/graphics/default_display_configuration_policy.h"
28#ifndef ANDROID29#ifndef ANDROID
29#include "mir_test_doubles/mock_drm.h"30#include "mir_test_doubles/mock_drm.h"
@@ -87,6 +88,7 @@
87#endif88#endif
88 return platform->create_display(89 return platform->create_display(
89 std::make_shared<mg::DefaultDisplayConfigurationPolicy>(),90 std::make_shared<mg::DefaultDisplayConfigurationPolicy>(),
91 std::make_shared<mtd::StubGLProgramFactory>(),
90 std::make_shared<mtd::StubGLConfig>());92 std::make_shared<mtd::StubGLConfig>());
91 }93 }
9294

Subscribers

People subscribed via source and target branches