Mir

Merge lp:~mir-team/mir/trunk-0.1.6 into lp:mir/0.1

Proposed by kevin gunn on 2014-02-28
Status: Merged
Approved by: Daniel van Vugt on 2014-03-06
Approved revision: 1446
Merged at revision: 1177
Proposed branch: lp:~mir-team/mir/trunk-0.1.6
Merge into: lp:mir/0.1
Diff against target: 19399 lines (+8125/-3470)
329 files modified
CMakeLists.txt (+23/-15)
cmake/FindXKBCOMMON.cmake (+1/-6)
cmake/MirCommon.cmake (+7/-10)
cmake/src/mir/mir_discover_gtest_tests.cpp (+24/-10)
cross-compile-chroot.sh (+64/-22)
debian/changelog (+68/-0)
debian/control (+72/-8)
debian/create_postinst_prerm_scripts.sh (+30/-0)
debian/install_ld_so_conf.sh (+18/-0)
debian/libmirclientplatform-android.install (+1/-0)
debian/libmirclientplatform-mesa.install (+1/-0)
debian/libmirplatform.install (+0/-1)
debian/libmirplatformgraphics-android.install (+1/-0)
debian/libmirplatformgraphics-mesa.install (+1/-0)
debian/libmirserver16.install (+1/-1)
debian/rules (+20/-10)
debian/update-alternatives.postinst.in (+18/-0)
debian/update-alternatives.prerm.in (+16/-0)
doc/component_reports.md (+5/-5)
examples/CMakeLists.txt (+14/-3)
examples/basic_server_configuration.cpp (+13/-7)
examples/demo-shell/demo_shell.cpp (+14/-7)
examples/render_overlays.cpp (+135/-0)
examples/render_surfaces.cpp (+34/-14)
examples/render_to_fb.cpp (+0/-1)
examples/scroll.cpp (+1/-1)
examples/server_configuration.cpp (+10/-4)
examples/server_configuration.h (+7/-1)
guides/cppguide.xml (+7/-6)
include/platform/mir/abnormal_exit.h (+3/-3)
include/platform/mir/graphics/drm_authenticator.h (+1/-3)
include/platform/mir/options/configuration.h (+74/-0)
include/platform/mir/options/default_configuration.h (+40/-75)
include/platform/mir/udev/wrapper.h (+2/-1)
include/server/mir/compositor/compositor_report.h (+0/-11)
include/server/mir/default_server_configuration.h (+18/-7)
include/server/mir/frontend/connector_report.h (+0/-15)
include/server/mir/frontend/session_mediator_report.h (+0/-24)
include/server/mir/input/surface.h (+1/-1)
include/server/mir/report/legacy_input_report.h (+39/-0)
include/server/mir/scene/scene_report.h (+7/-18)
include/shared/mir/report/lttng/mir_tracepoint.h (+1/-2)
include/shared/mir/report/lttng/tracepoint_provider.h (+6/-3)
include/shared/mir/shared_library.h (+3/-3)
include/test/mir_test/draw/graphics_region_factory.h (+18/-27)
include/test/mir_test/draw/patterns.h (+1/-1)
include/test/mir_test_doubles/mock_display_device.h (+1/-0)
include/test/mir_test_doubles/mock_drm.h (+1/-0)
include/test/mir_test_doubles/mock_gl.h (+2/-0)
include/test/mir_test_doubles/mock_hwc_composer_device_1.h (+2/-0)
include/test/mir_test_doubles/mock_input_surface.h (+2/-2)
include/test/mir_test_doubles/mock_renderer.h (+8/-6)
include/test/mir_test_doubles/stub_display_builder.h (+41/-27)
include/test/mir_test_doubles/stub_display_configuration.h (+2/-2)
include/test/mir_test_doubles/stub_renderer.h (+65/-0)
include/test/mir_test_doubles/stub_surface_builder.h (+7/-6)
include/test/mir_test_framework/udev_environment.h (+12/-2)
src/client/CMakeLists.txt (+9/-33)
src/client/android/CMakeLists.txt (+38/-0)
src/client/android/android_client_platform.cpp (+0/-7)
src/client/android/client_platform_factory.cpp (+34/-0)
src/client/android/client_platform_factory.h (+41/-0)
src/client/client_platform_factory.h (+8/-3)
src/client/default_connection_configuration.cpp (+31/-2)
src/client/lttng/CMakeLists.txt (+4/-7)
src/client/lttng/client_tracepoint_provider.h (+2/-2)
src/client/lttng/input_receiver_report.cpp (+65/-0)
src/client/lttng/input_receiver_report.h (+46/-0)
src/client/lttng/input_receiver_report_tp.h (+96/-0)
src/client/lttng/rpc_report.cpp (+1/-1)
src/client/lttng/rpc_report_tp.c (+0/-4)
src/client/lttng/tracepoints.c (+5/-0)
src/client/mesa/CMakeLists.txt (+40/-0)
src/client/mesa/client_platform.cpp (+1/-39)
src/client/mesa/client_platform_factory.cpp (+71/-0)
src/client/mesa/client_platform_factory.h (+41/-0)
src/client/mesa/native_surface.cpp (+12/-2)
src/client/mesa/native_surface.h (+1/-0)
src/client/mir_client_library.cpp (+1/-2)
src/client/mir_connection.cpp (+3/-2)
src/client/mir_screencast_api.cpp (+1/-1)
src/client/native_client_platform_factory.h (+0/-49)
src/platform/CMakeLists.txt (+1/-0)
src/platform/graphics/CMakeLists.txt (+2/-3)
src/platform/graphics/android/CMakeLists.txt (+21/-3)
src/platform/graphics/android/android_display.cpp (+4/-23)
src/platform/graphics/android/android_display.h (+3/-7)
src/platform/graphics/android/android_display_configuration.cpp (+3/-19)
src/platform/graphics/android/android_display_configuration.h (+1/-1)
src/platform/graphics/android/android_platform.cpp (+1/-1)
src/platform/graphics/android/configurable_display_buffer.h (+43/-0)
src/platform/graphics/android/display_buffer.cpp (+65/-8)
src/platform/graphics/android/display_buffer.h (+8/-3)
src/platform/graphics/android/display_builder.h (+2/-5)
src/platform/graphics/android/display_device.h (+1/-0)
src/platform/graphics/android/fb_device.cpp (+5/-0)
src/platform/graphics/android/fb_device.h (+1/-0)
src/platform/graphics/android/hwc_common_device.cpp (+6/-3)
src/platform/graphics/android/hwc_common_device.h (+1/-0)
src/platform/graphics/android/hwc_device.cpp (+28/-16)
src/platform/graphics/android/hwc_device.h (+2/-1)
src/platform/graphics/android/hwc_fb_device.cpp (+24/-12)
src/platform/graphics/android/hwc_fb_device.h (+1/-0)
src/platform/graphics/android/hwc_layerlist.cpp (+117/-43)
src/platform/graphics/android/hwc_layerlist.h (+33/-8)
src/platform/graphics/android/hwc_layers.cpp (+96/-94)
src/platform/graphics/android/hwc_layers.h (+32/-38)
src/platform/graphics/android/output_builder.cpp (+4/-10)
src/platform/graphics/android/output_builder.h (+2/-3)
src/platform/graphics/mesa/CMakeLists.txt (+19/-3)
src/platform/graphics/mesa/display.cpp (+11/-0)
src/platform/graphics/mesa/display_buffer.cpp (+72/-31)
src/platform/graphics/mesa/display_buffer.h (+4/-1)
src/platform/graphics/mesa/display_helpers.cpp (+8/-1)
src/platform/graphics/mesa/platform.cpp (+1/-1)
src/platform/graphics/mesa/platform.h (+1/-1)
src/platform/options/CMakeLists.txt (+1/-0)
src/platform/options/default_configuration.cpp (+105/-100)
src/platform/options/program_option.cpp (+3/-3)
src/platform/udev_wrapper.cpp (+16/-0)
src/server/CMakeLists.txt (+5/-5)
src/server/compositor/CMakeLists.txt (+2/-1)
src/server/compositor/compositing_screencast.cpp (+176/-0)
src/server/compositor/compositing_screencast.h (+74/-0)
src/server/compositor/default_configuration.cpp (+9/-21)
src/server/compositor/default_display_buffer_compositor.cpp (+2/-1)
src/server/compositor/gl_renderer.cpp (+56/-23)
src/server/compositor/gl_renderer.h (+6/-1)
src/server/compositor/gl_renderer_factory.cpp (+0/-8)
src/server/compositor/gl_renderer_factory.h (+0/-5)
src/server/compositor/multi_threaded_compositor.cpp (+1/-1)
src/server/compositor/renderer.h (+5/-1)
src/server/compositor/screencast_display_buffer.cpp (+110/-0)
src/server/compositor/screencast_display_buffer.h (+85/-0)
src/server/compositor/switching_bundle.cpp (+33/-7)
src/server/compositor/switching_bundle.h (+5/-1)
src/server/default_server_configuration.cpp (+15/-79)
src/server/frontend/CMakeLists.txt (+0/-9)
src/server/frontend/default_configuration.cpp (+4/-7)
src/server/frontend/published_socket_connector.cpp (+1/-41)
src/server/frontend/published_socket_connector.h (+0/-3)
src/server/frontend/session_mediator.cpp (+43/-2)
src/server/frontend/session_mediator_android.cpp (+0/-44)
src/server/frontend/session_mediator_mesa.cpp (+0/-68)
src/server/graphics/default_configuration.cpp (+23/-13)
src/server/graphics/nested/nested_display.cpp (+2/-1)
src/server/input/CMakeLists.txt (+0/-1)
src/server/input/android/android_input_window_handle.cpp (+1/-1)
src/server/input/default_configuration.cpp (+11/-7)
src/server/logging/CMakeLists.txt (+23/-0)
src/server/logging/default_configuration.cpp (+0/-108)
src/server/lttng/input_report_tp.c (+0/-4)
src/server/lttng/message_processor_report_tp.c (+0/-4)
src/server/report/CMakeLists.txt (+10/-0)
src/server/report/default_server_configuration.cpp (+119/-0)
src/server/report/logging/CMakeLists.txt (+2/-2)
src/server/report/logging/compositor_report.cpp (+18/-21)
src/server/report/logging/compositor_report.h (+18/-13)
src/server/report/logging/connector_report.cpp (+17/-16)
src/server/report/logging/connector_report.h (+11/-5)
src/server/report/logging/display_report.cpp (+57/-56)
src/server/report/logging/display_report.h (+11/-5)
src/server/report/logging/input_report.cpp (+16/-13)
src/server/report/logging/input_report.h (+12/-11)
src/server/report/logging/logging_report_factory.cpp (+75/-0)
src/server/report/logging/message_processor_report.cpp (+17/-16)
src/server/report/logging/message_processor_report.h (+12/-7)
src/server/report/logging/scene_report.cpp (+75/-82)
src/server/report/logging/scene_report.h (+17/-13)
src/server/report/logging/session_mediator_report.cpp (+45/-45)
src/server/report/logging/session_mediator_report.h (+14/-7)
src/server/report/logging_report_factory.h (+59/-0)
src/server/report/lttng/CMakeLists.txt (+9/-14)
src/server/report/lttng/compositor_report.cpp (+49/-0)
src/server/report/lttng/compositor_report.h (+52/-0)
src/server/report/lttng/compositor_report_tp.h (+76/-0)
src/server/report/lttng/connector_report.cpp (+65/-0)
src/server/report/lttng/connector_report.h (+58/-0)
src/server/report/lttng/connector_report_tp.h (+68/-0)
src/server/report/lttng/display_report.cpp (+57/-0)
src/server/report/lttng/display_report.h (+60/-0)
src/server/report/lttng/display_report_tp.h (+69/-0)
src/server/report/lttng/input_report.cpp (+7/-6)
src/server/report/lttng/input_report.h (+16/-12)
src/server/report/lttng/input_report_tp.h (+3/-16)
src/server/report/lttng/lttng_report_factory.cpp (+64/-0)
src/server/report/lttng/lttng_utils.h (+47/-0)
src/server/report/lttng/lttng_utils_pop.h (+22/-0)
src/server/report/lttng/message_processor_report.cpp (+27/-23)
src/server/report/lttng/message_processor_report.h (+8/-4)
src/server/report/lttng/message_processor_report_tp.h (+58/-22)
src/server/report/lttng/scene_report.cpp (+44/-0)
src/server/report/lttng/scene_report.h (+48/-0)
src/server/report/lttng/scene_report_tp.h (+59/-0)
src/server/report/lttng/server_tracepoint_provider.cpp (+2/-2)
src/server/report/lttng/server_tracepoint_provider.h (+5/-2)
src/server/report/lttng/session_mediator_report.cpp (+46/-0)
src/server/report/lttng/session_mediator_report.h (+53/-0)
src/server/report/lttng/session_mediator_report_tp.h (+68/-0)
src/server/report/lttng/tracepoints.c (+10/-0)
src/server/report/lttng_report_factory.h (+43/-0)
src/server/report/null/CMakeLists.txt (+12/-0)
src/server/report/null/compositor_report.cpp (+25/-25)
src/server/report/null/compositor_report.h (+46/-0)
src/server/report/null/connector_report.cpp (+31/-0)
src/server/report/null/connector_report.h (+50/-0)
src/server/report/null/display_report.cpp (+18/-18)
src/server/report/null/display_report.h (+25/-22)
src/server/report/null/input_report.cpp (+17/-17)
src/server/report/null/input_report.h (+11/-8)
src/server/report/null/message_processor_report.cpp (+26/-26)
src/server/report/null/message_processor_report.h (+10/-7)
src/server/report/null/null_report_factory.cpp (+92/-0)
src/server/report/null/scene_report.cpp (+36/-0)
src/server/report/null/scene_report.h (+51/-0)
src/server/report/null/session_mediator_report.cpp (+35/-35)
src/server/report/null/session_mediator_report.h (+64/-0)
src/server/report/null_report_factory.h (+51/-0)
src/server/report/report_factory.h (+72/-0)
src/server/scene/CMakeLists.txt (+0/-2)
src/server/scene/application_session.cpp (+4/-1)
src/server/scene/basic_surface.cpp (+155/-40)
src/server/scene/basic_surface.h (+62/-40)
src/server/scene/default_configuration.cpp (+1/-38)
src/server/scene/mutable_surface_state.h (+5/-5)
src/server/scene/session_manager.cpp (+2/-0)
src/server/scene/surface_allocator.cpp (+9/-7)
src/server/scene/surface_data.cpp (+0/-194)
src/server/scene/surface_data.h (+0/-82)
src/server/scene/surface_impl.cpp (+1/-1)
src/server/scene/surface_stack.cpp (+6/-6)
src/shared/CMakeLists.txt (+3/-2)
src/shared/graphics/android/CMakeLists.txt (+2/-0)
src/shared/report/lttng/tracepoint_provider.cpp (+3/-3)
src/shared/sharedlibrary/CMakeLists.txt (+19/-0)
src/shared/sharedlibrary/shared_library.cpp (+3/-3)
src/utils/screencast.cpp (+59/-43)
tests/CMakeLists.txt (+3/-2)
tests/acceptance-tests/test_client_authorization.cpp (+2/-0)
tests/acceptance-tests/test_client_input.cpp (+0/-5)
tests/acceptance-tests/test_nested_mir.cpp (+6/-1)
tests/acceptance-tests/test_server_shutdown.cpp (+4/-28)
tests/draw/CMakeLists.txt (+9/-7)
tests/draw/android_graphics_region_factory.cpp (+53/-47)
tests/draw/mesa_graphics_region_factory.cpp (+42/-0)
tests/integration-tests/CMakeLists.txt (+3/-2)
tests/integration-tests/client/CMakeLists.txt (+1/-1)
tests/integration-tests/client/test_client_render.cpp (+9/-10)
tests/integration-tests/compositor/test_swapping_swappers.cpp (+38/-36)
tests/integration-tests/frontend/test_application_mediator_report.cpp (+7/-1)
tests/integration-tests/graphics/android/test_buffer_integration.cpp (+6/-4)
tests/integration-tests/graphics/android/test_display_integration.cpp (+0/-1)
tests/integration-tests/graphics/android/test_internal_client.cpp (+5/-3)
tests/integration-tests/graphics/mesa/test_buffer_integration.cpp (+5/-2)
tests/integration-tests/input/CMakeLists.txt (+1/-1)
tests/integration-tests/input/android/test_android_cursor_listener.cpp (+4/-2)
tests/integration-tests/input/android/test_android_input_manager.cpp (+4/-3)
tests/integration-tests/test_session.cpp (+3/-18)
tests/integration-tests/test_surface_first_frame_sync.cpp (+2/-13)
tests/mir_test_doubles/CMakeLists.txt (+2/-2)
tests/mir_test_doubles/mock_drm.cpp (+7/-4)
tests/mir_test_doubles/mock_gl.cpp (+13/-0)
tests/mir_test_doubles/test_protobuf_socket_server.cpp (+5/-4)
tests/mir_test_framework/stubbed_server_configuration.cpp (+17/-28)
tests/mir_test_framework/testing_client_options.cpp (+2/-2)
tests/mir_test_framework/udev_environment.cpp (+28/-14)
tests/unit-tests/CMakeLists.txt (+3/-0)
tests/unit-tests/android_input/input_reader.cpp (+7/-7)
tests/unit-tests/client/CMakeLists.txt (+2/-2)
tests/unit-tests/client/android/test_android_client_platform.cpp (+3/-3)
tests/unit-tests/client/mesa/test_client_platform.cpp (+5/-5)
tests/unit-tests/client/mesa/test_native_surface.cpp (+20/-0)
tests/unit-tests/client/test_client_platform.cpp (+8/-11)
tests/unit-tests/client/test_mir_connection.cpp (+8/-0)
tests/unit-tests/compositor/CMakeLists.txt (+2/-0)
tests/unit-tests/compositor/test_compositing_screencast.cpp (+281/-0)
tests/unit-tests/compositor/test_default_display_buffer_compositor.cpp (+28/-15)
tests/unit-tests/compositor/test_gl_renderer.cpp (+4/-5)
tests/unit-tests/compositor/test_multi_threaded_compositor.cpp (+3/-2)
tests/unit-tests/compositor/test_rendering_operator.cpp (+2/-2)
tests/unit-tests/compositor/test_screencast_display_buffer.cpp (+169/-0)
tests/unit-tests/frontend/CMakeLists.txt (+2/-2)
tests/unit-tests/frontend/test_published_socket_connector.cpp (+6/-27)
tests/unit-tests/frontend/test_session_mediator.cpp (+3/-2)
tests/unit-tests/frontend/test_session_mediator_android.cpp (+3/-1)
tests/unit-tests/frontend/test_session_mediator_mesa.cpp (+7/-4)
tests/unit-tests/graphics/CMakeLists.txt (+2/-2)
tests/unit-tests/graphics/android/test_android_fb.cpp (+23/-52)
tests/unit-tests/graphics/android/test_android_platform.cpp (+4/-3)
tests/unit-tests/graphics/android/test_fb_device.cpp (+11/-5)
tests/unit-tests/graphics/android/test_hwc_common_device.cpp (+14/-34)
tests/unit-tests/graphics/android/test_hwc_device.cpp (+2/-0)
tests/unit-tests/graphics/android/test_hwc_display.cpp (+146/-26)
tests/unit-tests/graphics/android/test_hwc_layerlist.cpp (+173/-54)
tests/unit-tests/graphics/android/test_hwc_layers.cpp (+161/-127)
tests/unit-tests/graphics/android/test_output_builder.cpp (+29/-37)
tests/unit-tests/graphics/mesa/CMakeLists.txt (+1/-0)
tests/unit-tests/graphics/mesa/mock_kms_output.h (+52/-0)
tests/unit-tests/graphics/mesa/test_buffer_allocator.cpp (+4/-3)
tests/unit-tests/graphics/mesa/test_cursor.cpp (+2/-19)
tests/unit-tests/graphics/mesa/test_display.cpp (+24/-24)
tests/unit-tests/graphics/mesa/test_display_buffer.cpp (+74/-11)
tests/unit-tests/graphics/mesa/test_display_configuration.cpp (+4/-3)
tests/unit-tests/graphics/mesa/test_display_multi_monitor.cpp (+14/-5)
tests/unit-tests/graphics/mesa/test_drm_helper.cpp (+65/-0)
tests/unit-tests/graphics/mesa/test_gbm_buffer.cpp (+4/-3)
tests/unit-tests/graphics/mesa/test_internal_client.cpp (+1/-1)
tests/unit-tests/graphics/mesa/test_kms_page_flipper.cpp (+1/-1)
tests/unit-tests/graphics/mesa/test_linux_virtual_terminal.cpp (+10/-9)
tests/unit-tests/graphics/mesa/test_platform.cpp (+12/-9)
tests/unit-tests/graphics/offscreen/test_offscreen_display.cpp (+8/-6)
tests/unit-tests/graphics/test_display.cpp (+4/-3)
tests/unit-tests/graphics/test_graphics_platform.cpp (+5/-13)
tests/unit-tests/input/android/test_android_input_registrar.cpp (+1/-1)
tests/unit-tests/input/android/test_android_input_window_handle.cpp (+1/-1)
tests/unit-tests/logging/message_processor_report.cpp (+2/-2)
tests/unit-tests/logging/test_compositor_report.cpp (+4/-4)
tests/unit-tests/logging/test_display_report.cpp (+3/-2)
tests/unit-tests/logging/test_legacy_input_report.cpp (+4/-4)
tests/unit-tests/scene/CMakeLists.txt (+1/-1)
tests/unit-tests/scene/test_application_session.cpp (+67/-18)
tests/unit-tests/scene/test_basic_surface.cpp (+146/-37)
tests/unit-tests/scene/test_surface.cpp (+155/-35)
tests/unit-tests/scene/test_surface_impl.cpp (+8/-8)
tests/unit-tests/scene/test_surface_stack.cpp (+54/-34)
tests/unit-tests/test_udev_wrapper.cpp (+70/-0)
tools/install_on_android.sh (+1/-0)
tools/setup-partial-armhf-chroot.sh (+42/-72)
tools/valgrind_suppressions_armhf (+111/-0)
To merge this branch: bzr merge lp:~mir-team/mir/trunk-0.1.6
Reviewer Review Type Date Requested Status
Daniel van Vugt 2014-02-28 Approve on 2014-03-06
PS Jenkins bot (community) continuous-integration Approve on 2014-03-05
Mir development team 2014-03-04 Pending
Review via email: mp+208717@code.launchpad.net

Commit message

Latest upstream release of Mir 0.1.6 (lp:~mir-team/mir/development-branch r1433)

To post a comment you must log in.
lp:~mir-team/mir/trunk-0.1.6 updated on 2014-02-28
1436. By kevin gunn on 2014-02-28

Latest upstream release of Mir0.1.6 (lp:~mir-team/mir/development-branch r1433)

Daniel van Vugt (vanvugt) wrote :

The diff to tagged release 0.1.6 is good. Only changelog differs.

Only mentions of last minute bugs are missing from changelog:
  bug 1285955
  bug 1207312

I would also recommend not cluttering the changelog with details of internal changes that users of Mir won't ever need to understand. e.g. All but one of these are meaningless to the public Mir SDK so should not be mentioned;

396 + - config, frontend: remove force_threads_to_unblock_callback()
397 + - Protect input region member of surface data, hold mutex to access
398 + hidden member.
399 + - config: ConfigurationOptions::default_ipc_threads can be a constant.
400 + - debian: Provide platform packages managed with dpkg alternatives.
401 + - Add the ability to load device traces, both udev and ioctls, in the
402 + UdevEnvironment test helper.
403 + - test_client_input.cpp: Remove unused global "mir_test_socket".
404 + - Sundry improvements to mir::udev.

That's not all. I just picked it as an example. Only line 400 would qualify as meaningful to anyone else, so release notable.

review: Needs Fixing
kevin gunn (kgunn72) wrote :

wasn't sure to include bug 1285955 as fixed, as the mp is more of a temp workaround - but i'll include that.

I'm torn about condensing the changelog - i prefer the detail. But, happy to conform to convention.
I'll take one more scrub, but then let's move on getting this in.

