Mir

Merge lp:~cemil-azizoglu/mir/use_consistent_defines into lp:mir

Proposed by Cemil Azizoglu
Status: Work in progress
Proposed branch: lp:~cemil-azizoglu/mir/use_consistent_defines
Merge into: lp:mir
Prerequisite: lp:~cemil-azizoglu/mir/rename-mesa-to-KMS
Diff against target: 369 lines (+36/-33)
17 files modified
CMakeLists.txt (+1/-1)
include/common/mir/graphics/native_buffer.h (+2/-2)
include/common/mir_toolkit/mir_native_buffer.h (+1/-1)
src/common/graphics/android/CMakeLists.txt (+2/-1)
src/platforms/android/CMakeLists.txt (+2/-0)
src/platforms/android/server/CMakeLists.txt (+1/-1)
tests/acceptance-tests/test_client_library.cpp (+7/-7)
tests/include/mir_test_doubles/platform_factory.h (+1/-1)
tests/include/mir_test_doubles/stub_client_buffer.h (+1/-1)
tests/integration-tests/graphics/android/CMakeLists.txt (+1/-1)
tests/mir_test_doubles/platform_factory.cpp (+2/-2)
tests/mir_test_doubles/stub_buffer.cpp (+2/-2)
tests/mir_test_framework/stub_client_platform_factory.cpp (+1/-1)
tests/mir_test_framework/stubbed_graphics_platform.cpp (+3/-3)
tests/performance-tests/test_glmark2-es2-mir.cpp (+1/-1)
tests/unit-tests/graphics/test_display.cpp (+4/-4)
tests/unit-tests/graphics/test_graphics_platform.cpp (+4/-4)
To merge this branch: bzr merge lp:~cemil-azizoglu/mir/use_consistent_defines
Reviewer Review Type Date Requested Status
Mir development team Pending
Review via email: mp+260781@code.launchpad.net

Commit message

Use consistent platform related #defines.

Description of the change

Use consistent platform related #defines.

To post a comment you must log in.
2614. By Cemil Azizoglu

Fix defines

2615. By Cemil Azizoglu

Fix typo.

2616. By Cemil Azizoglu

Add KMS

2617. By Cemil Azizoglu

More fixups

Unmerged revisions

2617. By Cemil Azizoglu

More fixups

2616. By Cemil Azizoglu

Add KMS

2615. By Cemil Azizoglu

Fix typo.

2614. By Cemil Azizoglu

Fix defines

2613. By Cemil Azizoglu

Consistent buffer use.

2612. By Cemil Azizoglu

