Mir

Merge lp:~robertcarr/mir/emancipate-egl-native-display-from-surface into lp:~mir-team/mir/trunk

Proposed by Robert Carr
Status: Merged
Approved by: Robert Carr
Approved revision: no longer in the source branch.
Merged at revision: 687
Proposed branch: lp:~robertcarr/mir/emancipate-egl-native-display-from-surface
Merge into: lp:~mir-team/mir/trunk
Diff against target: 402 lines (+49/-46)
22 files modified
examples/demo-inprocess-surface-client/inprocess_egl_client.cpp (+2/-2)
include/server/mir/graphics/internal_client.h (+7/-1)
include/server/mir/graphics/platform.h (+1/-1)
include/test/mir_test_doubles/stub_platform.h (+1/-1)
src/server/graphics/android/android_platform.cpp (+2/-3)
src/server/graphics/android/android_platform.h (+1/-1)
src/server/graphics/android/internal_client.cpp (+10/-5)
src/server/graphics/android/internal_client.h (+2/-2)
src/server/graphics/gbm/gbm_platform.cpp (+2/-3)
src/server/graphics/gbm/gbm_platform.h (+1/-1)
src/server/graphics/gbm/internal_client.cpp (+3/-5)
src/server/graphics/gbm/internal_client.h (+2/-4)
tests/integration-tests/graphics/android/test_internal_client.cpp (+2/-2)
tests/integration-tests/graphics/gbm/test_buffer_integration.cpp (+1/-1)
tests/integration-tests/test_display_info.cpp (+1/-1)
tests/integration-tests/test_drm_auth_magic.cpp (+1/-1)
tests/integration-tests/test_surfaceloop.cpp (+2/-2)
tests/mir_test_framework/testing_server_options.cpp (+1/-1)
tests/unit-tests/frontend/test_session_mediator_gbm.cpp (+1/-1)
tests/unit-tests/graphics/android/test_internal_client.cpp (+3/-3)
tests/unit-tests/graphics/gbm/test_gbm_platform.cpp (+1/-3)
tests/unit-tests/graphics/gbm/test_internal_client.cpp (+2/-2)
To merge this branch: bzr merge lp:~robertcarr/mir/emancipate-egl-native-display-from-surface
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Kevin DuBois (community) Approve
Review via email: mp+163775@code.launchpad.net

Commit message

Allow access to the internal egl native display without usage of a surface.

Description of the change

Allow access to the internal egl native display without usage of a surface.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Kevin DuBois (kdub) wrote :

good, makes more sense

small needs fixing:

doesn't need to be a class member:
148 std::shared_ptr<MirNativeWindow> client_window;

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

> good, makes more sense
>
> small needs fixing:
>
> doesn't need to be a class member:
> 148 std::shared_ptr<MirNativeWindow> client_window;

apologies, it does need to be a class member so that a reference to it is maintained.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Kevin DuBois (kdub) wrote :