> The diff to tagged release 0.1.6 is good. Only changelog differs.
>
> Only mentions of last minute bugs are missing from changelog:
> bug 1285955
> bug 1207312
>
> I would also recommend not cluttering the changelog with details of internal
> changes that users of Mir won't ever need to understand. e.g. All but one of
> these are meaningless to the public Mir SDK so should not be mentioned;
>
> 396 + - config, frontend: remove force_threads_to_unblock_callback()
> 397 + - Protect input region member of surface data, hold mutex to
> access
> 398 + hidden member.
> 399 + - config: ConfigurationOptions::default_ipc_threads can be a
> constant.
> 400 + - debian: Provide platform packages managed with dpkg
> alternatives.
> 401 + - Add the ability to load device traces, both udev and ioctls, in
> the
> 402 + UdevEnvironment test helper.
> 403 + - test_client_input.cpp: Remove unused global "mir_test_socket".
> 404 + - Sundry improvements to mir::udev.
>
> That's not all. I just picked it as an example. Only line 400 would qualify as
> meaningful to anyone else, so release notable.

lp:~mir-team/mir/trunk-0.1.6 updated on 2014-02-28
1437. By kevin gunn on 2014-02-28

condense changelog and add a 2 bug references

kevin gunn (kgunn72) wrote :

Did you test your feature/code change/bug fix ? what device(s) ?
dev branch ci testing across i386, amd64 & arm/nexus4

Did you break mir server API or ABI and have the relevant bumps to .so and debian docs been made ?
yes - libmirserver, updates have been made

Did you break mir client API or ABI and have you followed up with the known clients & announced on mir-devel mailing list ?
yes

Don't forget to check on Xorg in the case of client API break
does not break Xorg/xmir

lp:~mir-team/mir/trunk-0.1.6 updated on 2014-03-03
1438. By kevin gunn on 2014-03-03

updated snapshot from mir-devel r1441

Daniel van Vugt (vanvugt) wrote :

For bug 1285955 the "workaround" is the closest thing to a fix the Mir project will ever need. So that's definitely Fix Released for Mir in 0.1.6.

Daniel van Vugt (vanvugt) wrote :

I think the last commit should be reverted ("updated snapshot from mir-devel r1441"). Mir 0.1.6 is r1433. Nothing newer than that should be included until it's cooled down a bit as part of the 0.1.7 cycle.

review: Needs Fixing
Daniel van Vugt (vanvugt) wrote :

The post-0.1.6 changes I intentionally kept out of 0.1.6 because they're large and still carry some risk. So I'll keep those back to the 0.1.7 release.

lp:~mir-team/mir/trunk-0.1.6 updated on 2014-03-04
1439. By Daniel van Vugt on 2014-03-04

Revert previous commit. Take it back to the vanilla Mir 0.1.6.

Daniel van Vugt (vanvugt) wrote :

I don't quite understand how CI approved the same code (repeatedly) in development-branch but it doesn't pass here. I can only imagine it's CI that changed.

lp:~mir-team/mir/trunk-0.1.6 updated on 2014-03-04
1440. By Daniel van Vugt on 2014-03-04

Reworked the changelog. It's now a higher-level summary of changes relevant
to other projects. Also fixed typos.

Daniel van Vugt (vanvugt) :
review: Approve
Daniel van Vugt (vanvugt) wrote :

The first Jenkins failure is bug 1287600. A fix has now been proposed for that :P

lp:~mir-team/mir/trunk-0.1.6 updated on 2014-03-04
1441. By kevin gunn on 2014-03-04

simplify options for display configuration

1442. By kevin gunn on 2014-03-04

make customizing config options easier

1443. By kevin gunn on 2014-03-04

bug fix for cross compile script and update changelog

lp:~mir-team/mir/trunk-0.1.6 updated on 2014-03-05
1444. By Daniel van Vugt on 2014-03-05

Revert r1441. It's a large and potentially dangerous change I intentionally
kept out of 0.1.6.

1445. By Daniel van Vugt on 2014-03-05

Fix and clean up changelog

Daniel van Vugt (vanvugt) wrote :

Cleaned up. Now the branch contains exactly what the changelog says:

Mir 0.1.6
+ Two cherry picks from Mir 0.1.7 (one enhancement + one bug fix)
+ changelog additions.

review: Approve
Daniel van Vugt (vanvugt) wrote :

We should stop adding bits of Mir 0.1.7. There are large changes post-0.1.6 (that I wrote even) and it's safest if we let them cool down and mature some more over the weeks before entering distro.

kevin gunn (kgunn72) wrote :

you should not be landing anything on devel you would not instantly want in archive.
devel has been treated as sacred, devel was only created as a barrier for server changes. if you need to mature items, keep a feature branch and ask for testing help.

> We should stop adding bits of Mir 0.1.7. There are large changes post-0.1.6
> (that I wrote even) and it's safest if we let them cool down and mature some
> more over the weeks before entering distro.

lp:~mir-team/mir/trunk-0.1.6 updated on 2014-03-05
1446. By kevin gunn on 2014-03-05

due to silo build diff, suppress arm tests
note: these pass on ci builds

Daniel van Vugt (vanvugt) wrote :

Feature branches are the opposite of maturing code. In a feature branch, no one other than the author is using it on a daily basis. So the maturation (testing by multiple people) never even begins.

Daniel van Vugt (vanvugt) wrote :

The diff still looks correct, and accurately reflected in debian/changelog.

review: Approve
lp:~mir-team/mir/trunk-0.1.6 updated on 2014-03-06
1447. By kevin gunn on 2014-03-06