Use MIR_BUILD_PLATFORM_ANDROID instead of ANDROID for consistency.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'CMakeLists.txt'
2--- CMakeLists.txt 2015-06-02 03:49:22 +0000
3+++ CMakeLists.txt 2015-06-02 03:49:23 +0000
4@@ -159,7 +159,7 @@
5 set(MIR_BUILD_PLATFORM_KMS TRUE)
6 endif()
7 if (platform STREQUAL "android")
8- set(MIR_BUILD_PLATFORM_ANDROID TRUE)
9+ set(MIR_BUILD_PLATFORM_ANDROID TRUE)
10 endif()
11 endforeach(platform)
12
13
14=== modified file 'include/common/mir/graphics/native_buffer.h'
15--- include/common/mir/graphics/native_buffer.h 2015-01-21 07:34:50 +0000
16+++ include/common/mir/graphics/native_buffer.h 2015-06-02 03:49:23 +0000
17@@ -19,7 +19,7 @@
18 #ifndef MIR_GRAPHICS_NATIVE_BUFFER_H_
19 #define MIR_GRAPHICS_NATIVE_BUFFER_H_
20
21-#ifndef ANDROID
22+#ifndef MIR_BUILD_PLATFORM_ANDROID
23 #include <mir_toolkit/mir_native_buffer.h>
24 #endif
25
26@@ -28,7 +28,7 @@
27 namespace graphics
28 {
29
30-#ifdef ANDROID
31+#ifdef MIR_BUILD_PLATFORM_ANDROID
32 //just a fwd dcl
33 class NativeBuffer;
34 #else
35
36=== modified file 'include/common/mir_toolkit/mir_native_buffer.h'
37--- include/common/mir_toolkit/mir_native_buffer.h 2014-03-06 06:05:17 +0000
38+++ include/common/mir_toolkit/mir_native_buffer.h 2015-06-02 03:49:23 +0000
39@@ -48,7 +48,7 @@
40 /**< \see http://www.khronos.org/registry/egl/extensions/EXT/EGL_EXT_buffer_age.txt */
41 } MirBufferPackage;
42
43-#ifdef ANDROID
44+#ifdef MIR_BUILD_PLATFORM_ANDROID
45 struct ANativeWindowBuffer;
46 typedef struct ANativeWindowBuffer MirNativeBuffer;
47 #else
48
49=== modified file 'src/common/graphics/android/CMakeLists.txt'
50--- src/common/graphics/android/CMakeLists.txt 2015-05-19 21:34:34 +0000
51+++ src/common/graphics/android/CMakeLists.txt 2015-06-02 03:49:23 +0000
52@@ -1,6 +1,7 @@
53 include_directories(SYSTEM ${LIBHARDWARE_INCLUDE_DIRS})
54
55-add_definitions( -DANDROID )
56+add_definitions(-DMIR_BUILD_PLATFORM_ANDROID)
57+add_definitions(-DANDROID)
58
59 add_library(
60 mirsharedandroid-static STATIC
61
62=== modified file 'src/platforms/android/CMakeLists.txt'
63--- src/platforms/android/CMakeLists.txt 2015-01-19 14:16:46 +0000
64+++ src/platforms/android/CMakeLists.txt 2015-06-02 03:49:23 +0000
65@@ -1,2 +1,4 @@
66+add_definitions(-DMIR_BUILD_PLATFORM_ANDROID)
67+
68 add_subdirectory(server/)
69 add_subdirectory(client/)
70
71=== modified file 'src/platforms/android/server/CMakeLists.txt'
72--- src/platforms/android/server/CMakeLists.txt 2015-05-19 21:34:34 +0000
73+++ src/platforms/android/server/CMakeLists.txt 2015-06-02 03:49:23 +0000
74@@ -10,7 +10,7 @@
75 )
76
77 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpermissive")
78-add_definitions( -DANDROID )
79+add_definitions(-DANDROID)
80
81 add_library(mirplatformgraphicsandroidobjects OBJECT
82 platform.cpp
83
84=== modified file 'tests/acceptance-tests/test_client_library.cpp'
85--- tests/acceptance-tests/test_client_library.cpp 2015-05-19 21:34:34 +0000
86+++ tests/acceptance-tests/test_client_library.cpp 2015-06-02 03:49:23 +0000
87@@ -29,7 +29,7 @@
88
89 #include "mir_protobuf.pb.h"
90
91-#ifdef ANDROID
92+#ifdef MIR_BUILD_PLATFORM_ANDROID
93 /*
94 * MirNativeBuffer for Android is defined opaquely, but we now depend on
95 * it having width and height fields, for all platforms. So need definition...
96@@ -398,7 +398,7 @@
97 mir_connection_release(connection);
98 }
99
100-#ifndef ANDROID
101+#ifndef MIR_BUILD_PLATFORM_ANDROID
102 TEST_F(ClientLibrary, surface_scanout_flag_toggles)
103 {
104 connection = mir_connect_sync(new_connection().c_str(), __PRETTY_FUNCTION__);
105@@ -457,7 +457,7 @@
106 }
107 #endif
108
109-#ifdef ANDROID
110+#ifdef MIR_BUILD_PLATFORM_ANDROID
111 // Mir's Android test infrastructure isn't quite ready for this yet.
112 TEST_F(ClientLibrary, DISABLED_gets_buffer_dimensions)
113 #else
114@@ -682,7 +682,7 @@
115 * trying to marshall stub buffers causes crashes.
116 */
117
118-#ifndef ANDROID
119+#ifndef MIR_BUILD_PLATFORM_ANDROID
120 TEST_F(ClientLibrary, create_simple_normal_surface_from_spec)
121 #else
122 TEST_F(ClientLibrary, DISABLED_create_simple_normal_surface_from_spec)
123@@ -713,7 +713,7 @@
124 mir_connection_release(connection);
125 }
126
127-#ifndef ANDROID
128+#ifndef MIR_BUILD_PLATFORM_ANDROID
129 TEST_F(ClientLibrary, create_simple_normal_surface_from_spec_async)
130 #else
131 TEST_F(ClientLibrary, DISABLED_create_simple_normal_surface_from_spec_async)
132@@ -744,7 +744,7 @@
133 mir_connection_release(connection);
134 }
135
136-#ifndef ANDROID
137+#ifndef MIR_BUILD_PLATFORM_ANDROID
138 TEST_F(ClientLibrary, can_specify_all_normal_surface_parameters_from_spec)
139 #else
140 TEST_F(ClientLibrary, DISABLED_can_specify_all_normal_surface_parameters_from_spec)
141@@ -780,7 +780,7 @@
142 mir_connection_release(connection);
143 }
144
145-#ifndef ANDROID
146+#ifndef MIR_BUILD_PLATFORM_ANDROID
147 TEST_F(ClientLibrary, set_fullscreen_on_output_makes_fullscreen_surface)
148 #else
149 TEST_F(ClientLibrary, DISABLED_set_fullscreen_on_output_makes_fullscreen_surface)
150
151=== modified file 'tests/include/mir_test_doubles/platform_factory.h'
152--- tests/include/mir_test_doubles/platform_factory.h 2014-06-06 07:56:34 +0000
153+++ tests/include/mir_test_doubles/platform_factory.h 2015-06-02 03:49:23 +0000
154@@ -35,7 +35,7 @@
155
156 std::shared_ptr<graphics::Platform> create_platform_with_null_dependencies();
157
158-#ifndef ANDROID
159+#ifdef MIR_BUILD_PLATFORM_KMS
160 std::shared_ptr<graphics::mesa::Platform> create_mesa_platform_with_null_dependencies();
161 #endif
162
163
164=== modified file 'tests/include/mir_test_doubles/stub_client_buffer.h'
165--- tests/include/mir_test_doubles/stub_client_buffer.h 2015-05-19 21:34:34 +0000
166+++ tests/include/mir_test_doubles/stub_client_buffer.h 2015-06-02 03:49:23 +0000
167@@ -65,7 +65,7 @@
168
169 std::shared_ptr<graphics::NativeBuffer> native_buffer_handle() const override
170 {
171-#ifndef ANDROID
172+#ifndef MIR_BUILD_PLATFORM_ANDROID
173 return package;
174 #else
175 return std::shared_ptr<graphics::NativeBuffer>();
176
177=== modified file 'tests/integration-tests/graphics/android/CMakeLists.txt'
178--- tests/integration-tests/graphics/android/CMakeLists.txt 2015-01-21 07:34:50 +0000
179+++ tests/integration-tests/graphics/android/CMakeLists.txt 2015-06-02 03:49:23 +0000
180@@ -9,7 +9,7 @@
181 )
182
183 #include_directories(SYSTEM ${LIBHARDWARE_INCLUDE_DIRS})
184-#add_definitions(-DANDROID)
185+add_definitions(-DMIR_BUILD_PLATFORM_ANDROID)
186
187 set(
188 INTEGRATION_TESTS_SRCS
189
190=== modified file 'tests/mir_test_doubles/platform_factory.cpp'
191--- tests/mir_test_doubles/platform_factory.cpp 2015-06-02 03:49:22 +0000
192+++ tests/mir_test_doubles/platform_factory.cpp 2015-06-02 03:49:23 +0000
193@@ -20,7 +20,7 @@
194
195 #include "mir/graphics/platform.h"
196
197-#ifndef ANDROID
198+#ifndef MIR_BUILD_PLATFORM_ANDROID
199 #include "src/platforms/mesa/server/kms/platform.h"
200 #endif
201
202@@ -31,7 +31,7 @@
203
204 namespace mtd = mir::test::doubles;
205
206-#ifdef ANDROID
207+#ifdef MIR_BUILD_PLATFORM_ANDROID
208 auto mtd::create_platform_with_null_dependencies()
209 -> std::shared_ptr<graphics::Platform>
210 {
211
212=== modified file 'tests/mir_test_doubles/stub_buffer.cpp'
213--- tests/mir_test_doubles/stub_buffer.cpp 2014-11-17 17:41:54 +0000
214+++ tests/mir_test_doubles/stub_buffer.cpp 2015-06-02 03:49:23 +0000
215@@ -18,7 +18,7 @@
216
217 #include "mir_test_doubles/stub_buffer.h"
218
219-#ifdef ANDROID
220+#ifdef MIR_BUILD_PLATFORM_ANDROID
221 #include "mir_test_doubles/stub_android_native_buffer.h"
222 #else
223 #include "mir_test_doubles/stub_gbm_native_buffer.h"
224@@ -29,7 +29,7 @@
225 auto mtd::StubBuffer::create_native_buffer()
226 -> std::shared_ptr<graphics::NativeBuffer>
227 {
228-#ifndef ANDROID
229+#ifndef MIR_BUILD_PLATFORM_ANDROID
230 return std::make_shared<StubGBMNativeBuffer>(geometry::Size{0,0});
231 #else
232 return std::make_shared<StubAndroidNativeBuffer>();
233
234=== modified file 'tests/mir_test_framework/stub_client_platform_factory.cpp'
235--- tests/mir_test_framework/stub_client_platform_factory.cpp 2015-05-19 21:34:34 +0000
236+++ tests/mir_test_framework/stub_client_platform_factory.cpp 2015-06-02 03:49:23 +0000
237@@ -75,7 +75,7 @@
238 MirNativeBuffer* convert_native_buffer(mir::graphics::NativeBuffer* buf) const
239 {
240 static_cast<void>(buf);
241-#ifndef ANDROID
242+#ifdef MIR_BUILD_PLATFORM_KMS
243 return buf;
244 #else
245 return nullptr;
246
247=== modified file 'tests/mir_test_framework/stubbed_graphics_platform.cpp'
248--- tests/mir_test_framework/stubbed_graphics_platform.cpp 2015-05-19 21:34:34 +0000
249+++ tests/mir_test_framework/stubbed_graphics_platform.cpp 2015-06-02 03:49:23 +0000
250@@ -28,7 +28,7 @@
251 #include "mir/fd.h"
252 #include "mir_test/pipe.h"
253
254-#ifdef ANDROID
255+#ifdef MIR_BUILD_PLATFORM_ANDROID
256 #include "mir_test_doubles/stub_android_native_buffer.h"
257 #endif
258
259@@ -65,7 +65,7 @@
260
261 std::shared_ptr<mg::NativeBuffer> native_buffer_handle() const override
262 {
263-#ifndef ANDROID
264+#ifndef MIR_BUILD_PLATFORM_ANDROID
265 auto native_buffer = std::make_shared<mg::NativeBuffer>();
266 native_buffer->data_items = 1;
267 native_buffer->data[0] = 0xDEADBEEF;
268@@ -124,7 +124,7 @@
269 {
270 if (msg_type == mg::BufferIpcMsgType::full_msg)
271 {
272-#ifndef ANDROID
273+#ifndef MIR_BUILD_PLATFORM_ANDROID
274 auto native_handle = buffer.native_buffer_handle();
275 for(auto i=0; i<native_handle->data_items; i++)
276 {
277
278=== modified file 'tests/performance-tests/test_glmark2-es2-mir.cpp'
279--- tests/performance-tests/test_glmark2-es2-mir.cpp 2015-01-21 07:34:50 +0000
280+++ tests/performance-tests/test_glmark2-es2-mir.cpp 2015-06-02 03:49:23 +0000
281@@ -18,7 +18,7 @@
282 {
283 void SetUp() override
284 {
285-#ifdef ANDROID
286+#ifdef MIR_BUILD_PLATFORM_ANDROID
287 /*
288 * Workaround instability that causes freezes when combining
289 * Android overlays with high-speed frame dropping (LP: #1391261).
290
291=== modified file 'tests/unit-tests/graphics/test_display.cpp'
292--- tests/unit-tests/graphics/test_display.cpp 2015-03-31 02:35:42 +0000
293+++ tests/unit-tests/graphics/test_display.cpp 2015-06-02 03:49:23 +0000
294@@ -28,7 +28,7 @@
295 #include "mir_test_doubles/stub_gl_program_factory.h"
296 #include "mir_test_doubles/platform_factory.h"
297 #include "src/server/graphics/default_display_configuration_policy.h"
298-#ifndef ANDROID
299+#ifndef MIR_BUILD_PLATFORM_ANDROID
300 #include "mir_test_doubles/mock_drm.h"
301 #include "mir_test_doubles/mock_gbm.h"
302 #include "mir_test_framework/udev_environment.h"
303@@ -42,7 +42,7 @@
304
305 namespace mg = mir::graphics;
306 namespace mtd = mir::test::doubles;
307-#ifndef ANDROID
308+#ifndef MIR_BUILD_PLATFORM_ANDROID
309 namespace mtf = mir_test_framework;
310 #endif
311
312@@ -61,7 +61,7 @@
313 mock_egl.provide_egl_extensions();
314 mock_gl.provide_gles_extensions();
315
316-#ifndef ANDROID
317+#ifndef MIR_BUILD_PLATFORM_ANDROID
318 fake_devices.add_standard_device("standard-drm-devices");
319 #endif
320 }
321@@ -77,7 +77,7 @@
322
323 ::testing::NiceMock<mtd::MockEGL> mock_egl;
324 ::testing::NiceMock<mtd::MockGL> mock_gl;
325-#ifdef ANDROID
326+#ifdef MIR_BUILD_PLATFORM_ANDROID
327 ::testing::NiceMock<mtd::HardwareAccessMock> hw_access_mock;
328 #else
329 ::testing::NiceMock<mtd::MockDRM> mock_drm;
330
331=== modified file 'tests/unit-tests/graphics/test_graphics_platform.cpp'
332--- tests/unit-tests/graphics/test_graphics_platform.cpp 2015-01-21 07:34:50 +0000
333+++ tests/unit-tests/graphics/test_graphics_platform.cpp 2015-06-02 03:49:23 +0000
334@@ -24,7 +24,7 @@
335 #include "mir_test_doubles/mock_egl.h"
336 #include "mir_test_doubles/mock_gl.h"
337 #include "mir_test_doubles/platform_factory.h"
338-#ifndef ANDROID
339+#ifndef MIR_BUILD_PLATFORM_ANDROID
340 #include "mir_test_doubles/mock_drm.h"
341 #include "mir_test_doubles/mock_gbm.h"
342 #include "mir_test_framework/udev_environment.h"
343@@ -41,7 +41,7 @@
344 namespace geom = mir::geometry;
345 namespace mtd = mir::test::doubles;
346 namespace mo = mir::options;
347-#ifndef ANDROID
348+#ifndef MIR_BUILD_PLATFORM_ANDROID
349 namespace mtf = mir_test_framework;
350 #endif
351
352@@ -52,7 +52,7 @@
353 {
354 using namespace testing;
355
356-#ifndef ANDROID
357+#ifndef MIR_BUILD_PLATFORM_ANDROID
358 ON_CALL(mock_gbm, gbm_bo_get_width(_))
359 .WillByDefault(Return(320));
360
361@@ -75,7 +75,7 @@
362
363 ::testing::NiceMock<mtd::MockEGL> mock_egl;
364 ::testing::NiceMock<mtd::MockGL> mock_gl;
365-#ifdef ANDROID
366+#ifdef MIR_BUILD_PLATFORM_ANDROID
367 ::testing::NiceMock<mtd::HardwareAccessMock> hw_access_mock;
368 #else
369 ::testing::NiceMock<mtd::MockDRM> mock_drm;

Subscribers

People subscribed via source and target branches