looks good

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

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'examples/demo-inprocess-surface-client/inprocess_egl_client.cpp'
--- examples/demo-inprocess-surface-client/inprocess_egl_client.cpp 2013-05-13 23:21:30 +0000
+++ examples/demo-inprocess-surface-client/inprocess_egl_client.cpp 2013-05-14 23:46:25 +0000
@@ -91,8 +91,8 @@
91 std::bind(std::mem_fn(&me::InprocessEGLClient::handle_event), this, std::placeholders::_1));91 std::bind(std::mem_fn(&me::InprocessEGLClient::handle_event), this, std::placeholders::_1));
92 input_thread->start();92 input_thread->start();
9393
94 auto internal_client = graphics_platform->create_internal_client(surface);94 auto internal_client = graphics_platform->create_internal_client();
95 me::EGLHelper helper(internal_client->egl_native_display(), internal_client->egl_native_window());95 me::EGLHelper helper(internal_client->egl_native_display(), internal_client->egl_native_window(surface));
9696
97 auto rc = eglMakeCurrent(helper.the_display(), helper.the_surface(), helper.the_surface(), helper.the_context());97 auto rc = eglMakeCurrent(helper.the_display(), helper.the_surface(), helper.the_surface(), helper.the_context());
98 assert(rc == EGL_TRUE);98 assert(rc == EGL_TRUE);
9999
=== modified file 'include/server/mir/graphics/internal_client.h'
--- include/server/mir/graphics/internal_client.h 2013-05-07 19:45:01 +0000
+++ include/server/mir/graphics/internal_client.h 2013-05-14 23:46:25 +0000
@@ -22,15 +22,21 @@
2222
23#include <EGL/egl.h>23#include <EGL/egl.h>
2424
25#include <memory>
26
25namespace mir27namespace mir
26{28{
29namespace frontend
30{
31class Surface;
32}
27namespace graphics33namespace graphics
28{34{
29class InternalClient35class InternalClient
30{36{
31public:37public:
32 virtual EGLNativeDisplayType egl_native_display() = 0;38 virtual EGLNativeDisplayType egl_native_display() = 0;
33 virtual EGLNativeWindowType egl_native_window() = 0;39 virtual EGLNativeWindowType egl_native_window(std::shared_ptr<frontend::Surface> const&) = 0;
34protected:40protected:
35 InternalClient() = default;41 InternalClient() = default;
36 virtual ~InternalClient() = default;42 virtual ~InternalClient() = default;
3743
=== modified file 'include/server/mir/graphics/platform.h'
--- include/server/mir/graphics/platform.h 2013-05-07 19:45:01 +0000
+++ include/server/mir/graphics/platform.h 2013-05-14 23:46:25 +0000
@@ -56,7 +56,7 @@
56 std::shared_ptr<BufferInitializer> const& buffer_initializer) = 0;56 std::shared_ptr<BufferInitializer> const& buffer_initializer) = 0;
57 virtual std::shared_ptr<Display> create_display() = 0;57 virtual std::shared_ptr<Display> create_display() = 0;
58 virtual std::shared_ptr<PlatformIPCPackage> get_ipc_package() = 0;58 virtual std::shared_ptr<PlatformIPCPackage> get_ipc_package() = 0;
59 virtual std::shared_ptr<InternalClient> create_internal_client(std::shared_ptr<frontend::Surface> const&) = 0;59 virtual std::shared_ptr<InternalClient> create_internal_client() = 0;
60};60};
6161
62// Create and return a new graphics platform.62// Create and return a new graphics platform.
6363
=== modified file 'include/test/mir_test_doubles/stub_platform.h'
--- include/test/mir_test_doubles/stub_platform.h 2013-05-07 22:33:03 +0000
+++ include/test/mir_test_doubles/stub_platform.h 2013-05-14 23:46:25 +0000
@@ -48,7 +48,7 @@
48 return std::make_shared<graphics::PlatformIPCPackage>();48 return std::make_shared<graphics::PlatformIPCPackage>();
49 }49 }
50 50
51 std::shared_ptr<graphics::InternalClient> create_internal_client(std::shared_ptr<frontend::Surface> const&)51 std::shared_ptr<graphics::InternalClient> create_internal_client()
52 {52 {
53 return std::shared_ptr<graphics::InternalClient>(); 53 return std::shared_ptr<graphics::InternalClient>();
54 } 54 }
5555
=== modified file 'src/server/graphics/android/android_platform.cpp'
--- src/server/graphics/android/android_platform.cpp 2013-05-07 20:24:11 +0000
+++ src/server/graphics/android/android_platform.cpp 2013-05-14 23:46:25 +0000
@@ -61,10 +61,9 @@
61 return std::make_shared<mg::PlatformIPCPackage>();61 return std::make_shared<mg::PlatformIPCPackage>();
62}62}
6363
64std::shared_ptr<mg::InternalClient> mga::AndroidPlatform::create_internal_client(64std::shared_ptr<mg::InternalClient> mga::AndroidPlatform::create_internal_client()
65 std::shared_ptr<mf::Surface> const& surface)
66{65{
67 return std::make_shared<mga::InternalClient>(surface);66 return std::make_shared<mga::InternalClient>();
68}67}
6968
70std::shared_ptr<mg::Platform> mg::create_platform(std::shared_ptr<DisplayReport> const& display_report)69std::shared_ptr<mg::Platform> mg::create_platform(std::shared_ptr<DisplayReport> const& display_report)
7170
=== modified file 'src/server/graphics/android/android_platform.h'
--- src/server/graphics/android/android_platform.h 2013-05-07 19:45:01 +0000
+++ src/server/graphics/android/android_platform.h 2013-05-14 23:46:25 +0000
@@ -39,7 +39,7 @@
39 const std::shared_ptr<BufferInitializer>& buffer_initializer);39 const std::shared_ptr<BufferInitializer>& buffer_initializer);
40 std::shared_ptr<Display> create_display();40 std::shared_ptr<Display> create_display();
41 std::shared_ptr<PlatformIPCPackage> get_ipc_package(); 41 std::shared_ptr<PlatformIPCPackage> get_ipc_package();
42 std::shared_ptr<InternalClient> create_internal_client(std::shared_ptr<frontend::Surface> const&);42 std::shared_ptr<InternalClient> create_internal_client();
4343
44private:44private:
45 std::shared_ptr<DisplayReport> const display_report;45 std::shared_ptr<DisplayReport> const display_report;
4646
=== modified file 'src/server/graphics/android/internal_client.cpp'
--- src/server/graphics/android/internal_client.cpp 2013-05-07 20:15:09 +0000
+++ src/server/graphics/android/internal_client.cpp 2013-05-14 23:46:25 +0000
@@ -24,11 +24,9 @@
24namespace mf=mir::frontend;24namespace mf=mir::frontend;
25namespace mga=mir::graphics::android;25namespace mga=mir::graphics::android;
2626
27mga::InternalClient::InternalClient(std::shared_ptr<frontend::Surface> const& surface)27mga::InternalClient::InternalClient()
28 : client_window(0)
28{29{
29 auto cache = std::make_shared<mga::InterpreterCache>();
30 auto interpreter = std::make_shared<mga::InternalClientWindow>(surface, cache);
31 client_window = std::make_shared<mga::MirNativeWindow>(interpreter);
32}30}
3331
34EGLNativeDisplayType mga::InternalClient::egl_native_display()32EGLNativeDisplayType mga::InternalClient::egl_native_display()
@@ -36,7 +34,14 @@
36 return EGL_DEFAULT_DISPLAY;34 return EGL_DEFAULT_DISPLAY;
37}35}
3836
39EGLNativeWindowType mga::InternalClient::egl_native_window()37EGLNativeWindowType mga::InternalClient::egl_native_window(std::shared_ptr<mf::Surface> const& surface)
40{38{
39 if (!client_window)
40 {
41 auto cache = std::make_shared<mga::InterpreterCache>();
42 auto interpreter = std::make_shared<mga::InternalClientWindow>(surface, cache);
43 client_window = std::make_shared<mga::MirNativeWindow>(interpreter);
44 }
45
41 return client_window.get();46 return client_window.get();
42}47}
4348
=== modified file 'src/server/graphics/android/internal_client.h'
--- src/server/graphics/android/internal_client.h 2013-05-07 20:15:09 +0000
+++ src/server/graphics/android/internal_client.h 2013-05-14 23:46:25 +0000
@@ -37,9 +37,9 @@
37class InternalClient : public mir::graphics::InternalClient37class InternalClient : public mir::graphics::InternalClient
38{38{
39public:39public:
40 InternalClient(std::shared_ptr<frontend::Surface> const&);40 InternalClient();
41 EGLNativeDisplayType egl_native_display();41 EGLNativeDisplayType egl_native_display();
42 EGLNativeWindowType egl_native_window();42 EGLNativeWindowType egl_native_window(std::shared_ptr<frontend::Surface> const&);
4343
44private:44private:
45 std::shared_ptr<MirNativeWindow> client_window;45 std::shared_ptr<MirNativeWindow> client_window;
4646
=== modified file 'src/server/graphics/gbm/gbm_platform.cpp'
--- src/server/graphics/gbm/gbm_platform.cpp 2013-05-08 18:57:03 +0000
+++ src/server/graphics/gbm/gbm_platform.cpp 2013-05-14 23:46:25 +0000
@@ -118,13 +118,12 @@
118 drm.auth_magic(magic);118 drm.auth_magic(magic);
119}119}
120120
121std::shared_ptr<mg::InternalClient> mgg::GBMPlatform::create_internal_client(121std::shared_ptr<mg::InternalClient> mgg::GBMPlatform::create_internal_client()
122 std::shared_ptr<frontend::Surface> const& surface)
123{122{
124 if (!internal_native_display)123 if (!internal_native_display)
125 internal_native_display = std::make_shared<mgg::InternalNativeDisplay>(get_ipc_package()); 124 internal_native_display = std::make_shared<mgg::InternalNativeDisplay>(get_ipc_package());
126 internal_display_clients_present = true;125 internal_display_clients_present = true;
127 return std::make_shared<mgg::InternalClient>(internal_native_display, surface);126 return std::make_shared<mgg::InternalClient>(internal_native_display);
128}127}
129128
130std::shared_ptr<mg::Platform> mg::create_platform(std::shared_ptr<DisplayReport> const& report)129std::shared_ptr<mg::Platform> mg::create_platform(std::shared_ptr<DisplayReport> const& report)
131130
=== modified file 'src/server/graphics/gbm/gbm_platform.h'
--- src/server/graphics/gbm/gbm_platform.h 2013-05-08 18:57:03 +0000
+++ src/server/graphics/gbm/gbm_platform.h 2013-05-14 23:46:25 +0000
@@ -48,7 +48,7 @@
48 const std::shared_ptr<BufferInitializer>& buffer_initializer);48 const std::shared_ptr<BufferInitializer>& buffer_initializer);
49 std::shared_ptr<Display> create_display();49 std::shared_ptr<Display> create_display();
50 std::shared_ptr<PlatformIPCPackage> get_ipc_package(); 50 std::shared_ptr<PlatformIPCPackage> get_ipc_package();
51 std::shared_ptr<InternalClient> create_internal_client(std::shared_ptr<frontend::Surface> const&);51 std::shared_ptr<InternalClient> create_internal_client();
5252
53 /* From DRMAuthenticator */53 /* From DRMAuthenticator */
54 void drm_auth_magic(drm_magic_t magic);54 void drm_auth_magic(drm_magic_t magic);
5555
=== modified file 'src/server/graphics/gbm/internal_client.cpp'
--- src/server/graphics/gbm/internal_client.cpp 2013-05-09 18:46:57 +0000
+++ src/server/graphics/gbm/internal_client.cpp 2013-05-14 23:46:25 +0000
@@ -22,10 +22,8 @@
22namespace mgg=mir::graphics::gbm;22namespace mgg=mir::graphics::gbm;
23namespace mf=mir::frontend;23namespace mf=mir::frontend;
2424
25mgg::InternalClient::InternalClient(std::shared_ptr<MirMesaEGLNativeDisplay> const& native_display,25mgg::InternalClient::InternalClient(std::shared_ptr<MirMesaEGLNativeDisplay> const& native_display)
26 std::shared_ptr<mf::Surface> const& surface)26 : native_display(native_display)
27 : native_display(native_display),
28 surface(surface)
29{27{
30}28}
3129
@@ -34,7 +32,7 @@
34 return reinterpret_cast<EGLNativeDisplayType>(native_display.get());32 return reinterpret_cast<EGLNativeDisplayType>(native_display.get());
35}33}
3634
37EGLNativeWindowType mgg::InternalClient::egl_native_window()35EGLNativeWindowType mgg::InternalClient::egl_native_window(std::shared_ptr<mf::Surface> const& surface)
38{36{
39 return reinterpret_cast<EGLNativeWindowType>(surface.get());37 return reinterpret_cast<EGLNativeWindowType>(surface.get());
40}38}
4139
=== modified file 'src/server/graphics/gbm/internal_client.h'
--- src/server/graphics/gbm/internal_client.h 2013-05-08 18:57:03 +0000
+++ src/server/graphics/gbm/internal_client.h 2013-05-14 23:46:25 +0000
@@ -38,14 +38,12 @@
38class InternalClient : public mir::graphics::InternalClient38class InternalClient : public mir::graphics::InternalClient
39{39{
40public:40public:
41 InternalClient(std::shared_ptr<MirMesaEGLNativeDisplay> const&,41 InternalClient(std::shared_ptr<MirMesaEGLNativeDisplay> const&);
42 std::shared_ptr<frontend::Surface> const&);
43 EGLNativeDisplayType egl_native_display();42 EGLNativeDisplayType egl_native_display();
44 EGLNativeWindowType egl_native_window();43 EGLNativeWindowType egl_native_window(std::shared_ptr<frontend::Surface> const&);
4544
46private:45private:
47 std::shared_ptr<MirMesaEGLNativeDisplay> const native_display;46 std::shared_ptr<MirMesaEGLNativeDisplay> const native_display;
48 std::shared_ptr<frontend::Surface> const surface;
49};47};
5048
51}49}
5250
=== modified file 'tests/integration-tests/graphics/android/test_internal_client.cpp'
--- tests/integration-tests/graphics/android/test_internal_client.cpp 2013-05-07 19:45:01 +0000
+++ tests/integration-tests/graphics/android/test_internal_client.cpp 2013-05-14 23:46:25 +0000
@@ -93,7 +93,7 @@
9393
94 auto report = std::shared_ptr<mg::NullDisplayReport>(); 94 auto report = std::shared_ptr<mg::NullDisplayReport>();
95 auto platform = mg::create_platform(report);95 auto platform = mg::create_platform(report);
96 auto internal_client = platform->create_internal_client(mir_surface);96 auto internal_client = platform->create_internal_client();
9797
98 int major, minor, n;98 int major, minor, n;
99 EGLContext egl_context;99 EGLContext egl_context;
@@ -116,7 +116,7 @@
116 rc = eglChooseConfig(egl_display, attribs, &egl_config, 1, &n);116 rc = eglChooseConfig(egl_display, attribs, &egl_config, 1, &n);
117 EXPECT_EQ(EGL_TRUE, rc);117 EXPECT_EQ(EGL_TRUE, rc);
118118
119 egl_surface = eglCreateWindowSurface(egl_display, egl_config, internal_client->egl_native_window(), NULL);119 egl_surface = eglCreateWindowSurface(egl_display, egl_config, internal_client->egl_native_window(mir_surface), NULL);
120 EXPECT_NE(EGL_NO_SURFACE, egl_surface);120 EXPECT_NE(EGL_NO_SURFACE, egl_surface);
121121
122 egl_context = eglCreateContext(egl_display, egl_config, EGL_NO_CONTEXT, context_attribs);122 egl_context = eglCreateContext(egl_display, egl_config, EGL_NO_CONTEXT, context_attribs);
123123
=== modified file 'tests/integration-tests/graphics/gbm/test_buffer_integration.cpp'
--- tests/integration-tests/graphics/gbm/test_buffer_integration.cpp 2013-05-07 22:33:03 +0000
+++ tests/integration-tests/graphics/gbm/test_buffer_integration.cpp 2013-05-14 23:46:25 +0000
@@ -100,7 +100,7 @@
100 return std::shared_ptr<mg::PlatformIPCPackage>();100 return std::shared_ptr<mg::PlatformIPCPackage>();
101 }101 }
102102
103 std::shared_ptr<mg::InternalClient> create_internal_client(std::shared_ptr<mir::frontend::Surface> const&)103 std::shared_ptr<mg::InternalClient> create_internal_client()
104 {104 {
105 return std::shared_ptr<mg::InternalClient>();105 return std::shared_ptr<mg::InternalClient>();
106 }106 }
107107
=== modified file 'tests/integration-tests/test_display_info.cpp'
--- tests/integration-tests/test_display_info.cpp 2013-05-07 19:45:01 +0000
+++ tests/integration-tests/test_display_info.cpp 2013-05-14 23:46:25 +0000
@@ -105,7 +105,7 @@
105 return std::make_shared<mg::PlatformIPCPackage>();105 return std::make_shared<mg::PlatformIPCPackage>();
106 }106 }
107107
108 std::shared_ptr<mg::InternalClient> create_internal_client(std::shared_ptr<mf::Surface> const&)108 std::shared_ptr<mg::InternalClient> create_internal_client()
109 {109 {
110 return std::shared_ptr<mg::InternalClient>(); 110 return std::shared_ptr<mg::InternalClient>();
111 } 111 }
112112
=== modified file 'tests/integration-tests/test_drm_auth_magic.cpp'
--- tests/integration-tests/test_drm_auth_magic.cpp 2013-05-07 22:33:03 +0000
+++ tests/integration-tests/test_drm_auth_magic.cpp 2013-05-14 23:46:25 +0000
@@ -80,7 +80,7 @@
80 return std::make_shared<mg::PlatformIPCPackage>();80 return std::make_shared<mg::PlatformIPCPackage>();
81 }81 }
8282
83 std::shared_ptr<mg::InternalClient> create_internal_client(std::shared_ptr<mir::frontend::Surface> const&)83 std::shared_ptr<mg::InternalClient> create_internal_client()
84 {84 {
85 return std::shared_ptr<mg::InternalClient>();85 return std::shared_ptr<mg::InternalClient>();
86 }86 }
8787
=== modified file 'tests/integration-tests/test_surfaceloop.cpp'
--- tests/integration-tests/test_surfaceloop.cpp 2013-05-07 19:45:01 +0000
+++ tests/integration-tests/test_surfaceloop.cpp 2013-05-14 23:46:25 +0000
@@ -356,7 +356,7 @@
356 return std::make_shared<mg::PlatformIPCPackage>();356 return std::make_shared<mg::PlatformIPCPackage>();
357 }357 }
358358
359 std::shared_ptr<mg::InternalClient> create_internal_client(std::shared_ptr<mf::Surface> const&)359 std::shared_ptr<mg::InternalClient> create_internal_client()
360 {360 {
361 return std::shared_ptr<mg::InternalClient>(); 361 return std::shared_ptr<mg::InternalClient>();
362 } 362 }
@@ -488,7 +488,7 @@
488 return std::make_shared<mg::PlatformIPCPackage>();488 return std::make_shared<mg::PlatformIPCPackage>();
489 }489 }
490490
491 std::shared_ptr<mg::InternalClient> create_internal_client(std::shared_ptr<mf::Surface> const&)491 std::shared_ptr<mg::InternalClient> create_internal_client()
492 {492 {
493 return std::shared_ptr<mg::InternalClient>(); 493 return std::shared_ptr<mg::InternalClient>();
494 }494 }
495495
=== modified file 'tests/mir_test_framework/testing_server_options.cpp'
--- tests/mir_test_framework/testing_server_options.cpp 2013-05-07 19:45:01 +0000
+++ tests/mir_test_framework/testing_server_options.cpp 2013-05-14 23:46:25 +0000
@@ -119,7 +119,7 @@
119 return std::make_shared<mg::PlatformIPCPackage>();119 return std::make_shared<mg::PlatformIPCPackage>();
120 }120 }
121121
122 std::shared_ptr<mg::InternalClient> create_internal_client(std::shared_ptr<mf::Surface> const&)122 std::shared_ptr<mg::InternalClient> create_internal_client()
123 {123 {
124 return std::shared_ptr<mg::InternalClient>(); 124 return std::shared_ptr<mg::InternalClient>();
125 }125 }
126126
=== modified file 'tests/unit-tests/frontend/test_session_mediator_gbm.cpp'
--- tests/unit-tests/frontend/test_session_mediator_gbm.cpp 2013-05-07 22:33:03 +0000
+++ tests/unit-tests/frontend/test_session_mediator_gbm.cpp 2013-05-14 23:46:25 +0000
@@ -83,7 +83,7 @@
83 return std::make_shared<mg::PlatformIPCPackage>();83 return std::make_shared<mg::PlatformIPCPackage>();
84 }84 }
8585
86 std::shared_ptr<mg::InternalClient> create_internal_client(std::shared_ptr<mf::Surface> const&)86 std::shared_ptr<mg::InternalClient> create_internal_client()
87 {87 {
88 return std::shared_ptr<mg::InternalClient>();88 return std::shared_ptr<mg::InternalClient>();
89 }89 }
9090
=== modified file 'tests/unit-tests/graphics/android/test_internal_client.cpp'
--- tests/unit-tests/graphics/android/test_internal_client.cpp 2013-05-07 20:07:10 +0000
+++ tests/unit-tests/graphics/android/test_internal_client.cpp 2013-05-14 23:46:25 +0000
@@ -68,15 +68,15 @@
68TEST(InternalClient, native_display)68TEST(InternalClient, native_display)
69{69{
70 auto surface = std::make_shared<StubSurface>();70 auto surface = std::make_shared<StubSurface>();
71 mga::InternalClient client(surface);71 mga::InternalClient client;
72 EXPECT_EQ(EGL_DEFAULT_DISPLAY, client.egl_native_display());72 EXPECT_EQ(EGL_DEFAULT_DISPLAY, client.egl_native_display());
73}73}
7474
75TEST(InternalClient, native_window)75TEST(InternalClient, native_window)
76{76{
77 auto surface = std::make_shared<StubSurface>();77 auto surface = std::make_shared<StubSurface>();
78 mga::InternalClient client(surface);78 mga::InternalClient client;
79 ANativeWindow* native_window = static_cast<ANativeWindow*>(client.egl_native_window());79 ANativeWindow* native_window = static_cast<ANativeWindow*>(client.egl_native_window(surface));
8080
81 /* check for basic window sanity */81 /* check for basic window sanity */
82 ASSERT_NE(nullptr, native_window);82 ASSERT_NE(nullptr, native_window);
8383
=== modified file 'tests/unit-tests/graphics/gbm/test_gbm_platform.cpp'
--- tests/unit-tests/graphics/gbm/test_gbm_platform.cpp 2013-05-08 18:57:03 +0000
+++ tests/unit-tests/graphics/gbm/test_gbm_platform.cpp 2013-05-14 23:46:25 +0000
@@ -21,7 +21,6 @@
21#include "src/server/graphics/gbm/gbm_platform.h"21#include "src/server/graphics/gbm/gbm_platform.h"
22#include "src/server/graphics/gbm/internal_client.h"22#include "src/server/graphics/gbm/internal_client.h"
23#include "mir_test_doubles/null_virtual_terminal.h"23#include "mir_test_doubles/null_virtual_terminal.h"
24#include "mir_test_doubles/stub_surface.h"
2524
26#include "mir/graphics/null_display_report.h"25#include "mir/graphics/null_display_report.h"
2726
@@ -148,12 +147,11 @@
148 */147 */
149TEST_F(GBMGraphicsPlatform, platform_provides_validation_of_display_for_internal_clients)148TEST_F(GBMGraphicsPlatform, platform_provides_validation_of_display_for_internal_clients)
150{149{
151 auto stub_surface = std::make_shared<mtd::StubSurface>();
152 MirMesaEGLNativeDisplay* native_display = nullptr;150 MirMesaEGLNativeDisplay* native_display = nullptr;
153 EXPECT_EQ(0, mir_server_internal_display_is_valid(native_display));151 EXPECT_EQ(0, mir_server_internal_display_is_valid(native_display));
154 {152 {
155 auto platform = create_platform();153 auto platform = create_platform();
156 auto client = platform->create_internal_client(stub_surface);154 auto client = platform->create_internal_client();
157 native_display = reinterpret_cast<MirMesaEGLNativeDisplay*>(client->egl_native_display());155 native_display = reinterpret_cast<MirMesaEGLNativeDisplay*>(client->egl_native_display());
158 EXPECT_EQ(1, mir_server_internal_display_is_valid(native_display));156 EXPECT_EQ(1, mir_server_internal_display_is_valid(native_display));
159 }157 }
160158
=== modified file 'tests/unit-tests/graphics/gbm/test_internal_client.cpp'
--- tests/unit-tests/graphics/gbm/test_internal_client.cpp 2013-05-08 18:57:03 +0000
+++ tests/unit-tests/graphics/gbm/test_internal_client.cpp 2013-05-14 23:46:25 +0000
@@ -33,10 +33,10 @@
33{33{
34 auto stub_window = std::make_shared<mtd::StubSurface>();34 auto stub_window = std::make_shared<mtd::StubSurface>();
35 auto stub_display = std::make_shared<MirMesaEGLNativeDisplay>();35 auto stub_display = std::make_shared<MirMesaEGLNativeDisplay>();
36 mgg::InternalClient client(stub_display, stub_window);36 mgg::InternalClient client(stub_display);
3737
38 auto native_display = client.egl_native_display();38 auto native_display = client.egl_native_display();
39 auto native_window = client.egl_native_window();39 auto native_window = client.egl_native_window(stub_window);
4040
41 EXPECT_EQ(reinterpret_cast<EGLNativeDisplayType>(stub_display.get()), native_display);41 EXPECT_EQ(reinterpret_cast<EGLNativeDisplayType>(stub_display.get()), native_display);
42 EXPECT_EQ(reinterpret_cast<EGLNativeWindowType>(stub_window.get()), native_window);42 EXPECT_EQ(reinterpret_cast<EGLNativeWindowType>(stub_window.get()), native_window);

Subscribers

People subscribed via source and target branches