fix up debian control & rules

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'CMakeLists.txt'
--- CMakeLists.txt 2014-02-06 17:55:08 +0000
+++ CMakeLists.txt 2014-03-06 14:19:43 +0000
@@ -28,9 +28,14 @@
2828
29set(MIR_VERSION_MAJOR 0)29set(MIR_VERSION_MAJOR 0)
30set(MIR_VERSION_MINOR 1)30set(MIR_VERSION_MINOR 1)
31set(MIR_VERSION_PATCH 5)31set(MIR_VERSION_PATCH 6)
3232
33set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)33set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
34execute_process(
35 COMMAND ${CMAKE_CXX_COMPILER} -dumpmachine
36 OUTPUT_VARIABLE TARGET_ARCH
37 OUTPUT_STRIP_TRAILING_WHITESPACE
38)
3439
35option(use_debflags "Use build flags from dpkg-buildflags." OFF)40option(use_debflags "Use build flags from dpkg-buildflags." OFF)
36if(use_debflags)41if(use_debflags)
@@ -87,15 +92,28 @@
87)92)
88endif(MIR_DISABLE_EPOLL_REACTOR)93endif(MIR_DISABLE_EPOLL_REACTOR)
8994
95add_definitions(-DMESA_EGL_NO_X11_HEADERS)
96
90# Default to mesa backend97# Default to mesa backend
91set(98set(
92 MIR_PLATFORM99 MIR_PLATFORM
93 mesa100 mesa
94 CACHE101 CACHE
95 STRING102 STRING
96 "graphics backend to build (options are 'mesa' or 'android')"103 "a list of graphics backends to build (options are 'mesa' or 'android')"
97)104)
98105
106list(GET MIR_PLATFORM 0 MIR_TEST_PLATFORM)
107
108foreach(platform IN LISTS MIR_PLATFORM)
109 if (platform STREQUAL "mesa")
110 set(MIR_BUILD_PLATFORM_MESA TRUE)
111 endif()
112 if (platform STREQUAL "android")
113 set(MIR_BUILD_PLATFORM_ANDROID TRUE)
114 endif()
115endforeach(platform)
116
99find_package(EGL REQUIRED)117find_package(EGL REQUIRED)
100find_package(GLESv2 REQUIRED)118find_package(GLESv2 REQUIRED)
101find_package(GLM REQUIRED)119find_package(GLM REQUIRED)
@@ -110,24 +128,14 @@
110include_directories (${EGL_INCLUDE_DIRS})128include_directories (${EGL_INCLUDE_DIRS})
111include_directories (${GLM_INCLUDE_DIRS})129include_directories (${GLM_INCLUDE_DIRS})
112130
113if (MIR_PLATFORM STREQUAL "android")131if (MIR_BUILD_PLATFORM_ANDROID)
114
115 #android headers use 'int foo[0]' as struct members
116 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpermissive")
117
118 add_definitions( -DANDROID )
119
120 find_package(LibHardware REQUIRED)132 find_package(LibHardware REQUIRED)
133endif()
121134
122 #ctest does not work for android, so turn test discovery off135if (MIR_BUILD_PLATFORM_MESA)
123 set(DISABLE_GTEST_TEST_DISCOVERY ON)
124elseif (MIR_PLATFORM STREQUAL "mesa")
125 find_package( PkgConfig )136 find_package( PkgConfig )
126 pkg_check_modules( GBM REQUIRED gbm>=9.0.0)137 pkg_check_modules( GBM REQUIRED gbm>=9.0.0)
127 pkg_check_modules( DRM REQUIRED libdrm )138 pkg_check_modules( DRM REQUIRED libdrm )
128 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__GBM__")
129else ()
130 message (FATAL_ERROR "MIR_BACKEND must be either 'android' or 'mesa'")
131endif()139endif()
132140
133set(MIR_ANDROID_INCLUDE_DIRECTORIES) # to be filled by android-input141set(MIR_ANDROID_INCLUDE_DIRECTORIES) # to be filled by android-input
134142
=== modified file 'cmake/FindXKBCOMMON.cmake'
--- cmake/FindXKBCOMMON.cmake 2013-04-10 18:09:31 +0000
+++ cmake/FindXKBCOMMON.cmake 2014-03-06 14:19:43 +0000
@@ -3,13 +3,8 @@
3find_path(XKBCOMMON_INCLUDE_DIR xkbcommon/xkbcommon.h3find_path(XKBCOMMON_INCLUDE_DIR xkbcommon/xkbcommon.h
4 HINTS ${PC_XKBCOMMON_INCLUDEDIR} ${PC_XKBCOMMON_INCLUDE_DIRS})4 HINTS ${PC_XKBCOMMON_INCLUDEDIR} ${PC_XKBCOMMON_INCLUDE_DIRS})
55
6if (MIR_PLATFORM STREQUAL "android")
7find_library(XKBCOMMON_LIBRARY libxkbcommon.so
8 HINTS /usr/lib/arm-linux-gnueabihf/)
9else()
10find_library(XKBCOMMON_LIBRARY xkbcommon6find_library(XKBCOMMON_LIBRARY xkbcommon
11 HINTS ${PC_XKBCOMMON_LIBDIR} ${PC_XKBCOMMON_LIBRARY_DIRS})7 HINTS ${PC_XKBCOMMON_LIBDIR} ${PC_XKBCOMMON_LIBRARY_DIRS})
12endif()
138
14set(XKBCOMMON_LIBRARIES ${XKBCOMMON_LIBRARY})9set(XKBCOMMON_LIBRARIES ${XKBCOMMON_LIBRARY})
15set(XKBCOMMON_INCLUDE_DIRS ${XKBCOMMON_INCLUDE_DIR})10set(XKBCOMMON_INCLUDE_DIRS ${XKBCOMMON_INCLUDE_DIR})
@@ -20,4 +15,4 @@
20find_package_handle_standard_args(XKBCOMMON DEFAULT_MSG15find_package_handle_standard_args(XKBCOMMON DEFAULT_MSG
21 XKBCOMMON_LIBRARY XKBCOMMON_INCLUDE_DIR)16 XKBCOMMON_LIBRARY XKBCOMMON_INCLUDE_DIR)
2217
23mark_as_advanced(XKBCOMMON_INCLUDE_DIR XKBCOMMON_LIBRARY)
24\ No newline at end of file18\ No newline at end of file
19mark_as_advanced(XKBCOMMON_INCLUDE_DIR XKBCOMMON_LIBRARY)
2520
=== modified file 'cmake/MirCommon.cmake'
--- cmake/MirCommon.cmake 2014-01-16 04:00:01 +0000
+++ cmake/MirCommon.cmake 2014-03-06 14:19:43 +0000
@@ -22,15 +22,12 @@
22 valgrind)22 valgrind)
2323
24 if(VALGRIND_EXECUTABLE)24 if(VALGRIND_EXECUTABLE)
25 if(MIR_PLATFORM STREQUAL "android")25 set(VALGRIND_ARGS "--error-exitcode=1" "--trace-children=yes")
26 # don't exit with an error when valgrind find errors26 set(DISCOVER_FLAGS "--enable-memcheck")
27 #set(VALGRIND_ARGS "--error-exitcode=1")27 if (TARGET_ARCH STREQUAL "arm-linux-gnueabihf")
28 else()28 set(VALGRIND_ARGS ${VALGRIND_ARGS} "--suppressions=${CMAKE_SOURCE_DIR}/tools/valgrind_suppressions_armhf")
29 set(VALGRIND_ARGS "--error-exitcode=1 --trace-children=yes")29 set(DISCOVER_FLAGS ${DISCOVER_FLAGS} "--suppressions=${CMAKE_SOURCE_DIR}/tools/valgrind_suppressions_armhf")
30 endif()30 endif()
31
32 set(ENABLE_MEMCHECK_FLAG "--enable-memcheck")
33
34 else(VALGRIND_EXECUTABLE)31 else(VALGRIND_EXECUTABLE)
35 message("Not enabling memcheck as valgrind is missing on your system")32 message("Not enabling memcheck as valgrind is missing on your system")
36 endif(VALGRIND_EXECUTABLE)33 endif(VALGRIND_EXECUTABLE)
@@ -63,7 +60,7 @@
6360
64 add_custom_target(61 add_custom_target(
65 ${TEST_DISCOVERY_TARGET_NAME} ALL62 ${TEST_DISCOVERY_TARGET_NAME} ALL
66 ${EXECUTABLE_OUTPUT_PATH}/${EXECUTABLE} --gtest_list_tests | ${CMAKE_BINARY_DIR}/mir_gtest/mir_discover_gtest_tests --executable=${EXECUTABLE_OUTPUT_PATH}/${EXECUTABLE} ${ENABLE_MEMCHECK_FLAG}63 ${EXECUTABLE_OUTPUT_PATH}/${EXECUTABLE} --gtest_list_tests | ${CMAKE_BINARY_DIR}/mir_gtest/mir_discover_gtest_tests --executable=${EXECUTABLE_OUTPUT_PATH}/${EXECUTABLE} ${DISCOVER_FLAGS}
67 ${EXTRA_ENV_FLAGS}64 ${EXTRA_ENV_FLAGS}
68 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}65 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
69 COMMENT "Discovering Tests in ${EXECUTABLE}" VERBATIM)66 COMMENT "Discovering Tests in ${EXECUTABLE}" VERBATIM)
@@ -89,7 +86,7 @@
89 else()86 else()
90 add_custom_target(87 add_custom_target(
91 memcheck_test ALL88 memcheck_test ALL
92 ${CMAKE_BINARY_DIR}/mir_gtest/mir_discover_gtest_tests --executable=${CMAKE_BINARY_DIR}/mir_gtest/mir_test_memory_error --memcheck-test89 ${CMAKE_BINARY_DIR}/mir_gtest/mir_discover_gtest_tests --executable=${CMAKE_BINARY_DIR}/mir_gtest/mir_test_memory_error --memcheck-test ${DISCOVER_FLAGS}
93 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}90 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
94 COMMENT "Adding memcheck test" VERBATIM)91 COMMENT "Adding memcheck test" VERBATIM)
9592
9693
=== modified file 'cmake/src/mir/mir_discover_gtest_tests.cpp'
--- cmake/src/mir/mir_discover_gtest_tests.cpp 2013-07-01 06:29:43 +0000
+++ cmake/src/mir/mir_discover_gtest_tests.cpp 2014-03-06 14:19:43 +0000
@@ -58,26 +58,34 @@
58 return pattern;58 return pattern;
59}59}
6060
61vector<string> valgrind_cmd_patterns()61vector<string> valgrind_cmd_patterns(vector<string> const& suppressions)
62{62{
63 vector<string> patterns{63 vector<string> patterns{
64 "valgrind",64 "valgrind",
65 "--error-exitcode=1",65 "--error-exitcode=1",
66 "--trace-children=yes",66 "--trace-children=yes"
67 };
68
69 for (auto const& sup : suppressions)
70 patterns.push_back(std::string("--suppressions=") + sup);
71
72 vector<string> gtest_patterns{
67 "%s",73 "%s",
68 "--gtest_death_test_use_fork",74 "--gtest_death_test_use_fork",
69 "--gtest_filter=%s"75 "--gtest_filter=%s"
70 };76 };
7177
78 patterns.insert(patterns.end(), gtest_patterns.begin(), gtest_patterns.end());
79
72 return patterns;80 return patterns;
73}81}
7482
75string memcheck_cmd_line_pattern()83string memcheck_cmd_line_pattern(vector<string> const& suppressions)
76{84{
77 stringstream ss;85 stringstream ss;
7886
79 ss << "ADD_TEST(\"memcheck(%s.%s)\"";87 ss << "ADD_TEST(\"memcheck(%s.%s)\"";
80 for (auto& s : valgrind_cmd_patterns())88 for (auto& s : valgrind_cmd_patterns(suppressions))
81 ss << " \"" << s << "\"";89 ss << " \"" << s << "\"";
82 ss << ")" << endl;90 ss << ")" << endl;
8391
@@ -112,6 +120,7 @@
112 bool enable_memcheck;120 bool enable_memcheck;
113 bool memcheck_test;121 bool memcheck_test;
114 std::vector<std::pair<std::string, std::string>> extra_environment;122 std::vector<std::pair<std::string, std::string>> extra_environment;
123 std::vector<std::string> suppressions;
115};124};
116125
117bool parse_configuration_from_cmd_line(int argc, char** argv, Configuration& config)126bool parse_configuration_from_cmd_line(int argc, char** argv, Configuration& config)
@@ -121,6 +130,7 @@
121 {"enable-memcheck", no_argument, 0, 0},130 {"enable-memcheck", no_argument, 0, 0},
122 {"memcheck-test", no_argument, 0, 0},131 {"memcheck-test", no_argument, 0, 0},
123 {"add-environment", required_argument, 0, 0},132 {"add-environment", required_argument, 0, 0},
133 {"suppressions", required_argument, 0, 0},
124 {0, 0, 0, 0}134 {0, 0, 0, 0}
125 };135 };
126136
@@ -161,17 +171,21 @@
161 return false;171 return false;
162 config.extra_environment.push_back(std::make_pair(std::string(optarg, equal_pos - optarg), std::string(equal_pos + 1)));172 config.extra_environment.push_back(std::make_pair(std::string(optarg, equal_pos - optarg), std::string(equal_pos + 1)));
163 }173 }
174 else if (!strcmp(optname, "suppressions"))
175 {
176 config.suppressions.push_back(std::string(optarg));
177 }
164 }178 }
165179
166 return true;180 return true;
167}181}
168182
169string prepareMemcheckTestLine(string const& exe)183string prepareMemcheckTestLine(string const& exe, vector<string> const& suppressions)
170{184{
171 stringstream ss;185 stringstream ss;
172186
173 ss << "ADD_TEST(\"memcheck-test\" \"sh\" \"-c\" \"";187 ss << "ADD_TEST(\"memcheck-test\" \"sh\" \"-c\" \"";
174 for (auto& s : valgrind_cmd_patterns())188 for (auto& s : valgrind_cmd_patterns(suppressions))
175 ss << s << " ";189 ss << s << " ";
176 ss << "; if [ $? != 0 ]; then exit 0; else exit 1; fi\")";190 ss << "; if [ $? != 0 ]; then exit 0; else exit 1; fi\")";
177191
@@ -186,13 +200,13 @@
186 return cmd_line;200 return cmd_line;
187}201}
188202
189void emitMemcheckTest(string const& exe)203void emitMemcheckTest(string const& exe, vector<string> const& suppressions)
190{204{
191 ifstream CTestTestfile("CTestTestfile.cmake", ifstream::in);205 ifstream CTestTestfile("CTestTestfile.cmake", ifstream::in);
192 bool need_memcheck_test = true;206 bool need_memcheck_test = true;
193 string line;207 string line;
194208
195 string memcheckTestLine = prepareMemcheckTestLine(exe);209 string memcheckTestLine = prepareMemcheckTestLine(exe, suppressions);
196210
197 if (CTestTestfile.is_open())211 if (CTestTestfile.is_open())
198 {212 {
@@ -238,7 +252,7 @@
238252
239 if (config.memcheck_test)253 if (config.memcheck_test)
240 {254 {
241 emitMemcheckTest(config.executable);255 emitMemcheckTest(config.executable, config.suppressions);
242 return 0;256 return 0;
243 }257 }
244258
@@ -277,7 +291,7 @@
277 snprintf(291 snprintf(
278 cmd_line,292 cmd_line,
279 sizeof(cmd_line),293 sizeof(cmd_line),
280 config.enable_memcheck ? memcheck_cmd_line_pattern().c_str() :294 config.enable_memcheck ? memcheck_cmd_line_pattern(config.suppressions).c_str() :
281 ordinary_cmd_line_pattern().c_str(),295 ordinary_cmd_line_pattern().c_str(),
282 test_suite.c_str(),296 test_suite.c_str(),
283 elide_string_left(*test, output_width/2).c_str(),297 elide_string_left(*test, output_width/2).c_str(),
284298
=== modified file 'cross-compile-chroot.sh'
--- cross-compile-chroot.sh 2014-01-22 08:32:55 +0000
+++ cross-compile-chroot.sh 2014-03-06 14:19:43 +0000
@@ -1,27 +1,69 @@
1#!/bin/bash1#!/bin/bash
2# build script for Mir on android arm devices2# build script to compile Mir for armhf devices
3#3#
4set -e4set -e
55
6usage() {
7 echo "usage: $(basename $0) [-c] [-u]"
8 echo "-c clean before building"
9 echo "-u update partial chroot directory"
10 echo "-h this message"
11}
12
13clean_build_dir() {
14 rm -rf ${1}
15 mkdir ${1}
16}
17
6BUILD_DIR=build-android-arm18BUILD_DIR=build-android-arm
7NUM_JOBS=$(( `grep -c ^processor /proc/cpuinfo` + 1 ))19NUM_JOBS=$(( $(grep -c ^processor /proc/cpuinfo) + 1 ))
820_do_update_chroot=0
9if [ "$MIR_NDK_PATH" = "" ]; then21
10 export MIR_NDK_PATH=`pwd`/partial-armhf-chroot22while getopts "cuh" OPTNAME
11 if [ ! -d ${MIR_NDK_PATH} ]; then 23do
12 echo "no partial root specified or detected. attempting to create one"24 case $OPTNAME in
13 fi25 c )
14fi26 clean_build_dir ${BUILD_DIR}
1527 ;;
16pushd tools > /dev/null28 u )
17 ./setup-partial-armhf-chroot.sh ${MIR_NDK_PATH}29 _do_update_chroot=1
18popd > /dev/null30 ;;
1931 h )
20echo "Using MIR_NDK_PATH: $MIR_NDK_PATH"32 usage
2133 exit 0
22#start with a clean build every time34 ;;
23rm -rf ${BUILD_DIR}35 * )
24mkdir ${BUILD_DIR}36 echo "invalid option specified"
37 usage
38 exit 1
39 ;;
40 esac
41done
42
43
44if [ "${MIR_NDK_PATH}" = "" ]; then
45 export MIR_NDK_PATH=$(pwd)/partial-armhf-chroot
46fi
47
48if [ ! -d ${MIR_NDK_PATH} ]; then
49 echo "no partial chroot dir detected. attempting to create one"
50 _do_update_chroot=1
51fi
52
53if [ ! -d ${BUILD_DIR} ]; then
54 mkdir ${BUILD_DIR}
55fi
56
57if [ ${_do_update_chroot} -eq 1 ] ; then
58 pushd tools > /dev/null
59 ./setup-partial-armhf-chroot.sh ${MIR_NDK_PATH}
60 popd > /dev/null
61 # force a clean build after an update, since CMake cache maybe out of date
62 clean_build_dir ${BUILD_DIR}
63fi
64
65echo "Using MIR_NDK_PATH: ${MIR_NDK_PATH}"
66
25pushd ${BUILD_DIR} > /dev/null 67pushd ${BUILD_DIR} > /dev/null
2668
27 export PKG_CONFIG_PATH="${MIR_NDK_PATH}/usr/lib/pkgconfig:${MIR_NDK_PATH}/usr/lib/arm-linux-gnueabihf/pkgconfig"69 export PKG_CONFIG_PATH="${MIR_NDK_PATH}/usr/lib/pkgconfig:${MIR_NDK_PATH}/usr/lib/arm-linux-gnueabihf/pkgconfig"
@@ -33,9 +75,9 @@
33 echo "Using PKG_CONFIG_EXECUTABLE: $PKG_CONFIG_EXECUTABLE"75 echo "Using PKG_CONFIG_EXECUTABLE: $PKG_CONFIG_EXECUTABLE"
34 cmake -DCMAKE_TOOLCHAIN_FILE=../cmake/LinuxCrossCompile.cmake \76 cmake -DCMAKE_TOOLCHAIN_FILE=../cmake/LinuxCrossCompile.cmake \
35 -DBoost_COMPILER=-gcc \77 -DBoost_COMPILER=-gcc \
36 -DMIR_PLATFORM=android \78 -DMIR_PLATFORM=android\;mesa \
37 .. 79 ..
3880
39 cmake --build . -- -j${NUM_JOBS}81 make -j${NUM_JOBS}
4082
41popd ${BUILD_DIR} > /dev/null 83popd > /dev/null
4284
=== modified file 'debian/changelog'
--- debian/changelog 2014-02-12 18:29:30 +0000
+++ debian/changelog 2014-03-06 14:19:43 +0000
@@ -1,3 +1,71 @@
1mir (0.1.6-0ubuntu1) UNRELEASED; urgency=medium
2
3 * Cherry-picked from future release 0.1.7:
4 - Enhancement: options: Make it easier to customize DefaultConfiguration
5 - Bug fix: Don't pass a parameter to bash's popd command. It doesn't expect
6 one and will return an error from cross-compile-chroot.sh. (LP: #1287600)
7 * New upstream release 0.1.6 (https://launchpad.net/mir/+milestone/0.1.6)
8 - mirserver ABI bumped to 16.
9 - Server API changes:
10 . Report classes have moved to new namespaces/components. Please
11 consult the server headers.
12 . General clean-ups and virtual function changes affecting the ABI
13 (a rebuild is required for all shells).
14 - mirclient ABI unchanged, still at 7. Clients do not need rebuilding.
15 - Add new feature: Screen recording ("screencasting") as demonstrated by
16 the new mir-util "mirscreencast".
17 - debian: Provide platform packages managed with dpkg alternatives.
18 - Add new valgrind suppressions (mostly for armhf right now)
19 - tools: Add new libmirclientplatform.so to install_on_android.sh.
20 - Add "mir_demo_standalone_render_overlays", which is a free-standing
21 example of overlay support.
22 - Proper DisplayConfiguration for the AndroidDisplay to be better
23 prepared for multi-monitor Android.
24 - Commenced/continued simplifying the surface class hierarchy: BasicSurface
25 has now absorbed SurfaceData.
26 - Dynamically load the client platform library.
27 - Bugs fixed:
28 . Exceptions thrown from within compositing threads were untraceable,
29 resulting in a bunch of undebuggable crash reports (LP: #1237332)
30 . Ensure we close drm device file descriptors on exec. (LP: #1284081)
31 . nested render_surfaces fails on N4 [std::exception::what: Failed to
32 compile vertex shader:] (LP: #1284597)
33 . examples: correct "fullscreen-surfaces" option. (LP: #1284554)
34 . Fix mutex data race reported by helgrind in integration test:
35 SwapperSwappingStress (LP: #1282886)
36 . scene: Return null snapshots for sessions without surfaces
37 (LP: #1281728)
38 . tests: Address some raciness in
39 MesaDisplayTest.drm_device_change_event_triggers_handler.
40 (LP: #1283085)
41 . tests: Suppress spurious memory errors occuring when running the
42 unit tests on armhf with valgrind. (LP: #1279438)
43 . Mir shows an old frame on client startup (for Mesa GL clients)
44 (LP: #1281938)
45 . tests: Add expectation to validate second SessionAuthorizer method
46 is called wit correct parameter. (LP: #1218436)
47 . Set field "current_format" when sending a display config to the
48 server. (LP: #1277343)
49 . Fix crash in android devices by working around a subtle threading
50 bug, use a dummy thead_local array to push the gl/egl context TLS
51 into a region where the future wait code does not overwrite it.
52 (LP: #1280086)
53 . compositor: calling SwitchingBundle::force_requests_to_complete()
54 can be a no-op when there are no requests. (LP: #1281145)
55 . tests: Don't emit an "add" uevent manually when adding a device
56 (LP: #1281146)
57 . config: reduce size of default RPC thread pool. (LP: #1233001)
58 . Clients freeze on startup if 10 or more are already running
59 (LP: #1267323)
60 . Fix Nexus 10 leaking FDs in the hwc prepare/set loop. (LP: #1278658)
61 . Parallelize page flipping with rendering of the next frame, fixing
62 stuttering observed in multi-monitor clone mode (LP: #1213801)
63 . Ubuntu trusty update "glm 0.9.5.1-1" broke Mir builds. Work around the
64 change. (LP: #1285955)
65 . Screencast feature by compositing to offscreen buffer (LP: #1207312)
66
67 -- Kevin Gunn <kevin.gunn@canonical.com> Thu, 27 Feb 2014 19:37:47 -0600
68
1mir (0.1.5+14.04.20140212-0ubuntu1) trusty; urgency=medium69mir (0.1.5+14.04.20140212-0ubuntu1) trusty; urgency=medium
270
3 [ Kevin Gunn ]71 [ Kevin Gunn ]
472
=== modified file 'debian/control'
--- debian/control 2014-02-06 17:55:08 +0000
+++ debian/control 2014-03-06 14:19:43 +0000
@@ -19,20 +19,20 @@
19 libboost-regex-dev,19 libboost-regex-dev,
20 libboost-filesystem-dev,20 libboost-filesystem-dev,
21 protobuf-compiler,21 protobuf-compiler,
22 libdrm-dev [!armhf],22 libdrm-dev,
23 libegl1-mesa-dev,23 libegl1-mesa-dev,
24 libgles2-mesa-dev,24 libgles2-mesa-dev,
25 libgbm-dev [!armhf],25 libgbm-dev,
26 libglm-dev,26 libglm-dev,
27 libprotobuf-dev,27 libprotobuf-dev,
28 pkg-config,28 pkg-config,
29 android-headers (>=4.2.2) [armhf],29 android-headers (>=4.2.2) [i386 amd64 armhf],
30 libhardware-dev [armhf],30 libhardware-dev [i386 amd64 armhf],
31 libgoogle-glog-dev,31 libgoogle-glog-dev,
32 liblttng-ust-dev,32 liblttng-ust-dev,
33 libxkbcommon-dev,33 libxkbcommon-dev,
34 libumockdev-dev [!armhf],34 libumockdev-dev,
35 umockdev [!armhf],35 umockdev,
36 libudev-dev,36 libudev-dev,
37 google-mock (>= 1.6.0+svn437),37 google-mock (>= 1.6.0+svn437),
38 valgrind [!arm64],38 valgrind [!arm64],
@@ -70,7 +70,7 @@
70 .70 .
71 Contains the protocol's definition files.71 Contains the protocol's definition files.
7272
73Package: libmirserver1573Package: libmirserver16
74Section: libs74Section: libs
75Architecture: i386 amd64 armhf arm6475Architecture: i386 amd64 armhf arm64
76Multi-Arch: same76Multi-Arch: same
@@ -78,6 +78,8 @@
78Depends: ${misc:Depends},78Depends: ${misc:Depends},
79 ${shlibs:Depends},79 ${shlibs:Depends},
80 libmirplatform (= ${binary:Version}),80 libmirplatform (= ${binary:Version}),
81 libmirplatformgraphics-mesa (= ${binary:Version}) |
82 libmirplatformgraphics-android (= ${binary:Version}),
81Description: Display server for Ubuntu - server library83Description: Display server for Ubuntu - server library
82 Mir is a display server running on linux systems, with a focus on efficiency,84 Mir is a display server running on linux systems, with a focus on efficiency,
83 robust operation and a well-defined driver model.85 robust operation and a well-defined driver model.
@@ -99,6 +101,36 @@
99 Contains the shared libraries required for the Mir server to interact with101 Contains the shared libraries required for the Mir server to interact with
100 the underlying hardware platform.102 the underlying hardware platform.
101103
104Package: libmirplatformgraphics-mesa
105Section: libs
106Architecture: i386 amd64 armhf arm64
107Multi-Arch: same
108Pre-Depends: ${misc:Pre-Depends}
109Depends: ${misc:Depends},
110 ${shlibs:Depends},
111 libmirplatform (= ${binary:Version}),
112Description: Display server for Ubuntu - platform library for Mesa
113 Mir is a display server running on linux systems, with a focus on efficiency,
114 robust operation and a well-defined driver model.
115 .
116 Contains the shared libraries required for the Mir server to interact with
117 the hardware platform using the Mesa drivers.
118
119Package: libmirplatformgraphics-android
120Section: libs
121Architecture: i386 amd64 armhf
122Multi-Arch: same
123Pre-Depends: ${misc:Pre-Depends}
124Depends: ${misc:Depends},
125 ${shlibs:Depends},
126 libmirplatform (= ${binary:Version}),
127Description: Display server for Ubuntu - platform library for Android
128 Mir is a display server running on linux systems, with a focus on efficiency,
129 robust operation and a well-defined driver model.
130 .
131 Contains the shared libraries required for the Mir server to interact with
132 the hardware platform using the Android drivers.
133
102Package: mircommon-dev134Package: mircommon-dev
103Section: libdevel135Section: libdevel
104Architecture: i386 amd64 armhf arm64136Architecture: i386 amd64 armhf arm64
@@ -116,7 +148,7 @@
116Architecture: i386 amd64 armhf arm64148Architecture: i386 amd64 armhf arm64
117Multi-Arch: same149Multi-Arch: same
118Pre-Depends: ${misc:Pre-Depends}150Pre-Depends: ${misc:Pre-Depends}
119Depends: libmirserver15 (= ${binary:Version}),151Depends: libmirserver16 (= ${binary:Version}),
120 libmirprotobuf-dev (= ${binary:Version}),152 libmirprotobuf-dev (= ${binary:Version}),
121 mircommon-dev (= ${binary:Version}),153 mircommon-dev (= ${binary:Version}),
122 libglm-dev,154 libglm-dev,
@@ -135,6 +167,8 @@
135Pre-Depends: ${misc:Pre-Depends}167Pre-Depends: ${misc:Pre-Depends}
136Depends: ${misc:Depends},168Depends: ${misc:Depends},
137 ${shlibs:Depends},169 ${shlibs:Depends},
170 libmirclientplatform-mesa (= ${binary:Version}) |
171 libmirclientplatform-android (= ${binary:Version}),
138Description: Display server for Ubuntu - client library172Description: Display server for Ubuntu - client library
139 Mir is a display server running on linux systems, with a focus on efficiency,173 Mir is a display server running on linux systems, with a focus on efficiency,
140 robust operation and a well-defined driver model.174 robust operation and a well-defined driver model.
@@ -156,6 +190,36 @@
156 .190 .
157 Contains header files required to develop against Mir.191 Contains header files required to develop against Mir.
158192
193Package: libmirclientplatform-mesa
194Section: libs
195Architecture: i386 amd64 armhf arm64
196Multi-Arch: same
197Pre-Depends: ${misc:Pre-Depends}
198Depends: ${misc:Depends},
199 ${shlibs:Depends}
200Replaces: libmirclientplatform
201Description: Display server for Ubuntu - client platform library for Mesa
202 Mir is a display server running on linux systems, with a focus on efficiency,
203 robust operation and a well-defined driver model.
204 .
205 Contains the shared libraries required for the Mir clients to interact with
206 the underlying hardware platform using the Mesa drivers.
207
208Package: libmirclientplatform-android
209Section: libs
210Architecture: i386 amd64 armhf
211Multi-Arch: same
212Pre-Depends: ${misc:Pre-Depends}
213Depends: ${misc:Depends},
214 ${shlibs:Depends}
215Replaces: libmirclientplatform
216Description: Display server for Ubuntu - client platform library for Android
217 Mir is a display server running on linux systems, with a focus on efficiency,
218 robust operation and a well-defined driver model.
219 .
220 Contains the shared libraries required for the Mir clients to interact with
221 the underlying hardware platform using the Android drivers.
222
159Package: mir-demos223Package: mir-demos
160Architecture: i386 amd64 armhf arm64224Architecture: i386 amd64 armhf arm64
161Depends: ${misc:Depends},225Depends: ${misc:Depends},
162226
=== added file 'debian/create_postinst_prerm_scripts.sh'
--- debian/create_postinst_prerm_scripts.sh 1970-01-01 00:00:00 +0000
+++ debian/create_postinst_prerm_scripts.sh 2014-03-06 14:19:43 +0000
@@ -0,0 +1,30 @@
1#!/bin/sh
2
3set -e
4
5mir_platform_types="platformgraphics clientplatform"
6mir_platforms="android mesa"
7dpkg_alternatives_priority=500
8deb_host_multiarch=$1
9
10create_script()
11{
12 local script=$1
13 local platform_type=$2
14 local platform=$3
15
16 sed -e "s/@DEB_HOST_MULTIARCH@/$deb_host_multiarch/" \
17 -e "s/@MIR_PLATFORM_TYPE@/$platform_type/" \
18 -e "s/@MIR_PLATFORM@/$platform/" \
19 -e "s/@DPKG_ALTERNATIVES_PRIORITY@/$dpkg_alternatives_priority/" \
20 debian/update-alternatives.${script}.in > debian/libmir$platform_type-$platform.${script}
21}
22
23for platform_type in $mir_platform_types;
24do
25 for platform in $mir_platforms;
26 do
27 create_script postinst $platform_type $platform
28 create_script prerm $platform_type $platform
29 done
30done
031
=== added file 'debian/install_ld_so_conf.sh'
--- debian/install_ld_so_conf.sh 1970-01-01 00:00:00 +0000
+++ debian/install_ld_so_conf.sh 2014-03-06 14:19:43 +0000
@@ -0,0 +1,18 @@
1#!/bin/sh
2
3set -e
4
5mir_platform_types="platformgraphics clientplatform"
6mir_platforms="android mesa"
7
8DEB_HOST_MULTIARCH=$1
9
10for platform_type in $mir_platform_types;
11do
12 for platform in $mir_platforms;
13 do
14 platform_dir="/usr/lib/$DEB_HOST_MULTIARCH/mir/$platform_type/$platform"
15 package_dir="debian/libmir$platform_type-$platform/$platform_dir"
16 echo "$platform_dir" > $package_dir/ld.so.conf
17 done
18done
019
=== added file 'debian/libmirclientplatform-android.install'
--- debian/libmirclientplatform-android.install 1970-01-01 00:00:00 +0000
+++ debian/libmirclientplatform-android.install 2014-03-06 14:19:43 +0000
@@ -0,0 +1,1 @@
1usr/lib/*/mir/clientplatform/android/*
02
=== added file 'debian/libmirclientplatform-mesa.install'
--- debian/libmirclientplatform-mesa.install 1970-01-01 00:00:00 +0000
+++ debian/libmirclientplatform-mesa.install 2014-03-06 14:19:43 +0000
@@ -0,0 +1,1 @@
1usr/lib/*/mir/clientplatform/mesa/*
02
=== modified file 'debian/libmirplatform.install'
--- debian/libmirplatform.install 2013-08-09 03:54:38 +0000
+++ debian/libmirplatform.install 2014-03-06 14:19:43 +0000
@@ -1,2 +1,1 @@
1usr/lib/*/libmirplatform.so1usr/lib/*/libmirplatform.so
2usr/lib/*/libmirplatformgraphics.so
32
=== added file 'debian/libmirplatformgraphics-android.install'
--- debian/libmirplatformgraphics-android.install 1970-01-01 00:00:00 +0000
+++ debian/libmirplatformgraphics-android.install 2014-03-06 14:19:43 +0000
@@ -0,0 +1,1 @@
1usr/lib/*/mir/platformgraphics/android/*
02
=== added file 'debian/libmirplatformgraphics-mesa.install'
--- debian/libmirplatformgraphics-mesa.install 1970-01-01 00:00:00 +0000
+++ debian/libmirplatformgraphics-mesa.install 2014-03-06 14:19:43 +0000
@@ -0,0 +1,1 @@
1usr/lib/*/mir/platformgraphics/mesa/*
02
=== renamed file 'debian/libmirserver15.install' => 'debian/libmirserver16.install'
--- debian/libmirserver15.install 2014-02-06 17:55:08 +0000
+++ debian/libmirserver16.install 2014-03-06 14:19:43 +0000
@@ -1,1 +1,1 @@
1usr/lib/*/libmirserver.so.151usr/lib/*/libmirserver.so.16
22
=== modified file 'debian/rules'
--- debian/rules 2014-02-04 09:23:51 +0000
+++ debian/rules 2014-03-06 14:19:43 +0000
@@ -21,19 +21,29 @@
21ifeq ($(DEB_HOST_ARCH),armhf)21ifeq ($(DEB_HOST_ARCH),armhf)
22 dh_auto_configure -- \22 dh_auto_configure -- \
23 $(COMMON_CONFIGURE_OPTIONS) \23 $(COMMON_CONFIGURE_OPTIONS) \
24 -DMIR_RUN_ACCEPTANCE_TESTS=OFF -DMIR_RUN_INTEGRATION_TESTS=OFF \24 -DMIR_RUN_ACCEPTANCE_TESTS=OFF \
25 -DMIR_PLATFORM=android 25 -DMIR_RUN_INTEGRATION_TESTS=OFF \
26else26 -DMIR_PLATFORM=android\;mesa
27ifeq ($(DEB_HOST_ARCH),powerpc)27else
28 dh_auto_configure -- \28ifeq ($(DEB_HOST_ARCH),arm64)
29 $(COMMON_CONFIGURE_OPTIONS) \29 dh_auto_configure -- \
30 -DMIR_ENABLE_TESTS=NO30 $(COMMON_CONFIGURE_OPTIONS) \
31else31 -DMIR_PLATFORM=mesa
32 dh_auto_configure -- \32else
33 $(COMMON_CONFIGURE_OPTIONS)33 dh_auto_configure -- \
34 $(COMMON_CONFIGURE_OPTIONS) \
35 -DMIR_PLATFORM=mesa\;android
34endif36endif
35endif37endif
3638
37# TODO: we'll use a symbol file once mir is abi stable39# TODO: we'll use a symbol file once mir is abi stable
38override_dh_makeshlibs:40override_dh_makeshlibs:
39 dh_makeshlibs -V41 dh_makeshlibs -V
42
43override_dh_install:
44 dh_install --fail-missing
45 sh debian/install_ld_so_conf.sh $(DEB_HOST_MULTIARCH)
46
47override_dh_installdeb:
48 sh debian/create_postinst_prerm_scripts.sh $(DEB_HOST_MULTIARCH)
49 dh_installdeb
4050
=== added file 'debian/update-alternatives.postinst.in'
--- debian/update-alternatives.postinst.in 1970-01-01 00:00:00 +0000
+++ debian/update-alternatives.postinst.in 2014-03-06 14:19:43 +0000
@@ -0,0 +1,18 @@
1#!/bin/sh
2
3set -e
4
5if [ "$1" = "configure" ];
6then
7 update-alternatives --force --install \
8 /etc/ld.so.conf.d/@DEB_HOST_MULTIARCH@_mir@MIR_PLATFORM_TYPE@.conf \
9 @DEB_HOST_MULTIARCH@_mir@MIR_PLATFORM_TYPE@_conf \
10 /usr/lib/@DEB_HOST_MULTIARCH@/mir/@MIR_PLATFORM_TYPE@/@MIR_PLATFORM@/ld.so.conf \
11 @DPKG_ALTERNATIVES_PRIORITY@
12
13 LDCONFIG_NOTRIGGER=y ldconfig
14fi
15
16#DEBHELPER#
17
18exit 0
019
=== added file 'debian/update-alternatives.prerm.in'
--- debian/update-alternatives.prerm.in 1970-01-01 00:00:00 +0000
+++ debian/update-alternatives.prerm.in 2014-03-06 14:19:43 +0000
@@ -0,0 +1,16 @@
1#!/bin/sh
2
3set -e
4
5if [ "$1" = "remove" ];
6then
7 update-alternatives --remove \
8 @DEB_HOST_MULTIARCH@_mir@MIR_PLATFORM_TYPE@_conf \
9 /usr/lib/@DEB_HOST_MULTIARCH@/mir/@MIR_PLATFORM_TYPE@/@MIR_PLATFORM@/ld.so.conf
10
11 ldconfig
12fi
13
14#DEBHELPER#
15
16exit 0
017
=== modified file 'doc/component_reports.md'
--- doc/component_reports.md 2014-01-13 06:12:33 +0000
+++ doc/component_reports.md 2014-03-06 14:19:43 +0000
@@ -18,13 +18,13 @@
1818
19Report | Handlers19Report | Handlers
20----------------------- | --------20----------------------- | --------
21connector-report | log21connector-report | log,lttng
22display-report | log22display-report | log,lttng
23input-report | log,lttng23input-report | log,lttng
24legacy-input-report | log24legacy-input-report | log
25msg-processor-report | log,lttng25msg-processor-report | log,lttng
26session-mediator-report | log26session-mediator-report | log,lttng
27scene-report | log27scene-report | log,lttng
2828
29For example, to enable the LTTng input report, one could either use the29For example, to enable the LTTng input report, one could either use the
30`--input-report=lttng` command-line option to the server, or set the30`--input-report=lttng` command-line option to the server, or set the
@@ -40,7 +40,7 @@
40Report | Handlers40Report | Handlers
41------------------- | --------41------------------- | --------
42rpc-report | log,lttng42rpc-report | log,lttng
43input-receiver | log43input-receiver | log,lttng
4444
45For example, to enable the logging RPC report, one should set the45For example, to enable the logging RPC report, one should set the
46`MIR_CLIENT_RPC_REPORT=log` environment variable.46`MIR_CLIENT_RPC_REPORT=log` environment variable.
4747
=== modified file 'examples/CMakeLists.txt'
--- examples/CMakeLists.txt 2014-01-15 03:41:11 +0000
+++ examples/CMakeLists.txt 2014-03-06 14:19:43 +0000
@@ -93,12 +93,12 @@
93 ${PROJECT_SOURCE_DIR}/include/server93 ${PROJECT_SOURCE_DIR}/include/server
94 ${PROJECT_SOURCE_DIR}/include/client94 ${PROJECT_SOURCE_DIR}/include/client
95 ${PROJECT_SOURCE_DIR}/include/platform95 ${PROJECT_SOURCE_DIR}/include/platform
96 ${PROJECT_SOURCE_DIR}/include/test/mir_test/draw
96 ${GLESv2_INCLUDE_DIRS}97 ${GLESv2_INCLUDE_DIRS}
97)98)
9899
99set(RENDER_TO_FB_SOURCES render_to_fb.cpp)100add_executable(mir_demo_standalone_render_to_fb
100add_executable(mir_demo_standalone_render_to_fb 101 render_to_fb.cpp
101 ${RENDER_TO_FB_SOURCES}
102)102)
103103
104target_link_libraries(mir_demo_standalone_render_to_fb104target_link_libraries(mir_demo_standalone_render_to_fb
@@ -108,6 +108,17 @@
108 ${Boost_LIBRARIES}108 ${Boost_LIBRARIES}
109)109)
110110
111add_executable(mir_demo_standalone_render_overlays
112 render_overlays.cpp
113)
114
115target_link_libraries(mir_demo_standalone_render_overlays
116 mirserver
117 mirlogging
118 mirdraw
119 mirtestdraw
120)
121
111set(RENDER_SURFACES_SOURCES122set(RENDER_SURFACES_SOURCES
112 render_surfaces.cpp123 render_surfaces.cpp
113 buffer_render_target.cpp124 buffer_render_target.cpp
114125
=== modified file 'examples/basic_server_configuration.cpp'
--- examples/basic_server_configuration.cpp 2014-01-29 15:20:07 +0000
+++ examples/basic_server_configuration.cpp 2014-03-06 14:19:43 +0000
@@ -17,6 +17,7 @@
17 */17 */
1818
19#include "basic_server_configuration.h"19#include "basic_server_configuration.h"
20#include "mir/options/default_configuration.h"
2021
21#include "mir/abnormal_exit.h"22#include "mir/abnormal_exit.h"
22#include "mir/frontend/connector.h"23#include "mir/frontend/connector.h"
@@ -34,14 +35,19 @@
34namespace examples35namespace examples
35{36{
3637
37BasicServerConfiguration::BasicServerConfiguration(int argc, char const** argv)38BasicServerConfiguration::BasicServerConfiguration(int argc, char const** argv) :
38 : ServerConfiguration(argc, argv)39 ServerConfiguration([argc, argv]
40 {
41 auto result = std::make_shared<options::DefaultConfiguration>(argc, argv);
42
43 namespace po = boost::program_options;
44
45 result->add_options()
46 (launch_child_opt, po::value<std::string>(), "system() command to launch client");
47
48 return result;
49 }())
39{50{
40 namespace po = boost::program_options;
41
42 add_options()
43 (launch_child_opt, po::value<std::string>(), "system() command to launch client");
44;
45}51}
4652
47void BasicServerConfiguration::launch_client()53void BasicServerConfiguration::launch_client()
4854
=== modified file 'examples/demo-shell/demo_shell.cpp'
--- examples/demo-shell/demo_shell.cpp 2014-01-13 06:12:33 +0000
+++ examples/demo-shell/demo_shell.cpp 2014-03-06 14:19:43 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright © 2013 Canonical Ltd.2 * Copyright © 2013-2014 Canonical Ltd.
3 *3 *
4 * This program is free software: you can redistribute it and/or modify4 * 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 as5 * it under the terms of the GNU General Public License version 3 as
@@ -22,6 +22,7 @@
22#include "fullscreen_placement_strategy.h"22#include "fullscreen_placement_strategy.h"
23#include "../server_configuration.h"23#include "../server_configuration.h"
2424
25#include "mir/options/default_configuration.h"
25#include "mir/run_mir.h"26#include "mir/run_mir.h"
26#include "mir/report_exception.h"27#include "mir/report_exception.h"
27#include "mir/graphics/display.h"28#include "mir/graphics/display.h"
@@ -34,6 +35,7 @@
34namespace mg = mir::graphics;35namespace mg = mir::graphics;
35namespace mf = mir::frontend;36namespace mf = mir::frontend;
36namespace mi = mir::input;37namespace mi = mir::input;
38namespace mo = mir::options;
3739
38namespace mir40namespace mir
39{41{
@@ -44,14 +46,19 @@
44{46{
45 DemoServerConfiguration(int argc, char const* argv[],47 DemoServerConfiguration(int argc, char const* argv[],
46 std::initializer_list<std::shared_ptr<mi::EventFilter>> const& filter_list)48 std::initializer_list<std::shared_ptr<mi::EventFilter>> const& filter_list)
47 : ServerConfiguration(argc, argv),49 : ServerConfiguration([argc, argv]
50 {
51 auto result = std::make_shared<mo::DefaultConfiguration>(argc, argv);
52
53 namespace po = boost::program_options;
54
55 result->add_options()
56 ("fullscreen-surfaces", "Make all surfaces fullscreen");
57
58 return result;
59 }()),
48 filter_list(filter_list)60 filter_list(filter_list)
49 {61 {
50 namespace po = boost::program_options;
51
52 add_options()
53 ("fullscreen-surfaces", po::value<bool>(),
54 "Make all surfaces fullscreen [bool:default=false]");
55 }62 }
5663
57 std::shared_ptr<msh::PlacementStrategy> the_shell_placement_strategy() override64 std::shared_ptr<msh::PlacementStrategy> the_shell_placement_strategy() override
5865
=== added file 'examples/render_overlays.cpp'
--- examples/render_overlays.cpp 1970-01-01 00:00:00 +0000
+++ examples/render_overlays.cpp 2014-03-06 14:19:43 +0000
@@ -0,0 +1,135 @@
1/*
2 * Copyright © 2012, 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 "mir/default_server_configuration.h"
20#include "mir/graphics/display.h"
21#include "mir/graphics/renderable.h"
22#include "mir/graphics/display_buffer.h"
23#include "mir/graphics/platform.h"
24#include "mir/graphics/graphic_buffer_allocator.h"
25#include "mir/graphics/buffer_properties.h"
26#include "mir/report_exception.h"
27
28#include "graphics_region_factory.h"
29#include "patterns.h"
30
31#include <csignal>
32#include <iostream>
33
34namespace mg=mir::graphics;
35namespace ml=mir::logging;
36namespace mo=mir::options;
37namespace geom=mir::geometry;
38
39namespace
40{
41volatile std::sig_atomic_t running = true;
42
43void signal_handler(int /*signum*/)
44{
45 running = false;
46}
47}
48
49class DemoRenderable : public mg::Renderable
50{
51public:
52 DemoRenderable(std::shared_ptr<mg::Buffer> const& buffer, geom::Rectangle rect)
53 : renderable_buffer(buffer),
54 position(rect)
55 {
56 }
57
58 std::shared_ptr<mg::Buffer> buffer() const
59 {
60 return renderable_buffer;
61 }
62
63 bool alpha_enabled() const
64 {
65 return false;
66 }
67
68 geom::Rectangle screen_position() const
69 {
70 return position;
71 }
72
73private:
74 std::shared_ptr<mg::Buffer> const renderable_buffer;
75 geom::Rectangle const position;
76};
77
78int main(int argc, char const** argv)
79try
80{
81 mir::test::draw::DrawPatternSolid fill_with_green(0x00FF00FF);
82 mir::test::draw::DrawPatternSolid fill_with_blue(0x0000FFFF);
83
84 /* Set up graceful exit on SIGINT and SIGTERM */
85 struct sigaction sa;
86 sa.sa_handler = signal_handler;
87 sa.sa_flags = 0;
88 sigemptyset(&sa.sa_mask);
89
90 sigaction(SIGINT, &sa, NULL);
91 sigaction(SIGTERM, &sa, NULL);
92
93 mir::DefaultServerConfiguration conf{argc, argv};
94
95 auto platform = conf.the_graphics_platform();
96 auto display = platform->create_display(conf.the_display_configuration_policy());
97 auto buffer_allocator = platform->create_buffer_allocator(conf.the_buffer_initializer());
98 auto region_factory = mir::test::draw::create_graphics_region_factory();
99
100 mg::BufferProperties buffer_properties{
101 geom::Size{512, 512},
102 mir_pixel_format_abgr_8888,
103 mg::BufferUsage::hardware
104 };
105
106 auto buffer1 = buffer_allocator->alloc_buffer(buffer_properties);
107 auto buffer2 = buffer_allocator->alloc_buffer(buffer_properties);
108
109 fill_with_green.draw(*region_factory->graphic_region_from_handle(*buffer1->native_buffer_handle()));
110 fill_with_blue.draw(*region_factory->graphic_region_from_handle(*buffer2->native_buffer_handle()));
111
112 geom::Rectangle screen_pos1{{0,0} , {512, 512}};
113 geom::Rectangle screen_pos2{{80,80} , {592,592}};
114 std::list<std::shared_ptr<mg::Renderable>> renderlist
115 {
116 std::make_shared<DemoRenderable>(buffer2, screen_pos2),
117 std::make_shared<DemoRenderable>(buffer1, screen_pos1)
118 };
119
120 while (running)
121 {
122 display->for_each_display_buffer([&](mg::DisplayBuffer& buffer)
123 {
124 buffer.make_current();
125 auto render_fn = [](mg::Renderable const&) {};
126 buffer.render_and_post_update(renderlist, render_fn);
127 });
128 }
129 return 0;
130}
131catch (...)
132{
133 mir::report_exception(std::cerr);
134 return 1;
135}
0136
=== modified file 'examples/render_surfaces.cpp'
--- examples/render_surfaces.cpp 2014-02-04 14:48:29 +0000
+++ examples/render_surfaces.cpp 2014-03-06 14:19:43 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright © 2012 Canonical Ltd.2 * Copyright © 2012-2014 Canonical Ltd.
3 *3 *
4 * This program is free software: you can redistribute it and/or modify4 * 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 as5 * it under the terms of the GNU General Public License version 3 as
@@ -18,6 +18,7 @@
1818
19#include "mir/compositor/display_buffer_compositor_factory.h"19#include "mir/compositor/display_buffer_compositor_factory.h"
20#include "mir/compositor/display_buffer_compositor.h"20#include "mir/compositor/display_buffer_compositor.h"
21#include "mir/options/default_configuration.h"
21#include "mir/graphics/graphic_buffer_allocator.h"22#include "mir/graphics/graphic_buffer_allocator.h"
22#include "mir/frontend/connector.h"23#include "mir/frontend/connector.h"
23#include "mir/shell/surface_creation_parameters.h"24#include "mir/shell/surface_creation_parameters.h"
@@ -27,10 +28,12 @@
27#include "mir/graphics/cursor.h"28#include "mir/graphics/cursor.h"
28#include "mir/graphics/display.h"29#include "mir/graphics/display.h"
29#include "mir/graphics/display_buffer.h"30#include "mir/graphics/display_buffer.h"
31#include "mir/graphics/gl_context.h"
30#include "mir/shell/surface_factory.h"32#include "mir/shell/surface_factory.h"
31#include "mir/shell/surface.h"33#include "mir/shell/surface.h"
32#include "mir/run_mir.h"34#include "mir/run_mir.h"
33#include "mir/report_exception.h"35#include "mir/report_exception.h"
36#include "mir/raii.h"
3437
35#include "mir_image.h"38#include "mir_image.h"
36#include "buffer_render_target.h"39#include "buffer_render_target.h"
@@ -51,12 +54,14 @@
51namespace mc = mir::compositor;54namespace mc = mir::compositor;
52namespace ms = mir::scene;55namespace ms = mir::scene;
53namespace mf = mir::frontend;56namespace mf = mir::frontend;
57namespace mo = mir::options;
54namespace msh = mir::shell;58namespace msh = mir::shell;
55namespace mi = mir::input;59namespace mi = mir::input;
56namespace geom = mir::geometry;60namespace geom = mir::geometry;
57namespace mt = mir::tools;61namespace mt = mir::tools;
58namespace me = mir::examples;62namespace me = mir::examples;
5963
64
60///\page render_surfaces-example render_surfaces.cpp: A simple program using the mir library.65///\page render_surfaces-example render_surfaces.cpp: A simple program using the mir library.
61///\tableofcontents66///\tableofcontents
62///render_surfaces shows the use of mir to render some moving surfaces67///render_surfaces shows the use of mir to render some moving surfaces
@@ -194,7 +199,7 @@
194 h{static_cast<float>(s->size().height.as_uint32_t())},199 h{static_cast<float>(s->size().height.as_uint32_t())},
195 dx{dx},200 dx{dx},
196 dy{dy},201 dy{dy},
197 rotation_axis{rotation_axis},202 rotation_axis(rotation_axis),
198 alpha_offset{alpha_offset}203 alpha_offset{alpha_offset}
199 {204 {
200 }205 }
@@ -252,16 +257,22 @@
252class RenderSurfacesServerConfiguration : public me::ServerConfiguration257class RenderSurfacesServerConfiguration : public me::ServerConfiguration
253{258{
254public:259public:
255 RenderSurfacesServerConfiguration(int argc, char const** argv)260 RenderSurfacesServerConfiguration(int argc, char const** argv) :
256 : ServerConfiguration(argc, argv)261 ServerConfiguration([argc, argv]
262 {
263 auto result = std::make_shared<mo::DefaultConfiguration>(argc, argv);
264
265 namespace po = boost::program_options;
266
267 result->add_options()
268 (surfaces_to_render, po::value<int>()->default_value(5),
269 "Number of surfaces to render")
270 (display_cursor, po::value<bool>()->default_value(false),
271 "Display test cursor. (If input is disabled it gets animated.)");
272
273 return result;
274 }())
257 {275 {
258 namespace po = boost::program_options;
259
260 add_options()
261 (surfaces_to_render, po::value<int>()->default_value(5),
262 "Number of surfaces to render")
263 (display_cursor, po::value<bool>()->default_value(false),
264 "Display test cursor. (If input is disabled it gets animated.)");
265 }276 }
266277
267 ///\internal [RenderSurfacesServerConfiguration_stubs_tag]278 ///\internal [RenderSurfacesServerConfiguration_stubs_tag]
@@ -287,12 +298,17 @@
287 class RenderResourcesBufferInitializer : public mg::BufferInitializer298 class RenderResourcesBufferInitializer : public mg::BufferInitializer
288 {299 {
289 public:300 public:
290 RenderResourcesBufferInitializer()301 RenderResourcesBufferInitializer(std::unique_ptr<mg::GLContext> gl_context)
302 : gl_context{std::move(gl_context)}
291 {303 {
292 }304 }
293305
294 void operator()(mg::Buffer& buffer)306 void operator()(mg::Buffer& buffer)
295 {307 {
308 auto using_gl_context = mir::raii::paired_calls(
309 [this] { gl_context->make_current(); },
310 [this] { gl_context->release_current(); });
311
296 mt::ImageRenderer img_renderer{mir_image.pixel_data,312 mt::ImageRenderer img_renderer{mir_image.pixel_data,
297 geom::Size{mir_image.width, mir_image.height},313 geom::Size{mir_image.width, mir_image.height},
298 mir_image.bytes_per_pixel};314 mir_image.bytes_per_pixel};
@@ -300,9 +316,13 @@
300 brt.make_current();316 brt.make_current();
301 img_renderer.render();317 img_renderer.render();
302 }318 }
319
320 private:
321 std::unique_ptr<mg::GLContext> const gl_context;
322
303 };323 };
304324
305 return std::make_shared<RenderResourcesBufferInitializer>();325 return std::make_shared<RenderResourcesBufferInitializer>(the_display()->create_gl_context());
306 }326 }
307 ///\internal [RenderResourcesBufferInitializer_tag]327 ///\internal [RenderResourcesBufferInitializer_tag]
308328
@@ -443,7 +463,7 @@
443463
444 bool input_is_on()464 bool input_is_on()
445 {465 {
446 return the_options()->get<bool>(enable_input_opt);466 return the_options()->get<bool>(mo::enable_input_opt);
447 }467 }
448468
449 std::weak_ptr<mg::Cursor> the_cursor()469 std::weak_ptr<mg::Cursor> the_cursor()
450470
=== modified file 'examples/render_to_fb.cpp'
--- examples/render_to_fb.cpp 2014-01-13 06:12:33 +0000
+++ examples/render_to_fb.cpp 2014-03-06 14:19:43 +0000
@@ -27,7 +27,6 @@
27#include <iostream>27#include <iostream>
2828
29namespace mg=mir::graphics;29namespace mg=mir::graphics;
30namespace ml=mir::logging;
31namespace mo=mir::options;30namespace mo=mir::options;
3231
33namespace32namespace
3433
=== modified file 'examples/scroll.cpp'
--- examples/scroll.cpp 2014-01-24 11:15:31 +0000
+++ examples/scroll.cpp 2014-03-06 14:19:43 +0000
@@ -95,7 +95,7 @@
9595
96 EGLNativeDisplayType native_display = (EGLNativeDisplayType) mir_connection_get_egl_native_display(connection);96 EGLNativeDisplayType native_display = (EGLNativeDisplayType) mir_connection_get_egl_native_display(connection);
97 EGLNativeWindowType native_window = (EGLNativeWindowType) mir_surface_get_egl_native_window(surface);97 EGLNativeWindowType native_window = (EGLNativeWindowType) mir_surface_get_egl_native_window(surface);
98 assert(native_window != NULL);98 assert(native_window != (EGLNativeWindowType)NULL);
9999
100 disp = eglGetDisplay(native_display);100 disp = eglGetDisplay(native_display);
101 assert(disp != EGL_NO_DISPLAY);101 assert(disp != EGL_NO_DISPLAY);
102102
=== modified file 'examples/server_configuration.cpp'
--- examples/server_configuration.cpp 2014-01-29 15:20:07 +0000
+++ examples/server_configuration.cpp 2014-03-06 14:19:43 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright © 2013 Canonical Ltd.2 * Copyright © 2013-2014 Canonical Ltd.
3 *3 *
4 * This program is free software: you can redistribute it and/or modify4 * 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 as5 * it under the terms of the GNU General Public License version 3 as
@@ -17,6 +17,7 @@
17 */17 */
1818
19#include "server_configuration.h"19#include "server_configuration.h"
20#include "mir/options/default_configuration.h"
20#include "mir/graphics/display_configuration_policy.h"21#include "mir/graphics/display_configuration_policy.h"
21#include "mir/graphics/display_configuration.h"22#include "mir/graphics/display_configuration.h"
22#include "mir/input/composite_event_filter.h"23#include "mir/input/composite_event_filter.h"
@@ -145,16 +146,21 @@
145146
146}147}
147148
148me::ServerConfiguration::ServerConfiguration(int argc, char const** argv)149me::ServerConfiguration::ServerConfiguration(std::shared_ptr<options::DefaultConfiguration> const& configuration_options) :
149 : DefaultServerConfiguration(argc, argv)150 DefaultServerConfiguration(configuration_options)
150{151{
151 namespace po = boost::program_options;152 namespace po = boost::program_options;
152153
153 add_options()154 configuration_options->add_options()
154 (display_config_opt, po::value<std::string>()->default_value(clone_opt_val),155 (display_config_opt, po::value<std::string>()->default_value(clone_opt_val),
155 "Display configuration [{clone,sidebyside,single}]");156 "Display configuration [{clone,sidebyside,single}]");
156}157}
157158
159me::ServerConfiguration::ServerConfiguration(int argc, char const** argv) :
160 ServerConfiguration(std::make_shared<options::DefaultConfiguration>(argc, argv))
161{
162}
163
158std::shared_ptr<mg::DisplayConfigurationPolicy>164std::shared_ptr<mg::DisplayConfigurationPolicy>
159me::ServerConfiguration::the_display_configuration_policy()165me::ServerConfiguration::the_display_configuration_policy()
160{166{
161167
=== modified file 'examples/server_configuration.h'
--- examples/server_configuration.h 2013-08-28 03:41:48 +0000
+++ examples/server_configuration.h 2014-03-06 14:19:43 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright © 2013 Canonical Ltd.2 * Copyright © 2013-2014 Canonical Ltd.
3 *3 *
4 * This program is free software: you can redistribute it and/or modify4 * 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 as5 * it under the terms of the GNU General Public License version 3 as
@@ -23,6 +23,11 @@
2323
24namespace mir24namespace mir
25{25{
26namespace options
27{
28class DefaultConfiguration;
29}
30
26namespace examples31namespace examples
27{32{
2833
@@ -30,6 +35,7 @@
30{35{
31public:36public:
32 ServerConfiguration(int argc, char const** argv);37 ServerConfiguration(int argc, char const** argv);
38 explicit ServerConfiguration(std::shared_ptr<options::DefaultConfiguration> const& configuration_options);
3339
34 std::shared_ptr<graphics::DisplayConfigurationPolicy> the_display_configuration_policy() override;40 std::shared_ptr<graphics::DisplayConfigurationPolicy> the_display_configuration_policy() override;
35 std::shared_ptr<input::CompositeEventFilter> the_composite_event_filter() override;41 std::shared_ptr<input::CompositeEventFilter> the_composite_event_filter() override;
3642
=== modified file 'guides/cppguide.xml'
--- guides/cppguide.xml 2014-01-13 04:16:45 +0000
+++ guides/cppguide.xml 2014-03-06 14:19:43 +0000
@@ -1060,12 +1060,13 @@
1060 be private</a>.1060 be private</a>.
1061 </p>1061 </p>
1062 <p>1062 <p>
1063 When redefining an inherited virtual function, explicitly1063 When redefining an inherited virtual method (both pure
1064 declare it <code>virtual</code> in the declaration of the1064 and non-pure), explicitly declare it <code>override</code>
1065 derived class. Rationale: If <code>virtual</code> is1065 in the declaration of the derived class. Rationale: using
1066 omitted, the reader has to check all ancestors of the1066 <code>override</code> allows the compiler to consistently
1067 class in question to determine if the function is virtual1067 detect attempts to override methods that have been changed
1068 or not.1068 or completely removed. It also makes it straightforward for
1069 a reader to determine if a method is virtual or not.
1069 </p>1070 </p>
1070 </DECISION>1071 </DECISION>
1071 </BODY>1072 </BODY>
10721073
=== renamed file 'include/server/mir/abnormal_exit.h' => 'include/platform/mir/abnormal_exit.h'
--- include/server/mir/abnormal_exit.h 2013-04-24 05:22:20 +0000
+++ include/platform/mir/abnormal_exit.h 2014-03-06 14:19:43 +0000
@@ -2,15 +2,15 @@
2 * Copyright © 2013 Canonical Ltd.2 * Copyright © 2013 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: Alan Griffiths <alan@octopull.co.uk>16 * Authored by: Alan Griffiths <alan@octopull.co.uk>
1717
=== modified file 'include/platform/mir/graphics/drm_authenticator.h'
--- include/platform/mir/graphics/drm_authenticator.h 2013-08-28 03:41:48 +0000
+++ include/platform/mir/graphics/drm_authenticator.h 2014-03-06 14:19:43 +0000
@@ -19,8 +19,6 @@
19#ifndef MIR_GRAPHICS_DRM_AUTHENTICATOR_H_19#ifndef MIR_GRAPHICS_DRM_AUTHENTICATOR_H_
20#define MIR_GRAPHICS_DRM_AUTHENTICATOR_H_20#define MIR_GRAPHICS_DRM_AUTHENTICATOR_H_
2121
22#include <xf86drm.h>
23
24namespace mir22namespace mir
25{23{
26namespace graphics24namespace graphics
@@ -31,7 +29,7 @@
31public:29public:
32 virtual ~DRMAuthenticator() {}30 virtual ~DRMAuthenticator() {}
3331
34 virtual void drm_auth_magic(drm_magic_t magic) = 0;32 virtual void drm_auth_magic(unsigned int magic) = 0;
3533
36protected:34protected:
37 DRMAuthenticator() = default;35 DRMAuthenticator() = default;
3836
=== added file 'include/platform/mir/options/configuration.h'
--- include/platform/mir/options/configuration.h 1970-01-01 00:00:00 +0000
+++ include/platform/mir/options/configuration.h 2014-03-06 14:19:43 +0000
@@ -0,0 +1,74 @@
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: Alan Griffiths <alan@octopull.co.uk>
17 */
18
19#ifndef MIR_OPTIONS_CONFIGURATION_H_
20#define MIR_OPTIONS_CONFIGURATION_H_
21
22#include "mir/options/program_option.h"
23
24#include <memory>
25
26namespace mir
27{
28namespace options
29{
30extern char const* const server_socket_opt;
31extern char const* const no_server_socket_opt;
32extern char const* const enable_input_opt;
33extern char const* const session_mediator_report_opt;
34extern char const* const msg_processor_report_opt;
35extern char const* const compositor_report_opt;
36extern char const* const display_report_opt;
37extern char const* const legacy_input_report_opt;
38extern char const* const connector_report_opt;
39extern char const* const scene_report_opt;
40extern char const* const input_report_opt;
41extern char const* const host_socket_opt;
42extern char const* const standalone_opt;
43extern char const* const frontend_threads_opt;
44
45extern char const* const name_opt;
46extern char const* const offscreen_opt;
47
48extern char const* const glog;
49extern char const* const glog_stderrthreshold;
50extern char const* const glog_minloglevel;
51extern char const* const glog_log_dir;
52
53extern char const* const off_opt_value;
54extern char const* const log_opt_value;
55extern char const* const lttng_opt_value;
56
57extern char const* const platform_graphics_lib;
58
59class Configuration
60{
61public:
62 virtual std::shared_ptr<options::Option> the_options() const = 0;
63
64protected:
65
66 Configuration() = default;
67 virtual ~Configuration() = default;
68 Configuration(Configuration const&) = delete;
69 Configuration& operator=(Configuration const&) = delete;
70};
71}
72}
73
74#endif /* MIR_OPTIONS_CONFIGURATION_H_ */
075
=== renamed file 'include/server/mir/default_configuration_options.h' => 'include/platform/mir/options/default_configuration.h'
--- include/server/mir/default_configuration_options.h 2014-01-27 17:47:06 +0000
+++ include/platform/mir/options/default_configuration.h 2014-03-06 14:19:43 +0000
@@ -1,100 +1,65 @@
1/*1/*
2 * Copyright © 2013 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: Alan Griffiths <alan@octopull.co.uk>16 * Authored by: Alan Griffiths <alan@octopull.co.uk>
17 */17 */
1818
19#ifndef MIR_DEFAULT_CONFIGURATION_OPTIONS_H_19#ifndef MIR_OPTIONS_DEFAULT_CONFIGURATION_H_
20#define MIR_DEFAULT_CONFIGURATION_OPTIONS_H_20#define MIR_OPTIONS_DEFAULT_CONFIGURATION_H_
2121
22#include "mir/options/program_option.h"22#include "mir/options/configuration.h"
2323
24#include <memory>
2524
26namespace mir25namespace mir
27{26{
28class ConfigurationOptions27namespace options
29{28{
30public:29class DefaultConfiguration : public Configuration
31 static char const* const server_socket_opt;30{
32 static char const* const no_server_socket_opt;31public:
33 static char const* const enable_input_opt;32 DefaultConfiguration(int argc, char const* argv[]);
34 static char const* const session_mediator_report_opt;33 virtual ~DefaultConfiguration() = default;
35 static char const* const msg_processor_report_opt;34
36 static char const* const compositor_report_opt;35 // add_options() allows users to add their own options. This MUST be called
37 static char const* const display_report_opt;36 // before the first invocation of the_options() - typically during initialization.
38 static char const* const legacy_input_report_opt;
39 static char const* const connector_report_opt;
40 static char const* const scene_report_opt;
41 static char const* const input_report_opt;
42 static char const* const host_socket_opt;
43 static char const* const standalone_opt;
44 static char const* const frontend_threads_opt;
45 static char const* const name_opt;
46 static char const* const offscreen_opt;
47
48 static char const* const glog;
49 static char const* const glog_stderrthreshold;
50 static char const* const glog_minloglevel;
51 static char const* const glog_log_dir;
52 static char const* const glog_log_dir_default;
53 static int const glog_stderrthreshold_default;
54 static int const glog_minloglevel_default;
55
56 static bool const enable_input_default;
57
58 static char const* const off_opt_value;
59 static char const* const log_opt_value;
60 static char const* const lttng_opt_value;
61
62 static char const* const platform_graphics_lib;
63 static char const* const default_platform_graphics_lib;
64
65 virtual std::shared_ptr<options::Option> the_options() const = 0;
66
67protected:
68
69 int default_ipc_threads = 10;
70
71 ConfigurationOptions() = default;
72 virtual ~ConfigurationOptions() = default;
73 ConfigurationOptions(ConfigurationOptions const&) = delete;
74 ConfigurationOptions& operator=(ConfigurationOptions const&) = delete;
75};
76
77class DefaultConfigurationOptions : public ConfigurationOptions
78{
79public:
80 DefaultConfigurationOptions(int argc, char const* argv[]);
81 virtual ~DefaultConfigurationOptions() = default;
82
83protected:
84 // add_options() allows configuration specializations to add their
85 // own options. This MUST be called before the first invocation of
86 // the_options() - typically during construction.
87 boost::program_options::options_description_easy_init add_options();37 boost::program_options::options_description_easy_init add_options();
88 virtual void parse_options(boost::program_options::options_description& options_description, options::ProgramOption& options) const;
89 virtual std::shared_ptr<options::Option> the_options() const;
9038
91private:39private:
40 // accessed via the base interface, when access to add_options() has been "lost"
41 std::shared_ptr<options::Option> the_options() const override;
42
43 virtual void parse_arguments(
44 boost::program_options::options_description desc,
45 ProgramOption& options,
46 int argc,
47 char const* argv[]) const;
48
49 virtual void parse_environment(
50 boost::program_options::options_description& desc,
51 ProgramOption& options) const;
52
53 virtual void parse_config_file(
54 boost::program_options::options_description& desc,
55 ProgramOption& options) const;
56
92 int const argc;57 int const argc;
93 char const** const argv;58 char const** const argv;
94 std::shared_ptr<boost::program_options::options_description> const program_options;59 std::shared_ptr<boost::program_options::options_description> const program_options;
95 std::shared_ptr<options::Option> mutable options;60 std::shared_ptr<Option> mutable options;
96};61};
97}62}
9863}
9964
100#endif /* MIR_DEFAULT_CONFIGURATION_OPTIONS_H_ */65#endif /* MIR_OPTIONS_DEFAULT_CONFIGURATION_H_ */
10166
=== modified file 'include/platform/mir/udev/wrapper.h'
--- include/platform/mir/udev/wrapper.h 2014-01-22 08:32:55 +0000
+++ include/platform/mir/udev/wrapper.h 2014-03-06 14:19:43 +0000
@@ -93,7 +93,7 @@
93 bool operator!=(iterator const& rhs) const;93 bool operator!=(iterator const& rhs) const;
9494
95 Device const& operator*() const;95 Device const& operator*() const;
9696 Device const* operator->() const;
97 private:97 private:
98 friend class Enumerator;98 friend class Enumerator;
9999
@@ -135,6 +135,7 @@
135 void enable(void);135 void enable(void);
136 int fd(void) const;136 int fd(void) const;
137137
138 void filter_by_subsystem(std::string const& subsystem);
138 void filter_by_subsystem_and_type(std::string const& subsystem, std::string const& devtype);139 void filter_by_subsystem_and_type(std::string const& subsystem, std::string const& devtype);
139140
140 void process_events(std::function<void(EventType, Device const&)> const& handler) const;141 void process_events(std::function<void(EventType, Device const&)> const& handler) const;
141142
=== modified file 'include/server/mir/compositor/compositor_report.h'
--- include/server/mir/compositor/compositor_report.h 2014-01-10 05:48:41 +0000
+++ include/server/mir/compositor/compositor_report.h 2014-03-06 14:19:43 +0000
@@ -41,17 +41,6 @@
41 CompositorReport& operator=(CompositorReport const&) = delete;41 CompositorReport& operator=(CompositorReport const&) = delete;
42};42};
4343
44class NullCompositorReport : public CompositorReport
45{
46public:
47 void added_display(int width, int height, int x, int y, SubCompositorId id);
48 void began_frame(SubCompositorId id);
49 void finished_frame(bool bypassed, SubCompositorId id);
50 void started();
51 void stopped();
52 void scheduled();
53};
54
55} // namespace compositor44} // namespace compositor
56} // namespace mir45} // namespace mir
5746
5847
=== modified file 'include/server/mir/default_server_configuration.h'
--- include/server/mir/default_server_configuration.h 2014-01-29 18:02:33 +0000
+++ include/server/mir/default_server_configuration.h 2014-03-06 14:19:43 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright © 2012 Canonical Ltd.2 * Copyright © 2012-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 General Public License version 3,
@@ -20,7 +20,6 @@
2020
21#include "mir/cached_ptr.h"21#include "mir/cached_ptr.h"
22#include "mir/server_configuration.h"22#include "mir/server_configuration.h"
23#include "mir/default_configuration_options.h"
2423
25#include <memory>24#include <memory>
26#include <string>25#include <string>
@@ -114,10 +113,22 @@
114class Logger;113class Logger;
115}114}
116115
117class DefaultServerConfiguration : public virtual ServerConfiguration, protected DefaultConfigurationOptions116namespace options
117{
118class Option;
119class Configuration;
120}
121
122namespace report
123{
124class ReportFactory;
125}
126
127class DefaultServerConfiguration : public virtual ServerConfiguration
118{128{
119public:129public:
120 DefaultServerConfiguration(int argc, char const* argv[]);130 DefaultServerConfiguration(int argc, char const* argv[]);
131 explicit DefaultServerConfiguration(std::shared_ptr<options::Configuration> const& configuration_options);
121132
122 /** @name DisplayServer dependencies133 /** @name DisplayServer dependencies
123 * dependencies of DisplayServer on the rest of the Mir134 * dependencies of DisplayServer on the rest of the Mir
@@ -235,9 +246,7 @@
235 virtual std::shared_ptr<time::Clock> the_clock();246 virtual std::shared_ptr<time::Clock> the_clock();
236247
237protected:248protected:
238 using DefaultConfigurationOptions::the_options;249 std::shared_ptr<options::Option> the_options() const;
239 using DefaultConfigurationOptions::add_options;
240 using DefaultConfigurationOptions::parse_options;
241250
242 virtual std::shared_ptr<input::InputChannelFactory> the_input_channel_factory();251 virtual std::shared_ptr<input::InputChannelFactory> the_input_channel_factory();
243 virtual std::shared_ptr<scene::MediatingDisplayChanger> the_mediating_display_changer();252 virtual std::shared_ptr<scene::MediatingDisplayChanger> the_mediating_display_changer();
@@ -297,6 +306,7 @@
297 CachedPtr<scene::MediatingDisplayChanger> mediating_display_changer;306 CachedPtr<scene::MediatingDisplayChanger> mediating_display_changer;
298307
299private:308private:
309 std::shared_ptr<options::Configuration> const configuration_options;
300 std::shared_ptr<input::EventFilter> const default_filter;310 std::shared_ptr<input::EventFilter> const default_filter;
301311
302 virtual std::string the_socket_file() const;312 virtual std::string the_socket_file() const;
@@ -313,7 +323,8 @@
313 std::shared_ptr<scene::SessionManager> the_session_manager();323 std::shared_ptr<scene::SessionManager> the_session_manager();
314 std::shared_ptr<scene::SurfaceBuilder> the_surface_builder();324 std::shared_ptr<scene::SurfaceBuilder> the_surface_builder();
315 std::shared_ptr<scene::SurfaceController> the_surface_controller();325 std::shared_ptr<scene::SurfaceController> the_surface_controller();
316 std::function<void()> force_threads_to_unblock_callback();326
327 auto report_factory(char const* report_opt) -> std::unique_ptr<report::ReportFactory>;
317};328};
318}329}
319330
320331
=== modified file 'include/server/mir/frontend/connector_report.h'
--- include/server/mir/frontend/connector_report.h 2013-09-27 16:07:00 +0000
+++ include/server/mir/frontend/connector_report.h 2014-03-06 14:19:43 +0000
@@ -50,21 +50,6 @@
50 ConnectorReport& operator=(const ConnectorReport&) = delete;50 ConnectorReport& operator=(const ConnectorReport&) = delete;
51};51};
5252
53class NullConnectorReport : public ConnectorReport
54{
55public:
56 void thread_start() override;
57 void thread_end() override;
58 void starting_threads(int count) override;
59 void stopping_threads(int count) override;
60
61 void creating_session_for(int socket_handle) override;
62 void creating_socket_pair(int server_handle, int client_handle) override;
63
64 void listening_on(std::string const& endpoint) override;
65
66 void error(std::exception const& error) override;
67};
68}53}
69}54}
7055
7156
=== modified file 'include/server/mir/frontend/session_mediator_report.h'
--- include/server/mir/frontend/session_mediator_report.h 2013-09-24 07:02:12 +0000
+++ include/server/mir/frontend/session_mediator_report.h 2014-03-06 14:19:43 +0000
@@ -54,30 +54,6 @@
54 std::string const& what) = 0;54 std::string const& what) = 0;
55};55};
5656
57// Do-nothing implementation to satisfy dependencies
58class NullSessionMediatorReport : public SessionMediatorReport
59{
60 virtual void session_connect_called(std::string const& app_name);
61
62 virtual void session_create_surface_called(std::string const& app_name);
63
64 virtual void session_next_buffer_called(std::string const& app_name);
65
66 virtual void session_release_surface_called(std::string const& app_name);
67
68 virtual void session_disconnect_called(std::string const& app_name);
69
70 virtual void session_drm_auth_magic_called(std::string const& app_name);
71
72 virtual void session_configure_surface_called(std::string const& app_name);
73
74 virtual void session_configure_display_called(std::string const& app_name);
75
76 virtual void session_error(
77 std::string const& app_name,
78 char const* method,
79 std::string const& what);
80};
81}57}
82}58}
8359
8460
=== modified file 'include/server/mir/input/surface.h'
--- include/server/mir/input/surface.h 2014-01-13 06:12:33 +0000
+++ include/server/mir/input/surface.h 2014-03-06 14:19:43 +0000
@@ -31,7 +31,7 @@
31{31{
32public:32public:
33 virtual std::string const& name() const = 0;33 virtual std::string const& name() const = 0;
34 virtual geometry::Point position() const = 0;34 virtual geometry::Point top_left() const = 0;
35 virtual geometry::Size size() const = 0;35 virtual geometry::Size size() const = 0;
36 virtual bool contains(geometry::Point const& point) const = 0;36 virtual bool contains(geometry::Point const& point) const = 0;
3737
3838
=== added directory 'include/server/mir/logging'
=== renamed file 'include/server/mir/logging/glog_logger.h' => 'include/server/mir/logging/glog_logger.h'
=== removed directory 'include/server/mir/lttng'
=== added directory 'include/server/mir/report'
=== added file 'include/server/mir/report/legacy_input_report.h'
--- include/server/mir/report/legacy_input_report.h 1970-01-01 00:00:00 +0000
+++ include/server/mir/report/legacy_input_report.h 2014-03-06 14:19:43 +0000
@@ -0,0 +1,39 @@
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: Andreas Pokorny <andreas.pokorny@canonical.com>
17 */
18
19#ifndef MIR_REPORT_LEGACY_INPUT_REPORT_H_
20#define MIR_REPORT_LEGACY_INPUT_REPORT_H_
21
22#include <memory>
23
24namespace mir
25{
26namespace logging
27{
28class Logger;
29}
30namespace report
31{
32namespace legacy_input
33{
34void initialize(std::shared_ptr<mir::logging::Logger> const& logger);
35}
36}
37}
38
39#endif // MIR_REPORT_LEGACY_INPUT_REPORT_H_
040
=== renamed directory 'include/server/mir/logging' => 'include/server/mir/report/logging'
=== modified file 'include/server/mir/scene/scene_report.h'
--- include/server/mir/scene/scene_report.h 2014-01-13 06:12:33 +0000
+++ include/server/mir/scene/scene_report.h 2014-03-06 14:19:43 +0000
@@ -26,16 +26,15 @@
26{26{
27namespace scene27namespace scene
28{28{
29class BasicSurface;
30
31class SceneReport29class SceneReport
32{30{
33public:31public:
34 virtual void surface_created(BasicSurface* const surface) = 0;32 typedef void* BasicSurfaceId;
35 virtual void surface_added(BasicSurface* const surface) = 0;33 virtual void surface_created(BasicSurfaceId id, std::string const& name) = 0;
34 virtual void surface_added(BasicSurfaceId id, std::string const& name) = 0;
3635
37 virtual void surface_removed(BasicSurface* const surface) = 0;36 virtual void surface_removed(BasicSurfaceId id, std::string const& name) = 0;
38 virtual void surface_deleted(BasicSurface* const surface) = 0;37 virtual void surface_deleted(BasicSurfaceId id, std::string const& name) = 0;
3938
40protected:39protected:
41 SceneReport() = default;40 SceneReport() = default;
@@ -44,17 +43,7 @@
44 SceneReport& operator=(SceneReport const&) = delete;43 SceneReport& operator=(SceneReport const&) = delete;
45};44};
4645
47class NullSceneReport : public SceneReport46}
48{47}
49public:
50 virtual void surface_created(BasicSurface* const /*surface*/) override;
51 virtual void surface_added(BasicSurface* const /*surface*/) override;
52
53 virtual void surface_removed(BasicSurface* const /*surface*/) override;
54 virtual void surface_deleted(BasicSurface* const /*surface*/) override;
55};
56}
57}
58
5948
60#endif /* MIR_SCENE_SCENE_REPORT_H_ */49#endif /* MIR_SCENE_SCENE_REPORT_H_ */
6150
=== added directory 'include/shared/mir/logging'
=== removed directory 'include/shared/mir/logging'
=== renamed file 'include/shared/mir/logging/dumb_console_logger.h' => 'include/shared/mir/logging/dumb_console_logger.h'
=== renamed file 'include/shared/mir/logging/input_timestamp.h' => 'include/shared/mir/logging/input_timestamp.h'
=== renamed file 'include/shared/mir/logging/logger.h' => 'include/shared/mir/logging/logger.h'
=== added directory 'include/shared/mir/report'
=== renamed directory 'include/shared/mir/lttng' => 'include/shared/mir/report/lttng'
=== modified file 'include/shared/mir/report/lttng/mir_tracepoint.h'
--- include/shared/mir/lttng/mir_tracepoint.h 2013-06-03 12:15:44 +0000
+++ include/shared/mir/report/lttng/mir_tracepoint.h 2014-03-06 14:19:43 +0000
@@ -27,7 +27,6 @@
27 *27 *
28 * See: http://sourceware.org/bugzilla/show_bug.cgi?id=1397428 * See: http://sourceware.org/bugzilla/show_bug.cgi?id=13974
29 */29 */
30
31#ifdef __clang__30#ifdef __clang__
32namespace mir_systemtap_bug_1397431namespace mir_systemtap_bug_13974
33{32{
@@ -36,7 +35,7 @@
36#define mir_tracepoint(c, e, ...) ::mir_systemtap_bug_13974::mir_tracepoint_consume_args(0, __VA_ARGS__)35#define mir_tracepoint(c, e, ...) ::mir_systemtap_bug_13974::mir_tracepoint_consume_args(0, __VA_ARGS__)
37#pragma message "Building with clang: Disabling LTTng tracepoints."36#pragma message "Building with clang: Disabling LTTng tracepoints."
38#else37#else
39#define mir_tracepoint(c, e, ...) tracepoint(c, e, __VA_ARGS__)38#define mir_tracepoint(c, ...) tracepoint(c, __VA_ARGS__)
40#endif39#endif
4140
42#endif /* MIR_LTTNG_MIR_TRACEPOINT_H_ */41#endif /* MIR_LTTNG_MIR_TRACEPOINT_H_ */
4342
=== modified file 'include/shared/mir/report/lttng/tracepoint_provider.h'
--- include/shared/mir/lttng/tracepoint_provider.h 2013-06-04 10:47:05 +0000
+++ include/shared/mir/report/lttng/tracepoint_provider.h 2014-03-06 14:19:43 +0000
@@ -16,13 +16,15 @@
16 * Authored by: Alexandros Frantzis <alexandros.frantzis@canonical.com>16 * Authored by: Alexandros Frantzis <alexandros.frantzis@canonical.com>
17 */17 */
1818
19#ifndef MIR_LTTNG_TRACEPOINT_PROVIDER_H_19#ifndef MIR_REPORT_LTTNG_TRACEPOINT_PROVIDER_H_
20#define MIR_LTTNG_TRACEPOINT_PROVIDER_H_20#define MIR_REPORT_LTTNG_TRACEPOINT_PROVIDER_H_
2121
22#include <string>22#include <string>
2323
24namespace mir24namespace mir
25{25{
26namespace report
27{
26namespace lttng28namespace lttng
27{29{
2830
@@ -41,5 +43,6 @@
4143
42}44}
43}45}
46}
4447
45#endif /* MIR_LTTNG_TRACEPOINT_PROVIDER_H_ */48#endif /* MIR_REPORT_LTTNG_TRACEPOINT_PROVIDER_H_ */
4649
=== renamed file 'include/server/mir/shared_library.h' => 'include/shared/mir/shared_library.h'
--- include/server/mir/shared_library.h 2013-06-21 10:07:40 +0000
+++ include/shared/mir/shared_library.h 2014-03-06 14:19:43 +0000
@@ -2,15 +2,15 @@
2 * Copyright © 2013 Canonical Ltd.2 * Copyright © 2013 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: Alan Griffiths <alan@octopull.co.uk>16 * Authored by: Alan Griffiths <alan@octopull.co.uk>
1717
=== renamed file 'include/test/mir_test/draw/android_graphics.h' => 'include/test/mir_test/draw/graphics_region_factory.h'
--- include/test/mir_test/draw/android_graphics.h 2014-01-13 06:12:33 +0000
+++ include/test/mir_test/draw/graphics_region_factory.h 2014-03-06 14:19:43 +0000
@@ -15,45 +15,36 @@
15 *15 *
16 * Authored by: Kevin DuBois <kevin.dubois@canonical.com>16 * Authored by: Kevin DuBois <kevin.dubois@canonical.com>
17 */17 */
18#ifndef MIR_TEST_DRAW_ANDROID_GRAPHICS18#ifndef MIR_TEST_DRAW_GRAPHICS_REGION_FACTORY
19#define MIR_TEST_DRAW_ANDROID_GRAPHICS19#define MIR_TEST_DRAW_GRAPHICS_REGION_FACTORY
2020
21#include "mir/graphics/native_buffer.h"
21#include "mir_toolkit/mir_client_library.h"22#include "mir_toolkit/mir_client_library.h"
22#include "mir/compositor/buffer_stream.h"
23#include "mir/geometry/size.h"
24
25#include <hardware/gralloc.h>
26#include <memory>23#include <memory>
2724
28namespace mir25namespace mir
29{26{
30namespace compositor
31{
32 class BufferIPCPackage;
33}
34namespace test27namespace test
35{28{
36namespace draw29namespace draw
37{30{
3831
39class TestGrallocMapper32class GraphicsRegionFactory
40{33{
41public:34public:
42 TestGrallocMapper();35 virtual ~GraphicsRegionFactory() {}
43 TestGrallocMapper(const hw_module_t *hw_module, alloc_device_t* alloc_dev);36 virtual std::shared_ptr<MirGraphicsRegion> graphic_region_from_handle(
44 ~TestGrallocMapper();37 graphics::NativeBuffer const& native_buffer) = 0;
45 std::shared_ptr<MirGraphicsRegion> graphic_region_from_handle(ANativeWindowBuffer* package);38
4639protected:
47private:40 GraphicsRegionFactory() = default;
48 TestGrallocMapper(TestGrallocMapper const&) = delete;41 GraphicsRegionFactory(GraphicsRegionFactory const&) = delete;
49 TestGrallocMapper& operator=(TestGrallocMapper const&) = delete;42 GraphicsRegionFactory& operator=(GraphicsRegionFactory const&) = delete;
50
51 const bool gralloc_ownership;
52 gralloc_module_t* module;
53 alloc_device_t* alloc_dev;
54};43};
5544
56}45std::shared_ptr<GraphicsRegionFactory> create_graphics_region_factory();
57}46
58}47}
59#endif /* MIR_TEST_DRAW_ANDROID_GRAPHICS */48}
49}
50#endif /* MIR_TEST_DRAW_GRAPHICS_REGION_FACTORY */
6051
=== modified file 'include/test/mir_test/draw/patterns.h'
--- include/test/mir_test/draw/patterns.h 2013-10-14 20:35:46 +0000
+++ include/test/mir_test/draw/patterns.h 2014-03-06 14:19:43 +0000
@@ -72,7 +72,7 @@
72private:72private:
73 uint32_t color_pattern [Rows][Cols];73 uint32_t color_pattern [Rows][Cols];
74};74};
75#include "mir_test/draw/draw_pattern_checkered-inl.h"75#include "draw_pattern_checkered-inl.h"
7676
77}77}
78}78}
7979
=== modified file 'include/test/mir_test_doubles/mock_display_device.h'
--- include/test/mir_test_doubles/mock_display_device.h 2014-01-23 17:26:51 +0000
+++ include/test/mir_test_doubles/mock_display_device.h 2014-03-06 14:19:43 +0000
@@ -38,6 +38,7 @@
38 MOCK_METHOD1(prepare_gl_and_overlays, void(std::list<std::shared_ptr<graphics::Renderable>> const&));38 MOCK_METHOD1(prepare_gl_and_overlays, void(std::list<std::shared_ptr<graphics::Renderable>> const&));
39 MOCK_METHOD2(gpu_render, void(EGLDisplay, EGLSurface));39 MOCK_METHOD2(gpu_render, void(EGLDisplay, EGLSurface));
40 MOCK_METHOD1(post, void(graphics::Buffer const&));40 MOCK_METHOD1(post, void(graphics::Buffer const&));
41 MOCK_CONST_METHOD1(apply_orientation, bool(MirOrientation));
41};42};
42}43}
43}44}
4445
=== modified file 'include/test/mir_test_doubles/mock_drm.h'
--- include/test/mir_test_doubles/mock_drm.h 2013-08-28 03:41:48 +0000
+++ include/test/mir_test_doubles/mock_drm.h 2014-03-06 14:19:43 +0000
@@ -88,6 +88,7 @@
88 MockDRM();88 MockDRM();
89 ~MockDRM() noexcept;89 ~MockDRM() noexcept;
9090
91 MOCK_METHOD3(open, int(char const* path, int flags, mode_t mode));
91 MOCK_METHOD2(drmOpen, int(const char *name, const char *busid));92 MOCK_METHOD2(drmOpen, int(const char *name, const char *busid));
92 MOCK_METHOD1(drmClose, int(int fd));93 MOCK_METHOD1(drmClose, int(int fd));
93 MOCK_METHOD3(drmIoctl, int(int fd, unsigned long request, void *arg));94 MOCK_METHOD3(drmIoctl, int(int fd, unsigned long request, void *arg));
9495
=== modified file 'include/test/mir_test_doubles/mock_gl.h'
--- include/test/mir_test_doubles/mock_gl.h 2014-01-13 06:12:33 +0000
+++ include/test/mir_test_doubles/mock_gl.h 2014-03-06 14:19:43 +0000
@@ -52,6 +52,7 @@
52 MOCK_METHOD1(glCreateShader, GLuint(GLenum));52 MOCK_METHOD1(glCreateShader, GLuint(GLenum));
53 MOCK_METHOD2(glDeleteBuffers, void(GLsizei, const GLuint *));53 MOCK_METHOD2(glDeleteBuffers, void(GLsizei, const GLuint *));
54 MOCK_METHOD2(glDeleteFramebuffers, void(GLsizei, const GLuint *));54 MOCK_METHOD2(glDeleteFramebuffers, void(GLsizei, const GLuint *));
55 MOCK_METHOD2(glDeleteRenderbuffers, void(GLsizei, const GLuint *));
55 MOCK_METHOD1(glDeleteProgram, void(GLuint));56 MOCK_METHOD1(glDeleteProgram, void(GLuint));
56 MOCK_METHOD1(glDeleteShader, void(GLuint));57 MOCK_METHOD1(glDeleteShader, void(GLuint));
57 MOCK_METHOD2(glDeleteTextures, void(GLsizei, const GLuint *));58 MOCK_METHOD2(glDeleteTextures, void(GLsizei, const GLuint *));
@@ -100,6 +101,7 @@
100 void(GLuint, GLint, GLenum, GLboolean, GLsizei,101 void(GLuint, GLint, GLenum, GLboolean, GLsizei,
101 const GLvoid *));102 const GLvoid *));
102 MOCK_METHOD4(glViewport, void(GLint, GLint, GLsizei, GLsizei));103 MOCK_METHOD4(glViewport, void(GLint, GLint, GLsizei, GLsizei));
104 MOCK_METHOD0(glFinish, void());
103};105};
104106
105}107}
106108
=== modified file 'include/test/mir_test_doubles/mock_hwc_composer_device_1.h'
--- include/test/mir_test_doubles/mock_hwc_composer_device_1.h 2014-01-29 18:54:06 +0000
+++ include/test/mir_test_doubles/mock_hwc_composer_device_1.h 2014-03-06 14:19:43 +0000
@@ -44,6 +44,8 @@
44 external_set = false;44 external_set = false;
45 virtual_prepare = false;45 virtual_prepare = false;
46 virtual_set = false;46 virtual_set = false;
47 fb_fence = -1;
48 retire_fence = -1;
4749
48 common.version = HWC_DEVICE_API_VERSION_1_1;50 common.version = HWC_DEVICE_API_VERSION_1_1;
4951
5052
=== modified file 'include/test/mir_test_doubles/mock_input_surface.h'
--- include/test/mir_test_doubles/mock_input_surface.h 2014-01-13 06:12:33 +0000
+++ include/test/mir_test_doubles/mock_input_surface.h 2014-03-06 14:19:43 +0000
@@ -35,7 +35,7 @@
35 MockInputSurface()35 MockInputSurface()
36 {36 {
37 using namespace testing;37 using namespace testing;
38 ON_CALL(*this, position())38 ON_CALL(*this, top_left())
39 .WillByDefault(39 .WillByDefault(
40 Return(geometry::Point{}));40 Return(geometry::Point{}));
41 ON_CALL(*this, size())41 ON_CALL(*this, size())
@@ -46,7 +46,7 @@
46 .WillByDefault(testing::ReturnRef(n));46 .WillByDefault(testing::ReturnRef(n));
47 }47 }
48 ~MockInputSurface() noexcept {}48 ~MockInputSurface() noexcept {}
49 MOCK_CONST_METHOD0(position, geometry::Point());49 MOCK_CONST_METHOD0(top_left, geometry::Point());
50 MOCK_CONST_METHOD0(size, geometry::Size());50 MOCK_CONST_METHOD0(size, geometry::Size());
51 MOCK_CONST_METHOD0(name, std::string const&());51 MOCK_CONST_METHOD0(name, std::string const&());
52 MOCK_CONST_METHOD1(contains, bool(geometry::Point const&));52 MOCK_CONST_METHOD1(contains, bool(geometry::Point const&));
5353
=== renamed file 'include/test/mir_test_doubles/mock_surface_renderer.h' => 'include/test/mir_test_doubles/mock_renderer.h'
--- include/test/mir_test_doubles/mock_surface_renderer.h 2014-01-14 07:02:27 +0000
+++ include/test/mir_test_doubles/mock_renderer.h 2014-03-06 14:19:43 +0000
@@ -15,8 +15,8 @@
15 *15 *
16 * Authored by: Kevin DuBois <kevin.dubois@canonical.com>16 * Authored by: Kevin DuBois <kevin.dubois@canonical.com>
17 */17 */
18#ifndef MIR_TEST_DOUBLES_MOCK_SURFACE_RENDERER_H_18#ifndef MIR_TEST_DOUBLES_MOCK_RENDERER_H_
19#define MIR_TEST_DOUBLES_MOCK_SURFACE_RENDERER_H_19#define MIR_TEST_DOUBLES_MOCK_RENDERER_H_
2020
21#include "src/server/compositor/renderer.h"21#include "src/server/compositor/renderer.h"
2222
@@ -29,17 +29,19 @@
29namespace doubles29namespace doubles
30{30{
3131
32struct MockSurfaceRenderer : public compositor::Renderer32struct MockRenderer : public compositor::Renderer
33{33{
34 MOCK_CONST_METHOD1(begin, void(float));34 MOCK_METHOD1(set_viewport, void(geometry::Rectangle const&));
35 MOCK_METHOD1(set_rotation, void(float));
36 MOCK_CONST_METHOD0(begin, void());
35 MOCK_CONST_METHOD2(render, void(compositor::CompositingCriteria const&, graphics::Buffer&));37 MOCK_CONST_METHOD2(render, void(compositor::CompositingCriteria const&, graphics::Buffer&));
36 MOCK_CONST_METHOD0(end, void());38 MOCK_CONST_METHOD0(end, void());
37 MOCK_METHOD0(suspend, void());39 MOCK_METHOD0(suspend, void());
3840
39 ~MockSurfaceRenderer() noexcept {}41 ~MockRenderer() noexcept {}
40};42};
4143
42}44}
43}45}
44}46}
45#endif /* MIR_TEST_DOUBLES_MOCK_SURFACE_RENDERER_H_ */47#endif /* MIR_TEST_DOUBLES_MOCK_RENDERER_H_ */
4648
=== modified file 'include/test/mir_test_doubles/stub_display_builder.h'
--- include/test/mir_test_doubles/stub_display_builder.h 2014-01-13 06:12:33 +0000
+++ include/test/mir_test_doubles/stub_display_builder.h 2014-03-06 14:19:43 +0000
@@ -20,8 +20,7 @@
20#define MIR_TEST_DOUBLES_STUB_DISPLAY_BUILDER_H_20#define MIR_TEST_DOUBLES_STUB_DISPLAY_BUILDER_H_
2121
22#include "src/platform/graphics/android/display_builder.h"22#include "src/platform/graphics/android/display_builder.h"
23#include "stub_display_buffer.h"23#include "src/platform/graphics/android/configurable_display_buffer.h"
24#include "stub_display_device.h"
25#include <gmock/gmock.h>24#include <gmock/gmock.h>
2625
27namespace mir26namespace mir
@@ -30,25 +29,47 @@
30{29{
31namespace doubles30namespace doubles
32{31{
32
33struct StubConfigurableDisplayBuffer : public graphics::android::ConfigurableDisplayBuffer
34{
35 StubConfigurableDisplayBuffer(geometry::Rectangle rect)
36 : rect(rect)
37 {
38 }
39
40 geometry::Rectangle view_area() const { return rect; }
41 void make_current() {}
42 void release_current() {}
43 void post_update() {}
44 bool can_bypass() const override { return false; }
45 void render_and_post_update(
46 std::list<std::shared_ptr<graphics::Renderable>> const&,
47 std::function<void(graphics::Renderable const&)> const&) {}
48 MirOrientation orientation() const override { return mir_orientation_normal; }
49 void configure(graphics::DisplayConfigurationOutput const&) {}
50 graphics::DisplayConfigurationOutput configuration() const
51 {
52 return graphics::DisplayConfigurationOutput{
53 graphics::DisplayConfigurationOutputId{1},
54 graphics::DisplayConfigurationCardId{0},
55 graphics::DisplayConfigurationOutputType::vga,
56 {}, {}, 0, {}, false, false, {}, 0, mir_pixel_format_abgr_8888,
57 mir_power_mode_off,
58 mir_orientation_normal};
59 }
60private:
61 geometry::Rectangle rect;
62};
63
33struct StubDisplayBuilder : public graphics::android::DisplayBuilder64struct StubDisplayBuilder : public graphics::android::DisplayBuilder
34{65{
35 StubDisplayBuilder(std::shared_ptr<graphics::android::DisplayDevice> const& stub_dev, geometry::Size sz)66 StubDisplayBuilder(geometry::Size sz)
36 : stub_dev(stub_dev), sz(sz)67 : sz(sz)
37 {68 {
38 }69 }
3970
40 StubDisplayBuilder()71 StubDisplayBuilder()
41 : StubDisplayBuilder(std::make_shared<StubDisplayDevice>(), geometry::Size{0,0})72 : StubDisplayBuilder(geometry::Size{0,0})
42 {
43 }
44
45 StubDisplayBuilder(geometry::Size sz)
46 : StubDisplayBuilder(std::make_shared<StubDisplayDevice>(), sz)
47 {
48 }
49
50 StubDisplayBuilder(std::shared_ptr<graphics::android::DisplayDevice> const& stub_dev)
51 : stub_dev(stub_dev), sz(geometry::Size{0,0})
52 {73 {
53 }74 }
5475
@@ -57,20 +78,13 @@
57 return mir_pixel_format_abgr_8888;78 return mir_pixel_format_abgr_8888;
58 }79 }
5980
60 std::unique_ptr<graphics::DisplayBuffer> create_display_buffer(81 std::unique_ptr<graphics::android::ConfigurableDisplayBuffer> create_display_buffer(
61 std::shared_ptr<graphics::android::DisplayDevice> const&,
62 graphics::android::GLContext const&)82 graphics::android::GLContext const&)
63 {83 {
64 return std::unique_ptr<graphics::DisplayBuffer>(84 return std::unique_ptr<graphics::android::ConfigurableDisplayBuffer>(
65 new StubDisplayBuffer(geometry::Rectangle{{0,0},sz}));85 new StubConfigurableDisplayBuffer(geometry::Rectangle{{0,0},sz}));
66 }86 }
6787
68 std::shared_ptr<graphics::android::DisplayDevice> create_display_device()
69 {
70 return stub_dev;
71 }
72
73 std::shared_ptr<graphics::android::DisplayDevice> const stub_dev;
74 geometry::Size sz;88 geometry::Size sz;
75};89};
76}90}
7791
=== modified file 'include/test/mir_test_doubles/stub_display_configuration.h'
--- include/test/mir_test_doubles/stub_display_configuration.h 2014-01-31 07:35:54 +0000
+++ include/test/mir_test_doubles/stub_display_configuration.h 2014-03-06 14:19:43 +0000
@@ -93,8 +93,8 @@
93 graphics::DisplayConfigurationOutputType::vga,93 graphics::DisplayConfigurationOutputType::vga,
94 pfs, modes, i,94 pfs, modes, i,
95 physical_size,95 physical_size,
96 ((i % 2) == 0),96 ((i % 2) == 0), // even numbers have connected==true
97 ((i % 2) == 1),97 ((i % 4) == 0), // only every second even has used==true
98 top_left,98 top_left,
99 mode_index, pfs[0],99 mode_index, pfs[0],
100 mir_power_mode_off,100 mir_power_mode_off,
101101
=== added file 'include/test/mir_test_doubles/stub_renderer.h'
--- include/test/mir_test_doubles/stub_renderer.h 1970-01-01 00:00:00 +0000
+++ include/test/mir_test_doubles/stub_renderer.h 2014-03-06 14:19:43 +0000
@@ -0,0 +1,65 @@
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: Daniel van Vugt <daniel.van.vugt@canonical.com>
17 */
18
19#ifndef MIR_TEST_DOUBLES_STUB_RENDERER_H_
20#define MIR_TEST_DOUBLES_STUB_RENDERER_H_
21
22#include "src/server/compositor/renderer.h"
23
24namespace mir
25{
26namespace test
27{
28namespace doubles
29{
30
31class StubRenderer : public compositor::Renderer
32{
33public:
34 void set_viewport(geometry::Rectangle const&) override
35 {
36 }
37
38 void set_rotation(float) override
39 {
40 }
41
42 void begin() const override
43 {
44 }
45
46 void render(compositor::CompositingCriteria const&,
47 graphics::Buffer&) const override
48 {
49 }
50
51 void end() const override
52 {
53 }
54
55 void suspend() override
56 {
57 }
58};
59
60
61} // namespace doubles
62} // namespace test
63} // namespace mir
64
65#endif // MIR_TEST_DOUBLES_STUB_RENDERER_H_
066
=== modified file 'include/test/mir_test_doubles/stub_surface_builder.h'
--- include/test/mir_test_doubles/stub_surface_builder.h 2014-01-13 06:12:33 +0000
+++ include/test/mir_test_doubles/stub_surface_builder.h 2014-03-06 14:19:43 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright © 2013 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 General Public License version 3,
@@ -22,8 +22,7 @@
2222
23#include "src/server/scene/surface_builder.h"23#include "src/server/scene/surface_builder.h"
24#include "src/server/scene/basic_surface.h"24#include "src/server/scene/basic_surface.h"
25#include "src/server/scene/surface_data.h"25#include "src/server/report/null_report_factory.h"
26#include "mir/scene/scene_report.h"
27#include "mir/shell/surface_creation_parameters.h"26#include "mir/shell/surface_creation_parameters.h"
2827
29#include "mir_test_doubles/stub_buffer_stream.h"28#include "mir_test_doubles/stub_buffer_stream.h"
@@ -40,11 +39,13 @@
40public:39public:
41 StubSurfaceBuilder() :40 StubSurfaceBuilder() :
42 dummy_surface(std::make_shared<scene::BasicSurface>(41 dummy_surface(std::make_shared<scene::BasicSurface>(
43 std::make_shared<scene::SurfaceData>( 42 std::string("stub"),
44 std::string("stub"), geometry::Rectangle{{},{}}, [](){}, false),43 geometry::Rectangle{{},{}},
44 [](){},
45 false,
45 std::make_shared<StubBufferStream>(),46 std::make_shared<StubBufferStream>(),
46 std::shared_ptr<input::InputChannel>(),47 std::shared_ptr<input::InputChannel>(),
47 std::make_shared<scene::NullSceneReport>()))48 mir::report::null_scene_report()))
48 {49 {
49 }50 }
5051
5152
=== modified file 'include/test/mir_test_framework/udev_environment.h'
--- include/test/mir_test_framework/udev_environment.h 2014-01-13 06:12:33 +0000
+++ include/test/mir_test_framework/udev_environment.h 2014-03-06 14:19:43 +0000
@@ -35,8 +35,6 @@
35 UdevEnvironment();35 UdevEnvironment();
36 ~UdevEnvironment() noexcept;36 ~UdevEnvironment() noexcept;
3737
38 void add_standard_drm_devices();
39
40 std::string add_device(char const* subsystem,38 std::string add_device(char const* subsystem,
41 char const* name,39 char const* name,
42 char const* parent,40 char const* parent,
@@ -45,6 +43,18 @@
45 void remove_device(std::string const& device_path);43 void remove_device(std::string const& device_path);
46 void emit_device_changed(std::string const& device_path);44 void emit_device_changed(std::string const& device_path);
4745
46 /**
47 * Add a device from the set of standard device traces
48 *
49 * Looks for a <tt>name</tt>.umockdev file, and adds a UMockDev device
50 * from that description.
51 *
52 * If <tt>name</tt>.ioctl exists, it loads that ioctl script for the device
53 *
54 * @param name The unadorned filename of the device traces to add.
55 */
56 void add_standard_device(std::string const& name);
57
48 UMockdevTestbed *testbed;58 UMockdevTestbed *testbed;
49};59};
5060
5161
=== modified file 'src/client/CMakeLists.txt'
--- src/client/CMakeLists.txt 2014-02-06 22:37:53 +0000
+++ src/client/CMakeLists.txt 2014-03-06 14:19:43 +0000
@@ -18,6 +18,14 @@
18add_subdirectory(rpc/)18add_subdirectory(rpc/)
19add_subdirectory(lttng/)19add_subdirectory(lttng/)
2020
21if(MIR_BUILD_PLATFORM_ANDROID)
22add_subdirectory(android/)
23endif()
24
25if(MIR_BUILD_PLATFORM_MESA)
26add_subdirectory(mesa/)
27endif()
28
21set(29set(
22 CLIENT_SOURCES30 CLIENT_SOURCES
2331
@@ -38,34 +46,6 @@
38 mir_screencast_api.cpp46 mir_screencast_api.cpp
39)47)
4048
41if( MIR_PLATFORM STREQUAL "android")
42include_directories(SYSTEM ${LIBHARDWARE_INCLUDE_DIRS})
43set(
44 CLIENT_SOURCES
45
46 android/android_client_buffer.cpp
47 android/android_client_buffer_factory.cpp
48 android/android_registrar.cpp
49 android/android_client_platform.cpp
50 android/client_surface_interpreter.cpp
51 android/android_native_display_container.cpp
52 ${CLIENT_SOURCES}
53)
54endif()
55
56if( MIR_PLATFORM STREQUAL "mesa")
57set(
58 CLIENT_SOURCES
59
60 mesa/client_platform.cpp
61 mesa/client_buffer_factory.cpp
62 mesa/client_buffer.cpp
63 mesa/mesa_native_display_container.cpp
64 mesa/native_surface.cpp
65 ${CLIENT_SOURCES}
66)
67endif()
68
69add_library(49add_library(
70 mirclient SHARED50 mirclient SHARED
7151
@@ -81,14 +61,10 @@
81 SOVERSION ${MIRCLIENT_ABI}61 SOVERSION ${MIRCLIENT_ABI}
82)62)
8363
84# Ensure mirclient_compat_links exist before any dependents of mirclient
85add_dependencies(mirclient mirclient_compat_links)
86
87set(64set(
88 MIR_CLIENT_LIBRARIES65 MIR_CLIENT_LIBRARIES
89 ${Boost_LIBRARIES}66 ${Boost_LIBRARIES}
90 ${CMAKE_THREAD_LIBS_INIT}67 ${CMAKE_THREAD_LIBS_INIT}
91 ${LIBHARDWARE_LIBRARIES}
92 ${PROTOBUF_LIBRARIES}68 ${PROTOBUF_LIBRARIES}
93 ${XKBCOMMON_LIBRARIES}69 ${XKBCOMMON_LIBRARIES}
9470
@@ -96,10 +72,10 @@
96 mirsharedinput72 mirsharedinput
97 mirsharedlogging73 mirsharedlogging
98 mirsharedenv74 mirsharedenv
75 mirsharedsharedlibrary
99 mirclientrpc76 mirclientrpc
100 mirclientlttngstatic77 mirclientlttngstatic
10178
102 ${DRM_LIBRARIES}
103 ${MIR_COMMON_PLATFORM_LIBRARIES}79 ${MIR_COMMON_PLATFORM_LIBRARIES}
104 80
105 3rd_party81 3rd_party
10682
=== added file 'src/client/android/CMakeLists.txt'
--- src/client/android/CMakeLists.txt 1970-01-01 00:00:00 +0000
+++ src/client/android/CMakeLists.txt 2014-03-06 14:19:43 +0000
@@ -0,0 +1,38 @@
1include_directories(SYSTEM ${LIBHARDWARE_INCLUDE_DIRS})
2add_definitions(-DANDROID)
3
4add_library(
5 mirclientplatformandroid SHARED
6
7 android_client_buffer.cpp
8 android_client_buffer_factory.cpp
9 android_registrar.cpp
10 android_client_platform.cpp
11 client_platform_factory.cpp
12 client_surface_interpreter.cpp
13 android_native_display_container.cpp
14)
15
16set_target_properties(
17 mirclientplatformandroid PROPERTIES
18 OUTPUT_NAME mirclientplatform
19 LIBRARY_OUTPUT_DIRECTORY ${LIBRARY_OUTPUT_PATH}/android
20)
21
22target_link_libraries(
23 mirclientplatformandroid
24 mirclient
25
26 ${LIBHARDWARE_LIBRARIES}
27)
28
29if (MIR_TEST_PLATFORM STREQUAL "android")
30 add_custom_command(TARGET mirclientplatformandroid
31 POST_BUILD
32 COMMAND ${CMAKE_COMMAND} -E remove libmirclientplatform.so
33 COMMAND ${CMAKE_COMMAND} -E create_symlink android/$<TARGET_FILE_NAME:mirclientplatformandroid> libmirclientplatform.so
34 WORKING_DIRECTORY ${LIBRARY_OUTPUT_PATH}
35 )
36endif()
37
38install(TARGETS mirclientplatformandroid LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/mir/clientplatform/android)
039
=== modified file 'src/client/android/android_client_platform.cpp'
--- src/client/android/android_client_platform.cpp 2014-01-13 06:12:33 +0000
+++ src/client/android/android_client_platform.cpp 2014-03-06 14:19:43 +0000
@@ -22,7 +22,6 @@
22#include "android_client_buffer_factory.h"22#include "android_client_buffer_factory.h"
23#include "client_surface_interpreter.h"23#include "client_surface_interpreter.h"
24#include "../mir_connection.h"24#include "../mir_connection.h"
25#include "../native_client_platform_factory.h"
2625
27#include <EGL/egl.h>26#include <EGL/egl.h>
2827
@@ -44,12 +43,6 @@
4443
45}44}
4645
47std::shared_ptr<mcl::ClientPlatform>
48mcl::NativeClientPlatformFactory::create_client_platform(mcl::ClientContext* /*context*/)
49{
50 return std::make_shared<mcla::AndroidClientPlatform>();
51}
52
53std::shared_ptr<mcl::ClientBufferFactory> mcla::AndroidClientPlatform::create_buffer_factory()46std::shared_ptr<mcl::ClientBufferFactory> mcla::AndroidClientPlatform::create_buffer_factory()
54{47{
55 const hw_module_t *hw_module;48 const hw_module_t *hw_module;
5649
=== added file 'src/client/android/client_platform_factory.cpp'
--- src/client/android/client_platform_factory.cpp 1970-01-01 00:00:00 +0000
+++ src/client/android/client_platform_factory.cpp 2014-03-06 14:19:43 +0000
@@ -0,0 +1,34 @@
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: Alexandros Frantzis <alexandros.frantzis@canonical.com>
17 */
18
19#include "client_platform_factory.h"
20#include "android_client_platform.h"
21
22namespace mcl = mir::client;
23namespace mcla = mcl::android;
24
25std::shared_ptr<mcl::ClientPlatform>
26mcla::ClientPlatformFactory::create_client_platform(mcl::ClientContext* /*context*/)
27{
28 return std::make_shared<mcla::AndroidClientPlatform>();
29}
30
31extern "C" std::shared_ptr<mcl::ClientPlatformFactory> mcl::create_client_platform_factory()
32{
33 return std::make_shared<mcla::ClientPlatformFactory>();
34}
035
=== added file 'src/client/android/client_platform_factory.h'
--- src/client/android/client_platform_factory.h 1970-01-01 00:00:00 +0000
+++ src/client/android/client_platform_factory.h 2014-03-06 14:19:43 +0000
@@ -0,0 +1,41 @@
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: Alexandros Frantzis <alexandros.frantzis@canonical.com>
17 */
18
19#ifndef MIR_CLIENT_ANDROID_CLIENT_PLATFORM_FACTORY_H_
20#define MIR_CLIENT_ANDROID_CLIENT_PLATFORM_FACTORY_H_
21
22#include "../client_platform_factory.h"
23
24namespace mir
25{
26namespace client
27{
28namespace android
29{
30
31class ClientPlatformFactory : public client::ClientPlatformFactory
32{
33public:
34 std::shared_ptr<ClientPlatform> create_client_platform(ClientContext* context) override;
35};
36
37}
38}
39}
40
41#endif /* MIR_CLIENT_ANDROID_CLIENT_PLATFORM_FACTORY_H_ */
042
=== modified file 'src/client/client_platform_factory.h'
--- src/client/client_platform_factory.h 2013-04-24 05:22:20 +0000
+++ src/client/client_platform_factory.h 2014-03-06 14:19:43 +0000
@@ -18,6 +18,8 @@
18#ifndef MIR_CLIENT_CLIENT_PLATFORM_FACTORY_H_18#ifndef MIR_CLIENT_CLIENT_PLATFORM_FACTORY_H_
19#define MIR_CLIENT_CLIENT_PLATFORM_FACTORY_H_19#define MIR_CLIENT_CLIENT_PLATFORM_FACTORY_H_
2020
21#include <memory>
22
21namespace mir23namespace mir
22{24{
23namespace client25namespace client
@@ -29,16 +31,19 @@
29class ClientPlatformFactory31class ClientPlatformFactory
30{32{
31public:33public:
32 virtual ~ClientPlatformFactory() {}34 virtual ~ClientPlatformFactory() = default;
3335
34 virtual std::shared_ptr<ClientPlatform> create_client_platform(ClientContext* context) = 0;36 virtual std::shared_ptr<ClientPlatform> create_client_platform(ClientContext* context) = 0;
3537
36protected:38protected:
37 ClientPlatformFactory() = default;39 ClientPlatformFactory() = default;
38 ClientPlatformFactory(const ClientPlatformFactory& p) = delete;40 ClientPlatformFactory(ClientPlatformFactory const& p) = delete;
39 ClientPlatformFactory& operator=(const ClientPlatformFactory& p) = delete;41 ClientPlatformFactory& operator=(ClientPlatformFactory const& p) = delete;
40};42};
4143
44extern "C" typedef std::shared_ptr<ClientPlatformFactory>(*CreateClientPlatformFactory)();
45extern "C" std::shared_ptr<ClientPlatformFactory> create_client_platform_factory();
46
42}47}
43}48}
4449
4550
=== modified file 'src/client/default_connection_configuration.cpp'
--- src/client/default_connection_configuration.cpp 2014-01-14 04:10:15 +0000
+++ src/client/default_connection_configuration.cpp 2014-03-06 14:19:43 +0000
@@ -22,14 +22,16 @@
22#include "rpc/make_rpc_channel.h"22#include "rpc/make_rpc_channel.h"
23#include "rpc/null_rpc_report.h"23#include "rpc/null_rpc_report.h"
24#include "mir/logging/dumb_console_logger.h"24#include "mir/logging/dumb_console_logger.h"
25#include "native_client_platform_factory.h"
26#include "mir/input/input_platform.h"25#include "mir/input/input_platform.h"
27#include "mir/input/null_input_receiver_report.h"26#include "mir/input/null_input_receiver_report.h"
28#include "logging/rpc_report.h"27#include "logging/rpc_report.h"
29#include "logging/input_receiver_report.h"28#include "logging/input_receiver_report.h"
30#include "lttng/rpc_report.h"29#include "lttng/rpc_report.h"
30#include "lttng/input_receiver_report.h"
31#include "connection_surface_map.h"31#include "connection_surface_map.h"
32#include "lifecycle_control.h"32#include "lifecycle_control.h"
33#include "mir/shared_library.h"
34#include "client_platform_factory.h"
3335
34namespace mcl = mir::client;36namespace mcl = mir::client;
3537
@@ -38,6 +40,23 @@
38std::string const off_opt_val{"off"};40std::string const off_opt_val{"off"};
39std::string const log_opt_val{"log"};41std::string const log_opt_val{"log"};
40std::string const lttng_opt_val{"lttng"};42std::string const lttng_opt_val{"lttng"};
43std::string const default_platform_lib{"libmirclientplatform.so"};
44
45mir::SharedLibrary const* load_library(std::string const& libname)
46{
47 // There's no point in loading twice, and it isn't safe to unload...
48 static std::map<std::string, std::shared_ptr<mir::SharedLibrary>> libraries_cache;
49
50 if (auto& ptr = libraries_cache[libname])
51 {
52 return ptr.get();
53 }
54 else
55 {
56 ptr = std::make_shared<mir::SharedLibrary>(libname);
57 return ptr.get();
58 }
59}
41}60}
4261
43mcl::DefaultConnectionConfiguration::DefaultConnectionConfiguration(62mcl::DefaultConnectionConfiguration::DefaultConnectionConfiguration(
@@ -82,7 +101,15 @@
82 return client_platform_factory(101 return client_platform_factory(
83 []102 []
84 {103 {
85 return std::make_shared<mcl::NativeClientPlatformFactory>();104 auto const val_raw = getenv("MIR_CLIENT_PLATFORM_LIB");
105 std::string const val{val_raw ? val_raw : default_platform_lib};
106 auto const platform_lib = load_library(val);
107
108 auto const create_client_platform_factory =
109 platform_lib->load_function<mcl::CreateClientPlatformFactory>(
110 "create_client_platform_factory");
111
112 return create_client_platform_factory();
86 });113 });
87}114}
88115
@@ -131,6 +158,8 @@
131158
132 if (val == log_opt_val)159 if (val == log_opt_val)
133 return std::make_shared<mcl::logging::InputReceiverReport>(the_logger());160 return std::make_shared<mcl::logging::InputReceiverReport>(the_logger());
161 else if (val == lttng_opt_val)
162 return std::make_shared<mcl::lttng::InputReceiverReport>();
134 else163 else
135 return std::make_shared<mir::input::receiver::NullInputReceiverReport>();164 return std::make_shared<mir::input::receiver::NullInputReceiverReport>();
136 });165 });
137166
=== modified file 'src/client/lttng/CMakeLists.txt'
--- src/client/lttng/CMakeLists.txt 2014-01-13 06:12:33 +0000
+++ src/client/lttng/CMakeLists.txt 2014-03-06 14:19:43 +0000
@@ -5,13 +5,10 @@
55
6 client_tracepoint_provider.cpp6 client_tracepoint_provider.cpp
7 rpc_report.cpp7 rpc_report.cpp
8)8 input_receiver_report.cpp
99)
10add_library(10
11 mirclientlttng SHARED11add_library(mirclientlttng SHARED tracepoints.c)
12
13 rpc_report_tp.c
14)
1512
16# Don't treat missing-field-initializers as an error, since13# Don't treat missing-field-initializers as an error, since
17# the LTTng macros contain code that triggers this (but it's14# the LTTng macros contain code that triggers this (but it's
1815
=== modified file 'src/client/lttng/client_tracepoint_provider.h'
--- src/client/lttng/client_tracepoint_provider.h 2013-06-03 12:15:45 +0000
+++ src/client/lttng/client_tracepoint_provider.h 2014-03-06 14:19:43 +0000
@@ -19,7 +19,7 @@
19#ifndef MIR_CLIENT_LTTNG_CLIENT_TRACEPOINT_PROVIDER_H_19#ifndef MIR_CLIENT_LTTNG_CLIENT_TRACEPOINT_PROVIDER_H_
20#define MIR_CLIENT_LTTNG_CLIENT_TRACEPOINT_PROVIDER_H_20#define MIR_CLIENT_LTTNG_CLIENT_TRACEPOINT_PROVIDER_H_
2121
22#include "mir/lttng/tracepoint_provider.h"22#include "mir/report/lttng/tracepoint_provider.h"
2323
24namespace mir24namespace mir
25{25{
@@ -28,7 +28,7 @@
28namespace lttng28namespace lttng
29{29{
3030
31class ClientTracepointProvider : public mir::lttng::TracepointProvider31class ClientTracepointProvider : public mir::report::lttng::TracepointProvider
32{32{
33public:33public:
34 ClientTracepointProvider();34 ClientTracepointProvider();
3535
=== added file 'src/client/lttng/input_receiver_report.cpp'
--- src/client/lttng/input_receiver_report.cpp 1970-01-01 00:00:00 +0000
+++ src/client/lttng/input_receiver_report.cpp 2014-03-06 14:19:43 +0000
@@ -0,0 +1,65 @@
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 Lesser 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 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: Andreas Pokorny <andreas.pokorny@canonical.com>
17 */
18
19#include "input_receiver_report.h"
20#include "mir/report/lttng/mir_tracepoint.h"
21
22#include <stdexcept>
23#include <boost/throw_exception.hpp>
24
25#define TRACEPOINT_DEFINE
26#define TRACEPOINT_PROBE_DYNAMIC_LINKAGE
27#include "input_receiver_report_tp.h"
28
29void mir::client::lttng::InputReceiverReport::received_event(MirEvent const& event)
30{
31 switch (event.type)
32 {
33 case mir_event_type_key:
34 report(event.key);
35 break;
36 case mir_event_type_motion:
37 report(event.motion);
38 break;
39 default:
40 BOOST_THROW_EXCEPTION(std::runtime_error("Unexpected event type"));
41 }
42}
43
44void mir::client::lttng::InputReceiverReport::report(MirKeyEvent const& event) const
45{
46 mir_tracepoint(mir_client_input_receiver, key_event, event.device_id, event.source_id,
47 static_cast<int>(event.action), static_cast<int>(event.flags), event.modifiers, event.key_code,
48 event.scan_code, event.down_time, event.event_time);
49}
50
51void mir::client::lttng::InputReceiverReport::report(MirMotionEvent const& event) const
52{
53 mir_tracepoint(mir_client_input_receiver, motion_event, event.device_id, event.source_id, event.action,
54 static_cast<int>(event.flags), event.modifiers, event.edge_flags,
55 static_cast<int>(event.button_state), event.down_time, event.event_time);
56 for (unsigned int i = 0; i < event.pointer_count; i++)
57 {
58 mir_tracepoint(mir_client_input_receiver, motion_event_coordinate,
59 event.pointer_coordinates[i].id, event.pointer_coordinates[i].x, event.pointer_coordinates[i].y,
60 event.pointer_coordinates[i].touch_major, event.pointer_coordinates[i].touch_minor,
61 event.pointer_coordinates[i].size, event.pointer_coordinates[i].pressure,
62 event.pointer_coordinates[i].orientation);
63 }
64}
65
066
=== added file 'src/client/lttng/input_receiver_report.h'
--- src/client/lttng/input_receiver_report.h 1970-01-01 00:00:00 +0000
+++ src/client/lttng/input_receiver_report.h 2014-03-06 14:19:43 +0000
@@ -0,0 +1,46 @@
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 Lesser 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 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: Andreas Pokorny <andreas.pokorny@canonical.com>
17 */
18
19#ifndef MIR_CLIENT_LTTNG_INPUT_RECEIVER_REPORT_H_
20#define MIR_CLIENT_LTTNG_INPUT_RECEIVER_REPORT_H_
21
22#include "mir/input/input_receiver_report.h"
23#include "client_tracepoint_provider.h"
24
25namespace mir
26{
27namespace client
28{
29namespace lttng
30{
31
32class InputReceiverReport : public input::receiver::InputReceiverReport
33{
34public:
35 void received_event(MirEvent const& event) override;
36private:
37 void report(MirKeyEvent const& event) const;
38 void report(MirMotionEvent const& event) const;
39 ClientTracepointProvider tp_provider;
40};
41
42}
43}
44}
45
46#endif /* MIR_CLIENT_LTTNG_INPUT_RECEIVER_REPORT_H_ */
047
=== added file 'src/client/lttng/input_receiver_report_tp.h'
--- src/client/lttng/input_receiver_report_tp.h 1970-01-01 00:00:00 +0000
+++ src/client/lttng/input_receiver_report_tp.h 2014-03-06 14:19:43 +0000
@@ -0,0 +1,96 @@
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 Lesser 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 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: Andreas Pokorny <andreas.pokorny@canonical.com>
17 */
18
19#undef TRACEPOINT_PROVIDER
20#define TRACEPOINT_PROVIDER mir_client_input_receiver
21
22#undef TRACEPOINT_INCLUDE
23#define TRACEPOINT_INCLUDE "./input_receiver_report_tp.h"
24
25#if !defined(MIR_CLIENT_LTTNG_INPUT_RECEIVER_REPORT_TP_H_) || defined(TRACEPOINT_HEADER_MULTI_READ)
26#define MIR_CLIENT_LTTNG_INPUT_RECEIVER_REPORT_TP_H_
27
28#include <lttng/tracepoint.h>
29
30#ifdef __clang__
31/*
32 * TRACEPOINT_EVENT defines functions; since we disable tracepoints under clang
33 * these functions are unused and so generate fatal warnings.
34 * (see mir_tracepoint.h and http://sourceware.org/bugzilla/show_bug.cgi?id=13974)
35 */
36#pragma clang diagnostic push
37#pragma clang diagnostic warning "-Wunused-function"
38#endif
39
40TRACEPOINT_EVENT(
41 mir_client_input_receiver,
42 key_event,
43 TP_ARGS(int32_t, device_id, int32_t, source_id, int, action, int, flags, unsigned int, modifiers, int32_t, key_code, int32_t, scan_code, int64_t, down_time, int64_t, event_time),
44 TP_FIELDS(
45 ctf_integer(int32_t, device_id, device_id)
46 ctf_integer(int32_t, source_id, source_id)
47 ctf_integer(int, action, action)
48 ctf_integer(int, flags, flags)
49 ctf_integer(unsigned int, modifiers, modifiers)
50 ctf_integer(int32_t, key_code, key_code)
51 ctf_integer(int32_t, scan_code, scan_code)
52 ctf_integer(int64_t, down_time, down_time)
53 ctf_integer(int64_t, event_time, event_time)
54 )
55)
56
57TRACEPOINT_EVENT(
58 mir_client_input_receiver,
59 motion_event,
60 TP_ARGS(int32_t, device_id, int32_t, source_id, int, action, int, flags, unsigned int, modifiers, int32_t, edge_flags, int, button_state, int64_t, down_time, int64_t, event_time),
61 TP_FIELDS(
62 ctf_integer(int32_t, device_id, device_id)
63 ctf_integer(int32_t, source_id, source_id)
64 ctf_integer(int, action, action)
65 ctf_integer(int, flags, flags)
66 ctf_integer(unsigned int, modifiers, modifiers)
67 ctf_integer(int32_t, edge_flags, edge_flags)
68 ctf_integer(int, button_state, button_state)
69 ctf_integer(int64_t, down_time, down_time)
70 ctf_integer(int64_t, event_time, event_time)
71 )
72)
73
74TRACEPOINT_EVENT(
75 mir_client_input_receiver,
76 motion_event_coordinate,
77 TP_ARGS(int, id, float, x, float, y, float, touch_major, float, touch_minor, float, size, float, pressure, float, orientation),
78 TP_FIELDS(
79 ctf_integer(int, id, id)
80 ctf_float(float, x, x)
81 ctf_float(float, y, y)
82 ctf_float(float, touch_major, touch_major)
83 ctf_float(float, touch_minor, touch_minor)
84 ctf_float(float, size, size)
85 ctf_float(float, pressure, pressure)
86 ctf_float(float, orientation, orientation)
87 )
88)
89
90#ifdef __clang__
91#pragma clang diagnostic pop
92#endif
93
94#endif /* MIR_CLIENT_LTTNG_INPUT_RECEIVER_REPORT_TP_H_ */
95
96#include <lttng/tracepoint-event.h>
097
=== modified file 'src/client/lttng/rpc_report.cpp'
--- src/client/lttng/rpc_report.cpp 2013-09-26 13:50:11 +0000
+++ src/client/lttng/rpc_report.cpp 2014-03-06 14:19:43 +0000
@@ -17,7 +17,7 @@
17 */17 */
1818
19#include "rpc_report.h"19#include "rpc_report.h"
20#include "mir/lttng/mir_tracepoint.h"20#include "mir/report/lttng/mir_tracepoint.h"
2121
22#include "mir_protobuf_wire.pb.h"22#include "mir_protobuf_wire.pb.h"
2323
2424
=== removed file 'src/client/lttng/rpc_report_tp.c'
--- src/client/lttng/rpc_report_tp.c 2013-06-03 12:15:45 +0000
+++ src/client/lttng/rpc_report_tp.c 1970-01-01 00:00:00 +0000
@@ -1,4 +0,0 @@
1/* The probes need to be compiled in a C file (not C++) */
2#define TRACEPOINT_CREATE_PROBES
3
4#include "rpc_report_tp.h"
50
=== added file 'src/client/lttng/tracepoints.c'
--- src/client/lttng/tracepoints.c 1970-01-01 00:00:00 +0000
+++ src/client/lttng/tracepoints.c 2014-03-06 14:19:43 +0000
@@ -0,0 +1,5 @@
1/* The probes need to be compiled in a C file (not C++) */
2#define TRACEPOINT_CREATE_PROBES
3
4#include "rpc_report_tp.h"
5#include "input_receiver_report_tp.h"
06
=== added file 'src/client/mesa/CMakeLists.txt'
--- src/client/mesa/CMakeLists.txt 1970-01-01 00:00:00 +0000
+++ src/client/mesa/CMakeLists.txt 2014-03-06 14:19:43 +0000
@@ -0,0 +1,40 @@
1include_directories(
2 ${DRM_INCLUDE_DIRS}
3 ${EGL_INCLUDE_DIRS}
4)
5
6add_library(
7 mirclientplatformmesa SHARED
8
9 client_platform_factory.cpp
10 client_platform.cpp
11 client_buffer_factory.cpp
12 client_buffer.cpp
13 mesa_native_display_container.cpp
14 native_surface.cpp
15)
16
17set_target_properties(
18 mirclientplatformmesa PROPERTIES
19 OUTPUT_NAME mirclientplatform
20 LIBRARY_OUTPUT_DIRECTORY ${LIBRARY_OUTPUT_PATH}/mesa
21)
22
23target_link_libraries(
24 mirclientplatformmesa
25 mirclient
26
27 ${DRM_LDFLAGS} ${DRM_LIBRARIES}
28)
29
30if (MIR_TEST_PLATFORM STREQUAL "mesa")
31 add_custom_command(TARGET mirclientplatformmesa
32 POST_BUILD
33 COMMAND ${CMAKE_COMMAND} -E remove libmirclientplatform.so
34 COMMAND ${CMAKE_COMMAND} -E create_symlink mesa/$<TARGET_FILE_NAME:mirclientplatformmesa> libmirclientplatform.so
35 WORKING_DIRECTORY ${LIBRARY_OUTPUT_PATH}
36 )
37endif()
38
39install(TARGETS mirclientplatformmesa LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/mir/clientplatform/mesa)
40
041
=== modified file 'src/client/mesa/client_platform.cpp'
--- src/client/mesa/client_platform.cpp 2014-01-13 06:12:33 +0000
+++ src/client/mesa/client_platform.cpp 2014-03-06 14:19:43 +0000
@@ -20,14 +20,9 @@
20#include "client_platform.h"20#include "client_platform.h"
21#include "client_buffer_factory.h"21#include "client_buffer_factory.h"
22#include "mesa_native_display_container.h"22#include "mesa_native_display_container.h"
23#include "buffer_file_ops.h"
24#include "native_surface.h"23#include "native_surface.h"
25#include "../mir_connection.h"24#include "../mir_connection.h"
26#include "../client_buffer_factory.h"25#include "../client_buffer_factory.h"
27#include "../native_client_platform_factory.h"
28
29#include <sys/mman.h>
30#include <unistd.h>
3126
32namespace mcl=mir::client;27namespace mcl=mir::client;
33namespace mclm=mir::client::mesa;28namespace mclm=mir::client::mesa;
@@ -36,31 +31,6 @@
36namespace31namespace
37{32{
3833
39struct RealBufferFileOps : public mclm::BufferFileOps
40{
41 int close(int fd) const
42 {
43 while (::close(fd) == -1)
44 {
45 // Retry on EINTR, return error on anything else
46 if (errno != EINTR)
47 return errno;
48 }
49 return 0;
50 }
51
52 void* map(int fd, off_t offset, size_t size) const
53 {
54 return mmap(nullptr, size, PROT_READ | PROT_WRITE, MAP_SHARED,
55 fd, offset);
56 }
57
58 void unmap(void* addr, size_t size) const
59 {
60 munmap(addr, size);
61 }
62};
63
64struct NativeDisplayDeleter34struct NativeDisplayDeleter
65{35{
66 NativeDisplayDeleter(mcl::EGLNativeDisplayContainer& container)36 NativeDisplayDeleter(mcl::EGLNativeDisplayContainer& container)
@@ -79,14 +49,6 @@
7949
80}50}
8151
82std::shared_ptr<mcl::ClientPlatform>
83mcl::NativeClientPlatformFactory::create_client_platform(mcl::ClientContext* context)
84{
85 auto buffer_file_ops = std::make_shared<RealBufferFileOps>();
86 return std::make_shared<mclm::ClientPlatform>(
87 context, buffer_file_ops, mcl::EGLNativeDisplayContainer::instance());
88}
89
90mclm::ClientPlatform::ClientPlatform(52mclm::ClientPlatform::ClientPlatform(
91 ClientContext* const context,53 ClientContext* const context,
92 std::shared_ptr<BufferFileOps> const& buffer_file_ops,54 std::shared_ptr<BufferFileOps> const& buffer_file_ops,
@@ -125,7 +87,7 @@
125 //TODO: this is awkward on both android and gbm...87 //TODO: this is awkward on both android and gbm...
126 auto native_window = new NativeSurface(*client_surface);88 auto native_window = new NativeSurface(*client_surface);
127 auto egl_native_window = new EGLNativeWindowType;89 auto egl_native_window = new EGLNativeWindowType;
128 *egl_native_window = native_window;90 *egl_native_window = reinterpret_cast<EGLNativeWindowType>(native_window);
129 NativeWindowDeleter deleter(native_window);91 NativeWindowDeleter deleter(native_window);
130 return std::shared_ptr<EGLNativeWindowType>(egl_native_window, deleter);92 return std::shared_ptr<EGLNativeWindowType>(egl_native_window, deleter);
131}93}
13294
=== added file 'src/client/mesa/client_platform_factory.cpp'
--- src/client/mesa/client_platform_factory.cpp 1970-01-01 00:00:00 +0000
+++ src/client/mesa/client_platform_factory.cpp 2014-03-06 14:19:43 +0000
@@ -0,0 +1,71 @@
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: Alexandros Frantzis <alexandros.frantzis@canonical.com>
17 */
18
19#include "client_platform_factory.h"
20#include "client_platform.h"
21#include "buffer_file_ops.h"
22#include "../egl_native_display_container.h"
23
24#include <sys/mman.h>
25#include <unistd.h>
26
27namespace mcl = mir::client;
28namespace mclm = mcl::mesa;
29
30namespace
31{
32
33struct RealBufferFileOps : public mclm::BufferFileOps
34{
35 int close(int fd) const
36 {
37 while (::close(fd) == -1)
38 {
39 // Retry on EINTR, return error on anything else
40 if (errno != EINTR)
41 return errno;
42 }
43 return 0;
44 }
45
46 void* map(int fd, off_t offset, size_t size) const
47 {
48 return mmap(nullptr, size, PROT_READ | PROT_WRITE, MAP_SHARED,
49 fd, offset);
50 }
51
52 void unmap(void* addr, size_t size) const
53 {
54 munmap(addr, size);
55 }
56};
57
58}
59
60std::shared_ptr<mcl::ClientPlatform>
61mclm::ClientPlatformFactory::create_client_platform(mcl::ClientContext* context)
62{
63 auto buffer_file_ops = std::make_shared<RealBufferFileOps>();
64 return std::make_shared<mclm::ClientPlatform>(
65 context, buffer_file_ops, mcl::EGLNativeDisplayContainer::instance());
66}
67
68extern "C" std::shared_ptr<mcl::ClientPlatformFactory> mcl::create_client_platform_factory()
69{
70 return std::make_shared<mclm::ClientPlatformFactory>();
71}
072
=== added file 'src/client/mesa/client_platform_factory.h'
--- src/client/mesa/client_platform_factory.h 1970-01-01 00:00:00 +0000
+++ src/client/mesa/client_platform_factory.h 2014-03-06 14:19:43 +0000
@@ -0,0 +1,41 @@
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: Alexandros Frantzis <alexandros.frantzis@canonical.com>
17 */
18
19#ifndef MIR_CLIENT_MESA_CLIENT_PLATFORM_FACTORY_H_
20#define MIR_CLIENT_MESA_CLIENT_PLATFORM_FACTORY_H_
21
22#include "../client_platform_factory.h"
23
24namespace mir
25{
26namespace client
27{
28namespace mesa
29{
30
31class ClientPlatformFactory : public client::ClientPlatformFactory
32{
33public:
34 std::shared_ptr<ClientPlatform> create_client_platform(ClientContext* context) override;
35};
36
37}
38}
39}
40
41#endif /* MIR_CLIENT_MESA_CLIENT_PLATFORM_FACTORY_H_ */
042
=== modified file 'src/client/mesa/native_surface.cpp'
--- src/client/mesa/native_surface.cpp 2014-01-27 16:59:40 +0000
+++ src/client/mesa/native_surface.cpp 2014-03-06 14:19:43 +0000
@@ -46,7 +46,7 @@
46}46}
4747
48mclm::NativeSurface::NativeSurface(ClientSurface& surface)48mclm::NativeSurface::NativeSurface(ClientSurface& surface)
49 : surface(surface)49 : starting(true), surface(surface)
50{50{
51 surface_advance_buffer = advance_buffer_static;51 surface_advance_buffer = advance_buffer_static;
52 surface_get_parameters = get_parameters_static;52 surface_get_parameters = get_parameters_static;
@@ -55,7 +55,17 @@
5555
56int mclm::NativeSurface::advance_buffer(MirBufferPackage* buffer_package)56int mclm::NativeSurface::advance_buffer(MirBufferPackage* buffer_package)
57{57{
58 surface.request_and_wait_for_next_buffer();58 /*
59 * At present dri2_create_mir_window_surface will trigger
60 * mir_advance_colour_buffer which will land here. Since we're still
61 * creating the window, we don't have any buffers we want the server to
62 * composite, so avoid sending a request to the server on startup:
63 */
64 if (starting)
65 starting = false;
66 else
67 surface.request_and_wait_for_next_buffer();
68
59 auto buffer = surface.get_current_buffer();69 auto buffer = surface.get_current_buffer();
6070
61 auto buffer_to_driver = buffer->native_buffer_handle();71 auto buffer_to_driver = buffer->native_buffer_handle();
6272
=== modified file 'src/client/mesa/native_surface.h'
--- src/client/mesa/native_surface.h 2014-01-13 06:12:33 +0000
+++ src/client/mesa/native_surface.h 2014-03-06 14:19:43 +0000
@@ -39,6 +39,7 @@
39 int set_swapinterval(int interval);39 int set_swapinterval(int interval);
4040
41private:41private:
42 bool starting;
42 ClientSurface& surface;43 ClientSurface& surface;
43};44};
4445
4546
=== modified file 'src/client/mir_client_library.cpp'
--- src/client/mir_client_library.cpp 2014-01-28 18:21:14 +0000
+++ src/client/mir_client_library.cpp 2014-03-06 14:19:43 +0000
@@ -25,7 +25,6 @@
25#include "mir_connection.h"25#include "mir_connection.h"
26#include "display_configuration.h"26#include "display_configuration.h"
27#include "mir_surface.h"27#include "mir_surface.h"
28#include "native_client_platform_factory.h"
29#include "egl_native_display_container.h"28#include "egl_native_display_container.h"
30#include "default_connection_configuration.h"29#include "default_connection_configuration.h"
31#include "lifecycle_control.h"30#include "lifecycle_control.h"
@@ -397,7 +396,7 @@
397396
398MirEGLNativeWindowType mir_surface_get_egl_native_window(MirSurface *surface)397MirEGLNativeWindowType mir_surface_get_egl_native_window(MirSurface *surface)
399{398{
400 return surface->generate_native_window();399 return reinterpret_cast<MirEGLNativeWindowType>(surface->generate_native_window());
401}400}
402401
403MirWaitHandle* mir_surface_set_type(MirSurface *surf,402MirWaitHandle* mir_surface_set_type(MirSurface *surf,
404403
=== modified file 'src/client/mir_connection.cpp'
--- src/client/mir_connection.cpp 2014-01-24 18:11:19 +0000
+++ src/client/mir_connection.cpp 2014-03-06 14:19:43 +0000
@@ -16,8 +16,6 @@
16 * Authored by: Thomas Guest <thomas.guest@canonical.com>16 * Authored by: Thomas Guest <thomas.guest@canonical.com>
17 */17 */
1818
19#include "mir/logging/logger.h"
20
21#include "mir_connection.h"19#include "mir_connection.h"
22#include "mir_surface.h"20#include "mir_surface.h"
23#include "client_platform.h"21#include "client_platform.h"
@@ -28,6 +26,8 @@
28#include "connection_surface_map.h"26#include "connection_surface_map.h"
29#include "lifecycle_control.h"27#include "lifecycle_control.h"
3028
29#include "mir/logging/logger.h"
30
31#include <algorithm>31#include <algorithm>
32#include <cstddef>32#include <cstddef>
33#include <unistd.h>33#include <unistd.h>
@@ -458,6 +458,7 @@
458 display_request->set_output_id(output.output_id);458 display_request->set_output_id(output.output_id);
459 display_request->set_used(output.used);459 display_request->set_used(output.used);
460 display_request->set_current_mode(output.current_mode);460 display_request->set_current_mode(output.current_mode);
461 display_request->set_current_format(output.current_format);
461 display_request->set_position_x(output.position_x);462 display_request->set_position_x(output.position_x);
462 display_request->set_position_y(output.position_y);463 display_request->set_position_y(output.position_y);
463 display_request->set_power_mode(output.power_mode);464 display_request->set_power_mode(output.power_mode);
464465
=== modified file 'src/client/mir_screencast_api.cpp'
--- src/client/mir_screencast_api.cpp 2014-01-29 18:02:33 +0000
+++ src/client/mir_screencast_api.cpp 2014-03-06 14:19:43 +0000
@@ -96,5 +96,5 @@
9696
97MirEGLNativeWindowType mir_screencast_egl_native_window(MirScreencast* screencast)97MirEGLNativeWindowType mir_screencast_egl_native_window(MirScreencast* screencast)
98{98{
99 return screencast->egl_native_window();99 return reinterpret_cast<MirEGLNativeWindowType>(screencast->egl_native_window());
100}100}
101101
=== removed file 'src/client/native_client_platform_factory.h'
--- src/client/native_client_platform_factory.h 2013-06-17 09:51:42 +0000
+++ src/client/native_client_platform_factory.h 1970-01-01 00:00:00 +0000
@@ -1,49 +0,0 @@
1/*
2 * Copyright © 2012 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: Alexandros Frantzis <alexandros.frantzis@canonical.com>
17 */
18
19#ifndef MIR_CLIENT_NATIVE_CLIENT_PLATFORM_FACTORY_
20#define MIR_CLIENT_NATIVE_CLIENT_PLATFORM_FACTORY_
21
22#include "client_platform_factory.h"
23
24namespace mir
25{
26namespace client
27{
28
29/**
30 * Factory for creating the native client platform.
31 * \ingroup platform_enablement
32 */
33class NativeClientPlatformFactory : public ClientPlatformFactory
34{
35public:
36 /**
37 * Creates a client platform.
38 *
39 * This method needs to be implemented by each platform.
40 *
41 * \param [in] context information about the client
42 */
43 std::shared_ptr<ClientPlatform> create_client_platform(ClientContext* context);
44};
45
46}
47}
48
49#endif /* MIR_CLIENT_NATIVE_CLIENT_PLATFORM_FACTORY_ */
500
=== modified file 'src/platform/CMakeLists.txt'
--- src/platform/CMakeLists.txt 2014-01-22 08:32:55 +0000
+++ src/platform/CMakeLists.txt 2014-03-06 14:19:43 +0000
@@ -17,3 +17,4 @@
17install(TARGETS mirplatform LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})17install(TARGETS mirplatform LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
1818
19add_subdirectory(graphics/)19add_subdirectory(graphics/)
20add_subdirectory(options)
2021
=== modified file 'src/platform/graphics/CMakeLists.txt'
--- src/platform/graphics/CMakeLists.txt 2014-01-22 08:32:55 +0000
+++ src/platform/graphics/CMakeLists.txt 2014-03-06 14:19:43 +0000
@@ -8,7 +8,6 @@
8 egl_extensions.cpp8 egl_extensions.cpp
9 egl_resources.cpp9 egl_resources.cpp
10 display_configuration.cpp10 display_configuration.cpp
11 null_display_report.cpp
12 buffer_basic.cpp11 buffer_basic.cpp
13 pixel_format_utils.cpp12 pixel_format_utils.cpp
14)13)
@@ -26,11 +25,11 @@
26 ${EGL_LDFLAGS} ${EGL_LIBRARIES}25 ${EGL_LDFLAGS} ${EGL_LIBRARIES}
27)26)
2827
29if (MIR_PLATFORM STREQUAL "android")28if (MIR_BUILD_PLATFORM_ANDROID)
30 add_subdirectory(android/)29 add_subdirectory(android/)
31endif()30endif()
3231
33if (MIR_PLATFORM STREQUAL "mesa")32if (MIR_BUILD_PLATFORM_MESA)
34 add_subdirectory(mesa/)33 add_subdirectory(mesa/)
35endif()34endif()
3635
3736
=== modified file 'src/platform/graphics/android/CMakeLists.txt'
--- src/platform/graphics/android/CMakeLists.txt 2014-01-21 18:09:35 +0000
+++ src/platform/graphics/android/CMakeLists.txt 2014-03-06 14:19:43 +0000
@@ -4,8 +4,11 @@
4 ${GLESv2_INCLUDE_DIRS}4 ${GLESv2_INCLUDE_DIRS}
5)5)
66
7set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpermissive")
8add_definitions( -DANDROID )
9
7add_library(10add_library(
8 mirplatformgraphics SHARED11 mirplatformgraphicsandroid SHARED
912
10 android_platform.cpp13 android_platform.cpp
11 android_buffer_allocator.cpp14 android_buffer_allocator.cpp
@@ -31,8 +34,14 @@
31 gl_context.cpp34 gl_context.cpp
32)35)
3336
37set_target_properties(
38 mirplatformgraphicsandroid PROPERTIES
39 OUTPUT_NAME mirplatformgraphics
40 LIBRARY_OUTPUT_DIRECTORY ${LIBRARY_OUTPUT_PATH}/android
41)
42
34target_link_libraries(43target_link_libraries(
35 mirplatformgraphics44 mirplatformgraphicsandroid
3645
37 mirplatform46 mirplatform
38 mirsharedandroid47 mirsharedandroid
@@ -42,4 +51,13 @@
42 ${GLESv2_LDFLAGS} ${GLESv2_LIBRARIES}51 ${GLESv2_LDFLAGS} ${GLESv2_LIBRARIES}
43)52)
4453
45install(TARGETS mirplatformgraphics LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})54if (MIR_TEST_PLATFORM STREQUAL "android")
55 add_custom_command(TARGET mirplatformgraphicsandroid
56 POST_BUILD
57 COMMAND ${CMAKE_COMMAND} -E remove libmirplatformgraphics.so
58 COMMAND ${CMAKE_COMMAND} -E create_symlink android/$<TARGET_FILE_NAME:mirplatformgraphicsandroid> libmirplatformgraphics.so
59 WORKING_DIRECTORY ${LIBRARY_OUTPUT_PATH}
60 )
61endif()
62
63install(TARGETS mirplatformgraphicsandroid LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/mir/platformgraphics/android)
4664
=== modified file 'src/platform/graphics/android/android_display.cpp'
--- src/platform/graphics/android/android_display.cpp 2014-01-31 07:48:24 +0000
+++ src/platform/graphics/android/android_display.cpp 2014-03-06 14:19:43 +0000
@@ -17,14 +17,13 @@
17 */17 */
1818
19#include "mir/graphics/platform.h"19#include "mir/graphics/platform.h"
20#include "mir/graphics/display_configuration.h"20#include "android_display_configuration.h"
21#include "mir/graphics/display_report.h"21#include "mir/graphics/display_report.h"
22#include "mir/graphics/display_buffer.h"22#include "mir/graphics/display_buffer.h"
23#include "mir/graphics/gl_context.h"23#include "mir/graphics/gl_context.h"
24#include "mir/graphics/egl_resources.h"24#include "mir/graphics/egl_resources.h"
25#include "android_display.h"25#include "android_display.h"
26#include "display_builder.h"26#include "display_builder.h"
27#include "display_device.h"
28#include "mir/geometry/rectangle.h"27#include "mir/geometry/rectangle.h"
2928
30namespace mga=mir::graphics::android;29namespace mga=mir::graphics::android;
@@ -35,9 +34,7 @@
35 std::shared_ptr<DisplayReport> const& display_report)34 std::shared_ptr<DisplayReport> const& display_report)
36 : display_builder{display_builder},35 : display_builder{display_builder},
37 gl_context{display_builder->display_format(), *display_report},36 gl_context{display_builder->display_format(), *display_report},
38 display_device(display_builder->create_display_device()),37 display_buffer{display_builder->create_display_buffer(gl_context)}
39 display_buffer{display_builder->create_display_buffer(display_device, gl_context)},
40 current_configuration{display_buffer->view_area().size}
41{38{
42 display_report->report_successful_setup_of_native_resources();39 display_report->report_successful_setup_of_native_resources();
4340
@@ -55,31 +52,15 @@
55std::unique_ptr<mg::DisplayConfiguration> mga::AndroidDisplay::configuration() const52std::unique_ptr<mg::DisplayConfiguration> mga::AndroidDisplay::configuration() const
56{53{
57 return std::unique_ptr<mg::DisplayConfiguration>(54 return std::unique_ptr<mg::DisplayConfiguration>(
58 new mga::AndroidDisplayConfiguration(current_configuration)55 new mga::AndroidDisplayConfiguration(display_buffer->configuration()));
59 );
60}56}
6157
62void mga::AndroidDisplay::configure(mg::DisplayConfiguration const& configuration)58void mga::AndroidDisplay::configure(mg::DisplayConfiguration const& configuration)
63{59{
64 MirOrientation orientation = mir_orientation_normal;
65
66 configuration.for_each_output([&](mg::DisplayConfigurationOutput const& output)60 configuration.for_each_output([&](mg::DisplayConfigurationOutput const& output)
67 {61 {
68 // TODO: Properly support multiple outputs62 display_buffer->configure(output);
69 display_device->mode(output.power_mode);
70 orientation = output.orientation;
71 });63 });
72 current_configuration = dynamic_cast<mga::AndroidDisplayConfiguration const&>(configuration);
73
74 /*
75 * It's tempting to put orient() into the base class and so avoid this
76 * cast, but we only need it in the Android implementation right now.
77 */
78 if (android::DisplayBuffer* db =
79 dynamic_cast<mga::DisplayBuffer*>(display_buffer.get()))
80 {
81 db->orient(orientation);
82 }
83}64}
8465
85void mga::AndroidDisplay::register_configuration_change_handler(66void mga::AndroidDisplay::register_configuration_change_handler(
8667
=== modified file 'src/platform/graphics/android/android_display.h'
--- src/platform/graphics/android/android_display.h 2014-01-31 07:48:24 +0000
+++ src/platform/graphics/android/android_display.h 2014-03-06 14:19:43 +0000
@@ -19,9 +19,7 @@
19#ifndef MIR_GRAPHICS_ANDROID_ANDROID_DISPLAY_H_19#ifndef MIR_GRAPHICS_ANDROID_ANDROID_DISPLAY_H_
20#define MIR_GRAPHICS_ANDROID_ANDROID_DISPLAY_H_20#define MIR_GRAPHICS_ANDROID_ANDROID_DISPLAY_H_
2121
22#include "display_buffer.h"
23#include "mir/graphics/display.h"22#include "mir/graphics/display.h"
24#include "android_display_configuration.h"
25#include "gl_context.h"23#include "gl_context.h"
2624
27#include <memory>25#include <memory>
@@ -35,10 +33,9 @@
3533
36namespace android34namespace android
37{35{
38class DisplayDevice;
39
40class DisplayBuilder;36class DisplayBuilder;
41class DisplaySupportProvider;37class DisplaySupportProvider;
38class ConfigurableDisplayBuffer;
4239
43class AndroidDisplay : public Display40class AndroidDisplay : public Display
44{41{
@@ -69,10 +66,9 @@
69private:66private:
70 std::shared_ptr<DisplayBuilder> const display_builder;67 std::shared_ptr<DisplayBuilder> const display_builder;
71 GLContext gl_context;68 GLContext gl_context;
72 std::shared_ptr<DisplayDevice> const display_device;69
73 //we only have a primary display at the moment70 //we only have a primary display at the moment
74 std::unique_ptr<graphics::DisplayBuffer> const display_buffer;71 std::unique_ptr<ConfigurableDisplayBuffer> const display_buffer;
75 AndroidDisplayConfiguration current_configuration;
76};72};
7773
78}74}
7975
=== modified file 'src/platform/graphics/android/android_display_configuration.cpp'
--- src/platform/graphics/android/android_display_configuration.cpp 2014-01-23 22:03:09 +0000
+++ src/platform/graphics/android/android_display_configuration.cpp 2014-03-06 14:19:43 +0000
@@ -20,25 +20,9 @@
20namespace mga = mg::android;20namespace mga = mg::android;
21namespace geom = mir::geometry;21namespace geom = mir::geometry;
2222
23mga::AndroidDisplayConfiguration::AndroidDisplayConfiguration(geom::Size const& display_size)23mga::AndroidDisplayConfiguration::AndroidDisplayConfiguration(mg::DisplayConfigurationOutput && output)
24 : configuration{mg::DisplayConfigurationOutputId{1},24 : configuration(std::move(output)),
25 mg::DisplayConfigurationCardId{0},25 card{mg::DisplayConfigurationCardId{0}, 1}
26 mg::DisplayConfigurationOutputType::lvds,
27 {
28 mir_pixel_format_abgr_8888,
29 mir_pixel_format_xbgr_8888
30 },
31 {mg::DisplayConfigurationMode{display_size,0.0f}},
32 0,
33 geom::Size{0,0},
34 true,
35 true,
36 geom::Point{0,0},
37 0,
38 mir_pixel_format_abgr_8888,
39 mir_power_mode_on,
40 mir_orientation_normal},
41 card{mg::DisplayConfigurationCardId{0}, 1}
42{26{
43}27}
4428
4529
=== modified file 'src/platform/graphics/android/android_display_configuration.h'
--- src/platform/graphics/android/android_display_configuration.h 2014-01-13 06:12:33 +0000
+++ src/platform/graphics/android/android_display_configuration.h 2014-03-06 14:19:43 +0000
@@ -29,7 +29,7 @@
29class AndroidDisplayConfiguration : public graphics::DisplayConfiguration29class AndroidDisplayConfiguration : public graphics::DisplayConfiguration
30{30{
31public:31public:
32 AndroidDisplayConfiguration(geometry::Size const& display_size);32 AndroidDisplayConfiguration(DisplayConfigurationOutput&& output);
33 AndroidDisplayConfiguration(AndroidDisplayConfiguration const& other);33 AndroidDisplayConfiguration(AndroidDisplayConfiguration const& other);
34 AndroidDisplayConfiguration& operator=(AndroidDisplayConfiguration const& other);34 AndroidDisplayConfiguration& operator=(AndroidDisplayConfiguration const& other);
3535
3636
=== modified file 'src/platform/graphics/android/android_platform.cpp'
--- src/platform/graphics/android/android_platform.cpp 2014-02-04 23:20:36 +0000
+++ src/platform/graphics/android/android_platform.cpp 2014-03-06 14:19:43 +0000
@@ -29,9 +29,9 @@
29#include "mir/graphics/buffer_initializer.h"29#include "mir/graphics/buffer_initializer.h"
30#include "mir/graphics/buffer_id.h"30#include "mir/graphics/buffer_id.h"
31#include "mir/graphics/buffer_ipc_packer.h"31#include "mir/graphics/buffer_ipc_packer.h"
32#include "mir/graphics/display_report.h"
32#include "mir/options/option.h"33#include "mir/options/option.h"
3334
34#include "mir/graphics/null_display_report.h"
35#include <boost/throw_exception.hpp>35#include <boost/throw_exception.hpp>
36#include <stdexcept>36#include <stdexcept>
3737
3838
=== added file 'src/platform/graphics/android/configurable_display_buffer.h'
--- src/platform/graphics/android/configurable_display_buffer.h 1970-01-01 00:00:00 +0000
+++ src/platform/graphics/android/configurable_display_buffer.h 2014-03-06 14:19:43 +0000
@@ -0,0 +1,43 @@
1/*
2 * Copyright © 2013 Canonical Ltd.
3 *
4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU 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_CONFIGURABLE_DISPLAY_BUFFER_H_
20#define MIR_GRAPHICS_ANDROID_CONFIGURABLE_DISPLAY_BUFFER_H_
21
22#include "mir/graphics/display_buffer.h"
23#include "mir/graphics/display_configuration.h"
24
25namespace mir
26{
27namespace graphics
28{
29namespace android
30{
31
32class ConfigurableDisplayBuffer : public graphics::DisplayBuffer
33{
34public:
35 virtual DisplayConfigurationOutput configuration() const = 0;
36 virtual void configure(DisplayConfigurationOutput const&) = 0;
37};
38
39}
40}
41}
42
43#endif /* MIR_GRAPHICS_ANDROID_CONFIGURABLE_DISPLAY_BUFFER_H_ */
044
=== modified file 'src/platform/graphics/android/display_buffer.cpp'
--- src/platform/graphics/android/display_buffer.cpp 2014-01-23 17:26:51 +0000
+++ src/platform/graphics/android/display_buffer.cpp 2014-03-06 14:19:43 +0000
@@ -24,6 +24,7 @@
24#include <boost/throw_exception.hpp>24#include <boost/throw_exception.hpp>
25#include <stdexcept>25#include <stdexcept>
26#include <algorithm>26#include <algorithm>
27#include <sstream>
2728
28namespace mg=mir::graphics;29namespace mg=mir::graphics;
29namespace mga=mir::graphics::android;30namespace mga=mir::graphics::android;
@@ -38,7 +39,23 @@
38 display_device{display_device},39 display_device{display_device},
39 native_window{native_window},40 native_window{native_window},
40 gl_context{shared_gl_context, std::bind(mga::create_window_surface, std::placeholders::_1, std::placeholders::_2, native_window.get())},41 gl_context{shared_gl_context, std::bind(mga::create_window_surface, std::placeholders::_1, std::placeholders::_2, native_window.get())},
41 rotation{mir_orientation_normal}42 current_configuration{
43 mg::DisplayConfigurationOutputId{1},
44 mg::DisplayConfigurationCardId{0},
45 mg::DisplayConfigurationOutputType::lvds,
46 {
47 fb_bundle->fb_format()
48 },
49 {mg::DisplayConfigurationMode{fb_bundle->fb_size(),0.0f}},
50 0,
51 geom::Size{0,0}, //could use DPI information to fill this
52 true,
53 true,
54 geom::Point{0,0},
55 0,
56 fb_bundle->fb_format(),
57 mir_power_mode_on,
58 mir_orientation_normal}
42{59{
43}60}
4461
@@ -48,8 +65,11 @@
48 int width = size.width.as_int();65 int width = size.width.as_int();
49 int height = size.height.as_int();66 int height = size.height.as_int();
5067
51 if (rotation == mir_orientation_left || rotation == mir_orientation_right)68 if (current_configuration.orientation == mir_orientation_left
69 || current_configuration.orientation == mir_orientation_right)
70 {
52 std::swap(width, height);71 std::swap(width, height);
72 }
5373
54 return {{0,0}, {width,height}};74 return {{0,0}, {width,height}};
55}75