Mir

Merge lp:~raof/mir/nested-one-surface-per-crtc into lp:mir/0.1

Proposed by Chris Halse Rogers
Status: Superseded
Proposed branch: lp:~raof/mir/nested-one-surface-per-crtc
Merge into: lp:mir/0.1
Diff against target: 24803 lines (+10112/-4398) (has conflicts)
392 files modified
3rd_party/android-input/android/frameworks/base/services/input/InputDispatcher.cpp (+2/-0)
CMakeLists.txt (+26/-14)
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 (+21/-0)
debian/control (+78/-6)
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 (+4/-0)
debian/rules (+23/-0)
debian/update-alternatives.postinst.in (+18/-0)
debian/update-alternatives.prerm.in (+16/-0)
doc/component_reports.md (+5/-5)
examples/CMakeLists.txt (+13/-3)
examples/basic_server_configuration.cpp (+13/-7)
examples/demo-shell/CMakeLists.txt (+1/-0)
examples/demo-shell/demo_renderer.cpp (+33/-0)
examples/demo-shell/demo_renderer.h (+39/-0)
examples/demo-shell/demo_shell.cpp (+35/-9)
examples/demo-shell/window_manager.cpp (+10/-24)
examples/eglplasma.c (+9/-7)
examples/pixel_format_selector.cpp (+2/-7)
examples/render_overlays.cpp (+161/-0)
examples/render_surfaces.cpp (+36/-15)
examples/render_to_fb.cpp (+0/-1)
examples/scroll.cpp (+63/-42)
examples/server_configuration.cpp (+25/-30)
examples/server_configuration.h (+7/-1)
guides/cppguide.xml (+7/-6)
include/platform/mir/abnormal_exit.h (+3/-3)
include/platform/mir/graphics/display_configuration.h (+27/-7)
include/platform/mir/graphics/drm_authenticator.h (+1/-3)
include/platform/mir/graphics/overlapping_output_grouping.h (+3/-7)
include/platform/mir/graphics/renderable.h (+26/-1)
include/platform/mir/options/configuration.h (+73/-0)
include/platform/mir/options/default_configuration.h (+40/-75)
include/platform/mir/udev/wrapper.h (+2/-1)
include/server/mir/compositor/buffer_stream.h (+2/-1)
include/server/mir/compositor/compositing_criteria.h (+0/-52)
include/server/mir/compositor/compositor_report.h (+0/-11)
include/server/mir/compositor/display_buffer_compositor.h (+4/-2)
include/server/mir/compositor/gl_renderer.h (+13/-7)
include/server/mir/compositor/renderer.h (+11/-3)
include/server/mir/compositor/scene.h (+3/-4)
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/server/mir/shell/session.h (+0/-1)
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/shared/testdraw/draw_pattern_checkered-inl.h (+3/-3)
include/shared/testdraw/graphics_region_factory.h (+21/-30)
include/shared/testdraw/patterns.h (+4/-4)
include/test/mir_test_doubles/fake_renderable.h (+37/-11)
include/test/mir_test_doubles/mock_buffer_bundle.h (+1/-0)
include/test/mir_test_doubles/mock_buffer_stream.h (+1/-0)
include/test/mir_test_doubles/mock_compositing_criteria.h (+0/-45)
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_renderable.h (+6/-1)
include/test/mir_test_doubles/mock_renderer.h (+10/-8)
include/test/mir_test_doubles/null_display_configuration.h (+1/-1)
include/test/mir_test_doubles/stub_buffer.h (+16/-4)
include/test/mir_test_doubles/stub_buffer_stream.h (+2/-0)
include/test/mir_test_doubles/stub_display_builder.h (+41/-27)
include/test/mir_test_doubles/stub_display_configuration.h (+8/-3)
include/test/mir_test_doubles/stub_renderable.h (+25/-1)
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 (+45/-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 (+47/-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 (+3/-3)
src/platform/graphics/android/CMakeLists.txt (+28/-3)
src/platform/graphics/android/android_display.cpp (+15/-20)
src/platform/graphics/android/android_display.h (+3/-7)
src/platform/graphics/android/android_display_configuration.cpp (+7/-24)
src/platform/graphics/android/android_display_configuration.h (+2/-5)
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 (+11/-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 (+35/-10)
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 (+102/-84)
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/display_configuration.cpp (+50/-0)
src/platform/graphics/mesa/CMakeLists.txt (+26/-4)
src/platform/graphics/mesa/cursor.cpp (+26/-15)
src/platform/graphics/mesa/cursor.h (+2/-1)
src/platform/graphics/mesa/display.cpp (+18/-1)
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/native_platform.cpp (+2/-0)
src/platform/graphics/mesa/platform.cpp (+1/-1)
src/platform/graphics/mesa/platform.h (+1/-1)
src/platform/graphics/mesa/real_kms_display_configuration.cpp (+6/-34)
src/platform/graphics/mesa/real_kms_display_configuration.h (+1/-4)
src/platform/graphics/overlapping_output_grouping.cpp (+7/-8)
src/platform/options/CMakeLists.txt (+1/-0)
src/platform/options/default_configuration.cpp (+104/-102)
src/platform/options/program_option.cpp (+3/-3)
src/platform/udev_wrapper.cpp (+16/-0)
src/server/CMakeLists.txt (+8/-4)
src/server/compositor/CMakeLists.txt (+2/-1)
src/server/compositor/buffer_bundle.h (+1/-0)
src/server/compositor/buffer_stream_surfaces.cpp (+5/-0)
src/server/compositor/buffer_stream_surfaces.h (+1/-0)
src/server/compositor/bypass.cpp (+10/-10)
src/server/compositor/bypass.h (+5/-7)
src/server/compositor/compositing_screencast.cpp (+176/-0)
src/server/compositor/compositing_screencast.h (+74/-0)
src/server/compositor/default_configuration.cpp (+25/-0)
src/server/compositor/default_display_buffer_compositor.cpp (+27/-9)
src/server/compositor/default_display_buffer_compositor.h (+2/-1)
src/server/compositor/default_display_buffer_compositor_factory.cpp (+2/-2)
src/server/compositor/gl_renderer.cpp (+87/-50)
src/server/compositor/gl_renderer_factory.cpp (+1/-9)
src/server/compositor/gl_renderer_factory.h (+1/-6)
src/server/compositor/multi_threaded_compositor.cpp (+16/-17)
src/server/compositor/multi_threaded_compositor.h (+0/-2)
src/server/compositor/occlusion.cpp (+11/-11)
src/server/compositor/occlusion.h (+4/-6)
src/server/compositor/rendering_operator.cpp (+9/-5)
src/server/compositor/rendering_operator.h (+5/-3)
src/server/compositor/screencast_display_buffer.cpp (+110/-0)
src/server/compositor/screencast_display_buffer.h (+85/-0)
src/server/compositor/switching_bundle.cpp (+42/-6)
src/server/compositor/switching_bundle.h (+6/-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 (+174/-71)
src/server/frontend/session_mediator_android.cpp (+0/-44)
src/server/frontend/session_mediator_mesa.cpp (+0/-68)
src/server/graphics/default_configuration.cpp (+31/-24)
src/server/graphics/default_display_configuration_policy.cpp (+9/-10)
src/server/graphics/nested/nested_display.cpp (+45/-35)
src/server/graphics/nested/nested_display_configuration.cpp (+59/-39)
src/server/graphics/nested/nested_display_configuration.h (+1/-5)
src/server/graphics/offscreen/display.cpp (+6/-0)
src/server/graphics/offscreen/display_configuration.cpp (+5/-3)
src/server/graphics/offscreen/display_configuration.h (+1/-5)
src/server/input/CMakeLists.txt (+0/-1)
src/server/input/android/android_input_window_handle.cpp (+1/-1)
src/server/input/default_configuration.cpp (+12/-8)
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 (+176/-40)
src/server/scene/basic_surface.h (+71/-10)
src/server/scene/default_configuration.cpp (+1/-38)
src/server/scene/mediating_display_changer.cpp (+2/-7)
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 (+12/-14)
src/shared/CMakeLists.txt (+4/-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/shared/testdraw/CMakeLists.txt (+11/-7)
src/shared/testdraw/android_graphics_region_factory.cpp (+59/-27)
src/shared/testdraw/mesa_graphics_region_factory.cpp (+42/-0)
src/shared/testdraw/patterns.cpp (+4/-4)
src/utils/screencast.cpp (+332/-0)
tests/CMakeLists.txt (+3/-3)
tests/acceptance-tests/test_client_authorization.cpp (+2/-0)
tests/acceptance-tests/test_client_input.cpp (+38/-5)
tests/acceptance-tests/test_nested_mir.cpp (+6/-1)
tests/acceptance-tests/test_server_shutdown.cpp (+6/-30)
tests/acceptance-tests/test_surfaces_with_output_id.cpp (+4/-5)
tests/integration-tests/CMakeLists.txt (+3/-2)
tests/integration-tests/client/CMakeLists.txt (+1/-1)
tests/integration-tests/client/test_client_render.cpp (+10/-11)
tests/integration-tests/compositor/test_swapping_swappers.cpp (+42/-11)
tests/integration-tests/frontend/test_application_mediator_report.cpp (+7/-1)
tests/integration-tests/graphics/android/test_buffer_integration.cpp (+7/-5)
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 (+5/-20)
tests/integration-tests/test_surface_first_frame_sync.cpp (+5/-16)
tests/integration-tests/test_swapinterval.cpp (+2/-1)
tests/mir_test/display_config_matchers.cpp (+6/-3)
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 (+19/-30)
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_bypass.cpp (+55/-59)
tests/unit-tests/compositor/test_compositing_screencast.cpp (+281/-0)
tests/unit-tests/compositor/test_default_display_buffer_compositor.cpp (+96/-82)
tests/unit-tests/compositor/test_gl_renderer.cpp (+28/-29)
tests/unit-tests/compositor/test_multi_threaded_compositor.cpp (+20/-17)
tests/unit-tests/compositor/test_occlusion.cpp (+24/-27)
tests/unit-tests/compositor/test_rendering_operator.cpp (+15/-15)
tests/unit-tests/compositor/test_screencast_display_buffer.cpp (+169/-0)
tests/unit-tests/draw/test_draw_patterns.cpp (+1/-1)
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 (+4/-11)
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 (+46/-83)
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 (+47/-8)
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 (+95/-24)
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 (+41/-42)
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_native_platform.cpp (+60/-0)
tests/unit-tests/graphics/mesa/test_overlapping_output_grouping.cpp (+4/-7)
tests/unit-tests/graphics/mesa/test_platform.cpp (+12/-9)
tests/unit-tests/graphics/nested/test_nested_display_configuration.cpp (+20/-68)
tests/unit-tests/graphics/offscreen/test_offscreen_display.cpp (+8/-6)
tests/unit-tests/graphics/test_default_display_configuration_policy.cpp (+42/-38)
tests/unit-tests/graphics/test_display.cpp (+38/-3)
tests/unit-tests/graphics/test_display_configuration.cpp (+41/-0)
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 (+82/-0)
tests/unit-tests/scene/test_basic_surface.cpp (+146/-37)
tests/unit-tests/scene/test_surface.cpp (+159/-35)
tests/unit-tests/scene/test_surface_impl.cpp (+8/-8)
tests/unit-tests/scene/test_surface_stack.cpp (+113/-123)
tests/unit-tests/test_udev_wrapper.cpp (+70/-0)
tools/install_on_android.sh (+2/-1)
tools/setup-partial-armhf-chroot.sh (+42/-72)
tools/valgrind_suppressions_armhf (+111/-0)
Text conflict in CMakeLists.txt
Text conflict in debian/changelog
Text conflict in debian/control
Path conflict: debian/libmirserver15.install / debian/libmirserver16.install
Text conflict in debian/libmirserver16.install
Text conflict in debian/rules
Text conflict in src/platform/graphics/android/android_display.cpp
Text conflict in src/platform/graphics/android/display_buffer.h
Text conflict in src/platform/graphics/android/hwc_device.cpp
Text conflict in src/platform/graphics/android/hwc_layers.cpp
Text conflict in src/server/CMakeLists.txt
Text conflict in src/server/compositor/default_configuration.cpp
Text conflict in src/server/compositor/switching_bundle.cpp
Text conflict in src/server/frontend/session_mediator.cpp
Text conflict in src/server/scene/basic_surface.h
Text conflict in src/shared/testdraw/android_graphics_region_factory.cpp
Text conflict in src/utils/screencast.cpp
Text conflict in tests/integration-tests/compositor/test_swapping_swappers.cpp
Text conflict in tests/unit-tests/graphics/android/test_output_builder.cpp
Text conflict in tests/unit-tests/scene/test_application_session.cpp
Text conflict in tests/unit-tests/scene/test_surface.cpp
To merge this branch: bzr merge lp:~raof/mir/nested-one-surface-per-crtc
Reviewer Review Type Date Requested Status
Mir development team Pending
Review via email: mp+209614@code.launchpad.net

Description of the change

Resolve FIXME in nested_output.cpp, which incidentally unbreaks
nested on multihead.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file '3rd_party/android-input/android/frameworks/base/services/input/InputDispatcher.cpp'
2--- 3rd_party/android-input/android/frameworks/base/services/input/InputDispatcher.cpp 2014-01-13 06:12:33 +0000
3+++ 3rd_party/android-input/android/frameworks/base/services/input/InputDispatcher.cpp 2014-03-06 09:14:28 +0000
4@@ -432,6 +432,7 @@
5 sp<InputWindowHandle> InputDispatcher::findTouchedWindowAtLocked(int32_t x, int32_t y) {
6 sp<InputWindowHandle> foundHandle = NULL;
7 mEnumerator->for_each([&](sp<InputWindowHandle> windowHandle) {
8+ windowHandle->updateInfo();
9 const InputWindowInfo* windowInfo = windowHandle->getInfo();
10 int32_t flags = windowInfo->layoutParamsFlags;
11
12@@ -1151,6 +1152,7 @@
13
14 // Traverse windows from front to back to find touched window and outside targets.
15 mEnumerator->for_each([&](sp<InputWindowHandle> const& windowHandle){
16+ windowHandle->updateInfo();
17 const InputWindowInfo* windowInfo = windowHandle->getInfo();
18 int32_t flags = windowInfo->layoutParamsFlags;
19
20
21=== modified file 'CMakeLists.txt'
22--- CMakeLists.txt 2014-02-06 17:55:08 +0000
23+++ CMakeLists.txt 2014-03-06 09:14:28 +0000
24@@ -28,9 +28,18 @@
25
26 set(MIR_VERSION_MAJOR 0)
27 set(MIR_VERSION_MINOR 1)
28+<<<<<<< TREE
29 set(MIR_VERSION_PATCH 5)
30+=======
31+set(MIR_VERSION_PATCH 7)
32+>>>>>>> MERGE-SOURCE
33
34 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
35+execute_process(
36+ COMMAND ${CMAKE_CXX_COMPILER} -dumpmachine
37+ OUTPUT_VARIABLE TARGET_ARCH
38+ OUTPUT_STRIP_TRAILING_WHITESPACE
39+)
40
41 option(use_debflags "Use build flags from dpkg-buildflags." OFF)
42 if(use_debflags)
43@@ -87,15 +96,28 @@
44 )
45 endif(MIR_DISABLE_EPOLL_REACTOR)
46
47+add_definitions(-DMESA_EGL_NO_X11_HEADERS)
48+
49 # Default to mesa backend
50 set(
51 MIR_PLATFORM
52 mesa
53 CACHE
54 STRING
55- "graphics backend to build (options are 'mesa' or 'android')"
56+ "a list of graphics backends to build (options are 'mesa' or 'android')"
57 )
58
59+list(GET MIR_PLATFORM 0 MIR_TEST_PLATFORM)
60+
61+foreach(platform IN LISTS MIR_PLATFORM)
62+ if (platform STREQUAL "mesa")
63+ set(MIR_BUILD_PLATFORM_MESA TRUE)
64+ endif()
65+ if (platform STREQUAL "android")
66+ set(MIR_BUILD_PLATFORM_ANDROID TRUE)
67+ endif()
68+endforeach(platform)
69+
70 find_package(EGL REQUIRED)
71 find_package(GLESv2 REQUIRED)
72 find_package(GLM REQUIRED)
73@@ -110,24 +132,14 @@
74 include_directories (${EGL_INCLUDE_DIRS})
75 include_directories (${GLM_INCLUDE_DIRS})
76
77-if (MIR_PLATFORM STREQUAL "android")
78-
79- #android headers use 'int foo[0]' as struct members
80- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpermissive")
81-
82- add_definitions( -DANDROID )
83-
84+if (MIR_BUILD_PLATFORM_ANDROID)
85 find_package(LibHardware REQUIRED)
86+endif()
87
88- #ctest does not work for android, so turn test discovery off
89- set(DISABLE_GTEST_TEST_DISCOVERY ON)
90-elseif (MIR_PLATFORM STREQUAL "mesa")
91+if (MIR_BUILD_PLATFORM_MESA)
92 find_package( PkgConfig )
93 pkg_check_modules( GBM REQUIRED gbm>=9.0.0)
94 pkg_check_modules( DRM REQUIRED libdrm )
95- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__GBM__")
96-else ()
97- message (FATAL_ERROR "MIR_BACKEND must be either 'android' or 'mesa'")
98 endif()
99
100 set(MIR_ANDROID_INCLUDE_DIRECTORIES) # to be filled by android-input
101
102=== modified file 'cmake/FindXKBCOMMON.cmake'
103--- cmake/FindXKBCOMMON.cmake 2013-04-10 18:09:31 +0000
104+++ cmake/FindXKBCOMMON.cmake 2014-03-06 09:14:28 +0000
105@@ -3,13 +3,8 @@
106 find_path(XKBCOMMON_INCLUDE_DIR xkbcommon/xkbcommon.h
107 HINTS ${PC_XKBCOMMON_INCLUDEDIR} ${PC_XKBCOMMON_INCLUDE_DIRS})
108
109-if (MIR_PLATFORM STREQUAL "android")
110-find_library(XKBCOMMON_LIBRARY libxkbcommon.so
111- HINTS /usr/lib/arm-linux-gnueabihf/)
112-else()
113 find_library(XKBCOMMON_LIBRARY xkbcommon
114 HINTS ${PC_XKBCOMMON_LIBDIR} ${PC_XKBCOMMON_LIBRARY_DIRS})
115-endif()
116
117 set(XKBCOMMON_LIBRARIES ${XKBCOMMON_LIBRARY})
118 set(XKBCOMMON_INCLUDE_DIRS ${XKBCOMMON_INCLUDE_DIR})
119@@ -20,4 +15,4 @@
120 find_package_handle_standard_args(XKBCOMMON DEFAULT_MSG
121 XKBCOMMON_LIBRARY XKBCOMMON_INCLUDE_DIR)
122
123-mark_as_advanced(XKBCOMMON_INCLUDE_DIR XKBCOMMON_LIBRARY)
124\ No newline at end of file
125+mark_as_advanced(XKBCOMMON_INCLUDE_DIR XKBCOMMON_LIBRARY)
126
127=== modified file 'cmake/MirCommon.cmake'
128--- cmake/MirCommon.cmake 2014-01-16 04:00:01 +0000
129+++ cmake/MirCommon.cmake 2014-03-06 09:14:28 +0000
130@@ -22,15 +22,12 @@
131 valgrind)
132
133 if(VALGRIND_EXECUTABLE)
134- if(MIR_PLATFORM STREQUAL "android")
135- # don't exit with an error when valgrind find errors
136- #set(VALGRIND_ARGS "--error-exitcode=1")
137- else()
138- set(VALGRIND_ARGS "--error-exitcode=1 --trace-children=yes")
139+ set(VALGRIND_ARGS "--error-exitcode=1" "--trace-children=yes")
140+ set(DISCOVER_FLAGS "--enable-memcheck")
141+ if (TARGET_ARCH STREQUAL "arm-linux-gnueabihf")
142+ set(VALGRIND_ARGS ${VALGRIND_ARGS} "--suppressions=${CMAKE_SOURCE_DIR}/tools/valgrind_suppressions_armhf")
143+ set(DISCOVER_FLAGS ${DISCOVER_FLAGS} "--suppressions=${CMAKE_SOURCE_DIR}/tools/valgrind_suppressions_armhf")
144 endif()
145-
146- set(ENABLE_MEMCHECK_FLAG "--enable-memcheck")
147-
148 else(VALGRIND_EXECUTABLE)
149 message("Not enabling memcheck as valgrind is missing on your system")
150 endif(VALGRIND_EXECUTABLE)
151@@ -63,7 +60,7 @@
152
153 add_custom_target(
154 ${TEST_DISCOVERY_TARGET_NAME} ALL
155- ${EXECUTABLE_OUTPUT_PATH}/${EXECUTABLE} --gtest_list_tests | ${CMAKE_BINARY_DIR}/mir_gtest/mir_discover_gtest_tests --executable=${EXECUTABLE_OUTPUT_PATH}/${EXECUTABLE} ${ENABLE_MEMCHECK_FLAG}
156+ ${EXECUTABLE_OUTPUT_PATH}/${EXECUTABLE} --gtest_list_tests | ${CMAKE_BINARY_DIR}/mir_gtest/mir_discover_gtest_tests --executable=${EXECUTABLE_OUTPUT_PATH}/${EXECUTABLE} ${DISCOVER_FLAGS}
157 ${EXTRA_ENV_FLAGS}
158 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
159 COMMENT "Discovering Tests in ${EXECUTABLE}" VERBATIM)
160@@ -89,7 +86,7 @@
161 else()
162 add_custom_target(
163 memcheck_test ALL
164- ${CMAKE_BINARY_DIR}/mir_gtest/mir_discover_gtest_tests --executable=${CMAKE_BINARY_DIR}/mir_gtest/mir_test_memory_error --memcheck-test
165+ ${CMAKE_BINARY_DIR}/mir_gtest/mir_discover_gtest_tests --executable=${CMAKE_BINARY_DIR}/mir_gtest/mir_test_memory_error --memcheck-test ${DISCOVER_FLAGS}
166 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
167 COMMENT "Adding memcheck test" VERBATIM)
168
169
170=== modified file 'cmake/src/mir/mir_discover_gtest_tests.cpp'
171--- cmake/src/mir/mir_discover_gtest_tests.cpp 2013-07-01 06:29:43 +0000
172+++ cmake/src/mir/mir_discover_gtest_tests.cpp 2014-03-06 09:14:28 +0000
173@@ -58,26 +58,34 @@
174 return pattern;
175 }
176
177-vector<string> valgrind_cmd_patterns()
178+vector<string> valgrind_cmd_patterns(vector<string> const& suppressions)
179 {
180 vector<string> patterns{
181 "valgrind",
182 "--error-exitcode=1",
183- "--trace-children=yes",
184+ "--trace-children=yes"
185+ };
186+
187+ for (auto const& sup : suppressions)
188+ patterns.push_back(std::string("--suppressions=") + sup);
189+
190+ vector<string> gtest_patterns{
191 "%s",
192 "--gtest_death_test_use_fork",
193 "--gtest_filter=%s"
194 };
195
196+ patterns.insert(patterns.end(), gtest_patterns.begin(), gtest_patterns.end());
197+
198 return patterns;
199 }
200
201-string memcheck_cmd_line_pattern()
202+string memcheck_cmd_line_pattern(vector<string> const& suppressions)
203 {
204 stringstream ss;
205
206 ss << "ADD_TEST(\"memcheck(%s.%s)\"";
207- for (auto& s : valgrind_cmd_patterns())
208+ for (auto& s : valgrind_cmd_patterns(suppressions))
209 ss << " \"" << s << "\"";
210 ss << ")" << endl;
211
212@@ -112,6 +120,7 @@
213 bool enable_memcheck;
214 bool memcheck_test;
215 std::vector<std::pair<std::string, std::string>> extra_environment;
216+ std::vector<std::string> suppressions;
217 };
218
219 bool parse_configuration_from_cmd_line(int argc, char** argv, Configuration& config)
220@@ -121,6 +130,7 @@
221 {"enable-memcheck", no_argument, 0, 0},
222 {"memcheck-test", no_argument, 0, 0},
223 {"add-environment", required_argument, 0, 0},
224+ {"suppressions", required_argument, 0, 0},
225 {0, 0, 0, 0}
226 };
227
228@@ -161,17 +171,21 @@
229 return false;
230 config.extra_environment.push_back(std::make_pair(std::string(optarg, equal_pos - optarg), std::string(equal_pos + 1)));
231 }
232+ else if (!strcmp(optname, "suppressions"))
233+ {
234+ config.suppressions.push_back(std::string(optarg));
235+ }
236 }
237
238 return true;
239 }
240
241-string prepareMemcheckTestLine(string const& exe)
242+string prepareMemcheckTestLine(string const& exe, vector<string> const& suppressions)
243 {
244 stringstream ss;
245
246 ss << "ADD_TEST(\"memcheck-test\" \"sh\" \"-c\" \"";
247- for (auto& s : valgrind_cmd_patterns())
248+ for (auto& s : valgrind_cmd_patterns(suppressions))
249 ss << s << " ";
250 ss << "; if [ $? != 0 ]; then exit 0; else exit 1; fi\")";
251
252@@ -186,13 +200,13 @@
253 return cmd_line;
254 }
255
256-void emitMemcheckTest(string const& exe)
257+void emitMemcheckTest(string const& exe, vector<string> const& suppressions)
258 {
259 ifstream CTestTestfile("CTestTestfile.cmake", ifstream::in);
260 bool need_memcheck_test = true;
261 string line;
262
263- string memcheckTestLine = prepareMemcheckTestLine(exe);
264+ string memcheckTestLine = prepareMemcheckTestLine(exe, suppressions);
265
266 if (CTestTestfile.is_open())
267 {
268@@ -238,7 +252,7 @@
269
270 if (config.memcheck_test)
271 {
272- emitMemcheckTest(config.executable);
273+ emitMemcheckTest(config.executable, config.suppressions);
274 return 0;
275 }
276
277@@ -277,7 +291,7 @@
278 snprintf(
279 cmd_line,
280 sizeof(cmd_line),
281- config.enable_memcheck ? memcheck_cmd_line_pattern().c_str() :
282+ config.enable_memcheck ? memcheck_cmd_line_pattern(config.suppressions).c_str() :
283 ordinary_cmd_line_pattern().c_str(),
284 test_suite.c_str(),
285 elide_string_left(*test, output_width/2).c_str(),
286
287=== modified file 'cross-compile-chroot.sh'
288--- cross-compile-chroot.sh 2014-01-22 08:32:55 +0000
289+++ cross-compile-chroot.sh 2014-03-06 09:14:28 +0000
290@@ -1,27 +1,69 @@
291 #!/bin/bash
292-# build script for Mir on android arm devices
293+# build script to compile Mir for armhf devices
294 #
295 set -e
296
297+usage() {
298+ echo "usage: $(basename $0) [-c] [-u]"
299+ echo "-c clean before building"
300+ echo "-u update partial chroot directory"
301+ echo "-h this message"
302+}
303+
304+clean_build_dir() {
305+ rm -rf ${1}
306+ mkdir ${1}
307+}
308+
309 BUILD_DIR=build-android-arm
310-NUM_JOBS=$(( `grep -c ^processor /proc/cpuinfo` + 1 ))
311-
312-if [ "$MIR_NDK_PATH" = "" ]; then
313- export MIR_NDK_PATH=`pwd`/partial-armhf-chroot
314- if [ ! -d ${MIR_NDK_PATH} ]; then
315- echo "no partial root specified or detected. attempting to create one"
316- fi
317-fi
318-
319-pushd tools > /dev/null
320- ./setup-partial-armhf-chroot.sh ${MIR_NDK_PATH}
321-popd > /dev/null
322-
323-echo "Using MIR_NDK_PATH: $MIR_NDK_PATH"
324-
325-#start with a clean build every time
326-rm -rf ${BUILD_DIR}
327-mkdir ${BUILD_DIR}
328+NUM_JOBS=$(( $(grep -c ^processor /proc/cpuinfo) + 1 ))
329+_do_update_chroot=0
330+
331+while getopts "cuh" OPTNAME
332+do
333+ case $OPTNAME in
334+ c )
335+ clean_build_dir ${BUILD_DIR}
336+ ;;
337+ u )
338+ _do_update_chroot=1
339+ ;;
340+ h )
341+ usage
342+ exit 0
343+ ;;
344+ * )
345+ echo "invalid option specified"
346+ usage
347+ exit 1
348+ ;;
349+ esac
350+done
351+
352+
353+if [ "${MIR_NDK_PATH}" = "" ]; then
354+ export MIR_NDK_PATH=$(pwd)/partial-armhf-chroot
355+fi
356+
357+if [ ! -d ${MIR_NDK_PATH} ]; then
358+ echo "no partial chroot dir detected. attempting to create one"
359+ _do_update_chroot=1
360+fi
361+
362+if [ ! -d ${BUILD_DIR} ]; then
363+ mkdir ${BUILD_DIR}
364+fi
365+
366+if [ ${_do_update_chroot} -eq 1 ] ; then
367+ pushd tools > /dev/null
368+ ./setup-partial-armhf-chroot.sh ${MIR_NDK_PATH}
369+ popd > /dev/null
370+ # force a clean build after an update, since CMake cache maybe out of date
371+ clean_build_dir ${BUILD_DIR}
372+fi
373+
374+echo "Using MIR_NDK_PATH: ${MIR_NDK_PATH}"
375+
376 pushd ${BUILD_DIR} > /dev/null
377
378 export PKG_CONFIG_PATH="${MIR_NDK_PATH}/usr/lib/pkgconfig:${MIR_NDK_PATH}/usr/lib/arm-linux-gnueabihf/pkgconfig"
379@@ -33,9 +75,9 @@
380 echo "Using PKG_CONFIG_EXECUTABLE: $PKG_CONFIG_EXECUTABLE"
381 cmake -DCMAKE_TOOLCHAIN_FILE=../cmake/LinuxCrossCompile.cmake \
382 -DBoost_COMPILER=-gcc \
383- -DMIR_PLATFORM=android \
384+ -DMIR_PLATFORM=android\;mesa \
385 ..
386
387- cmake --build . -- -j${NUM_JOBS}
388+ make -j${NUM_JOBS}
389
390-popd ${BUILD_DIR} > /dev/null
391+popd > /dev/null
392
393=== modified file 'debian/changelog'
394--- debian/changelog 2014-02-12 18:29:30 +0000
395+++ debian/changelog 2014-03-06 09:14:28 +0000
396@@ -1,3 +1,4 @@
397+<<<<<<< TREE
398 mir (0.1.5+14.04.20140212-0ubuntu1) trusty; urgency=medium
399
400 [ Kevin Gunn ]
401@@ -51,6 +52,26 @@
402 mir (0.1.4+14.04.20140204-0ubuntu1) trusty; urgency=medium
403
404 [ Daniel van Vugt ]
405+=======
406+mir (0.1.5-0ubuntu1) UNRELEASED; urgency=medium
407+
408+ * New upstream release 0.1.5 (https://launchpad.net/mir/+milestone/0.1.5)
409+ - frontend: Implement screencast rpc methods
410+ - Bugs fixed:
411+ . frontend: Add a level of indirection to hide
412+ use of mir::protobuf::wire::Invocation from
413+ public headers (LP: #1276162)
414+ . graphics: android: remove wait on retireFenceFd.
415+ On some platforms (specifically the 4.4-based flo
416+ and grouper), this wait was causing us to miss
417+ vsync. (LP: #1274189)
418+
419+ -- Kevin Gunn <kevin.gunn@canonical.com> Thu, 06 Feb 2014 10:54:17 -0600
420+
421+mir (0.1.4+14.04.20140204-0ubuntu1) trusty; urgency=medium
422+
423+ [ Daniel van Vugt ]
424+>>>>>>> MERGE-SOURCE
425 * New upstream release 0.1.4 (https://launchpad.net/mir/+milestone/0.1.4)
426 - Fixed snapshotting and flicker problems for Unity8 on various Nexus
427 devices.
428
429=== modified file 'debian/control'
430--- debian/control 2014-02-06 17:55:08 +0000
431+++ debian/control 2014-03-06 09:14:28 +0000
432@@ -19,20 +19,20 @@
433 libboost-regex-dev,
434 libboost-filesystem-dev,
435 protobuf-compiler,
436- libdrm-dev [!armhf],
437+ libdrm-dev,
438 libegl1-mesa-dev,
439 libgles2-mesa-dev,
440- libgbm-dev [!armhf],
441+ libgbm-dev,
442 libglm-dev,
443 libprotobuf-dev,
444 pkg-config,
445- android-headers (>=4.2.2) [armhf],
446- libhardware-dev [armhf],
447+ android-headers (>=4.2.2) [i386 amd64 armhf],
448+ libhardware-dev [i386 amd64 armhf],
449 libgoogle-glog-dev,
450 liblttng-ust-dev,
451 libxkbcommon-dev,
452- libumockdev-dev [!armhf],
453- umockdev [!armhf],
454+ libumockdev-dev,
455+ umockdev,
456 libudev-dev,
457 google-mock (>= 1.6.0+svn437),
458 valgrind [!arm64],
459@@ -70,7 +70,11 @@
460 .
461 Contains the protocol's definition files.
462
463+<<<<<<< TREE
464 Package: libmirserver15
465+=======
466+Package: libmirserver16
467+>>>>>>> MERGE-SOURCE
468 Section: libs
469 Architecture: i386 amd64 armhf arm64
470 Multi-Arch: same
471@@ -78,6 +82,8 @@
472 Depends: ${misc:Depends},
473 ${shlibs:Depends},
474 libmirplatform (= ${binary:Version}),
475+ libmirplatformgraphics-mesa (= ${binary:Version}) |
476+ libmirplatformgraphics-android (= ${binary:Version}),
477 Description: Display server for Ubuntu - server library
478 Mir is a display server running on linux systems, with a focus on efficiency,
479 robust operation and a well-defined driver model.
480@@ -99,6 +105,36 @@
481 Contains the shared libraries required for the Mir server to interact with
482 the underlying hardware platform.
483
484+Package: libmirplatformgraphics-mesa
485+Section: libs
486+Architecture: i386 amd64 armhf arm64
487+Multi-Arch: same
488+Pre-Depends: ${misc:Pre-Depends}
489+Depends: ${misc:Depends},
490+ ${shlibs:Depends},
491+ libmirplatform (= ${binary:Version}),
492+Description: Display server for Ubuntu - platform library
493+ Mir is a display server running on linux systems, with a focus on efficiency,
494+ robust operation and a well-defined driver model.
495+ .
496+ Contains the shared libraries required for the Mir server to interact with
497+ the hardware platform using the Mesa drivers.
498+
499+Package: libmirplatformgraphics-android
500+Section: libs
501+Architecture: i386 amd64 armhf
502+Multi-Arch: same
503+Pre-Depends: ${misc:Pre-Depends}
504+Depends: ${misc:Depends},
505+ ${shlibs:Depends},
506+ libmirplatform (= ${binary:Version}),
507+Description: Display server for Ubuntu - platform library
508+ Mir is a display server running on linux systems, with a focus on efficiency,
509+ robust operation and a well-defined driver model.
510+ .
511+ Contains the shared libraries required for the Mir server to interact with
512+ the hardware platform using the Android drivers.
513+
514 Package: mircommon-dev
515 Section: libdevel
516 Architecture: i386 amd64 armhf arm64
517@@ -116,7 +152,11 @@
518 Architecture: i386 amd64 armhf arm64
519 Multi-Arch: same
520 Pre-Depends: ${misc:Pre-Depends}
521+<<<<<<< TREE
522 Depends: libmirserver15 (= ${binary:Version}),
523+=======
524+Depends: libmirserver16 (= ${binary:Version}),
525+>>>>>>> MERGE-SOURCE
526 libmirprotobuf-dev (= ${binary:Version}),
527 mircommon-dev (= ${binary:Version}),
528 libglm-dev,
529@@ -135,6 +175,8 @@
530 Pre-Depends: ${misc:Pre-Depends}
531 Depends: ${misc:Depends},
532 ${shlibs:Depends},
533+ libmirclientplatform-mesa (= ${binary:Version}) |
534+ libmirclientplatform-android (= ${binary:Version}),
535 Description: Display server for Ubuntu - client library
536 Mir is a display server running on linux systems, with a focus on efficiency,
537 robust operation and a well-defined driver model.
538@@ -156,6 +198,36 @@
539 .
540 Contains header files required to develop against Mir.
541
542+Package: libmirclientplatform-mesa
543+Section: libs
544+Architecture: i386 amd64 armhf arm64
545+Multi-Arch: same
546+Pre-Depends: ${misc:Pre-Depends}
547+Depends: ${misc:Depends},
548+ ${shlibs:Depends}
549+Replaces: libmirclientplatform
550+Description: Display server for Ubuntu - client platform library
551+ Mir is a display server running on linux systems, with a focus on efficiency,
552+ robust operation and a well-defined driver model.
553+ .
554+ Contains the shared libraries required for the Mir clients to interact with
555+ the underlying hardware platform using the Mesa drivers.
556+
557+Package: libmirclientplatform-android
558+Section: libs
559+Architecture: i386 amd64 armhf
560+Multi-Arch: same
561+Pre-Depends: ${misc:Pre-Depends}
562+Depends: ${misc:Depends},
563+ ${shlibs:Depends}
564+Replaces: libmirclientplatform
565+Description: Display server for Ubuntu - client platform library
566+ Mir is a display server running on linux systems, with a focus on efficiency,
567+ robust operation and a well-defined driver model.
568+ .
569+ Contains the shared libraries required for the Mir clients to interact with
570+ the underlying hardware platform using the Android drivers.
571+
572 Package: mir-demos
573 Architecture: i386 amd64 armhf arm64
574 Depends: ${misc:Depends},
575
576=== added file 'debian/create_postinst_prerm_scripts.sh'
577--- debian/create_postinst_prerm_scripts.sh 1970-01-01 00:00:00 +0000
578+++ debian/create_postinst_prerm_scripts.sh 2014-03-06 09:14:28 +0000
579@@ -0,0 +1,30 @@
580+#!/bin/sh
581+
582+set -e
583+
584+mir_platform_types="platformgraphics clientplatform"
585+mir_platforms="android mesa"
586+dpkg_alternatives_priority=500
587+deb_host_multiarch=$1
588+
589+create_script()
590+{
591+ local script=$1
592+ local platform_type=$2
593+ local platform=$3
594+
595+ sed -e "s/@DEB_HOST_MULTIARCH@/$deb_host_multiarch/" \
596+ -e "s/@MIR_PLATFORM_TYPE@/$platform_type/" \
597+ -e "s/@MIR_PLATFORM@/$platform/" \
598+ -e "s/@DPKG_ALTERNATIVES_PRIORITY@/$dpkg_alternatives_priority/" \
599+ debian/update-alternatives.${script}.in > debian/libmir$platform_type-$platform.${script}
600+}
601+
602+for platform_type in $mir_platform_types;
603+do
604+ for platform in $mir_platforms;
605+ do
606+ create_script postinst $platform_type $platform
607+ create_script prerm $platform_type $platform
608+ done
609+done
610
611=== added file 'debian/install_ld_so_conf.sh'
612--- debian/install_ld_so_conf.sh 1970-01-01 00:00:00 +0000
613+++ debian/install_ld_so_conf.sh 2014-03-06 09:14:28 +0000
614@@ -0,0 +1,18 @@
615+#!/bin/sh
616+
617+set -e
618+
619+mir_platform_types="platformgraphics clientplatform"
620+mir_platforms="android mesa"
621+
622+DEB_HOST_MULTIARCH=$1
623+
624+for platform_type in $mir_platform_types;
625+do
626+ for platform in $mir_platforms;
627+ do
628+ platform_dir="/usr/lib/$DEB_HOST_MULTIARCH/mir/$platform_type/$platform"
629+ package_dir="debian/libmir$platform_type-$platform/$platform_dir"
630+ echo "$platform_dir" > $package_dir/ld.so.conf
631+ done
632+done
633
634=== added file 'debian/libmirclientplatform-android.install'
635--- debian/libmirclientplatform-android.install 1970-01-01 00:00:00 +0000
636+++ debian/libmirclientplatform-android.install 2014-03-06 09:14:28 +0000
637@@ -0,0 +1,1 @@
638+usr/lib/*/mir/clientplatform/android/*
639
640=== added file 'debian/libmirclientplatform-mesa.install'
641--- debian/libmirclientplatform-mesa.install 1970-01-01 00:00:00 +0000
642+++ debian/libmirclientplatform-mesa.install 2014-03-06 09:14:28 +0000
643@@ -0,0 +1,1 @@
644+usr/lib/*/mir/clientplatform/mesa/*
645
646=== modified file 'debian/libmirplatform.install'
647--- debian/libmirplatform.install 2013-08-09 03:54:38 +0000
648+++ debian/libmirplatform.install 2014-03-06 09:14:28 +0000
649@@ -1,2 +1,1 @@
650 usr/lib/*/libmirplatform.so
651-usr/lib/*/libmirplatformgraphics.so
652
653=== added file 'debian/libmirplatformgraphics-android.install'
654--- debian/libmirplatformgraphics-android.install 1970-01-01 00:00:00 +0000
655+++ debian/libmirplatformgraphics-android.install 2014-03-06 09:14:28 +0000
656@@ -0,0 +1,1 @@
657+usr/lib/*/mir/platformgraphics/android/*
658
659=== added file 'debian/libmirplatformgraphics-mesa.install'
660--- debian/libmirplatformgraphics-mesa.install 1970-01-01 00:00:00 +0000
661+++ debian/libmirplatformgraphics-mesa.install 2014-03-06 09:14:28 +0000
662@@ -0,0 +1,1 @@
663+usr/lib/*/mir/platformgraphics/mesa/*
664
665=== renamed file 'debian/libmirserver15.install' => 'debian/libmirserver16.install'
666--- debian/libmirserver15.install 2014-02-06 17:55:08 +0000
667+++ debian/libmirserver16.install 2014-03-06 09:14:28 +0000
668@@ -1,1 +1,5 @@
669+<<<<<<< TREE
670 usr/lib/*/libmirserver.so.15
671+=======
672+usr/lib/*/libmirserver.so.16
673+>>>>>>> MERGE-SOURCE
674
675=== modified file 'debian/rules'
676--- debian/rules 2014-02-04 09:23:51 +0000
677+++ debian/rules 2014-03-06 09:14:28 +0000
678@@ -21,6 +21,7 @@
679 ifeq ($(DEB_HOST_ARCH),armhf)
680 dh_auto_configure -- \
681 $(COMMON_CONFIGURE_OPTIONS) \
682+<<<<<<< TREE
683 -DMIR_RUN_ACCEPTANCE_TESTS=OFF -DMIR_RUN_INTEGRATION_TESTS=OFF \
684 -DMIR_PLATFORM=android
685 else
686@@ -31,9 +32,31 @@
687 else
688 dh_auto_configure -- \
689 $(COMMON_CONFIGURE_OPTIONS)
690+=======
691+ -DMIR_PLATFORM=android\;mesa
692+else
693+ifeq ($(DEB_HOST_ARCH),arm64)
694+ dh_auto_configure -- \
695+ $(COMMON_CONFIGURE_OPTIONS) \
696+ -DMIR_PLATFORM=mesa
697+else
698+ dh_auto_configure -- \
699+ $(COMMON_CONFIGURE_OPTIONS) \
700+ -DMIR_PLATFORM=mesa\;android
701+>>>>>>> MERGE-SOURCE
702 endif
703 endif
704
705 # TODO: we'll use a symbol file once mir is abi stable
706 override_dh_makeshlibs:
707 dh_makeshlibs -V
708+
709+override_dh_install:
710+ dh_install --fail-missing \
711+ -Xusr/lib/$(DEB_HOST_MULTIARCH)/libmirplatformgraphics.so \
712+ -Xusr/lib/$(DEB_HOST_MULTIARCH)/libmirclientplatform.so
713+ sh debian/install_ld_so_conf.sh $(DEB_HOST_MULTIARCH)
714+
715+override_dh_installdeb:
716+ sh debian/create_postinst_prerm_scripts.sh $(DEB_HOST_MULTIARCH)
717+ dh_installdeb
718
719=== added file 'debian/update-alternatives.postinst.in'
720--- debian/update-alternatives.postinst.in 1970-01-01 00:00:00 +0000
721+++ debian/update-alternatives.postinst.in 2014-03-06 09:14:28 +0000
722@@ -0,0 +1,18 @@
723+#!/bin/sh
724+
725+set -e
726+
727+if [ "$1" = "configure" ];
728+then
729+ update-alternatives --force --install \
730+ /etc/ld.so.conf.d/@DEB_HOST_MULTIARCH@_mir@MIR_PLATFORM_TYPE@.conf \
731+ @DEB_HOST_MULTIARCH@_mir@MIR_PLATFORM_TYPE@_conf \
732+ /usr/lib/@DEB_HOST_MULTIARCH@/mir/@MIR_PLATFORM_TYPE@/@MIR_PLATFORM@/ld.so.conf \
733+ @DPKG_ALTERNATIVES_PRIORITY@
734+
735+ LDCONFIG_NOTRIGGER=y ldconfig
736+fi
737+
738+#DEBHELPER#
739+
740+exit 0
741
742=== added file 'debian/update-alternatives.prerm.in'
743--- debian/update-alternatives.prerm.in 1970-01-01 00:00:00 +0000
744+++ debian/update-alternatives.prerm.in 2014-03-06 09:14:28 +0000
745@@ -0,0 +1,16 @@
746+#!/bin/sh
747+
748+set -e
749+
750+if [ "$1" = "remove" ];
751+then
752+ update-alternatives --remove \
753+ @DEB_HOST_MULTIARCH@_mir@MIR_PLATFORM_TYPE@_conf \
754+ /usr/lib/@DEB_HOST_MULTIARCH@/mir/@MIR_PLATFORM_TYPE@/@MIR_PLATFORM@/ld.so.conf
755+
756+ ldconfig
757+fi
758+
759+#DEBHELPER#
760+
761+exit 0
762
763=== modified file 'doc/component_reports.md'
764--- doc/component_reports.md 2014-01-13 06:12:33 +0000
765+++ doc/component_reports.md 2014-03-06 09:14:28 +0000
766@@ -18,13 +18,13 @@
767
768 Report | Handlers
769 ----------------------- | --------
770-connector-report | log
771-display-report | log
772+connector-report | log,lttng
773+display-report | log,lttng
774 input-report | log,lttng
775 legacy-input-report | log
776 msg-processor-report | log,lttng
777-session-mediator-report | log
778-scene-report | log
779+session-mediator-report | log,lttng
780+scene-report | log,lttng
781
782 For example, to enable the LTTng input report, one could either use the
783 `--input-report=lttng` command-line option to the server, or set the
784@@ -40,7 +40,7 @@
785 Report | Handlers
786 ------------------- | --------
787 rpc-report | log,lttng
788-input-receiver | log
789+input-receiver | log,lttng
790
791 For example, to enable the logging RPC report, one should set the
792 `MIR_CLIENT_RPC_REPORT=log` environment variable.
793
794=== modified file 'examples/CMakeLists.txt'
795--- examples/CMakeLists.txt 2014-01-15 03:41:11 +0000
796+++ examples/CMakeLists.txt 2014-03-06 09:14:28 +0000
797@@ -96,9 +96,8 @@
798 ${GLESv2_INCLUDE_DIRS}
799 )
800
801-set(RENDER_TO_FB_SOURCES render_to_fb.cpp)
802-add_executable(mir_demo_standalone_render_to_fb
803- ${RENDER_TO_FB_SOURCES}
804+add_executable(mir_demo_standalone_render_to_fb
805+ render_to_fb.cpp
806 )
807
808 target_link_libraries(mir_demo_standalone_render_to_fb
809@@ -108,6 +107,17 @@
810 ${Boost_LIBRARIES}
811 )
812
813+add_executable(mir_demo_standalone_render_overlays
814+ render_overlays.cpp
815+)
816+
817+target_link_libraries(mir_demo_standalone_render_overlays
818+ mirserver
819+ mirlogging
820+ mirdraw
821+ mirtestdraw
822+)
823+
824 set(RENDER_SURFACES_SOURCES
825 render_surfaces.cpp
826 buffer_render_target.cpp
827
828=== modified file 'examples/basic_server_configuration.cpp'
829--- examples/basic_server_configuration.cpp 2014-01-29 15:20:07 +0000
830+++ examples/basic_server_configuration.cpp 2014-03-06 09:14:28 +0000
831@@ -17,6 +17,7 @@
832 */
833
834 #include "basic_server_configuration.h"
835+#include "mir/options/default_configuration.h"
836
837 #include "mir/abnormal_exit.h"
838 #include "mir/frontend/connector.h"
839@@ -34,14 +35,19 @@
840 namespace examples
841 {
842
843-BasicServerConfiguration::BasicServerConfiguration(int argc, char const** argv)
844- : ServerConfiguration(argc, argv)
845+BasicServerConfiguration::BasicServerConfiguration(int argc, char const** argv) :
846+ ServerConfiguration([argc, argv]
847+ {
848+ auto result = std::make_shared<options::DefaultConfiguration>(argc, argv);
849+
850+ namespace po = boost::program_options;
851+
852+ result->add_options()
853+ (launch_child_opt, po::value<std::string>(), "system() command to launch client");
854+
855+ return result;
856+ }())
857 {
858- namespace po = boost::program_options;
859-
860- add_options()
861- (launch_child_opt, po::value<std::string>(), "system() command to launch client");
862-;
863 }
864
865 void BasicServerConfiguration::launch_client()
866
867=== modified file 'examples/demo-shell/CMakeLists.txt'
868--- examples/demo-shell/CMakeLists.txt 2013-08-28 03:41:48 +0000
869+++ examples/demo-shell/CMakeLists.txt 2014-03-06 09:14:28 +0000
870@@ -1,5 +1,6 @@
871 add_executable(mir_demo_server_shell
872 demo_shell.cpp
873+ demo_renderer.cpp
874 fullscreen_placement_strategy.cpp
875 window_manager.cpp
876 ../server_configuration.cpp
877
878=== added file 'examples/demo-shell/demo_renderer.cpp'
879--- examples/demo-shell/demo_renderer.cpp 1970-01-01 00:00:00 +0000
880+++ examples/demo-shell/demo_renderer.cpp 2014-03-06 09:14:28 +0000
881@@ -0,0 +1,33 @@
882+/*
883+ * Copyright © 2014 Canonical Ltd.
884+ *
885+ * This program is free software: you can redistribute it and/or modify
886+ * it under the terms of the GNU General Public License version 3 as
887+ * published by the Free Software Foundation.
888+ *
889+ * This program is distributed in the hope that it will be useful,
890+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
891+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
892+ * GNU General Public License for more details.
893+ *
894+ * You should have received a copy of the GNU General Public License
895+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
896+ *
897+ * Authored by: Daniel van Vugt <daniel.van.vugt@canonical.com>
898+ */
899+
900+#include "demo_renderer.h"
901+
902+using namespace mir;
903+using namespace mir::examples;
904+
905+DemoRenderer::DemoRenderer(geometry::Rectangle const& display_area)
906+ : GLRenderer(display_area)
907+{
908+}
909+
910+void DemoRenderer::begin() const
911+{
912+ glClearColor(0.2f, 0.2f, 0.2f, 1.0f);
913+ glClear(GL_COLOR_BUFFER_BIT);
914+}
915
916=== added file 'examples/demo-shell/demo_renderer.h'
917--- examples/demo-shell/demo_renderer.h 1970-01-01 00:00:00 +0000
918+++ examples/demo-shell/demo_renderer.h 2014-03-06 09:14:28 +0000
919@@ -0,0 +1,39 @@
920+/*
921+ * Copyright © 2014 Canonical Ltd.
922+ *
923+ * This program is free software: you can redistribute it and/or modify
924+ * it under the terms of the GNU General Public License version 3 as
925+ * published by the Free Software Foundation.
926+ *
927+ * This program is distributed in the hope that it will be useful,
928+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
929+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
930+ * GNU General Public License for more details.
931+ *
932+ * You should have received a copy of the GNU General Public License
933+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
934+ *
935+ * Authored by: Daniel van Vugt <daniel.van.vugt@canonical.com>
936+ */
937+
938+#ifndef MIR_EXAMPLES_DEMO_RENDERER_H_
939+#define MIR_EXAMPLES_DEMO_RENDERER_H_
940+
941+#include "mir/compositor/gl_renderer.h"
942+
943+namespace mir
944+{
945+namespace examples
946+{
947+
948+class DemoRenderer : public compositor::GLRenderer
949+{
950+public:
951+ DemoRenderer(geometry::Rectangle const& display_area);
952+ void begin() const override;
953+};
954+
955+} // namespace examples
956+} // namespace mir
957+
958+#endif // MIR_EXAMPLES_DEMO_RENDERER_H_
959
960=== modified file 'examples/demo-shell/demo_shell.cpp'
961--- examples/demo-shell/demo_shell.cpp 2014-01-13 06:12:33 +0000
962+++ examples/demo-shell/demo_shell.cpp 2014-03-06 09:14:28 +0000
963@@ -1,5 +1,5 @@
964 /*
965- * Copyright © 2013 Canonical Ltd.
966+ * Copyright © 2013-2014 Canonical Ltd.
967 *
968 * This program is free software: you can redistribute it and/or modify
969 * it under the terms of the GNU General Public License version 3 as
970@@ -18,14 +18,17 @@
971
972 /// \example demo_shell.cpp A simple mir shell
973
974+#include "demo_renderer.h"
975 #include "window_manager.h"
976 #include "fullscreen_placement_strategy.h"
977 #include "../server_configuration.h"
978
979+#include "mir/options/default_configuration.h"
980 #include "mir/run_mir.h"
981 #include "mir/report_exception.h"
982 #include "mir/graphics/display.h"
983 #include "mir/input/composite_event_filter.h"
984+#include "mir/compositor/renderer_factory.h"
985
986 #include <iostream>
987
988@@ -34,24 +37,41 @@
989 namespace mg = mir::graphics;
990 namespace mf = mir::frontend;
991 namespace mi = mir::input;
992+namespace mo = mir::options;
993
994 namespace mir
995 {
996 namespace examples
997 {
998
999-struct DemoServerConfiguration : mir::examples::ServerConfiguration
1000-{
1001+class DemoRendererFactory : public compositor::RendererFactory
1002+{
1003+public:
1004+ std::unique_ptr<compositor::Renderer> create_renderer_for(
1005+ geometry::Rectangle const& rect) override
1006+ {
1007+ return std::unique_ptr<compositor::Renderer>(new DemoRenderer(rect));
1008+ }
1009+};
1010+
1011+class DemoServerConfiguration : public mir::examples::ServerConfiguration
1012+{
1013+public:
1014 DemoServerConfiguration(int argc, char const* argv[],
1015 std::initializer_list<std::shared_ptr<mi::EventFilter>> const& filter_list)
1016- : ServerConfiguration(argc, argv),
1017+ : ServerConfiguration([argc, argv]
1018+ {
1019+ auto result = std::make_shared<mo::DefaultConfiguration>(argc, argv);
1020+
1021+ namespace po = boost::program_options;
1022+
1023+ result->add_options()
1024+ ("fullscreen-surfaces", "Make all surfaces fullscreen");
1025+
1026+ return result;
1027+ }()),
1028 filter_list(filter_list)
1029 {
1030- namespace po = boost::program_options;
1031-
1032- add_options()
1033- ("fullscreen-surfaces", po::value<bool>(),
1034- "Make all surfaces fullscreen [bool:default=false]");
1035 }
1036
1037 std::shared_ptr<msh::PlacementStrategy> the_shell_placement_strategy() override
1038@@ -75,6 +95,12 @@
1039 return composite_filter;
1040 }
1041
1042+ std::shared_ptr<compositor::RendererFactory> the_renderer_factory() override
1043+ {
1044+ return std::make_shared<DemoRendererFactory>();
1045+ }
1046+
1047+private:
1048 std::vector<std::shared_ptr<mi::EventFilter>> const filter_list;
1049 };
1050
1051
1052=== modified file 'examples/demo-shell/window_manager.cpp'
1053--- examples/demo-shell/window_manager.cpp 2014-01-21 10:15:36 +0000
1054+++ examples/demo-shell/window_manager.cpp 2014-03-06 09:14:28 +0000
1055@@ -140,23 +140,14 @@
1056 {
1057 compositor->stop();
1058 auto conf = display->configuration();
1059- conf->for_each_output([&](mg::DisplayConfigurationOutput const& output) -> void
1060- {
1061- MirPowerMode power_mode;
1062- if (!output.used) return;
1063-
1064- if (display_off == true)
1065- power_mode = mir_power_mode_on;
1066- else
1067- power_mode = mir_power_mode_off;
1068-
1069- conf->configure_output(output.id, output.used,
1070- output.top_left,
1071- output.current_mode_index,
1072- output.current_format,
1073- power_mode,
1074- output.orientation);
1075- });
1076+ MirPowerMode new_power_mode = display_off ?
1077+ mir_power_mode_on : mir_power_mode_off;
1078+ conf->for_each_output(
1079+ [&](mg::UserDisplayConfigurationOutput& output) -> void
1080+ {
1081+ output.power_mode = new_power_mode;
1082+ }
1083+ );
1084 display_off = !display_off;
1085
1086 display->configure(*conf.get());
1087@@ -184,14 +175,9 @@
1088 compositor->stop();
1089 auto conf = display->configuration();
1090 conf->for_each_output(
1091- [&](mg::DisplayConfigurationOutput const& output) -> void
1092+ [&](mg::UserDisplayConfigurationOutput& output) -> void
1093 {
1094- conf->configure_output(output.id, output.used,
1095- output.top_left,
1096- output.current_mode_index,
1097- output.current_format,
1098- output.power_mode,
1099- orientation);
1100+ output.orientation = orientation;
1101 }
1102 );
1103 display->configure(*conf);
1104
1105=== modified file 'examples/eglplasma.c'
1106--- examples/eglplasma.c 2013-09-19 13:24:22 +0000
1107+++ examples/eglplasma.c 2014-03-06 09:14:28 +0000
1108@@ -85,14 +85,13 @@
1109 " const float pi2 = 6.283185308; \n"
1110 " float u = texcoord.x * pi2; \n"
1111 " float v = texcoord.y * pi2; \n"
1112- " float t = mod(theta, pi2); \n"
1113- " float us = (cos(1.1 * u + 7.0 * t) + \n"
1114- " cos(2.3 * v * cos(1.0 * t)) + \n"
1115- " cos(0.3 * u * cos(3.0 * t)) \n"
1116+ " float us = (cos(1.1 * u + 7.0 * theta) + \n"
1117+ " cos(2.3 * v * cos(1.0 * theta)) + \n"
1118+ " cos(0.3 * u * cos(3.0 * theta)) \n"
1119 " ) / 3.0; \n"
1120- " float vs = (cos(2.3 * v + 8.0 * t) + \n"
1121- " cos(1.3 * u * cos(3.0 * t)) + \n"
1122- " cos(1.7 * v * cos(2.0 * t)) \n"
1123+ " float vs = (cos(2.3 * v + 8.0 * theta) + \n"
1124+ " cos(1.3 * u * cos(3.0 * theta)) + \n"
1125+ " cos(1.7 * v * cos(2.0 * theta)) \n"
1126 " ) / 3.0; \n"
1127 " float x = (us * vs + 1.0) / 2.0; \n"
1128 " gl_FragColor = vec4(gradient(x), 1.0); \n"
1129@@ -105,6 +104,7 @@
1130 1.0f,-1.0f,
1131 -1.0f,-1.0f,
1132 };
1133+ const float pi2 = 6.283185308f;
1134 GLuint vshader, fshader, prog;
1135 GLint linked, low_color, high_color, vpos, theta;
1136 unsigned int width = 0, height = 0;
1137@@ -151,6 +151,8 @@
1138 {
1139 glUniform1f(theta, angle);
1140 angle += 0.005f;
1141+ if (angle > pi2)
1142+ angle -= pi2;
1143 glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
1144 mir_eglapp_swap_buffers();
1145 }
1146
1147=== modified file 'examples/pixel_format_selector.cpp'
1148--- examples/pixel_format_selector.cpp 2014-01-15 03:28:24 +0000
1149+++ examples/pixel_format_selector.cpp 2014-03-06 09:14:28 +0000
1150@@ -40,7 +40,7 @@
1151 {
1152 base_policy->apply_to(conf);
1153 conf.for_each_output(
1154- [&](graphics::DisplayConfigurationOutput const& conf_output)
1155+ [&](graphics::UserDisplayConfigurationOutput& conf_output)
1156 {
1157 if (!conf_output.connected || !conf_output.used) return;
1158
1159@@ -56,12 +56,7 @@
1160 if (pos == conf_output.pixel_formats.end())
1161 return;
1162
1163- conf.configure_output(conf_output.id, true, conf_output.top_left,
1164- conf_output.current_mode_index,
1165- *pos,
1166- conf_output.power_mode,
1167- conf_output.orientation
1168- );
1169+ conf_output.current_format = *pos;
1170 });
1171 }
1172
1173
1174=== added file 'examples/render_overlays.cpp'
1175--- examples/render_overlays.cpp 1970-01-01 00:00:00 +0000
1176+++ examples/render_overlays.cpp 2014-03-06 09:14:28 +0000
1177@@ -0,0 +1,161 @@
1178+/*
1179+ * Copyright © 2012, 2014 Canonical Ltd.
1180+ *
1181+ * This program is free software: you can redistribute it and/or modify
1182+ * it under the terms of the GNU General Public License version 3 as
1183+ * published by the Free Software Foundation.
1184+ *
1185+ * This program is distributed in the hope that it will be useful,
1186+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
1187+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1188+ * GNU General Public License for more details.
1189+ *
1190+ * You should have received a copy of the GNU General Public License
1191+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
1192+ *
1193+ * Authored by: Kevin DuBois <kevin.dubois@canonical.com>
1194+ */
1195+
1196+#include "mir/default_server_configuration.h"
1197+#include "mir/graphics/display.h"
1198+#include "mir/graphics/renderable.h"
1199+#include "mir/graphics/display_buffer.h"
1200+#include "mir/graphics/platform.h"
1201+#include "mir/graphics/graphic_buffer_allocator.h"
1202+#include "mir/graphics/buffer_properties.h"
1203+#include "mir/report_exception.h"
1204+
1205+#include "testdraw/graphics_region_factory.h"
1206+#include "testdraw/patterns.h"
1207+
1208+#include <csignal>
1209+#include <iostream>
1210+
1211+namespace mg=mir::graphics;
1212+namespace ml=mir::logging;
1213+namespace mo=mir::options;
1214+namespace geom=mir::geometry;
1215+
1216+namespace
1217+{
1218+volatile std::sig_atomic_t running = true;
1219+
1220+void signal_handler(int /*signum*/)
1221+{
1222+ running = false;
1223+}
1224+}
1225+
1226+class DemoRenderable : public mg::Renderable
1227+{
1228+public:
1229+ DemoRenderable(std::shared_ptr<mg::Buffer> const& buffer, geom::Rectangle rect)
1230+ : renderable_buffer(buffer),
1231+ position(rect)
1232+ {
1233+ }
1234+
1235+ std::shared_ptr<mg::Buffer> buffer(unsigned long) const override
1236+ {
1237+ return renderable_buffer;
1238+ }
1239+
1240+ bool alpha_enabled() const
1241+ {
1242+ return false;
1243+ }
1244+
1245+ geom::Rectangle screen_position() const
1246+ {
1247+ return position;
1248+ }
1249+
1250+ float alpha() const override
1251+ {
1252+ return 1.0f;
1253+ }
1254+
1255+ glm::mat4 transformation() const override
1256+ {
1257+ return trans;
1258+ }
1259+
1260+ bool shaped() const
1261+ {
1262+ return false;
1263+ }
1264+
1265+ bool should_be_rendered_in(geom::Rectangle const& rect) const override
1266+ {
1267+ return rect.overlaps(position);
1268+ }
1269+
1270+ int buffers_ready_for_compositor() const override
1271+ {
1272+ return 1;
1273+ }
1274+
1275+private:
1276+ std::shared_ptr<mg::Buffer> const renderable_buffer;
1277+ geom::Rectangle const position;
1278+ glm::mat4 const trans;
1279+};
1280+
1281+int main(int argc, char const** argv)
1282+try
1283+{
1284+ mir::test::draw::DrawPatternSolid fill_with_green(0x00FF00FF);
1285+ mir::test::draw::DrawPatternSolid fill_with_blue(0x0000FFFF);
1286+
1287+ /* Set up graceful exit on SIGINT and SIGTERM */
1288+ struct sigaction sa;
1289+ sa.sa_handler = signal_handler;
1290+ sa.sa_flags = 0;
1291+ sigemptyset(&sa.sa_mask);
1292+
1293+ sigaction(SIGINT, &sa, NULL);
1294+ sigaction(SIGTERM, &sa, NULL);
1295+
1296+ mir::DefaultServerConfiguration conf{argc, argv};
1297+
1298+ auto platform = conf.the_graphics_platform();
1299+ auto display = platform->create_display(conf.the_display_configuration_policy());
1300+ auto buffer_allocator = platform->create_buffer_allocator(conf.the_buffer_initializer());
1301+ auto region_factory = mir::test::draw::create_graphics_region_factory();
1302+
1303+ mg::BufferProperties buffer_properties{
1304+ geom::Size{512, 512},
1305+ mir_pixel_format_abgr_8888,
1306+ mg::BufferUsage::hardware
1307+ };
1308+
1309+ auto buffer1 = buffer_allocator->alloc_buffer(buffer_properties);
1310+ auto buffer2 = buffer_allocator->alloc_buffer(buffer_properties);
1311+
1312+ fill_with_green.draw(*region_factory->graphic_region_from_handle(*buffer1->native_buffer_handle()));
1313+ fill_with_blue.draw(*region_factory->graphic_region_from_handle(*buffer2->native_buffer_handle()));
1314+
1315+ geom::Rectangle screen_pos1{{0,0} , {512, 512}};
1316+ geom::Rectangle screen_pos2{{80,80} , {592,592}};
1317+ std::list<std::shared_ptr<mg::Renderable>> renderlist
1318+ {
1319+ std::make_shared<DemoRenderable>(buffer2, screen_pos2),
1320+ std::make_shared<DemoRenderable>(buffer1, screen_pos1)
1321+ };
1322+
1323+ while (running)
1324+ {
1325+ display->for_each_display_buffer([&](mg::DisplayBuffer& buffer)
1326+ {
1327+ buffer.make_current();
1328+ auto render_fn = [](mg::Renderable const&) {};
1329+ buffer.render_and_post_update(renderlist, render_fn);
1330+ });
1331+ }
1332+ return 0;
1333+}
1334+catch (...)
1335+{
1336+ mir::report_exception(std::cerr);
1337+ return 1;
1338+}
1339
1340=== modified file 'examples/render_surfaces.cpp'
1341--- examples/render_surfaces.cpp 2014-02-04 14:48:29 +0000
1342+++ examples/render_surfaces.cpp 2014-03-06 09:14:28 +0000
1343@@ -1,5 +1,5 @@
1344 /*
1345- * Copyright © 2012 Canonical Ltd.
1346+ * Copyright © 2012-2014 Canonical Ltd.
1347 *
1348 * This program is free software: you can redistribute it and/or modify
1349 * it under the terms of the GNU General Public License version 3 as
1350@@ -18,6 +18,7 @@
1351
1352 #include "mir/compositor/display_buffer_compositor_factory.h"
1353 #include "mir/compositor/display_buffer_compositor.h"
1354+#include "mir/options/default_configuration.h"
1355 #include "mir/graphics/graphic_buffer_allocator.h"
1356 #include "mir/frontend/connector.h"
1357 #include "mir/shell/surface_creation_parameters.h"
1358@@ -27,10 +28,12 @@
1359 #include "mir/graphics/cursor.h"
1360 #include "mir/graphics/display.h"
1361 #include "mir/graphics/display_buffer.h"
1362+#include "mir/graphics/gl_context.h"
1363 #include "mir/shell/surface_factory.h"
1364 #include "mir/shell/surface.h"
1365 #include "mir/run_mir.h"
1366 #include "mir/report_exception.h"
1367+#include "mir/raii.h"
1368
1369 #include "mir_image.h"
1370 #include "buffer_render_target.h"
1371@@ -51,12 +54,14 @@
1372 namespace mc = mir::compositor;
1373 namespace ms = mir::scene;
1374 namespace mf = mir::frontend;
1375+namespace mo = mir::options;
1376 namespace msh = mir::shell;
1377 namespace mi = mir::input;
1378 namespace geom = mir::geometry;
1379 namespace mt = mir::tools;
1380 namespace me = mir::examples;
1381
1382+
1383 ///\page render_surfaces-example render_surfaces.cpp: A simple program using the mir library.
1384 ///\tableofcontents
1385 ///render_surfaces shows the use of mir to render some moving surfaces
1386@@ -194,7 +199,7 @@
1387 h{static_cast<float>(s->size().height.as_uint32_t())},
1388 dx{dx},
1389 dy{dy},
1390- rotation_axis{rotation_axis},
1391+ rotation_axis(rotation_axis),
1392 alpha_offset{alpha_offset}
1393 {
1394 }
1395@@ -252,16 +257,22 @@
1396 class RenderSurfacesServerConfiguration : public me::ServerConfiguration
1397 {
1398 public:
1399- RenderSurfacesServerConfiguration(int argc, char const** argv)
1400- : ServerConfiguration(argc, argv)
1401+ RenderSurfacesServerConfiguration(int argc, char const** argv) :
1402+ ServerConfiguration([argc, argv]
1403+ {
1404+ auto result = std::make_shared<mo::DefaultConfiguration>(argc, argv);
1405+
1406+ namespace po = boost::program_options;
1407+
1408+ result->add_options()
1409+ (surfaces_to_render, po::value<int>()->default_value(5),
1410+ "Number of surfaces to render")
1411+ (display_cursor, po::value<bool>()->default_value(false),
1412+ "Display test cursor. (If input is disabled it gets animated.)");
1413+
1414+ return result;
1415+ }())
1416 {
1417- namespace po = boost::program_options;
1418-
1419- add_options()
1420- (surfaces_to_render, po::value<int>()->default_value(5),
1421- "Number of surfaces to render")
1422- (display_cursor, po::value<bool>()->default_value(false),
1423- "Display test cursor. (If input is disabled it gets animated.)");
1424 }
1425
1426 ///\internal [RenderSurfacesServerConfiguration_stubs_tag]
1427@@ -287,12 +298,17 @@
1428 class RenderResourcesBufferInitializer : public mg::BufferInitializer
1429 {
1430 public:
1431- RenderResourcesBufferInitializer()
1432+ RenderResourcesBufferInitializer(std::unique_ptr<mg::GLContext> gl_context)
1433+ : gl_context{std::move(gl_context)}
1434 {
1435 }
1436
1437 void operator()(mg::Buffer& buffer)
1438 {
1439+ auto using_gl_context = mir::raii::paired_calls(
1440+ [this] { gl_context->make_current(); },
1441+ [this] { gl_context->release_current(); });
1442+
1443 mt::ImageRenderer img_renderer{mir_image.pixel_data,
1444 geom::Size{mir_image.width, mir_image.height},
1445 mir_image.bytes_per_pixel};
1446@@ -300,9 +316,13 @@
1447 brt.make_current();
1448 img_renderer.render();
1449 }
1450+
1451+ private:
1452+ std::unique_ptr<mg::GLContext> const gl_context;
1453+
1454 };
1455
1456- return std::make_shared<RenderResourcesBufferInitializer>();
1457+ return std::make_shared<RenderResourcesBufferInitializer>(the_display()->create_gl_context());
1458 }
1459 ///\internal [RenderResourcesBufferInitializer_tag]
1460
1461@@ -322,7 +342,7 @@
1462 {
1463 }
1464
1465- void composite()
1466+ bool composite()
1467 {
1468 animate_cursor();
1469 stop_watch.stop();
1470@@ -340,6 +360,7 @@
1471 m.step();
1472
1473 frames++;
1474+ return false;
1475 }
1476
1477 private:
1478@@ -443,7 +464,7 @@
1479
1480 bool input_is_on()
1481 {
1482- return the_options()->get<bool>(enable_input_opt);
1483+ return the_options()->get<bool>(mo::enable_input_opt);
1484 }
1485
1486 std::weak_ptr<mg::Cursor> the_cursor()
1487
1488=== modified file 'examples/render_to_fb.cpp'
1489--- examples/render_to_fb.cpp 2014-01-13 06:12:33 +0000
1490+++ examples/render_to_fb.cpp 2014-03-06 09:14:28 +0000
1491@@ -27,7 +27,6 @@
1492 #include <iostream>
1493
1494 namespace mg=mir::graphics;
1495-namespace ml=mir::logging;
1496 namespace mo=mir::options;
1497
1498 namespace
1499
1500=== modified file 'examples/scroll.cpp'
1501--- examples/scroll.cpp 2014-01-24 11:15:31 +0000
1502+++ examples/scroll.cpp 2014-03-06 09:14:28 +0000
1503@@ -23,46 +23,21 @@
1504 #include <signal.h>
1505 #include <string.h>
1506 #include <stdio.h>
1507+#include <stdlib.h>
1508 #include <unistd.h>
1509 #include <getopt.h>
1510 #include <EGL/egl.h>
1511 #include <GLES2/gl2.h>
1512
1513+#include <thread>
1514+
1515 static char const *socket_file = NULL;
1516-
1517-int main(int argc, char* argv[])
1518+static EGLDisplay disp;
1519+
1520+
1521+void create_and_run_scroll_surface(MirConnection *connection)
1522 {
1523- MirConnection *connection = 0;
1524 MirSurface *surface = 0;
1525- int arg;
1526- opterr = 0;
1527- while ((arg = getopt (argc, argv, "hm:")) != -1)
1528- {
1529- switch (arg)
1530- {
1531- case 'm':
1532- socket_file = optarg;
1533- break;
1534-
1535- case '?':
1536- case 'h':
1537- default:
1538- puts(argv[0]);
1539- puts("Usage:");
1540- puts(" -m <Mir server socket>");
1541- puts(" -h: this help text");
1542- return -1;
1543- }
1544- }
1545-
1546- puts("Starting");
1547-
1548- connection = mir_connect_sync(socket_file, __PRETTY_FUNCTION__);
1549- assert(connection != NULL);
1550- assert(mir_connection_is_valid(connection));
1551- assert(strcmp(mir_connection_get_error_message(connection), "") == 0);
1552- puts("Connected");
1553-
1554 MirPixelFormat pixel_format;
1555 unsigned int valid_formats;
1556 mir_connection_get_available_surface_formats(connection, &pixel_format, 1, &valid_formats);
1557@@ -79,7 +54,6 @@
1558
1559 /* egl setup */
1560 int major, minor, n, rc;
1561- EGLDisplay disp;
1562 EGLContext context;
1563 EGLSurface egl_surface;
1564 EGLConfig egl_config;
1565@@ -93,12 +67,8 @@
1566 EGL_NONE };
1567 EGLint context_attribs[] = { EGL_CONTEXT_CLIENT_VERSION, 2, EGL_NONE };
1568
1569- EGLNativeDisplayType native_display = (EGLNativeDisplayType) mir_connection_get_egl_native_display(connection);
1570 EGLNativeWindowType native_window = (EGLNativeWindowType) mir_surface_get_egl_native_window(surface);
1571- assert(native_window != NULL);
1572-
1573- disp = eglGetDisplay(native_display);
1574- assert(disp != EGL_NO_DISPLAY);
1575+ assert(native_window != (EGLNativeWindowType)NULL);
1576
1577 rc = eglInitialize(disp, &major, &minor);
1578 assert(rc == EGL_TRUE);
1579@@ -131,16 +101,67 @@
1580
1581 eglDestroySurface(disp, egl_surface);
1582 eglDestroyContext(disp, context);
1583- eglTerminate(disp);
1584-
1585+
1586 mir_surface_release_sync(surface);
1587 puts("Surface released");
1588+}
1589+
1590+int main(int argc, char* argv[])
1591+{
1592+ MirConnection *connection = 0;
1593+ unsigned num_windows = 1;
1594+ int arg;
1595+ opterr = 0;
1596+ while ((arg = getopt (argc, argv, "hm:w:")) != -1)
1597+ {
1598+ switch (arg)
1599+ {
1600+ case 'm':
1601+ socket_file = optarg;
1602+ break;
1603+ case 'w':
1604+ num_windows = atoi(optarg);
1605+ break;
1606+ case '?':
1607+ case 'h':
1608+ default:
1609+ puts(argv[0]);
1610+ puts("Usage:");
1611+ puts(" -m <Mir server socket>");
1612+ puts(" -w <Number of windows to create>:");
1613+ puts(" -h: this help text");
1614+ return -1;
1615+ }
1616+ }
1617+
1618+ puts("Starting");
1619+
1620+ connection = mir_connect_sync(socket_file, __PRETTY_FUNCTION__);
1621+ assert(connection != NULL);
1622+ assert(mir_connection_is_valid(connection));
1623+ assert(strcmp(mir_connection_get_error_message(connection), "") == 0);
1624+ puts("Connected");
1625+
1626+ EGLNativeDisplayType native_display = (EGLNativeDisplayType) mir_connection_get_egl_native_display(connection);
1627+ disp = eglGetDisplay(native_display);
1628+ assert(disp != EGL_NO_DISPLAY);
1629+
1630+ if (num_windows == 1)
1631+ {
1632+ create_and_run_scroll_surface(connection);
1633+ }
1634+ else
1635+ {
1636+ for (unsigned i = 0; i < num_windows; i++) std::thread(create_and_run_scroll_surface, connection).detach();
1637+ for(;;) {}
1638+ }
1639+
1640+
1641+ eglTerminate(disp);
1642
1643 mir_connection_release(connection);
1644 puts("Connection released");
1645
1646- (void)rc;
1647-
1648 return 0;
1649 }
1650
1651
1652=== modified file 'examples/server_configuration.cpp'
1653--- examples/server_configuration.cpp 2014-01-29 15:20:07 +0000
1654+++ examples/server_configuration.cpp 2014-03-06 09:14:28 +0000
1655@@ -1,5 +1,5 @@
1656 /*
1657- * Copyright © 2013 Canonical Ltd.
1658+ * Copyright © 2013-2014 Canonical Ltd.
1659 *
1660 * This program is free software: you can redistribute it and/or modify
1661 * it under the terms of the GNU General Public License version 3 as
1662@@ -17,6 +17,7 @@
1663 */
1664
1665 #include "server_configuration.h"
1666+#include "mir/options/default_configuration.h"
1667 #include "mir/graphics/display_configuration_policy.h"
1668 #include "mir/graphics/display_configuration.h"
1669 #include "mir/input/composite_event_filter.h"
1670@@ -55,28 +56,23 @@
1671 });
1672
1673 conf.for_each_output(
1674- [&](mg::DisplayConfigurationOutput const& conf_output)
1675+ [&](mg::UserDisplayConfigurationOutput& conf_output)
1676 {
1677 if (conf_output.connected && conf_output.modes.size() > 0 &&
1678 available_outputs_for_card[conf_output.card_id] > 0)
1679 {
1680- conf.configure_output(conf_output.id, true,
1681- geom::Point{max_x, 0},
1682- preferred_mode_index,
1683- conf_output.current_format,
1684- mir_power_mode_on,
1685- mir_orientation_normal);
1686+ conf_output.used = true;
1687+ conf_output.top_left = geom::Point{max_x, 0};
1688+ conf_output.current_mode_index = preferred_mode_index;
1689+ conf_output.power_mode = mir_power_mode_on;
1690+ conf_output.orientation = mir_orientation_normal;
1691 max_x += conf_output.modes[preferred_mode_index].size.width.as_int();
1692 --available_outputs_for_card[conf_output.card_id];
1693 }
1694 else
1695 {
1696- conf.configure_output(conf_output.id, false,
1697- conf_output.top_left,
1698- conf_output.current_mode_index,
1699- conf_output.current_format,
1700- mir_power_mode_on,
1701- mir_orientation_normal);
1702+ conf_output.used = false;
1703+ conf_output.power_mode = mir_power_mode_off;
1704 }
1705 });
1706 }
1707@@ -91,26 +87,20 @@
1708 bool done{false};
1709
1710 conf.for_each_output(
1711- [&](mg::DisplayConfigurationOutput const& conf_output)
1712+ [&](mg::UserDisplayConfigurationOutput& conf_output)
1713 {
1714 if (!done && conf_output.connected && conf_output.modes.size() > 0)
1715 {
1716- conf.configure_output(conf_output.id, true,
1717- geom::Point{0, 0},
1718- preferred_mode_index,
1719- conf_output.current_format,
1720- mir_power_mode_on,
1721- mir_orientation_normal);
1722+ conf_output.used = true;
1723+ conf_output.top_left = geom::Point{0, 0};
1724+ conf_output.current_mode_index = preferred_mode_index;
1725+ conf_output.power_mode = mir_power_mode_on;
1726 done = true;
1727 }
1728 else
1729 {
1730- conf.configure_output(conf_output.id, false,
1731- conf_output.top_left,
1732- conf_output.current_mode_index,
1733- conf_output.current_format,
1734- mir_power_mode_on,
1735- mir_orientation_normal);
1736+ conf_output.used = false;
1737+ conf_output.power_mode = mir_power_mode_off;
1738 }
1739 });
1740 }
1741@@ -145,16 +135,21 @@
1742
1743 }
1744
1745-me::ServerConfiguration::ServerConfiguration(int argc, char const** argv)
1746- : DefaultServerConfiguration(argc, argv)
1747+me::ServerConfiguration::ServerConfiguration(std::shared_ptr<options::DefaultConfiguration> const& configuration_options) :
1748+ DefaultServerConfiguration(configuration_options)
1749 {
1750 namespace po = boost::program_options;
1751
1752- add_options()
1753+ configuration_options->add_options()
1754 (display_config_opt, po::value<std::string>()->default_value(clone_opt_val),
1755 "Display configuration [{clone,sidebyside,single}]");
1756 }
1757
1758+me::ServerConfiguration::ServerConfiguration(int argc, char const** argv) :
1759+ ServerConfiguration(std::make_shared<options::DefaultConfiguration>(argc, argv))
1760+{
1761+}
1762+
1763 std::shared_ptr<mg::DisplayConfigurationPolicy>
1764 me::ServerConfiguration::the_display_configuration_policy()
1765 {
1766
1767=== modified file 'examples/server_configuration.h'
1768--- examples/server_configuration.h 2013-08-28 03:41:48 +0000
1769+++ examples/server_configuration.h 2014-03-06 09:14:28 +0000
1770@@ -1,5 +1,5 @@
1771 /*
1772- * Copyright © 2013 Canonical Ltd.
1773+ * Copyright © 2013-2014 Canonical Ltd.
1774 *
1775 * This program is free software: you can redistribute it and/or modify
1776 * it under the terms of the GNU General Public License version 3 as
1777@@ -23,6 +23,11 @@
1778
1779 namespace mir
1780 {
1781+namespace options
1782+{
1783+class DefaultConfiguration;
1784+}
1785+
1786 namespace examples
1787 {
1788
1789@@ -30,6 +35,7 @@
1790 {
1791 public:
1792 ServerConfiguration(int argc, char const** argv);
1793+ explicit ServerConfiguration(std::shared_ptr<options::DefaultConfiguration> const& configuration_options);
1794
1795 std::shared_ptr<graphics::DisplayConfigurationPolicy> the_display_configuration_policy() override;
1796 std::shared_ptr<input::CompositeEventFilter> the_composite_event_filter() override;
1797
1798=== modified file 'guides/cppguide.xml'
1799--- guides/cppguide.xml 2014-01-13 04:16:45 +0000
1800+++ guides/cppguide.xml 2014-03-06 09:14:28 +0000
1801@@ -1060,12 +1060,13 @@
1802 be private</a>.
1803 </p>
1804 <p>
1805- When redefining an inherited virtual function, explicitly
1806- declare it <code>virtual</code> in the declaration of the
1807- derived class. Rationale: If <code>virtual</code> is
1808- omitted, the reader has to check all ancestors of the
1809- class in question to determine if the function is virtual
1810- or not.
1811+ When redefining an inherited virtual method (both pure
1812+ and non-pure), explicitly declare it <code>override</code>
1813+ in the declaration of the derived class. Rationale: using
1814+ <code>override</code> allows the compiler to consistently
1815+ detect attempts to override methods that have been changed
1816+ or completely removed. It also makes it straightforward for
1817+ a reader to determine if a method is virtual or not.
1818 </p>
1819 </DECISION>
1820 </BODY>
1821
1822=== renamed file 'include/server/mir/abnormal_exit.h' => 'include/platform/mir/abnormal_exit.h'
1823--- include/server/mir/abnormal_exit.h 2013-04-24 05:22:20 +0000
1824+++ include/platform/mir/abnormal_exit.h 2014-03-06 09:14:28 +0000
1825@@ -2,15 +2,15 @@
1826 * Copyright © 2013 Canonical Ltd.
1827 *
1828 * This program is free software: you can redistribute it and/or modify it
1829- * under the terms of the GNU General Public License version 3,
1830+ * under the terms of the GNU Lesser General Public License version 3,
1831 * as published by the Free Software Foundation.
1832 *
1833 * This program is distributed in the hope that it will be useful,
1834 * but WITHOUT ANY WARRANTY; without even the implied warranty of
1835 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1836- * GNU General Public License for more details.
1837+ * GNU Lesser General Public License for more details.
1838 *
1839- * You should have received a copy of the GNU General Public License
1840+ * You should have received a copy of the GNU Lesser General Public License
1841 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1842 *
1843 * Authored by: Alan Griffiths <alan@octopull.co.uk>
1844
1845=== modified file 'include/platform/mir/graphics/display_configuration.h'
1846--- include/platform/mir/graphics/display_configuration.h 2014-01-13 06:12:33 +0000
1847+++ include/platform/mir/graphics/display_configuration.h 2014-03-06 09:14:28 +0000
1848@@ -114,6 +114,31 @@
1849 /** The logical rectangle occupied by the output, based on its position,
1850 current mode and orientation (rotation) */
1851 geometry::Rectangle extents() const;
1852+ bool valid() const;
1853+};
1854+
1855+/**
1856+ * Mirror of a DisplayConfigurationOutput, with some fields limited to
1857+ * being read-only, preventing users from changing things they shouldn't.
1858+ */
1859+struct UserDisplayConfigurationOutput
1860+{
1861+ DisplayConfigurationOutputId const& id;
1862+ DisplayConfigurationCardId const& card_id;
1863+ DisplayConfigurationOutputType const& type;
1864+ std::vector<MirPixelFormat> const& pixel_formats;
1865+ std::vector<DisplayConfigurationMode> const& modes;
1866+ size_t const& preferred_mode_index;
1867+ geometry::Size const& physical_size_mm;
1868+ bool const& connected;
1869+ bool& used;
1870+ geometry::Point& top_left;
1871+ size_t& current_mode_index;
1872+ MirPixelFormat& current_format;
1873+ MirPowerMode& power_mode;
1874+ MirOrientation& orientation;
1875+
1876+ UserDisplayConfigurationOutput(DisplayConfigurationOutput& master);
1877 };
1878
1879 std::ostream& operator<<(std::ostream& out, DisplayConfigurationCard const& val);
1880@@ -140,13 +165,8 @@
1881 virtual void for_each_card(std::function<void(DisplayConfigurationCard const&)> f) const = 0;
1882 /** Executes a function object for each output in the configuration. */
1883 virtual void for_each_output(std::function<void(DisplayConfigurationOutput const&)> f) const = 0;
1884-
1885- /** Configures an output. */
1886- virtual void configure_output(DisplayConfigurationOutputId id, bool used,
1887- geometry::Point top_left, size_t mode_index,
1888- MirPixelFormat format,
1889- MirPowerMode power_mode,
1890- MirOrientation orientation) = 0;
1891+ virtual void for_each_output(std::function<void(UserDisplayConfigurationOutput&)> f) = 0;
1892+ virtual bool valid() const;
1893
1894 protected:
1895 DisplayConfiguration() = default;
1896
1897=== modified file 'include/platform/mir/graphics/drm_authenticator.h'
1898--- include/platform/mir/graphics/drm_authenticator.h 2013-08-28 03:41:48 +0000
1899+++ include/platform/mir/graphics/drm_authenticator.h 2014-03-06 09:14:28 +0000
1900@@ -19,8 +19,6 @@
1901 #ifndef MIR_GRAPHICS_DRM_AUTHENTICATOR_H_
1902 #define MIR_GRAPHICS_DRM_AUTHENTICATOR_H_
1903
1904-#include <xf86drm.h>
1905-
1906 namespace mir
1907 {
1908 namespace graphics
1909@@ -31,7 +29,7 @@
1910 public:
1911 virtual ~DRMAuthenticator() {}
1912
1913- virtual void drm_auth_magic(drm_magic_t magic) = 0;
1914+ virtual void drm_auth_magic(unsigned int magic) = 0;
1915
1916 protected:
1917 DRMAuthenticator() = default;
1918
1919=== renamed file 'src/platform/graphics/mesa/overlapping_output_grouping.h' => 'include/platform/mir/graphics/overlapping_output_grouping.h'
1920--- src/platform/graphics/mesa/overlapping_output_grouping.h 2014-01-13 06:12:33 +0000
1921+++ include/platform/mir/graphics/overlapping_output_grouping.h 2014-03-06 09:14:28 +0000
1922@@ -16,8 +16,8 @@
1923 * Authored by: Alexandros Frantzis <alexandros.frantzis@canonical.com>
1924 */
1925
1926-#ifndef MIR_GRAPHICS_MESA_OVERLAPPING_OUTPUT_GROUPING_H_
1927-#define MIR_GRAPHICS_MESA_OVERLAPPING_OUTPUT_GROUPING_H_
1928+#ifndef MIR_GRAPHICS_OVERLAPPING_OUTPUT_GROUPING_H_
1929+#define MIR_GRAPHICS_OVERLAPPING_OUTPUT_GROUPING_H_
1930
1931 #include <vector>
1932 #include <functional>
1933@@ -34,9 +34,6 @@
1934 class DisplayConfiguration;
1935 struct DisplayConfigurationOutput;
1936
1937-namespace mesa
1938-{
1939-
1940 class OverlappingOutputGroup
1941 {
1942 public:
1943@@ -67,6 +64,5 @@
1944
1945 }
1946 }
1947-}
1948
1949-#endif /* MIR_GRAPHICS_MESA_OVERLAPPING_OUTPUT_GROUPING_H_ */
1950+#endif /* MIR_GRAPHICS_OVERLAPPING_OUTPUT_GROUPING_H_ */
1951
1952=== modified file 'include/platform/mir/graphics/renderable.h'
1953--- include/platform/mir/graphics/renderable.h 2014-01-24 21:54:18 +0000
1954+++ include/platform/mir/graphics/renderable.h 2014-03-06 09:14:28 +0000
1955@@ -20,6 +20,7 @@
1956 #define MIR_GRAPHICS_RENDERABLE_H_
1957
1958 #include <mir/geometry/rectangle.h>
1959+#include <glm/glm.hpp>
1960 #include <memory>
1961
1962 namespace mir
1963@@ -31,10 +32,34 @@
1964 class Renderable
1965 {
1966 public:
1967- virtual std::shared_ptr<Buffer> buffer() const = 0;
1968+ /**
1969+ * Return the next buffer that should be composited/rendered.
1970+ *
1971+ * \param [in] frameno The frameno parameter is important for
1972+ * multi-monitor platforms. Calls with the same frameno
1973+ * will get the same buffer returned. This ensures that
1974+ * a surface visible on multiple outputs does not get
1975+ * its buffers consumed any faster than the refresh
1976+ * rate of a single monitor. Implementations may ignore
1977+ * the value of frameno on single-monitor platforms
1978+ * only. The caller should always ensure the frameno
1979+ * is different to the previous frame. The exact value
1980+ * of frameno is not important but a large range of
1981+ * values is recommended.
1982+ */
1983+ virtual std::shared_ptr<Buffer> buffer(unsigned long frameno) const = 0;
1984+
1985 virtual bool alpha_enabled() const = 0;
1986 virtual geometry::Rectangle screen_position() const = 0;
1987
1988+ // These are from the old CompositingCriteria. There is a little bit
1989+ // of function overlap with the above functions still.
1990+ virtual float alpha() const = 0;
1991+ virtual glm::mat4 transformation() const = 0;
1992+ virtual bool should_be_rendered_in(geometry::Rectangle const& rect) const = 0;
1993+ virtual bool shaped() const = 0; // meaning the pixel format has alpha
1994+ virtual int buffers_ready_for_compositor() const = 0;
1995+
1996 protected:
1997 Renderable() = default;
1998 virtual ~Renderable() = default;
1999
2000=== added file 'include/platform/mir/options/configuration.h'
2001--- include/platform/mir/options/configuration.h 1970-01-01 00:00:00 +0000
2002+++ include/platform/mir/options/configuration.h 2014-03-06 09:14:28 +0000
2003@@ -0,0 +1,73 @@
2004+/*
2005+ * Copyright © 2014 Canonical Ltd.
2006+ *
2007+ * This program is free software: you can redistribute it and/or modify it
2008+ * under the terms of the GNU Lesser General Public License version 3,
2009+ * as published by the Free Software Foundation.
2010+ *
2011+ * This program is distributed in the hope that it will be useful,
2012+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
2013+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2014+ * GNU Lesser General Public License for more details.
2015+ *
2016+ * You should have received a copy of the GNU Lesser General Public License
2017+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
2018+ *
2019+ * Authored By: Alan Griffiths <alan@octopull.co.uk>
2020+ */
2021+
2022+#ifndef MIR_OPTIONS_CONFIGURATION_H_
2023+#define MIR_OPTIONS_CONFIGURATION_H_
2024+
2025+#include "mir/options/program_option.h"
2026+
2027+#include <memory>
2028+
2029+namespace mir
2030+{
2031+namespace options
2032+{
2033+extern char const* const server_socket_opt;
2034+extern char const* const no_server_socket_opt;
2035+extern char const* const enable_input_opt;
2036+extern char const* const session_mediator_report_opt;
2037+extern char const* const msg_processor_report_opt;
2038+extern char const* const compositor_report_opt;
2039+extern char const* const display_report_opt;
2040+extern char const* const legacy_input_report_opt;
2041+extern char const* const connector_report_opt;
2042+extern char const* const scene_report_opt;
2043+extern char const* const input_report_opt;
2044+extern char const* const host_socket_opt;
2045+extern char const* const frontend_threads_opt;
2046+
2047+extern char const* const name_opt;
2048+extern char const* const offscreen_opt;
2049+
2050+extern char const* const glog;
2051+extern char const* const glog_stderrthreshold;
2052+extern char const* const glog_minloglevel;
2053+extern char const* const glog_log_dir;
2054+
2055+extern char const* const off_opt_value;
2056+extern char const* const log_opt_value;
2057+extern char const* const lttng_opt_value;
2058+
2059+extern char const* const platform_graphics_lib;
2060+
2061+class Configuration
2062+{
2063+public:
2064+ virtual std::shared_ptr<options::Option> the_options() const = 0;
2065+
2066+protected:
2067+
2068+ Configuration() = default;
2069+ virtual ~Configuration() = default;
2070+ Configuration(Configuration const&) = delete;
2071+ Configuration& operator=(Configuration const&) = delete;
2072+};
2073+}
2074+}
2075+
2076+#endif /* MIR_OPTIONS_CONFIGURATION_H_ */
2077
2078=== renamed file 'include/server/mir/default_configuration_options.h' => 'include/platform/mir/options/default_configuration.h'
2079--- include/server/mir/default_configuration_options.h 2014-01-27 17:47:06 +0000
2080+++ include/platform/mir/options/default_configuration.h 2014-03-06 09:14:28 +0000
2081@@ -1,100 +1,65 @@
2082 /*
2083- * Copyright © 2013 Canonical Ltd.
2084+ * Copyright © 2013-2014 Canonical Ltd.
2085 *
2086 * This program is free software: you can redistribute it and/or modify it
2087- * under the terms of the GNU General Public License version 3,
2088+ * under the terms of the GNU Lesser General Public License version 3,
2089 * as published by the Free Software Foundation.
2090 *
2091 * This program is distributed in the hope that it will be useful,
2092 * but WITHOUT ANY WARRANTY; without even the implied warranty of
2093 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2094- * GNU General Public License for more details.
2095+ * GNU Lesser General Public License for more details.
2096 *
2097- * You should have received a copy of the GNU General Public License
2098+ * You should have received a copy of the GNU Lesser General Public License
2099 * along with this program. If not, see <http://www.gnu.org/licenses/>.
2100 *
2101 * Authored by: Alan Griffiths <alan@octopull.co.uk>
2102 */
2103
2104-#ifndef MIR_DEFAULT_CONFIGURATION_OPTIONS_H_
2105-#define MIR_DEFAULT_CONFIGURATION_OPTIONS_H_
2106-
2107-#include "mir/options/program_option.h"
2108-
2109-#include <memory>
2110+#ifndef MIR_OPTIONS_DEFAULT_CONFIGURATION_H_
2111+#define MIR_OPTIONS_DEFAULT_CONFIGURATION_H_
2112+
2113+#include "mir/options/configuration.h"
2114+
2115
2116 namespace mir
2117 {
2118-class ConfigurationOptions
2119-{
2120-public:
2121- static char const* const server_socket_opt;
2122- static char const* const no_server_socket_opt;
2123- static char const* const enable_input_opt;
2124- static char const* const session_mediator_report_opt;
2125- static char const* const msg_processor_report_opt;
2126- static char const* const compositor_report_opt;
2127- static char const* const display_report_opt;
2128- static char const* const legacy_input_report_opt;
2129- static char const* const connector_report_opt;
2130- static char const* const scene_report_opt;
2131- static char const* const input_report_opt;
2132- static char const* const host_socket_opt;
2133- static char const* const standalone_opt;
2134- static char const* const frontend_threads_opt;
2135- static char const* const name_opt;
2136- static char const* const offscreen_opt;
2137-
2138- static char const* const glog;
2139- static char const* const glog_stderrthreshold;
2140- static char const* const glog_minloglevel;
2141- static char const* const glog_log_dir;
2142- static char const* const glog_log_dir_default;
2143- static int const glog_stderrthreshold_default;
2144- static int const glog_minloglevel_default;
2145-
2146- static bool const enable_input_default;
2147-
2148- static char const* const off_opt_value;
2149- static char const* const log_opt_value;
2150- static char const* const lttng_opt_value;
2151-
2152- static char const* const platform_graphics_lib;
2153- static char const* const default_platform_graphics_lib;
2154-
2155- virtual std::shared_ptr<options::Option> the_options() const = 0;
2156-
2157-protected:
2158-
2159- int default_ipc_threads = 10;
2160-
2161- ConfigurationOptions() = default;
2162- virtual ~ConfigurationOptions() = default;
2163- ConfigurationOptions(ConfigurationOptions const&) = delete;
2164- ConfigurationOptions& operator=(ConfigurationOptions const&) = delete;
2165-};
2166-
2167-class DefaultConfigurationOptions : public ConfigurationOptions
2168-{
2169-public:
2170- DefaultConfigurationOptions(int argc, char const* argv[]);
2171- virtual ~DefaultConfigurationOptions() = default;
2172-
2173-protected:
2174- // add_options() allows configuration specializations to add their
2175- // own options. This MUST be called before the first invocation of
2176- // the_options() - typically during construction.
2177+namespace options
2178+{
2179+class DefaultConfiguration : public Configuration
2180+{
2181+public:
2182+ DefaultConfiguration(int argc, char const* argv[]);
2183+ virtual ~DefaultConfiguration() = default;
2184+
2185+ // add_options() allows users to add their own options. This MUST be called
2186+ // before the first invocation of the_options() - typically during initialization.
2187 boost::program_options::options_description_easy_init add_options();
2188- virtual void parse_options(boost::program_options::options_description& options_description, options::ProgramOption& options) const;
2189- virtual std::shared_ptr<options::Option> the_options() const;
2190
2191 private:
2192+ // accessed via the base interface, when access to add_options() has been "lost"
2193+ std::shared_ptr<options::Option> the_options() const override;
2194+
2195+ virtual void parse_arguments(
2196+ boost::program_options::options_description desc,
2197+ ProgramOption& options,
2198+ int argc,
2199+ char const* argv[]) const;
2200+
2201+ virtual void parse_environment(
2202+ boost::program_options::options_description& desc,
2203+ ProgramOption& options) const;
2204+
2205+ virtual void parse_config_file(
2206+ boost::program_options::options_description& desc,
2207+ ProgramOption& options) const;
2208+
2209 int const argc;
2210 char const** const argv;
2211 std::shared_ptr<boost::program_options::options_description> const program_options;
2212- std::shared_ptr<options::Option> mutable options;
2213+ std::shared_ptr<Option> mutable options;
2214 };
2215 }
2216-
2217-
2218-#endif /* MIR_DEFAULT_CONFIGURATION_OPTIONS_H_ */
2219+}
2220+
2221+#endif /* MIR_OPTIONS_DEFAULT_CONFIGURATION_H_ */
2222
2223=== modified file 'include/platform/mir/udev/wrapper.h'
2224--- include/platform/mir/udev/wrapper.h 2014-01-22 08:32:55 +0000
2225+++ include/platform/mir/udev/wrapper.h 2014-03-06 09:14:28 +0000
2226@@ -93,7 +93,7 @@
2227 bool operator!=(iterator const& rhs) const;
2228
2229 Device const& operator*() const;
2230-
2231+ Device const* operator->() const;
2232 private:
2233 friend class Enumerator;
2234
2235@@ -135,6 +135,7 @@
2236 void enable(void);
2237 int fd(void) const;
2238
2239+ void filter_by_subsystem(std::string const& subsystem);
2240 void filter_by_subsystem_and_type(std::string const& subsystem, std::string const& devtype);
2241
2242 void process_events(std::function<void(EventType, Device const&)> const& handler) const;
2243
2244=== modified file 'include/server/mir/compositor/buffer_stream.h'
2245--- include/server/mir/compositor/buffer_stream.h 2014-02-04 14:00:58 +0000
2246+++ include/server/mir/compositor/buffer_stream.h 2014-03-06 09:14:28 +0000
2247@@ -1,5 +1,5 @@
2248 /*
2249- * Copyright © 2012 Canonical Ltd.
2250+ * Copyright © 2012-2014 Canonical Ltd.
2251 *
2252 * This program is free software: you can redistribute it and/or modify it
2253 * under the terms of the GNU General Public License version 3,
2254@@ -50,6 +50,7 @@
2255 virtual void resize(geometry::Size const& size) = 0;
2256 virtual void allow_framedropping(bool) = 0;
2257 virtual void force_requests_to_complete() = 0;
2258+ virtual int buffers_ready_for_compositor() const = 0;
2259 };
2260
2261 }
2262
2263=== removed file 'include/server/mir/compositor/compositing_criteria.h'
2264--- include/server/mir/compositor/compositing_criteria.h 2014-01-13 06:12:33 +0000
2265+++ include/server/mir/compositor/compositing_criteria.h 1970-01-01 00:00:00 +0000
2266@@ -1,52 +0,0 @@
2267-/*
2268- * Copyright © 2013 Canonical Ltd.
2269- *
2270- * This program is free software: you can redistribute it and/or modify it
2271- * under the terms of the GNU General Public License version 3,
2272- * as published by the Free Software Foundation.
2273- *
2274- * This program is distributed in the hope that it will be useful,
2275- * but WITHOUT ANY WARRANTY; without even the implied warranty of
2276- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2277- * GNU General Public License for more details.
2278- *
2279- * You should have received a copy of the GNU General Public License
2280- * along with this program. If not, see <http://www.gnu.org/licenses/>.
2281- *
2282- * Authored by: Kevin DuBois <kevin.dubois@canonical.com>
2283- */
2284-
2285-#ifndef MIR_COMPOSITOR_COMPOSITING_CRITERIA_H_
2286-#define MIR_COMPOSITOR_COMPOSITING_CRITERIA_H_
2287-
2288-#include <glm/glm.hpp>
2289-
2290-namespace mir
2291-{
2292-namespace geometry
2293-{
2294-struct Rectangle;
2295-}
2296-namespace compositor
2297-{
2298-
2299-class CompositingCriteria
2300-{
2301-public:
2302- virtual float alpha() const = 0;
2303- virtual glm::mat4 const& transformation() const = 0;
2304- virtual bool should_be_rendered_in(geometry::Rectangle const& rect) const = 0;
2305- virtual bool shaped() const = 0; // meaning the pixel format has alpha
2306-
2307- virtual ~CompositingCriteria() = default;
2308-
2309-protected:
2310- CompositingCriteria() = default;
2311- CompositingCriteria(CompositingCriteria const&) = delete;
2312- CompositingCriteria& operator=(CompositingCriteria const&) = delete;
2313-};
2314-
2315-}
2316-}
2317-
2318-#endif /* MIR_COMPOSITOR_COMPOSITING_CRITERIA_H_ */
2319
2320=== modified file 'include/server/mir/compositor/compositor_report.h'
2321--- include/server/mir/compositor/compositor_report.h 2014-01-10 05:48:41 +0000
2322+++ include/server/mir/compositor/compositor_report.h 2014-03-06 09:14:28 +0000
2323@@ -41,17 +41,6 @@
2324 CompositorReport& operator=(CompositorReport const&) = delete;
2325 };
2326
2327-class NullCompositorReport : public CompositorReport
2328-{
2329-public:
2330- void added_display(int width, int height, int x, int y, SubCompositorId id);
2331- void began_frame(SubCompositorId id);
2332- void finished_frame(bool bypassed, SubCompositorId id);
2333- void started();
2334- void stopped();
2335- void scheduled();
2336-};
2337-
2338 } // namespace compositor
2339 } // namespace mir
2340
2341
2342=== modified file 'include/server/mir/compositor/display_buffer_compositor.h'
2343--- include/server/mir/compositor/display_buffer_compositor.h 2013-08-28 03:41:48 +0000
2344+++ include/server/mir/compositor/display_buffer_compositor.h 2014-03-06 09:14:28 +0000
2345@@ -1,5 +1,5 @@
2346 /*
2347- * Copyright © 2012-2013 Canonical Ltd.
2348+ * Copyright © 2012-2014 Canonical Ltd.
2349 *
2350 * This program is free software: you can redistribute it and/or modify it
2351 * under the terms of the GNU General Public License version 3,
2352@@ -30,7 +30,9 @@
2353 public:
2354 virtual ~DisplayBufferCompositor() = default;
2355
2356- virtual void composite() = 0;
2357+ /// Returns true if there is additional work to do. E.g. a composited surface
2358+ /// has additional buffers ready to composite or during animation
2359+ virtual bool composite() = 0;
2360
2361 protected:
2362 DisplayBufferCompositor() = default;
2363
2364=== renamed file 'src/server/compositor/gl_renderer.h' => 'include/server/mir/compositor/gl_renderer.h'
2365--- src/server/compositor/gl_renderer.h 2014-01-22 08:48:56 +0000
2366+++ include/server/mir/compositor/gl_renderer.h 2014-03-06 09:14:28 +0000
2367@@ -19,9 +19,9 @@
2368 #ifndef MIR_COMPOSITOR_GL_RENDERER_H_
2369 #define MIR_COMPOSITOR_GL_RENDERER_H_
2370
2371-#include "renderer.h"
2372-#include "mir/geometry/rectangle.h"
2373-#include "mir/graphics/buffer_id.h"
2374+#include <mir/compositor/renderer.h>
2375+#include <mir/geometry/rectangle.h>
2376+#include <mir/graphics/buffer_id.h>
2377 #include <GLES2/gl2.h>
2378 #include <unordered_map>
2379
2380@@ -37,8 +37,11 @@
2381 virtual ~GLRenderer() noexcept;
2382
2383 // These are called with a valid GL context:
2384- void begin(float rotation) const override;
2385- void render(CompositingCriteria const& info, graphics::Buffer& buffer) const override;
2386+ void set_viewport(geometry::Rectangle const& rect) override;
2387+ void set_rotation(float degrees) override;
2388+ void begin() const override;
2389+ void render(graphics::Renderable const& renderable,
2390+ graphics::Buffer& buffer) const override;
2391 void end() const override;
2392
2393 // This is called _without_ a GL context:
2394@@ -54,8 +57,11 @@
2395 GLuint transform_uniform_loc;
2396 GLuint alpha_uniform_loc;
2397 GLuint vertex_attribs_vbo;
2398-
2399- typedef CompositingCriteria const* SurfaceID;
2400+ float rotation;
2401+
2402+ geometry::Rectangle viewport;
2403+
2404+ typedef graphics::Renderable const* SurfaceID;
2405 struct Texture
2406 {
2407 GLuint id = 0;
2408
2409=== renamed file 'src/server/compositor/renderer.h' => 'include/server/mir/compositor/renderer.h'
2410--- src/server/compositor/renderer.h 2014-01-14 07:02:27 +0000
2411+++ include/server/mir/compositor/renderer.h 2014-03-06 09:14:28 +0000
2412@@ -19,23 +19,31 @@
2413 #ifndef MIR_COMPOSITOR_RENDERER_H_
2414 #define MIR_COMPOSITOR_RENDERER_H_
2415
2416+#include "mir/geometry/rectangle.h"
2417+
2418 namespace mir
2419 {
2420 namespace graphics
2421 {
2422 class Buffer;
2423+class Renderable;
2424 }
2425 namespace compositor
2426 {
2427-class CompositingCriteria;
2428
2429 class Renderer
2430 {
2431 public:
2432 virtual ~Renderer() = default;
2433
2434- virtual void begin(float rotation = 0.0f) const = 0;
2435- virtual void render(CompositingCriteria const& info, graphics::Buffer& buffer) const = 0;
2436+ virtual void set_viewport(geometry::Rectangle const& rect) = 0;
2437+ virtual void set_rotation(float degrees) = 0;
2438+ virtual void begin() const = 0;
2439+
2440+ // XXX The buffer parameter here could now be replaced with a "frameno"
2441+ // instead, and use renderable.buffer(frameno). Is that better?
2442+ virtual void render(graphics::Renderable const& renderable,
2443+ graphics::Buffer& buffer) const = 0;
2444 virtual void end() const = 0;
2445
2446 virtual void suspend() = 0; // called when begin/render/end skipped
2447
2448=== renamed file 'src/server/compositor/renderer_factory.h' => 'include/server/mir/compositor/renderer_factory.h'
2449=== modified file 'include/server/mir/compositor/scene.h'
2450--- include/server/mir/compositor/scene.h 2014-01-13 06:12:33 +0000
2451+++ include/server/mir/compositor/scene.h 2014-03-06 09:14:28 +0000
2452@@ -26,17 +26,16 @@
2453
2454 namespace mir
2455 {
2456+namespace graphics { class Renderable; }
2457 namespace compositor
2458 {
2459-class BufferStream;
2460-class CompositingCriteria;
2461
2462 class FilterForScene
2463 {
2464 public:
2465 virtual ~FilterForScene() {}
2466
2467- virtual bool operator()(CompositingCriteria const&) = 0;
2468+ virtual bool operator()(graphics::Renderable const&) = 0;
2469
2470 protected:
2471 FilterForScene() = default;
2472@@ -49,7 +48,7 @@
2473 public:
2474 virtual ~OperatorForScene() {}
2475
2476- virtual void operator()(CompositingCriteria const&, BufferStream&) = 0;
2477+ virtual void operator()(graphics::Renderable const&) = 0;
2478
2479 protected:
2480 OperatorForScene() = default;
2481
2482=== modified file 'include/server/mir/default_server_configuration.h'
2483--- include/server/mir/default_server_configuration.h 2014-01-29 18:02:33 +0000
2484+++ include/server/mir/default_server_configuration.h 2014-03-06 09:14:28 +0000
2485@@ -1,5 +1,5 @@
2486 /*
2487- * Copyright © 2012 Canonical Ltd.
2488+ * Copyright © 2012-2014 Canonical Ltd.
2489 *
2490 * This program is free software: you can redistribute it and/or modify it
2491 * under the terms of the GNU General Public License version 3,
2492@@ -20,7 +20,6 @@
2493
2494 #include "mir/cached_ptr.h"
2495 #include "mir/server_configuration.h"
2496-#include "mir/default_configuration_options.h"
2497
2498 #include <memory>
2499 #include <string>
2500@@ -114,10 +113,22 @@
2501 class Logger;
2502 }
2503
2504-class DefaultServerConfiguration : public virtual ServerConfiguration, protected DefaultConfigurationOptions
2505+namespace options
2506+{
2507+class Option;
2508+class Configuration;
2509+}
2510+
2511+namespace report
2512+{
2513+class ReportFactory;
2514+}
2515+
2516+class DefaultServerConfiguration : public virtual ServerConfiguration
2517 {
2518 public:
2519 DefaultServerConfiguration(int argc, char const* argv[]);
2520+ explicit DefaultServerConfiguration(std::shared_ptr<options::Configuration> const& configuration_options);
2521
2522 /** @name DisplayServer dependencies
2523 * dependencies of DisplayServer on the rest of the Mir
2524@@ -235,9 +246,7 @@
2525 virtual std::shared_ptr<time::Clock> the_clock();
2526
2527 protected:
2528- using DefaultConfigurationOptions::the_options;
2529- using DefaultConfigurationOptions::add_options;
2530- using DefaultConfigurationOptions::parse_options;
2531+ std::shared_ptr<options::Option> the_options() const;
2532
2533 virtual std::shared_ptr<input::InputChannelFactory> the_input_channel_factory();
2534 virtual std::shared_ptr<scene::MediatingDisplayChanger> the_mediating_display_changer();
2535@@ -297,6 +306,7 @@
2536 CachedPtr<scene::MediatingDisplayChanger> mediating_display_changer;
2537
2538 private:
2539+ std::shared_ptr<options::Configuration> const configuration_options;
2540 std::shared_ptr<input::EventFilter> const default_filter;
2541
2542 virtual std::string the_socket_file() const;
2543@@ -313,7 +323,8 @@
2544 std::shared_ptr<scene::SessionManager> the_session_manager();
2545 std::shared_ptr<scene::SurfaceBuilder> the_surface_builder();
2546 std::shared_ptr<scene::SurfaceController> the_surface_controller();
2547- std::function<void()> force_threads_to_unblock_callback();
2548+
2549+ auto report_factory(char const* report_opt) -> std::unique_ptr<report::ReportFactory>;
2550 };
2551 }
2552
2553
2554=== modified file 'include/server/mir/frontend/connector_report.h'
2555--- include/server/mir/frontend/connector_report.h 2013-09-27 16:07:00 +0000
2556+++ include/server/mir/frontend/connector_report.h 2014-03-06 09:14:28 +0000
2557@@ -50,21 +50,6 @@
2558 ConnectorReport& operator=(const ConnectorReport&) = delete;
2559 };
2560
2561-class NullConnectorReport : public ConnectorReport
2562-{
2563-public:
2564- void thread_start() override;
2565- void thread_end() override;
2566- void starting_threads(int count) override;
2567- void stopping_threads(int count) override;
2568-
2569- void creating_session_for(int socket_handle) override;
2570- void creating_socket_pair(int server_handle, int client_handle) override;
2571-
2572- void listening_on(std::string const& endpoint) override;
2573-
2574- void error(std::exception const& error) override;
2575-};
2576 }
2577 }
2578
2579
2580=== modified file 'include/server/mir/frontend/session_mediator_report.h'
2581--- include/server/mir/frontend/session_mediator_report.h 2013-09-24 07:02:12 +0000
2582+++ include/server/mir/frontend/session_mediator_report.h 2014-03-06 09:14:28 +0000
2583@@ -54,30 +54,6 @@
2584 std::string const& what) = 0;
2585 };
2586
2587-// Do-nothing implementation to satisfy dependencies
2588-class NullSessionMediatorReport : public SessionMediatorReport
2589-{
2590- virtual void session_connect_called(std::string const& app_name);
2591-
2592- virtual void session_create_surface_called(std::string const& app_name);
2593-
2594- virtual void session_next_buffer_called(std::string const& app_name);
2595-
2596- virtual void session_release_surface_called(std::string const& app_name);
2597-
2598- virtual void session_disconnect_called(std::string const& app_name);
2599-
2600- virtual void session_drm_auth_magic_called(std::string const& app_name);
2601-
2602- virtual void session_configure_surface_called(std::string const& app_name);
2603-
2604- virtual void session_configure_display_called(std::string const& app_name);
2605-
2606- virtual void session_error(
2607- std::string const& app_name,
2608- char const* method,
2609- std::string const& what);
2610-};
2611 }
2612 }
2613
2614
2615=== modified file 'include/server/mir/input/surface.h'
2616--- include/server/mir/input/surface.h 2014-01-13 06:12:33 +0000
2617+++ include/server/mir/input/surface.h 2014-03-06 09:14:28 +0000
2618@@ -31,7 +31,7 @@
2619 {
2620 public:
2621 virtual std::string const& name() const = 0;
2622- virtual geometry::Point position() const = 0;
2623+ virtual geometry::Point top_left() const = 0;
2624 virtual geometry::Size size() const = 0;
2625 virtual bool contains(geometry::Point const& point) const = 0;
2626
2627
2628=== added directory 'include/server/mir/logging'
2629=== renamed file 'include/server/mir/logging/glog_logger.h' => 'include/server/mir/logging/glog_logger.h'
2630=== removed directory 'include/server/mir/lttng'
2631=== added directory 'include/server/mir/report'
2632=== added file 'include/server/mir/report/legacy_input_report.h'
2633--- include/server/mir/report/legacy_input_report.h 1970-01-01 00:00:00 +0000
2634+++ include/server/mir/report/legacy_input_report.h 2014-03-06 09:14:28 +0000
2635@@ -0,0 +1,39 @@
2636+/*
2637+ * Copyright © 2014 Canonical Ltd.
2638+ *
2639+ * This program is free software: you can redistribute it and/or modify it
2640+ * under the terms of the GNU General Public License version 3,
2641+ * as published by the Free Software Foundation.
2642+ *
2643+ * This program is distributed in the hope that it will be useful,
2644+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
2645+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2646+ * GNU General Public License for more details.
2647+ *
2648+ * You should have received a copy of the GNU General Public License
2649+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
2650+ *
2651+ * Authored by: Andreas Pokorny <andreas.pokorny@canonical.com>
2652+ */
2653+
2654+#ifndef MIR_REPORT_LEGACY_INPUT_REPORT_H_
2655+#define MIR_REPORT_LEGACY_INPUT_REPORT_H_
2656+
2657+#include <memory>
2658+
2659+namespace mir
2660+{
2661+namespace logging
2662+{
2663+class Logger;
2664+}
2665+namespace report
2666+{
2667+namespace legacy_input
2668+{
2669+void initialize(std::shared_ptr<mir::logging::Logger> const& logger);
2670+}
2671+}
2672+}
2673+
2674+#endif // MIR_REPORT_LEGACY_INPUT_REPORT_H_
2675
2676=== renamed directory 'include/server/mir/logging' => 'include/server/mir/report/logging'
2677=== modified file 'include/server/mir/scene/scene_report.h'
2678--- include/server/mir/scene/scene_report.h 2014-01-13 06:12:33 +0000
2679+++ include/server/mir/scene/scene_report.h 2014-03-06 09:14:28 +0000
2680@@ -26,16 +26,15 @@
2681 {
2682 namespace scene
2683 {
2684-class BasicSurface;
2685-
2686 class SceneReport
2687 {
2688 public:
2689- virtual void surface_created(BasicSurface* const surface) = 0;
2690- virtual void surface_added(BasicSurface* const surface) = 0;
2691+ typedef void* BasicSurfaceId;
2692+ virtual void surface_created(BasicSurfaceId id, std::string const& name) = 0;
2693+ virtual void surface_added(BasicSurfaceId id, std::string const& name) = 0;
2694
2695- virtual void surface_removed(BasicSurface* const surface) = 0;
2696- virtual void surface_deleted(BasicSurface* const surface) = 0;
2697+ virtual void surface_removed(BasicSurfaceId id, std::string const& name) = 0;
2698+ virtual void surface_deleted(BasicSurfaceId id, std::string const& name) = 0;
2699
2700 protected:
2701 SceneReport() = default;
2702@@ -44,17 +43,7 @@
2703 SceneReport& operator=(SceneReport const&) = delete;
2704 };
2705
2706-class NullSceneReport : public SceneReport
2707-{
2708-public:
2709- virtual void surface_created(BasicSurface* const /*surface*/) override;
2710- virtual void surface_added(BasicSurface* const /*surface*/) override;
2711-
2712- virtual void surface_removed(BasicSurface* const /*surface*/) override;
2713- virtual void surface_deleted(BasicSurface* const /*surface*/) override;
2714-};
2715-}
2716-}
2717-
2718+}
2719+}
2720
2721 #endif /* MIR_SCENE_SCENE_REPORT_H_ */
2722
2723=== modified file 'include/server/mir/shell/session.h'
2724--- include/server/mir/shell/session.h 2014-02-07 12:56:44 +0000
2725+++ include/server/mir/shell/session.h 2014-03-06 09:14:28 +0000
2726@@ -33,7 +33,6 @@
2727 class Session : public frontend::Session
2728 {
2729 public:
2730- virtual std::string name() const = 0;
2731 virtual void force_requests_to_complete() = 0;
2732 virtual pid_t process_id() const = 0;
2733
2734
2735=== added directory 'include/shared/mir/logging'
2736=== removed directory 'include/shared/mir/logging'
2737=== renamed file 'include/shared/mir/logging/dumb_console_logger.h' => 'include/shared/mir/logging/dumb_console_logger.h'
2738=== renamed file 'include/shared/mir/logging/input_timestamp.h' => 'include/shared/mir/logging/input_timestamp.h'
2739=== renamed file 'include/shared/mir/logging/logger.h' => 'include/shared/mir/logging/logger.h'
2740=== added directory 'include/shared/mir/report'
2741=== renamed directory 'include/shared/mir/lttng' => 'include/shared/mir/report/lttng'
2742=== modified file 'include/shared/mir/report/lttng/mir_tracepoint.h'
2743--- include/shared/mir/lttng/mir_tracepoint.h 2013-06-03 12:15:44 +0000
2744+++ include/shared/mir/report/lttng/mir_tracepoint.h 2014-03-06 09:14:28 +0000
2745@@ -27,7 +27,6 @@
2746 *
2747 * See: http://sourceware.org/bugzilla/show_bug.cgi?id=13974
2748 */
2749-
2750 #ifdef __clang__
2751 namespace mir_systemtap_bug_13974
2752 {
2753@@ -36,7 +35,7 @@
2754 #define mir_tracepoint(c, e, ...) ::mir_systemtap_bug_13974::mir_tracepoint_consume_args(0, __VA_ARGS__)
2755 #pragma message "Building with clang: Disabling LTTng tracepoints."
2756 #else
2757-#define mir_tracepoint(c, e, ...) tracepoint(c, e, __VA_ARGS__)
2758+#define mir_tracepoint(c, ...) tracepoint(c, __VA_ARGS__)
2759 #endif
2760
2761 #endif /* MIR_LTTNG_MIR_TRACEPOINT_H_ */
2762
2763=== modified file 'include/shared/mir/report/lttng/tracepoint_provider.h'
2764--- include/shared/mir/lttng/tracepoint_provider.h 2013-06-04 10:47:05 +0000
2765+++ include/shared/mir/report/lttng/tracepoint_provider.h 2014-03-06 09:14:28 +0000
2766@@ -16,13 +16,15 @@
2767 * Authored by: Alexandros Frantzis <alexandros.frantzis@canonical.com>
2768 */
2769
2770-#ifndef MIR_LTTNG_TRACEPOINT_PROVIDER_H_
2771-#define MIR_LTTNG_TRACEPOINT_PROVIDER_H_
2772+#ifndef MIR_REPORT_LTTNG_TRACEPOINT_PROVIDER_H_
2773+#define MIR_REPORT_LTTNG_TRACEPOINT_PROVIDER_H_
2774
2775 #include <string>
2776
2777 namespace mir
2778 {
2779+namespace report
2780+{
2781 namespace lttng
2782 {
2783
2784@@ -41,5 +43,6 @@
2785
2786 }
2787 }
2788+}
2789
2790-#endif /* MIR_LTTNG_TRACEPOINT_PROVIDER_H_ */
2791+#endif /* MIR_REPORT_LTTNG_TRACEPOINT_PROVIDER_H_ */
2792
2793=== renamed file 'include/server/mir/shared_library.h' => 'include/shared/mir/shared_library.h'
2794--- include/server/mir/shared_library.h 2013-06-21 10:07:40 +0000
2795+++ include/shared/mir/shared_library.h 2014-03-06 09:14:28 +0000
2796@@ -2,15 +2,15 @@
2797 * Copyright © 2013 Canonical Ltd.
2798 *
2799 * This program is free software: you can redistribute it and/or modify it
2800- * under the terms of the GNU General Public License version 3,
2801+ * under the terms of the GNU Lesser General Public License version 3,
2802 * as published by the Free Software Foundation.
2803 *
2804 * This program is distributed in the hope that it will be useful,
2805 * but WITHOUT ANY WARRANTY; without even the implied warranty of
2806 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2807- * GNU General Public License for more details.
2808+ * GNU Lesser General Public License for more details.
2809 *
2810- * You should have received a copy of the GNU General Public License
2811+ * You should have received a copy of the GNU Lesser General Public License
2812 * along with this program. If not, see <http://www.gnu.org/licenses/>.
2813 *
2814 * Authored by: Alan Griffiths <alan@octopull.co.uk>
2815
2816=== renamed directory 'include/test/mir_test/draw' => 'include/shared/testdraw'
2817=== modified file 'include/shared/testdraw/draw_pattern_checkered-inl.h'
2818--- include/test/mir_test/draw/draw_pattern_checkered-inl.h 2014-01-13 06:12:33 +0000
2819+++ include/shared/testdraw/draw_pattern_checkered-inl.h 2014-03-06 09:14:28 +0000
2820@@ -2,15 +2,15 @@
2821 * Copyright © 2012 Canonical Ltd.
2822 *
2823 * This program is free software: you can redistribute it and/or modify it
2824- * under the terms of the GNU General Public License version 3,
2825+ * under the terms of the GNU Lesser General Public License version 3,
2826 * as published by the Free Software Foundation.
2827 *
2828 * This program is distributed in the hope that it will be useful,
2829 * but WITHOUT ANY WARRANTY; without even the implied warranty of
2830 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2831- * GNU General Public License for more details.
2832+ * GNU Lesser General Public License for more details.
2833 *
2834- * You should have received a copy of the GNU General Public License
2835+ * You should have received a copy of the GNU Lesser General Public License
2836 * along with this program. If not, see <http://www.gnu.org/licenses/>.
2837 *
2838 * Authored by: Kevin DuBois <kevin.dubois@canonical.com>
2839
2840=== renamed file 'include/test/mir_test/draw/android_graphics.h' => 'include/shared/testdraw/graphics_region_factory.h'
2841--- include/test/mir_test/draw/android_graphics.h 2014-01-13 06:12:33 +0000
2842+++ include/shared/testdraw/graphics_region_factory.h 2014-03-06 09:14:28 +0000
2843@@ -2,58 +2,49 @@
2844 * Copyright © 2012 Canonical Ltd.
2845 *
2846 * This program is free software: you can redistribute it and/or modify it
2847- * under the terms of the GNU General Public License version 3,
2848+ * under the terms of the GNU Lesser General Public License version 3,
2849 * as published by the Free Software Foundation.
2850 *
2851 * This program is distributed in the hope that it will be useful,
2852 * but WITHOUT ANY WARRANTY; without even the implied warranty of
2853 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2854- * GNU General Public License for more details.
2855+ * GNU Lesser General Public License for more details.
2856 *
2857- * You should have received a copy of the GNU General Public License
2858+ * You should have received a copy of the GNU Lesser General Public License
2859 * along with this program. If not, see <http://www.gnu.org/licenses/>.
2860 *
2861 * Authored by: Kevin DuBois <kevin.dubois@canonical.com>
2862 */
2863-#ifndef MIR_TEST_DRAW_ANDROID_GRAPHICS
2864-#define MIR_TEST_DRAW_ANDROID_GRAPHICS
2865+#ifndef MIR_TEST_DRAW_GRAPHICS_REGION_FACTORY
2866+#define MIR_TEST_DRAW_GRAPHICS_REGION_FACTORY
2867
2868+#include "mir/graphics/native_buffer.h"
2869 #include "mir_toolkit/mir_client_library.h"
2870-#include "mir/compositor/buffer_stream.h"
2871-#include "mir/geometry/size.h"
2872-
2873-#include <hardware/gralloc.h>
2874 #include <memory>
2875
2876 namespace mir
2877 {
2878-namespace compositor
2879-{
2880- class BufferIPCPackage;
2881-}
2882 namespace test
2883 {
2884 namespace draw
2885 {
2886
2887-class TestGrallocMapper
2888+class GraphicsRegionFactory
2889 {
2890 public:
2891- TestGrallocMapper();
2892- TestGrallocMapper(const hw_module_t *hw_module, alloc_device_t* alloc_dev);
2893- ~TestGrallocMapper();
2894- std::shared_ptr<MirGraphicsRegion> graphic_region_from_handle(ANativeWindowBuffer* package);
2895-
2896-private:
2897- TestGrallocMapper(TestGrallocMapper const&) = delete;
2898- TestGrallocMapper& operator=(TestGrallocMapper const&) = delete;
2899-
2900- const bool gralloc_ownership;
2901- gralloc_module_t* module;
2902- alloc_device_t* alloc_dev;
2903+ virtual ~GraphicsRegionFactory() {}
2904+ virtual std::shared_ptr<MirGraphicsRegion> graphic_region_from_handle(
2905+ graphics::NativeBuffer const& native_buffer) = 0;
2906+
2907+protected:
2908+ GraphicsRegionFactory() = default;
2909+ GraphicsRegionFactory(GraphicsRegionFactory const&) = delete;
2910+ GraphicsRegionFactory& operator=(GraphicsRegionFactory const&) = delete;
2911 };
2912
2913-}
2914-}
2915-}
2916-#endif /* MIR_TEST_DRAW_ANDROID_GRAPHICS */
2917+std::shared_ptr<GraphicsRegionFactory> create_graphics_region_factory();
2918+
2919+}
2920+}
2921+}
2922+#endif /* MIR_TEST_DRAW_GRAPHICS_REGION_FACTORY */
2923
2924=== modified file 'include/shared/testdraw/patterns.h'
2925--- include/test/mir_test/draw/patterns.h 2013-10-14 20:35:46 +0000
2926+++ include/shared/testdraw/patterns.h 2014-03-06 09:14:28 +0000
2927@@ -2,15 +2,15 @@
2928 * Copyright © 2012 Canonical Ltd.
2929 *
2930 * This program is free software: you can redistribute it and/or modify it
2931- * under the terms of the GNU General Public License version 3,
2932+ * under the terms of the GNU Lesser General Public License version 3,
2933 * as published by the Free Software Foundation.
2934 *
2935 * This program is distributed in the hope that it will be useful,
2936 * but WITHOUT ANY WARRANTY; without even the implied warranty of
2937 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2938- * GNU General Public License for more details.
2939+ * GNU Lesser General Public License for more details.
2940 *
2941- * You should have received a copy of the GNU General Public License
2942+ * You should have received a copy of the GNU Lesser General Public License
2943 * along with this program. If not, see <http://www.gnu.org/licenses/>.
2944 *
2945 * Authored by: Kevin DuBois <kevin.dubois@canonical.com>
2946@@ -72,7 +72,7 @@
2947 private:
2948 uint32_t color_pattern [Rows][Cols];
2949 };
2950-#include "mir_test/draw/draw_pattern_checkered-inl.h"
2951+#include "draw_pattern_checkered-inl.h"
2952
2953 }
2954 }
2955
2956=== renamed file 'include/test/mir_test_doubles/stub_compositing_criteria.h' => 'include/test/mir_test_doubles/fake_renderable.h'
2957--- include/test/mir_test_doubles/stub_compositing_criteria.h 2013-10-15 08:53:10 +0000
2958+++ include/test/mir_test_doubles/fake_renderable.h 2014-03-06 09:14:28 +0000
2959@@ -16,10 +16,10 @@
2960 * Authored by: Daniel van Vugt <daniel.van.vugt@canonical.com>
2961 */
2962
2963-#ifndef MIR_TEST_DOUBLES_STUB_COMPOSITING_CRITERIA_H_
2964-#define MIR_TEST_DOUBLES_STUB_COMPOSITING_CRITERIA_H_
2965+#ifndef MIR_TEST_DOUBLES_FAKE_RENDERABLE_H_
2966+#define MIR_TEST_DOUBLES_FAKE_RENDERABLE_H_
2967
2968-#include "mir/compositor/compositing_criteria.h"
2969+#include "mir/graphics/renderable.h"
2970 #include <glm/gtc/matrix_transform.hpp>
2971 #include <gmock/gmock.h>
2972
2973@@ -30,14 +30,14 @@
2974 namespace doubles
2975 {
2976
2977-class StubCompositingCriteria : public compositor::CompositingCriteria
2978+class FakeRenderable : public graphics::Renderable
2979 {
2980 public:
2981- StubCompositingCriteria(int x, int y, int width, int height,
2982- float opacity=1.0f,
2983- bool rectangular=true,
2984- bool visible=true,
2985- bool posted=true)
2986+ FakeRenderable(int x, int y, int width, int height,
2987+ float opacity=1.0f,
2988+ bool rectangular=true,
2989+ bool visible=true,
2990+ bool posted=true)
2991 : rect{{x, y}, {width, height}},
2992 opacity(opacity),
2993 rectangular(rectangular),
2994@@ -55,7 +55,7 @@
2995 return opacity;
2996 }
2997
2998- glm::mat4 const& transformation() const override
2999+ glm::mat4 transformation() const override
3000 {
3001 return trans;
3002 }
3003@@ -70,7 +70,33 @@
3004 return !rectangular;
3005 }
3006
3007+ void set_buffer(std::shared_ptr<graphics::Buffer> b)
3008+ {
3009+ buf = b;
3010+ }
3011+
3012+ std::shared_ptr<graphics::Buffer> buffer(unsigned long) const override
3013+ {
3014+ return buf;
3015+ }
3016+
3017+ bool alpha_enabled() const override
3018+ {
3019+ return shaped() || alpha() < 1.0f;
3020+ }
3021+
3022+ geometry::Rectangle screen_position() const override
3023+ {
3024+ return rect;
3025+ }
3026+
3027+ int buffers_ready_for_compositor() const override
3028+ {
3029+ return 1;
3030+ }
3031+
3032 private:
3033+ std::shared_ptr<graphics::Buffer> buf;
3034 mir::geometry::Rectangle rect;
3035 glm::mat4 trans;
3036 float opacity;
3037@@ -82,4 +108,4 @@
3038 } // namespace doubles
3039 } // namespace test
3040 } // namespace mir
3041-#endif // MIR_TEST_DOUBLES_STUB_COMPOSITING_CRITERIA_H_
3042+#endif // MIR_TEST_DOUBLES_FAKE_RENDERABLE_H_
3043
3044=== modified file 'include/test/mir_test_doubles/mock_buffer_bundle.h'
3045--- include/test/mir_test_doubles/mock_buffer_bundle.h 2014-01-31 14:13:36 +0000
3046+++ include/test/mir_test_doubles/mock_buffer_bundle.h 2014-03-06 09:14:28 +0000
3047@@ -48,6 +48,7 @@
3048 MOCK_METHOD0(force_client_abort, void());
3049 MOCK_METHOD0(force_requests_to_complete, void());
3050 MOCK_METHOD1(resize, void(const geometry::Size &));
3051+ int buffers_ready_for_compositor() const override { return 1; }
3052 };
3053
3054 }
3055
3056=== modified file 'include/test/mir_test_doubles/mock_buffer_stream.h'
3057--- include/test/mir_test_doubles/mock_buffer_stream.h 2014-02-04 14:00:58 +0000
3058+++ include/test/mir_test_doubles/mock_buffer_stream.h 2014-03-06 09:14:28 +0000
3059@@ -42,6 +42,7 @@
3060 MOCK_METHOD0(force_client_completion, void());
3061 MOCK_METHOD1(allow_framedropping, void(bool));
3062 MOCK_METHOD0(force_requests_to_complete, void());
3063+ int buffers_ready_for_compositor() const override { return 1; }
3064 };
3065 }
3066 }
3067
3068=== removed file 'include/test/mir_test_doubles/mock_compositing_criteria.h'
3069--- include/test/mir_test_doubles/mock_compositing_criteria.h 2013-10-07 07:56:05 +0000
3070+++ include/test/mir_test_doubles/mock_compositing_criteria.h 1970-01-01 00:00:00 +0000
3071@@ -1,45 +0,0 @@
3072-/*
3073- * Copyright © 2013 Canonical Ltd.
3074- *
3075- * This program is free software: you can redistribute it and/or modify it
3076- * under the terms of the GNU General Public License version 3,
3077- * as published by the Free Software Foundation.
3078- *
3079- * This program is distributed in the hope that it will be useful,
3080- * but WITHOUT ANY WARRANTY; without even the implied warranty of
3081- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3082- * GNU General Public License for more details.
3083- *
3084- * You should have received a copy of the GNU General Public License
3085- * along with this program. If not, see <http://www.gnu.org/licenses/>.
3086- *
3087- * Authored by: Kevin DuBois <kevin.dubois@canonical.com>
3088- */
3089-
3090-#ifndef MIR_TEST_DOUBLES_MOCK_COMPOSITING_CRITERIA_H_
3091-#define MIR_TEST_DOUBLES_MOCK_COMPOSITING_CRITERIA_H_
3092-
3093-#include "mir/compositor/compositing_criteria.h"
3094-#include <gmock/gmock.h>
3095-
3096-namespace mir
3097-{
3098-namespace test
3099-{
3100-namespace doubles
3101-{
3102-
3103-class MockCompositingCriteria : public compositor::CompositingCriteria
3104-{
3105-public:
3106- ~MockCompositingCriteria() noexcept {}
3107- MOCK_CONST_METHOD0(alpha, float());
3108- MOCK_CONST_METHOD0(transformation, glm::mat4 const&());
3109- MOCK_CONST_METHOD1(should_be_rendered_in, bool(geometry::Rectangle const&));
3110- MOCK_CONST_METHOD0(shaped, bool());
3111-};
3112-
3113-}
3114-}
3115-}
3116-#endif /* MIR_TEST_DOUBLES_MOCK_COMPOSITING_CRITERIA_H_ */
3117
3118=== modified file 'include/test/mir_test_doubles/mock_display_device.h'
3119--- include/test/mir_test_doubles/mock_display_device.h 2014-01-23 17:26:51 +0000
3120+++ include/test/mir_test_doubles/mock_display_device.h 2014-03-06 09:14:28 +0000
3121@@ -38,6 +38,7 @@
3122 MOCK_METHOD1(prepare_gl_and_overlays, void(std::list<std::shared_ptr<graphics::Renderable>> const&));
3123 MOCK_METHOD2(gpu_render, void(EGLDisplay, EGLSurface));
3124 MOCK_METHOD1(post, void(graphics::Buffer const&));
3125+ MOCK_CONST_METHOD1(apply_orientation, bool(MirOrientation));
3126 };
3127 }
3128 }
3129
3130=== modified file 'include/test/mir_test_doubles/mock_drm.h'
3131--- include/test/mir_test_doubles/mock_drm.h 2013-08-28 03:41:48 +0000
3132+++ include/test/mir_test_doubles/mock_drm.h 2014-03-06 09:14:28 +0000
3133@@ -88,6 +88,7 @@
3134 MockDRM();
3135 ~MockDRM() noexcept;
3136
3137+ MOCK_METHOD3(open, int(char const* path, int flags, mode_t mode));
3138 MOCK_METHOD2(drmOpen, int(const char *name, const char *busid));
3139 MOCK_METHOD1(drmClose, int(int fd));
3140 MOCK_METHOD3(drmIoctl, int(int fd, unsigned long request, void *arg));
3141
3142=== modified file 'include/test/mir_test_doubles/mock_gl.h'
3143--- include/test/mir_test_doubles/mock_gl.h 2014-01-13 06:12:33 +0000
3144+++ include/test/mir_test_doubles/mock_gl.h 2014-03-06 09:14:28 +0000
3145@@ -52,6 +52,7 @@
3146 MOCK_METHOD1(glCreateShader, GLuint(GLenum));
3147 MOCK_METHOD2(glDeleteBuffers, void(GLsizei, const GLuint *));
3148 MOCK_METHOD2(glDeleteFramebuffers, void(GLsizei, const GLuint *));
3149+ MOCK_METHOD2(glDeleteRenderbuffers, void(GLsizei, const GLuint *));
3150 MOCK_METHOD1(glDeleteProgram, void(GLuint));
3151 MOCK_METHOD1(glDeleteShader, void(GLuint));
3152 MOCK_METHOD2(glDeleteTextures, void(GLsizei, const GLuint *));
3153@@ -100,6 +101,7 @@
3154 void(GLuint, GLint, GLenum, GLboolean, GLsizei,
3155 const GLvoid *));
3156 MOCK_METHOD4(glViewport, void(GLint, GLint, GLsizei, GLsizei));
3157+ MOCK_METHOD0(glFinish, void());
3158 };
3159
3160 }
3161
3162=== modified file 'include/test/mir_test_doubles/mock_hwc_composer_device_1.h'
3163--- include/test/mir_test_doubles/mock_hwc_composer_device_1.h 2014-01-29 18:54:06 +0000
3164+++ include/test/mir_test_doubles/mock_hwc_composer_device_1.h 2014-03-06 09:14:28 +0000
3165@@ -44,6 +44,8 @@
3166 external_set = false;
3167 virtual_prepare = false;
3168 virtual_set = false;
3169+ fb_fence = -1;
3170+ retire_fence = -1;
3171
3172 common.version = HWC_DEVICE_API_VERSION_1_1;
3173
3174
3175=== modified file 'include/test/mir_test_doubles/mock_input_surface.h'
3176--- include/test/mir_test_doubles/mock_input_surface.h 2014-01-13 06:12:33 +0000
3177+++ include/test/mir_test_doubles/mock_input_surface.h 2014-03-06 09:14:28 +0000
3178@@ -35,7 +35,7 @@
3179 MockInputSurface()
3180 {
3181 using namespace testing;
3182- ON_CALL(*this, position())
3183+ ON_CALL(*this, top_left())
3184 .WillByDefault(
3185 Return(geometry::Point{}));
3186 ON_CALL(*this, size())
3187@@ -46,7 +46,7 @@
3188 .WillByDefault(testing::ReturnRef(n));
3189 }
3190 ~MockInputSurface() noexcept {}
3191- MOCK_CONST_METHOD0(position, geometry::Point());
3192+ MOCK_CONST_METHOD0(top_left, geometry::Point());
3193 MOCK_CONST_METHOD0(size, geometry::Size());
3194 MOCK_CONST_METHOD0(name, std::string const&());
3195 MOCK_CONST_METHOD1(contains, bool(geometry::Point const&));
3196
3197=== modified file 'include/test/mir_test_doubles/mock_renderable.h'
3198--- include/test/mir_test_doubles/mock_renderable.h 2014-01-22 18:15:53 +0000
3199+++ include/test/mir_test_doubles/mock_renderable.h 2014-03-06 09:14:28 +0000
3200@@ -30,9 +30,14 @@
3201 {
3202 struct MockRenderable : public graphics::Renderable
3203 {
3204- MOCK_CONST_METHOD0(buffer, std::shared_ptr<graphics::Buffer>());
3205+ MOCK_CONST_METHOD1(buffer, std::shared_ptr<graphics::Buffer>(unsigned long));
3206 MOCK_CONST_METHOD0(alpha_enabled, bool());
3207 MOCK_CONST_METHOD0(screen_position, geometry::Rectangle());
3208+ MOCK_CONST_METHOD0(alpha, float());
3209+ MOCK_CONST_METHOD0(transformation, glm::mat4());
3210+ MOCK_CONST_METHOD1(should_be_rendered_in, bool(geometry::Rectangle const& rect));
3211+ MOCK_CONST_METHOD0(shaped, bool());
3212+ int buffers_ready_for_compositor() const override { return 1; }
3213 };
3214 }
3215 }
3216
3217=== renamed file 'include/test/mir_test_doubles/mock_surface_renderer.h' => 'include/test/mir_test_doubles/mock_renderer.h'
3218--- include/test/mir_test_doubles/mock_surface_renderer.h 2014-01-14 07:02:27 +0000
3219+++ include/test/mir_test_doubles/mock_renderer.h 2014-03-06 09:14:28 +0000
3220@@ -15,10 +15,10 @@
3221 *
3222 * Authored by: Kevin DuBois <kevin.dubois@canonical.com>
3223 */
3224-#ifndef MIR_TEST_DOUBLES_MOCK_SURFACE_RENDERER_H_
3225-#define MIR_TEST_DOUBLES_MOCK_SURFACE_RENDERER_H_
3226+#ifndef MIR_TEST_DOUBLES_MOCK_RENDERER_H_
3227+#define MIR_TEST_DOUBLES_MOCK_RENDERER_H_
3228
3229-#include "src/server/compositor/renderer.h"
3230+#include "mir/compositor/renderer.h"
3231
3232 #include <gmock/gmock.h>
3233
3234@@ -29,17 +29,19 @@
3235 namespace doubles
3236 {
3237
3238-struct MockSurfaceRenderer : public compositor::Renderer
3239+struct MockRenderer : public compositor::Renderer
3240 {
3241- MOCK_CONST_METHOD1(begin, void(float));
3242- MOCK_CONST_METHOD2(render, void(compositor::CompositingCriteria const&, graphics::Buffer&));
3243+ MOCK_METHOD1(set_viewport, void(geometry::Rectangle const&));
3244+ MOCK_METHOD1(set_rotation, void(float));
3245+ MOCK_CONST_METHOD0(begin, void());
3246+ MOCK_CONST_METHOD2(render, void(graphics::Renderable const&, graphics::Buffer&));
3247 MOCK_CONST_METHOD0(end, void());
3248 MOCK_METHOD0(suspend, void());
3249
3250- ~MockSurfaceRenderer() noexcept {}
3251+ ~MockRenderer() noexcept {}
3252 };
3253
3254 }
3255 }
3256 }
3257-#endif /* MIR_TEST_DOUBLES_MOCK_SURFACE_RENDERER_H_ */
3258+#endif /* MIR_TEST_DOUBLES_MOCK_RENDERER_H_ */
3259
3260=== modified file 'include/test/mir_test_doubles/null_display_configuration.h'
3261--- include/test/mir_test_doubles/null_display_configuration.h 2014-01-13 04:16:45 +0000
3262+++ include/test/mir_test_doubles/null_display_configuration.h 2014-03-06 09:14:28 +0000
3263@@ -35,7 +35,7 @@
3264 void for_each_output(std::function<void(graphics::DisplayConfigurationOutput const&)>) const override
3265 {
3266 }
3267- void configure_output(graphics::DisplayConfigurationOutputId, bool, geometry::Point, size_t, MirPixelFormat, MirPowerMode, MirOrientation) override
3268+ void for_each_output(std::function<void(graphics::UserDisplayConfigurationOutput&)>) override
3269 {
3270 }
3271 };
3272
3273=== modified file 'include/test/mir_test_doubles/stub_buffer.h'
3274--- include/test/mir_test_doubles/stub_buffer.h 2014-01-21 23:22:46 +0000
3275+++ include/test/mir_test_doubles/stub_buffer.h 2014-03-06 09:14:28 +0000
3276@@ -39,20 +39,31 @@
3277 {
3278 public:
3279 StubBuffer()
3280- : buf_size{0, 0},
3281- buf_pixel_format{mir_pixel_format_abgr_8888}
3282+ : StubBuffer{
3283+ graphics::BufferProperties{
3284+ geometry::Size{},
3285+ mir_pixel_format_abgr_8888,
3286+ graphics::BufferUsage::hardware}}
3287+
3288 {
3289 }
3290
3291 StubBuffer(graphics::BufferProperties const& properties)
3292+ : StubBuffer{properties, geometry::Stride{}}
3293+ {
3294+ }
3295+
3296+ StubBuffer(graphics::BufferProperties const& properties,
3297+ geometry::Stride stride)
3298 : buf_size{properties.size},
3299- buf_pixel_format{properties.format}
3300+ buf_pixel_format{properties.format},
3301+ buf_stride{stride}
3302 {
3303 }
3304
3305 virtual geometry::Size size() const { return buf_size; }
3306
3307- virtual geometry::Stride stride() const { return geometry::Stride(); }
3308+ virtual geometry::Stride stride() const { return buf_stride; }
3309
3310 virtual MirPixelFormat pixel_format() const { return buf_pixel_format; }
3311
3312@@ -70,6 +81,7 @@
3313
3314 geometry::Size const buf_size;
3315 MirPixelFormat const buf_pixel_format;
3316+ geometry::Stride const buf_stride;
3317 };
3318 }
3319 }
3320
3321=== modified file 'include/test/mir_test_doubles/stub_buffer_stream.h'
3322--- include/test/mir_test_doubles/stub_buffer_stream.h 2014-02-04 14:00:58 +0000
3323+++ include/test/mir_test_doubles/stub_buffer_stream.h 2014-03-06 09:14:28 +0000
3324@@ -72,6 +72,8 @@
3325 {
3326 }
3327
3328+ int buffers_ready_for_compositor() const override { return 1; }
3329+
3330 StubBuffer stub_client_buffer;
3331 std::shared_ptr<graphics::Buffer> stub_compositor_buffer;
3332 };
3333
3334=== modified file 'include/test/mir_test_doubles/stub_display_builder.h'
3335--- include/test/mir_test_doubles/stub_display_builder.h 2014-01-13 06:12:33 +0000
3336+++ include/test/mir_test_doubles/stub_display_builder.h 2014-03-06 09:14:28 +0000
3337@@ -20,8 +20,7 @@
3338 #define MIR_TEST_DOUBLES_STUB_DISPLAY_BUILDER_H_
3339
3340 #include "src/platform/graphics/android/display_builder.h"
3341-#include "stub_display_buffer.h"
3342-#include "stub_display_device.h"
3343+#include "src/platform/graphics/android/configurable_display_buffer.h"
3344 #include <gmock/gmock.h>
3345
3346 namespace mir
3347@@ -30,25 +29,47 @@
3348 {
3349 namespace doubles
3350 {
3351+
3352+struct StubConfigurableDisplayBuffer : public graphics::android::ConfigurableDisplayBuffer
3353+{
3354+ StubConfigurableDisplayBuffer(geometry::Rectangle rect)
3355+ : rect(rect)
3356+ {
3357+ }
3358+
3359+ geometry::Rectangle view_area() const { return rect; }
3360+ void make_current() {}
3361+ void release_current() {}
3362+ void post_update() {}
3363+ bool can_bypass() const override { return false; }
3364+ void render_and_post_update(
3365+ std::list<std::shared_ptr<graphics::Renderable>> const&,
3366+ std::function<void(graphics::Renderable const&)> const&) {}
3367+ MirOrientation orientation() const override { return mir_orientation_normal; }
3368+ void configure(graphics::DisplayConfigurationOutput const&) {}
3369+ graphics::DisplayConfigurationOutput configuration() const
3370+ {
3371+ return graphics::DisplayConfigurationOutput{
3372+ graphics::DisplayConfigurationOutputId{1},
3373+ graphics::DisplayConfigurationCardId{0},
3374+ graphics::DisplayConfigurationOutputType::vga,
3375+ {}, {}, 0, {}, false, false, {}, 0, mir_pixel_format_abgr_8888,
3376+ mir_power_mode_off,
3377+ mir_orientation_normal};
3378+ }
3379+private:
3380+ geometry::Rectangle rect;
3381+};
3382+
3383 struct StubDisplayBuilder : public graphics::android::DisplayBuilder
3384 {
3385- StubDisplayBuilder(std::shared_ptr<graphics::android::DisplayDevice> const& stub_dev, geometry::Size sz)
3386- : stub_dev(stub_dev), sz(sz)
3387+ StubDisplayBuilder(geometry::Size sz)
3388+ : sz(sz)
3389 {
3390 }
3391
3392 StubDisplayBuilder()
3393- : StubDisplayBuilder(std::make_shared<StubDisplayDevice>(), geometry::Size{0,0})
3394- {
3395- }
3396-
3397- StubDisplayBuilder(geometry::Size sz)
3398- : StubDisplayBuilder(std::make_shared<StubDisplayDevice>(), sz)
3399- {
3400- }
3401-
3402- StubDisplayBuilder(std::shared_ptr<graphics::android::DisplayDevice> const& stub_dev)
3403- : stub_dev(stub_dev), sz(geometry::Size{0,0})
3404+ : StubDisplayBuilder(geometry::Size{0,0})
3405 {
3406 }
3407
3408@@ -57,20 +78,13 @@
3409 return mir_pixel_format_abgr_8888;
3410 }
3411
3412- std::unique_ptr<graphics::DisplayBuffer> create_display_buffer(
3413- std::shared_ptr<graphics::android::DisplayDevice> const&,
3414+ std::unique_ptr<graphics::android::ConfigurableDisplayBuffer> create_display_buffer(
3415 graphics::android::GLContext const&)
3416 {
3417- return std::unique_ptr<graphics::DisplayBuffer>(
3418- new StubDisplayBuffer(geometry::Rectangle{{0,0},sz}));
3419- }
3420-
3421- std::shared_ptr<graphics::android::DisplayDevice> create_display_device()
3422- {
3423- return stub_dev;
3424- }
3425-
3426- std::shared_ptr<graphics::android::DisplayDevice> const stub_dev;
3427+ return std::unique_ptr<graphics::android::ConfigurableDisplayBuffer>(
3428+ new StubConfigurableDisplayBuffer(geometry::Rectangle{{0,0},sz}));
3429+ }
3430+
3431 geometry::Size sz;
3432 };
3433 }
3434
3435=== modified file 'include/test/mir_test_doubles/stub_display_configuration.h'
3436--- include/test/mir_test_doubles/stub_display_configuration.h 2014-01-31 07:35:54 +0000
3437+++ include/test/mir_test_doubles/stub_display_configuration.h 2014-03-06 09:14:28 +0000
3438@@ -93,8 +93,8 @@
3439 graphics::DisplayConfigurationOutputType::vga,
3440 pfs, modes, i,
3441 physical_size,
3442- ((i % 2) == 0),
3443- ((i % 2) == 1),
3444+ ((i % 2) == 0), // even numbers have connected==true
3445+ ((i % 4) == 0), // only every second even has used==true
3446 top_left,
3447 mode_index, pfs[0],
3448 mir_power_mode_off,
3449@@ -156,8 +156,13 @@
3450 }
3451 }
3452
3453- void configure_output(graphics::DisplayConfigurationOutputId, bool, geometry::Point, size_t, MirPixelFormat, MirPowerMode, MirOrientation) override
3454+ void for_each_output(std::function<void(graphics::UserDisplayConfigurationOutput&)> f) override
3455 {
3456+ for (auto& disp : outputs)
3457+ {
3458+ graphics::UserDisplayConfigurationOutput user(disp);
3459+ f(user);
3460+ }
3461 }
3462
3463 std::vector<graphics::DisplayConfigurationCard> cards;
3464
3465=== modified file 'include/test/mir_test_doubles/stub_renderable.h'
3466--- include/test/mir_test_doubles/stub_renderable.h 2014-01-20 19:18:06 +0000
3467+++ include/test/mir_test_doubles/stub_renderable.h 2014-03-06 09:14:28 +0000
3468@@ -32,7 +32,7 @@
3469 class StubRenderable : public graphics::Renderable
3470 {
3471 public:
3472- std::shared_ptr<graphics::Buffer> buffer() const
3473+ std::shared_ptr<graphics::Buffer> buffer(unsigned long) const override
3474 {
3475 return {};
3476 }
3477@@ -44,6 +44,30 @@
3478 {
3479 return {{},{}};
3480 }
3481+ float alpha() const override
3482+ {
3483+ return 1.0f;
3484+ }
3485+ glm::mat4 transformation() const override
3486+ {
3487+ return trans;
3488+ }
3489+ bool should_be_rendered_in(geometry::Rectangle const&) const override
3490+ {
3491+ return true;
3492+ }
3493+ bool shaped() const override
3494+ {
3495+ return false;
3496+ }
3497+
3498+ int buffers_ready_for_compositor() const override
3499+ {
3500+ return 1;
3501+ }
3502+
3503+private:
3504+ glm::mat4 trans;
3505 };
3506
3507 }
3508
3509=== added file 'include/test/mir_test_doubles/stub_renderer.h'
3510--- include/test/mir_test_doubles/stub_renderer.h 1970-01-01 00:00:00 +0000
3511+++ include/test/mir_test_doubles/stub_renderer.h 2014-03-06 09:14:28 +0000
3512@@ -0,0 +1,65 @@
3513+/*
3514+ * Copyright © 2014 Canonical Ltd.
3515+ *
3516+ * This program is free software: you can redistribute it and/or modify it
3517+ * under the terms of the GNU General Public License version 3,
3518+ * as published by the Free Software Foundation.
3519+ *
3520+ * This program is distributed in the hope that it will be useful,
3521+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
3522+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3523+ * GNU General Public License for more details.
3524+ *
3525+ * You should have received a copy of the GNU General Public License
3526+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
3527+ *
3528+ * Authored by: Daniel van Vugt <daniel.van.vugt@canonical.com>
3529+ */
3530+
3531+#ifndef MIR_TEST_DOUBLES_STUB_RENDERER_H_
3532+#define MIR_TEST_DOUBLES_STUB_RENDERER_H_
3533+
3534+#include "mir/compositor/renderer.h"
3535+
3536+namespace mir
3537+{
3538+namespace test
3539+{
3540+namespace doubles
3541+{
3542+
3543+class StubRenderer : public compositor::Renderer
3544+{
3545+public:
3546+ void set_viewport(geometry::Rectangle const&) override
3547+ {
3548+ }
3549+
3550+ void set_rotation(float) override
3551+ {
3552+ }
3553+
3554+ void begin() const override
3555+ {
3556+ }
3557+
3558+ void render(graphics::Renderable const&,
3559+ graphics::Buffer&) const override
3560+ {
3561+ }
3562+
3563+ void end() const override
3564+ {
3565+ }
3566+
3567+ void suspend() override
3568+ {
3569+ }
3570+};
3571+
3572+
3573+} // namespace doubles
3574+} // namespace test
3575+} // namespace mir
3576+
3577+#endif // MIR_TEST_DOUBLES_STUB_RENDERER_H_
3578
3579=== modified file 'include/test/mir_test_doubles/stub_surface_builder.h'
3580--- include/test/mir_test_doubles/stub_surface_builder.h 2014-01-13 06:12:33 +0000
3581+++ include/test/mir_test_doubles/stub_surface_builder.h 2014-03-06 09:14:28 +0000
3582@@ -1,5 +1,5 @@
3583 /*
3584- * Copyright © 2013 Canonical Ltd.
3585+ * Copyright © 2013-2014 Canonical Ltd.
3586 *
3587 * This program is free software: you can redistribute it and/or modify it
3588 * under the terms of the GNU General Public License version 3,
3589@@ -22,8 +22,7 @@
3590
3591 #include "src/server/scene/surface_builder.h"
3592 #include "src/server/scene/basic_surface.h"
3593-#include "src/server/scene/surface_data.h"
3594-#include "mir/scene/scene_report.h"
3595+#include "src/server/report/null_report_factory.h"
3596 #include "mir/shell/surface_creation_parameters.h"
3597
3598 #include "mir_test_doubles/stub_buffer_stream.h"
3599@@ -40,11 +39,13 @@
3600 public:
3601 StubSurfaceBuilder() :
3602 dummy_surface(std::make_shared<scene::BasicSurface>(
3603- std::make_shared<scene::SurfaceData>(
3604- std::string("stub"), geometry::Rectangle{{},{}}, [](){}, false),
3605+ std::string("stub"),
3606+ geometry::Rectangle{{},{}},
3607+ [](){},
3608+ false,
3609 std::make_shared<StubBufferStream>(),
3610 std::shared_ptr<input::InputChannel>(),
3611- std::make_shared<scene::NullSceneReport>()))
3612+ mir::report::null_scene_report()))
3613 {
3614 }
3615
3616
3617=== modified file 'include/test/mir_test_framework/udev_environment.h'
3618--- include/test/mir_test_framework/udev_environment.h 2014-01-13 06:12:33 +0000
3619+++ include/test/mir_test_framework/udev_environment.h 2014-03-06 09:14:28 +0000
3620@@ -35,8 +35,6 @@
3621 UdevEnvironment();
3622 ~UdevEnvironment() noexcept;
3623
3624- void add_standard_drm_devices();
3625-
3626 std::string add_device(char const* subsystem,
3627 char const* name,
3628 char const* parent,
3629@@ -45,6 +43,18 @@
3630 void remove_device(std::string const& device_path);
3631 void emit_device_changed(std::string const& device_path);
3632
3633+ /**
3634+ * Add a device from the set of standard device traces
3635+ *
3636+ * Looks for a <tt>name</tt>.umockdev file, and adds a UMockDev device
3637+ * from that description.
3638+ *
3639+ * If <tt>name</tt>.ioctl exists, it loads that ioctl script for the device
3640+ *
3641+ * @param name The unadorned filename of the device traces to add.
3642+ */
3643+ void add_standard_device(std::string const& name);
3644+
3645 UMockdevTestbed *testbed;
3646 };
3647
3648
3649=== modified file 'src/client/CMakeLists.txt'
3650--- src/client/CMakeLists.txt 2014-02-06 22:37:53 +0000
3651+++ src/client/CMakeLists.txt 2014-03-06 09:14:28 +0000
3652@@ -18,6 +18,14 @@
3653 add_subdirectory(rpc/)
3654 add_subdirectory(lttng/)
3655
3656+if(MIR_BUILD_PLATFORM_ANDROID)
3657+add_subdirectory(android/)
3658+endif()
3659+
3660+if(MIR_BUILD_PLATFORM_MESA)
3661+add_subdirectory(mesa/)
3662+endif()
3663+
3664 set(
3665 CLIENT_SOURCES
3666
3667@@ -38,34 +46,6 @@
3668 mir_screencast_api.cpp
3669 )
3670
3671-if( MIR_PLATFORM STREQUAL "android")
3672-include_directories(SYSTEM ${LIBHARDWARE_INCLUDE_DIRS})
3673-set(
3674- CLIENT_SOURCES
3675-
3676- android/android_client_buffer.cpp
3677- android/android_client_buffer_factory.cpp
3678- android/android_registrar.cpp
3679- android/android_client_platform.cpp
3680- android/client_surface_interpreter.cpp
3681- android/android_native_display_container.cpp
3682- ${CLIENT_SOURCES}
3683-)
3684-endif()
3685-
3686-if( MIR_PLATFORM STREQUAL "mesa")
3687-set(
3688- CLIENT_SOURCES
3689-
3690- mesa/client_platform.cpp
3691- mesa/client_buffer_factory.cpp
3692- mesa/client_buffer.cpp
3693- mesa/mesa_native_display_container.cpp
3694- mesa/native_surface.cpp
3695- ${CLIENT_SOURCES}
3696-)
3697-endif()
3698-
3699 add_library(
3700 mirclient SHARED
3701
3702@@ -81,14 +61,10 @@
3703 SOVERSION ${MIRCLIENT_ABI}
3704 )
3705
3706-# Ensure mirclient_compat_links exist before any dependents of mirclient
3707-add_dependencies(mirclient mirclient_compat_links)
3708-
3709 set(
3710 MIR_CLIENT_LIBRARIES
3711 ${Boost_LIBRARIES}
3712 ${CMAKE_THREAD_LIBS_INIT}
3713- ${LIBHARDWARE_LIBRARIES}
3714 ${PROTOBUF_LIBRARIES}
3715 ${XKBCOMMON_LIBRARIES}
3716
3717@@ -96,10 +72,10 @@
3718 mirsharedinput
3719 mirsharedlogging
3720 mirsharedenv
3721+ mirsharedsharedlibrary
3722 mirclientrpc
3723 mirclientlttngstatic
3724
3725- ${DRM_LIBRARIES}
3726 ${MIR_COMMON_PLATFORM_LIBRARIES}
3727
3728 3rd_party
3729
3730=== added file 'src/client/android/CMakeLists.txt'
3731--- src/client/android/CMakeLists.txt 1970-01-01 00:00:00 +0000
3732+++ src/client/android/CMakeLists.txt 2014-03-06 09:14:28 +0000
3733@@ -0,0 +1,45 @@
3734+include_directories(SYSTEM ${LIBHARDWARE_INCLUDE_DIRS})
3735+add_definitions(-DANDROID)
3736+
3737+add_library(
3738+ mirclientplatformandroid SHARED
3739+
3740+ android_client_buffer.cpp
3741+ android_client_buffer_factory.cpp
3742+ android_registrar.cpp
3743+ android_client_platform.cpp
3744+ client_platform_factory.cpp
3745+ client_surface_interpreter.cpp
3746+ android_native_display_container.cpp
3747+)
3748+
3749+set_target_properties(
3750+ mirclientplatformandroid PROPERTIES
3751+ OUTPUT_NAME mirclientplatform
3752+ LIBRARY_OUTPUT_DIRECTORY ${LIBRARY_OUTPUT_PATH}/android
3753+)
3754+
3755+target_link_libraries(
3756+ mirclientplatformandroid
3757+ mirclient
3758+
3759+ ${LIBHARDWARE_LIBRARIES}
3760+)
3761+
3762+install(TARGETS mirclientplatformandroid LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/mir/clientplatform/android)
3763+
3764+if (MIR_TEST_PLATFORM STREQUAL "android")
3765+ add_custom_command(TARGET mirclientplatformandroid
3766+ POST_BUILD
3767+ COMMAND ${CMAKE_COMMAND} -E remove libmirclientplatform.so
3768+ COMMAND ${CMAKE_COMMAND} -E create_symlink android/$<TARGET_FILE_NAME:mirclientplatformandroid> libmirclientplatform.so
3769+ WORKING_DIRECTORY ${LIBRARY_OUTPUT_PATH}
3770+ )
3771+
3772+ install(CODE
3773+ "execute_process(
3774+ COMMAND ln -sf mir/clientplatform/android/libmirclientplatform.so
3775+ WORKING_DIRECTORY \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}
3776+ )"
3777+ )
3778+endif()
3779
3780=== modified file 'src/client/android/android_client_platform.cpp'
3781--- src/client/android/android_client_platform.cpp 2014-01-13 06:12:33 +0000
3782+++ src/client/android/android_client_platform.cpp 2014-03-06 09:14:28 +0000
3783@@ -22,7 +22,6 @@
3784 #include "android_client_buffer_factory.h"
3785 #include "client_surface_interpreter.h"
3786 #include "../mir_connection.h"
3787-#include "../native_client_platform_factory.h"
3788
3789 #include <EGL/egl.h>
3790
3791@@ -44,12 +43,6 @@
3792
3793 }
3794
3795-std::shared_ptr<mcl::ClientPlatform>
3796-mcl::NativeClientPlatformFactory::create_client_platform(mcl::ClientContext* /*context*/)
3797-{
3798- return std::make_shared<mcla::AndroidClientPlatform>();
3799-}
3800-
3801 std::shared_ptr<mcl::ClientBufferFactory> mcla::AndroidClientPlatform::create_buffer_factory()
3802 {
3803 const hw_module_t *hw_module;
3804
3805=== added file 'src/client/android/client_platform_factory.cpp'
3806--- src/client/android/client_platform_factory.cpp 1970-01-01 00:00:00 +0000
3807+++ src/client/android/client_platform_factory.cpp 2014-03-06 09:14:28 +0000
3808@@ -0,0 +1,34 @@
3809+/*
3810+ * Copyright © 2014 Canonical Ltd.
3811+ *
3812+ * This program is free software: you can redistribute it and/or modify it
3813+ * under the terms of the GNU Lesser General Public License version 3,
3814+ * as published by the Free Software Foundation.
3815+ *
3816+ * This program is distributed in the hope that it will be useful,
3817+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
3818+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3819+ * GNU Lesser General Public License for more details.
3820+ *
3821+ * You should have received a copy of the GNU Lesser General Public License
3822+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
3823+ *
3824+ * Authored by: Alexandros Frantzis <alexandros.frantzis@canonical.com>
3825+ */
3826+
3827+#include "client_platform_factory.h"
3828+#include "android_client_platform.h"
3829+
3830+namespace mcl = mir::client;
3831+namespace mcla = mcl::android;
3832+
3833+std::shared_ptr<mcl::ClientPlatform>
3834+mcla::ClientPlatformFactory::create_client_platform(mcl::ClientContext* /*context*/)
3835+{
3836+ return std::make_shared<mcla::AndroidClientPlatform>();
3837+}
3838+
3839+extern "C" std::shared_ptr<mcl::ClientPlatformFactory> mcl::create_client_platform_factory()
3840+{
3841+ return std::make_shared<mcla::ClientPlatformFactory>();
3842+}
3843
3844=== added file 'src/client/android/client_platform_factory.h'
3845--- src/client/android/client_platform_factory.h 1970-01-01 00:00:00 +0000
3846+++ src/client/android/client_platform_factory.h 2014-03-06 09:14:28 +0000
3847@@ -0,0 +1,41 @@
3848+/*
3849+ * Copyright © 2014 Canonical Ltd.
3850+ *
3851+ * This program is free software: you can redistribute it and/or modify it
3852+ * under the terms of the GNU Lesser General Public License version 3,
3853+ * as published by the Free Software Foundation.
3854+ *
3855+ * This program is distributed in the hope that it will be useful,
3856+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
3857+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3858+ * GNU Lesser General Public License for more details.
3859+ *
3860+ * You should have received a copy of the GNU Lesser General Public License
3861+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
3862+ *
3863+ * Authored by: Alexandros Frantzis <alexandros.frantzis@canonical.com>
3864+ */
3865+
3866+#ifndef MIR_CLIENT_ANDROID_CLIENT_PLATFORM_FACTORY_H_
3867+#define MIR_CLIENT_ANDROID_CLIENT_PLATFORM_FACTORY_H_
3868+
3869+#include "../client_platform_factory.h"
3870+
3871+namespace mir
3872+{
3873+namespace client
3874+{
3875+namespace android
3876+{
3877+
3878+class ClientPlatformFactory : public client::ClientPlatformFactory
3879+{
3880+public:
3881+ std::shared_ptr<ClientPlatform> create_client_platform(ClientContext* context) override;
3882+};
3883+
3884+}
3885+}
3886+}
3887+
3888+#endif /* MIR_CLIENT_ANDROID_CLIENT_PLATFORM_FACTORY_H_ */
3889
3890=== modified file 'src/client/client_platform_factory.h'
3891--- src/client/client_platform_factory.h 2013-04-24 05:22:20 +0000
3892+++ src/client/client_platform_factory.h 2014-03-06 09:14:28 +0000
3893@@ -18,6 +18,8 @@
3894 #ifndef MIR_CLIENT_CLIENT_PLATFORM_FACTORY_H_
3895 #define MIR_CLIENT_CLIENT_PLATFORM_FACTORY_H_
3896
3897+#include <memory>
3898+
3899 namespace mir
3900 {
3901 namespace client
3902@@ -29,16 +31,19 @@
3903 class ClientPlatformFactory
3904 {
3905 public:
3906- virtual ~ClientPlatformFactory() {}
3907+ virtual ~ClientPlatformFactory() = default;
3908
3909 virtual std::shared_ptr<ClientPlatform> create_client_platform(ClientContext* context) = 0;
3910
3911 protected:
3912 ClientPlatformFactory() = default;
3913- ClientPlatformFactory(const ClientPlatformFactory& p) = delete;
3914- ClientPlatformFactory& operator=(const ClientPlatformFactory& p) = delete;
3915+ ClientPlatformFactory(ClientPlatformFactory const& p) = delete;
3916+ ClientPlatformFactory& operator=(ClientPlatformFactory const& p) = delete;
3917 };
3918
3919+extern "C" typedef std::shared_ptr<ClientPlatformFactory>(*CreateClientPlatformFactory)();
3920+extern "C" std::shared_ptr<ClientPlatformFactory> create_client_platform_factory();
3921+
3922 }
3923 }
3924
3925
3926=== modified file 'src/client/default_connection_configuration.cpp'
3927--- src/client/default_connection_configuration.cpp 2014-01-14 04:10:15 +0000
3928+++ src/client/default_connection_configuration.cpp 2014-03-06 09:14:28 +0000
3929@@ -22,14 +22,16 @@
3930 #include "rpc/make_rpc_channel.h"
3931 #include "rpc/null_rpc_report.h"
3932 #include "mir/logging/dumb_console_logger.h"
3933-#include "native_client_platform_factory.h"
3934 #include "mir/input/input_platform.h"
3935 #include "mir/input/null_input_receiver_report.h"
3936 #include "logging/rpc_report.h"
3937 #include "logging/input_receiver_report.h"
3938 #include "lttng/rpc_report.h"
3939+#include "lttng/input_receiver_report.h"
3940 #include "connection_surface_map.h"
3941 #include "lifecycle_control.h"
3942+#include "mir/shared_library.h"
3943+#include "client_platform_factory.h"
3944
3945 namespace mcl = mir::client;
3946
3947@@ -38,6 +40,23 @@
3948 std::string const off_opt_val{"off"};
3949 std::string const log_opt_val{"log"};
3950 std::string const lttng_opt_val{"lttng"};
3951+std::string const default_platform_lib{"libmirclientplatform.so"};
3952+
3953+mir::SharedLibrary const* load_library(std::string const& libname)
3954+{
3955+ // There's no point in loading twice, and it isn't safe to unload...
3956+ static std::map<std::string, std::shared_ptr<mir::SharedLibrary>> libraries_cache;
3957+
3958+ if (auto& ptr = libraries_cache[libname])
3959+ {
3960+ return ptr.get();
3961+ }
3962+ else
3963+ {
3964+ ptr = std::make_shared<mir::SharedLibrary>(libname);
3965+ return ptr.get();
3966+ }
3967+}
3968 }
3969
3970 mcl::DefaultConnectionConfiguration::DefaultConnectionConfiguration(
3971@@ -82,7 +101,15 @@
3972 return client_platform_factory(
3973 []
3974 {
3975- return std::make_shared<mcl::NativeClientPlatformFactory>();
3976+ auto const val_raw = getenv("MIR_CLIENT_PLATFORM_LIB");
3977+ std::string const val{val_raw ? val_raw : default_platform_lib};
3978+ auto const platform_lib = load_library(val);
3979+
3980+ auto const create_client_platform_factory =
3981+ platform_lib->load_function<mcl::CreateClientPlatformFactory>(
3982+ "create_client_platform_factory");
3983+
3984+ return create_client_platform_factory();
3985 });
3986 }
3987
3988@@ -131,6 +158,8 @@
3989
3990 if (val == log_opt_val)
3991 return std::make_shared<mcl::logging::InputReceiverReport>(the_logger());
3992+ else if (val == lttng_opt_val)
3993+ return std::make_shared<mcl::lttng::InputReceiverReport>();
3994 else
3995 return std::make_shared<mir::input::receiver::NullInputReceiverReport>();
3996 });
3997
3998=== modified file 'src/client/lttng/CMakeLists.txt'
3999--- src/client/lttng/CMakeLists.txt 2014-01-13 06:12:33 +0000
4000+++ src/client/lttng/CMakeLists.txt 2014-03-06 09:14:28 +0000
4001@@ -5,13 +5,10 @@
4002
4003 client_tracepoint_provider.cpp
4004 rpc_report.cpp
4005-)
4006-
4007-add_library(
4008- mirclientlttng SHARED
4009-
4010- rpc_report_tp.c
4011-)
4012+ input_receiver_report.cpp
4013+)
4014+
4015+add_library(mirclientlttng SHARED tracepoints.c)
4016
4017 # Don't treat missing-field-initializers as an error, since
4018 # the LTTng macros contain code that triggers this (but it's
4019
4020=== modified file 'src/client/lttng/client_tracepoint_provider.h'
4021--- src/client/lttng/client_tracepoint_provider.h 2013-06-03 12:15:45 +0000
4022+++ src/client/lttng/client_tracepoint_provider.h 2014-03-06 09:14:28 +0000
4023@@ -19,7 +19,7 @@
4024 #ifndef MIR_CLIENT_LTTNG_CLIENT_TRACEPOINT_PROVIDER_H_
4025 #define MIR_CLIENT_LTTNG_CLIENT_TRACEPOINT_PROVIDER_H_
4026
4027-#include "mir/lttng/tracepoint_provider.h"
4028+#include "mir/report/lttng/tracepoint_provider.h"
4029
4030 namespace mir
4031 {
4032@@ -28,7 +28,7 @@
4033 namespace lttng
4034 {
4035
4036-class ClientTracepointProvider : public mir::lttng::TracepointProvider
4037+class ClientTracepointProvider : public mir::report::lttng::TracepointProvider
4038 {
4039 public:
4040 ClientTracepointProvider();
4041
4042=== added file 'src/client/lttng/input_receiver_report.cpp'
4043--- src/client/lttng/input_receiver_report.cpp 1970-01-01 00:00:00 +0000
4044+++ src/client/lttng/input_receiver_report.cpp 2014-03-06 09:14:28 +0000
4045@@ -0,0 +1,65 @@
4046+/*
4047+ * Copyright © 2014 Canonical Ltd.
4048+ *
4049+ * This program is free software: you can redistribute it and/or modify
4050+ * it under the terms of the GNU Lesser General Public License version 3 as
4051+ * published by the Free Software Foundation.
4052+ *
4053+ * This program is distributed in the hope that it will be useful,
4054+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
4055+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4056+ * GNU Lesser General Public License for more details.
4057+ *
4058+ * You should have received a copy of the GNU Lesser General Public License
4059+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
4060+ *
4061+ * Authored by: Andreas Pokorny <andreas.pokorny@canonical.com>
4062+ */
4063+
4064+#include "input_receiver_report.h"
4065+#include "mir/report/lttng/mir_tracepoint.h"
4066+
4067+#include <stdexcept>
4068+#include <boost/throw_exception.hpp>
4069+
4070+#define TRACEPOINT_DEFINE
4071+#define TRACEPOINT_PROBE_DYNAMIC_LINKAGE
4072+#include "input_receiver_report_tp.h"
4073+
4074+void mir::client::lttng::InputReceiverReport::received_event(MirEvent const& event)
4075+{
4076+ switch (event.type)
4077+ {
4078+ case mir_event_type_key:
4079+ report(event.key);
4080+ break;
4081+ case mir_event_type_motion:
4082+ report(event.motion);
4083+ break;
4084+ default:
4085+ BOOST_THROW_EXCEPTION(std::runtime_error("Unexpected event type"));
4086+ }
4087+}
4088+
4089+void mir::client::lttng::InputReceiverReport::report(MirKeyEvent const& event) const
4090+{
4091+ mir_tracepoint(mir_client_input_receiver, key_event, event.device_id, event.source_id,
4092+ static_cast<int>(event.action), static_cast<int>(event.flags), event.modifiers, event.key_code,
4093+ event.scan_code, event.down_time, event.event_time);
4094+}
4095+
4096+void mir::client::lttng::InputReceiverReport::report(MirMotionEvent const& event) const
4097+{
4098+ mir_tracepoint(mir_client_input_receiver, motion_event, event.device_id, event.source_id, event.action,
4099+ static_cast<int>(event.flags), event.modifiers, event.edge_flags,
4100+ static_cast<int>(event.button_state), event.down_time, event.event_time);
4101+ for (unsigned int i = 0; i < event.pointer_count; i++)
4102+ {
4103+ mir_tracepoint(mir_client_input_receiver, motion_event_coordinate,
4104+ event.pointer_coordinates[i].id, event.pointer_coordinates[i].x, event.pointer_coordinates[i].y,
4105+ event.pointer_coordinates[i].touch_major, event.pointer_coordinates[i].touch_minor,
4106+ event.pointer_coordinates[i].size, event.pointer_coordinates[i].pressure,
4107+ event.pointer_coordinates[i].orientation);
4108+ }
4109+}
4110+
4111
4112=== added file 'src/client/lttng/input_receiver_report.h'
4113--- src/client/lttng/input_receiver_report.h 1970-01-01 00:00:00 +0000
4114+++ src/client/lttng/input_receiver_report.h 2014-03-06 09:14:28 +0000
4115@@ -0,0 +1,46 @@
4116+/*
4117+ * Copyright © 2014 Canonical Ltd.
4118+ *
4119+ * This program is free software: you can redistribute it and/or modify
4120+ * it under the terms of the GNU Lesser General Public License version 3 as
4121+ * published by the Free Software Foundation.
4122+ *
4123+ * This program is distributed in the hope that it will be useful,
4124+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
4125+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4126+ * GNU Lesser General Public License for more details.
4127+ *
4128+ * You should have received a copy of the GNU Lesser General Public License
4129+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
4130+ *
4131+ * Authored by: Andreas Pokorny <andreas.pokorny@canonical.com>
4132+ */
4133+
4134+#ifndef MIR_CLIENT_LTTNG_INPUT_RECEIVER_REPORT_H_
4135+#define MIR_CLIENT_LTTNG_INPUT_RECEIVER_REPORT_H_
4136+
4137+#include "mir/input/input_receiver_report.h"
4138+#include "client_tracepoint_provider.h"
4139+
4140+namespace mir
4141+{
4142+namespace client
4143+{
4144+namespace lttng
4145+{
4146+
4147+class InputReceiverReport : public input::receiver::InputReceiverReport
4148+{
4149+public:
4150+ void received_event(MirEvent const& event) override;
4151+private:
4152+ void report(MirKeyEvent const& event) const;
4153+ void report(MirMotionEvent const& event) const;
4154+ ClientTracepointProvider tp_provider;
4155+};
4156+
4157+}
4158+}
4159+}
4160+
4161+#endif /* MIR_CLIENT_LTTNG_INPUT_RECEIVER_REPORT_H_ */
4162
4163=== added file 'src/client/lttng/input_receiver_report_tp.h'
4164--- src/client/lttng/input_receiver_report_tp.h 1970-01-01 00:00:00 +0000
4165+++ src/client/lttng/input_receiver_report_tp.h 2014-03-06 09:14:28 +0000
4166@@ -0,0 +1,96 @@
4167+/*
4168+ * Copyright © 2014 Canonical Ltd.
4169+ *
4170+ * This program is free software: you can redistribute it and/or modify
4171+ * it under the terms of the GNU Lesser General Public License version 3 as
4172+ * published by the Free Software Foundation.
4173+ *
4174+ * This program is distributed in the hope that it will be useful,
4175+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
4176+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4177+ * GNU Lesser General Public License for more details.
4178+ *
4179+ * You should have received a copy of the GNU Lesser General Public License
4180+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
4181+ *
4182+ * Authored by: Andreas Pokorny <andreas.pokorny@canonical.com>
4183+ */
4184+
4185+#undef TRACEPOINT_PROVIDER
4186+#define TRACEPOINT_PROVIDER mir_client_input_receiver
4187+
4188+#undef TRACEPOINT_INCLUDE
4189+#define TRACEPOINT_INCLUDE "./input_receiver_report_tp.h"
4190+
4191+#if !defined(MIR_CLIENT_LTTNG_INPUT_RECEIVER_REPORT_TP_H_) || defined(TRACEPOINT_HEADER_MULTI_READ)
4192+#define MIR_CLIENT_LTTNG_INPUT_RECEIVER_REPORT_TP_H_
4193+
4194+#include <lttng/tracepoint.h>
4195+
4196+#ifdef __clang__
4197+/*
4198+ * TRACEPOINT_EVENT defines functions; since we disable tracepoints under clang
4199+ * these functions are unused and so generate fatal warnings.
4200+ * (see mir_tracepoint.h and http://sourceware.org/bugzilla/show_bug.cgi?id=13974)
4201+ */
4202+#pragma clang diagnostic push
4203+#pragma clang diagnostic warning "-Wunused-function"
4204+#endif
4205+
4206+TRACEPOINT_EVENT(
4207+ mir_client_input_receiver,
4208+ key_event,
4209+ 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),
4210+ TP_FIELDS(
4211+ ctf_integer(int32_t, device_id, device_id)
4212+ ctf_integer(int32_t, source_id, source_id)
4213+ ctf_integer(int, action, action)
4214+ ctf_integer(int, flags, flags)
4215+ ctf_integer(unsigned int, modifiers, modifiers)
4216+ ctf_integer(int32_t, key_code, key_code)
4217+ ctf_integer(int32_t, scan_code, scan_code)
4218+ ctf_integer(int64_t, down_time, down_time)
4219+ ctf_integer(int64_t, event_time, event_time)
4220+ )
4221+)
4222+
4223+TRACEPOINT_EVENT(
4224+ mir_client_input_receiver,
4225+ motion_event,
4226+ 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),
4227+ TP_FIELDS(
4228+ ctf_integer(int32_t, device_id, device_id)
4229+ ctf_integer(int32_t, source_id, source_id)
4230+ ctf_integer(int, action, action)
4231+ ctf_integer(int, flags, flags)
4232+ ctf_integer(unsigned int, modifiers, modifiers)
4233+ ctf_integer(int32_t, edge_flags, edge_flags)
4234+ ctf_integer(int, button_state, button_state)
4235+ ctf_integer(int64_t, down_time, down_time)
4236+ ctf_integer(int64_t, event_time, event_time)
4237+ )
4238+)
4239+
4240+TRACEPOINT_EVENT(
4241+ mir_client_input_receiver,
4242+ motion_event_coordinate,
4243+ TP_ARGS(int, id, float, x, float, y, float, touch_major, float, touch_minor, float, size, float, pressure, float, orientation),
4244+ TP_FIELDS(
4245+ ctf_integer(int, id, id)
4246+ ctf_float(float, x, x)
4247+ ctf_float(float, y, y)
4248+ ctf_float(float, touch_major, touch_major)
4249+ ctf_float(float, touch_minor, touch_minor)
4250+ ctf_float(float, size, size)
4251+ ctf_float(float, pressure, pressure)
4252+ ctf_float(float, orientation, orientation)
4253+ )
4254+)
4255+
4256+#ifdef __clang__
4257+#pragma clang diagnostic pop
4258+#endif
4259+
4260+#endif /* MIR_CLIENT_LTTNG_INPUT_RECEIVER_REPORT_TP_H_ */
4261+
4262+#include <lttng/tracepoint-event.h>
4263
4264=== modified file 'src/client/lttng/rpc_report.cpp'
4265--- src/client/lttng/rpc_report.cpp 2013-09-26 13:50:11 +0000
4266+++ src/client/lttng/rpc_report.cpp 2014-03-06 09:14:28 +0000
4267@@ -17,7 +17,7 @@
4268 */
4269
4270 #include "rpc_report.h"
4271-#include "mir/lttng/mir_tracepoint.h"
4272+#include "mir/report/lttng/mir_tracepoint.h"
4273
4274 #include "mir_protobuf_wire.pb.h"
4275
4276
4277=== removed file 'src/client/lttng/rpc_report_tp.c'
4278--- src/client/lttng/rpc_report_tp.c 2013-06-03 12:15:45 +0000
4279+++ src/client/lttng/rpc_report_tp.c 1970-01-01 00:00:00 +0000
4280@@ -1,4 +0,0 @@
4281-/* The probes need to be compiled in a C file (not C++) */
4282-#define TRACEPOINT_CREATE_PROBES
4283-
4284-#include "rpc_report_tp.h"
4285
4286=== added file 'src/client/lttng/tracepoints.c'
4287--- src/client/lttng/tracepoints.c 1970-01-01 00:00:00 +0000
4288+++ src/client/lttng/tracepoints.c 2014-03-06 09:14:28 +0000
4289@@ -0,0 +1,5 @@
4290+/* The probes need to be compiled in a C file (not C++) */
4291+#define TRACEPOINT_CREATE_PROBES
4292+
4293+#include "rpc_report_tp.h"
4294+#include "input_receiver_report_tp.h"
4295
4296=== added file 'src/client/mesa/CMakeLists.txt'
4297--- src/client/mesa/CMakeLists.txt 1970-01-01 00:00:00 +0000
4298+++ src/client/mesa/CMakeLists.txt 2014-03-06 09:14:28 +0000
4299@@ -0,0 +1,47 @@
4300+include_directories(
4301+ ${DRM_INCLUDE_DIRS}
4302+ ${EGL_INCLUDE_DIRS}
4303+)
4304+
4305+add_library(
4306+ mirclientplatformmesa SHARED
4307+
4308+ client_platform_factory.cpp
4309+ client_platform.cpp
4310+ client_buffer_factory.cpp
4311+ client_buffer.cpp
4312+ mesa_native_display_container.cpp
4313+ native_surface.cpp
4314+)
4315+
4316+set_target_properties(
4317+ mirclientplatformmesa PROPERTIES
4318+ OUTPUT_NAME mirclientplatform
4319+ LIBRARY_OUTPUT_DIRECTORY ${LIBRARY_OUTPUT_PATH}/mesa
4320+)
4321+
4322+target_link_libraries(
4323+ mirclientplatformmesa
4324+ mirclient
4325+
4326+ ${DRM_LDFLAGS} ${DRM_LIBRARIES}
4327+)
4328+
4329+install(TARGETS mirclientplatformmesa LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/mir/clientplatform/mesa)
4330+
4331+if (MIR_TEST_PLATFORM STREQUAL "mesa")
4332+ add_custom_command(TARGET mirclientplatformmesa
4333+ POST_BUILD
4334+ COMMAND ${CMAKE_COMMAND} -E remove libmirclientplatform.so
4335+ COMMAND ${CMAKE_COMMAND} -E create_symlink mesa/$<TARGET_FILE_NAME:mirclientplatformmesa> libmirclientplatform.so
4336+ WORKING_DIRECTORY ${LIBRARY_OUTPUT_PATH}
4337+ )
4338+
4339+ install(CODE
4340+ "execute_process(
4341+ COMMAND ln -sf mir/clientplatform/mesa/libmirclientplatform.so
4342+ WORKING_DIRECTORY \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}
4343+ )"
4344+ )
4345+endif()
4346+
4347
4348=== modified file 'src/client/mesa/client_platform.cpp'
4349--- src/client/mesa/client_platform.cpp 2014-01-13 06:12:33 +0000
4350+++ src/client/mesa/client_platform.cpp 2014-03-06 09:14:28 +0000
4351@@ -20,14 +20,9 @@
4352 #include "client_platform.h"
4353 #include "client_buffer_factory.h"
4354 #include "mesa_native_display_container.h"
4355-#include "buffer_file_ops.h"
4356 #include "native_surface.h"
4357 #include "../mir_connection.h"
4358 #include "../client_buffer_factory.h"
4359-#include "../native_client_platform_factory.h"
4360-
4361-#include <sys/mman.h>
4362-#include <unistd.h>
4363
4364 namespace mcl=mir::client;
4365 namespace mclm=mir::client::mesa;
4366@@ -36,31 +31,6 @@
4367 namespace
4368 {
4369
4370-struct RealBufferFileOps : public mclm::BufferFileOps
4371-{
4372- int close(int fd) const
4373- {
4374- while (::close(fd) == -1)
4375- {
4376- // Retry on EINTR, return error on anything else
4377- if (errno != EINTR)
4378- return errno;
4379- }
4380- return 0;
4381- }
4382-
4383- void* map(int fd, off_t offset, size_t size) const
4384- {
4385- return mmap(nullptr, size, PROT_READ | PROT_WRITE, MAP_SHARED,
4386- fd, offset);
4387- }
4388-
4389- void unmap(void* addr, size_t size) const
4390- {
4391- munmap(addr, size);
4392- }
4393-};
4394-
4395 struct NativeDisplayDeleter
4396 {
4397 NativeDisplayDeleter(mcl::EGLNativeDisplayContainer& container)
4398@@ -79,14 +49,6 @@
4399
4400 }
4401
4402-std::shared_ptr<mcl::ClientPlatform>
4403-mcl::NativeClientPlatformFactory::create_client_platform(mcl::ClientContext* context)
4404-{
4405- auto buffer_file_ops = std::make_shared<RealBufferFileOps>();
4406- return std::make_shared<mclm::ClientPlatform>(
4407- context, buffer_file_ops, mcl::EGLNativeDisplayContainer::instance());
4408-}
4409-
4410 mclm::ClientPlatform::ClientPlatform(
4411 ClientContext* const context,
4412 std::shared_ptr<BufferFileOps> const& buffer_file_ops,
4413@@ -125,7 +87,7 @@
4414 //TODO: this is awkward on both android and gbm...
4415 auto native_window = new NativeSurface(*client_surface);
4416 auto egl_native_window = new EGLNativeWindowType;
4417- *egl_native_window = native_window;
4418+ *egl_native_window = reinterpret_cast<EGLNativeWindowType>(native_window);
4419 NativeWindowDeleter deleter(native_window);
4420 return std::shared_ptr<EGLNativeWindowType>(egl_native_window, deleter);
4421 }
4422
4423=== added file 'src/client/mesa/client_platform_factory.cpp'
4424--- src/client/mesa/client_platform_factory.cpp 1970-01-01 00:00:00 +0000
4425+++ src/client/mesa/client_platform_factory.cpp 2014-03-06 09:14:28 +0000
4426@@ -0,0 +1,71 @@
4427+/*
4428+ * Copyright © 2014 Canonical Ltd.
4429+ *
4430+ * This program is free software: you can redistribute it and/or modify it
4431+ * under the terms of the GNU Lesser General Public License version 3,
4432+ * as published by the Free Software Foundation.
4433+ *
4434+ * This program is distributed in the hope that it will be useful,
4435+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
4436+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4437+ * GNU Lesser General Public License for more details.
4438+ *
4439+ * You should have received a copy of the GNU Lesser General Public License
4440+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
4441+ *
4442+ * Authored by: Alexandros Frantzis <alexandros.frantzis@canonical.com>
4443+ */
4444+
4445+#include "client_platform_factory.h"
4446+#include "client_platform.h"
4447+#include "buffer_file_ops.h"
4448+#include "../egl_native_display_container.h"
4449+
4450+#include <sys/mman.h>
4451+#include <unistd.h>
4452+
4453+namespace mcl = mir::client;
4454+namespace mclm = mcl::mesa;
4455+
4456+namespace
4457+{
4458+
4459+struct RealBufferFileOps : public mclm::BufferFileOps
4460+{
4461+ int close(int fd) const
4462+ {
4463+ while (::close(fd) == -1)
4464+ {
4465+ // Retry on EINTR, return error on anything else
4466+ if (errno != EINTR)
4467+ return errno;
4468+ }
4469+ return 0;
4470+ }
4471+
4472+ void* map(int fd, off_t offset, size_t size) const
4473+ {
4474+ return mmap(nullptr, size, PROT_READ | PROT_WRITE, MAP_SHARED,
4475+ fd, offset);
4476+ }
4477+
4478+ void unmap(void* addr, size_t size) const
4479+ {
4480+ munmap(addr, size);
4481+ }
4482+};
4483+
4484+}
4485+
4486+std::shared_ptr<mcl::ClientPlatform>
4487+mclm::ClientPlatformFactory::create_client_platform(mcl::ClientContext* context)
4488+{
4489+ auto buffer_file_ops = std::make_shared<RealBufferFileOps>();
4490+ return std::make_shared<mclm::ClientPlatform>(
4491+ context, buffer_file_ops, mcl::EGLNativeDisplayContainer::instance());
4492+}
4493+
4494+extern "C" std::shared_ptr<mcl::ClientPlatformFactory> mcl::create_client_platform_factory()
4495+{
4496+ return std::make_shared<mclm::ClientPlatformFactory>();
4497+}
4498
4499=== added file 'src/client/mesa/client_platform_factory.h'
4500--- src/client/mesa/client_platform_factory.h 1970-01-01 00:00:00 +0000
4501+++ src/client/mesa/client_platform_factory.h 2014-03-06 09:14:28 +0000
4502@@ -0,0 +1,41 @@
4503+/*
4504+ * Copyright © 2014 Canonical Ltd.
4505+ *
4506+ * This program is free software: you can redistribute it and/or modify it
4507+ * under the terms of the GNU Lesser General Public License version 3,
4508+ * as published by the Free Software Foundation.
4509+ *
4510+ * This program is distributed in the hope that it will be useful,
4511+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
4512+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4513+ * GNU Lesser General Public License for more details.
4514+ *
4515+ * You should have received a copy of the GNU Lesser General Public License
4516+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
4517+ *
4518+ * Authored by: Alexandros Frantzis <alexandros.frantzis@canonical.com>
4519+ */
4520+
4521+#ifndef MIR_CLIENT_MESA_CLIENT_PLATFORM_FACTORY_H_
4522+#define MIR_CLIENT_MESA_CLIENT_PLATFORM_FACTORY_H_
4523+
4524+#include "../client_platform_factory.h"
4525+
4526+namespace mir
4527+{
4528+namespace client
4529+{
4530+namespace mesa
4531+{
4532+
4533+class ClientPlatformFactory : public client::ClientPlatformFactory
4534+{
4535+public:
4536+ std::shared_ptr<ClientPlatform> create_client_platform(ClientContext* context) override;
4537+};
4538+
4539+}
4540+}
4541+}
4542+
4543+#endif /* MIR_CLIENT_MESA_CLIENT_PLATFORM_FACTORY_H_ */
4544
4545=== modified file 'src/client/mesa/native_surface.cpp'
4546--- src/client/mesa/native_surface.cpp 2014-01-27 16:59:40 +0000
4547+++ src/client/mesa/native_surface.cpp 2014-03-06 09:14:28 +0000
4548@@ -46,7 +46,7 @@
4549 }
4550
4551 mclm::NativeSurface::NativeSurface(ClientSurface& surface)
4552- : surface(surface)
4553+ : starting(true), surface(surface)
4554 {
4555 surface_advance_buffer = advance_buffer_static;
4556 surface_get_parameters = get_parameters_static;
4557@@ -55,7 +55,17 @@
4558
4559 int mclm::NativeSurface::advance_buffer(MirBufferPackage* buffer_package)
4560 {
4561- surface.request_and_wait_for_next_buffer();
4562+ /*
4563+ * At present dri2_create_mir_window_surface will trigger
4564+ * mir_advance_colour_buffer which will land here. Since we're still
4565+ * creating the window, we don't have any buffers we want the server to
4566+ * composite, so avoid sending a request to the server on startup:
4567+ */
4568+ if (starting)
4569+ starting = false;
4570+ else
4571+ surface.request_and_wait_for_next_buffer();
4572+
4573 auto buffer = surface.get_current_buffer();
4574
4575 auto buffer_to_driver = buffer->native_buffer_handle();
4576
4577=== modified file 'src/client/mesa/native_surface.h'
4578--- src/client/mesa/native_surface.h 2014-01-13 06:12:33 +0000
4579+++ src/client/mesa/native_surface.h 2014-03-06 09:14:28 +0000
4580@@ -39,6 +39,7 @@
4581 int set_swapinterval(int interval);
4582
4583 private:
4584+ bool starting;
4585 ClientSurface& surface;
4586 };
4587
4588
4589=== modified file 'src/client/mir_client_library.cpp'
4590--- src/client/mir_client_library.cpp 2014-01-28 18:21:14 +0000
4591+++ src/client/mir_client_library.cpp 2014-03-06 09:14:28 +0000
4592@@ -25,7 +25,6 @@
4593 #include "mir_connection.h"
4594 #include "display_configuration.h"
4595 #include "mir_surface.h"
4596-#include "native_client_platform_factory.h"
4597 #include "egl_native_display_container.h"
4598 #include "default_connection_configuration.h"
4599 #include "lifecycle_control.h"
4600@@ -397,7 +396,7 @@
4601
4602 MirEGLNativeWindowType mir_surface_get_egl_native_window(MirSurface *surface)
4603 {
4604- return surface->generate_native_window();
4605+ return reinterpret_cast<MirEGLNativeWindowType>(surface->generate_native_window());
4606 }
4607
4608 MirWaitHandle* mir_surface_set_type(MirSurface *surf,
4609
4610=== modified file 'src/client/mir_connection.cpp'
4611--- src/client/mir_connection.cpp 2014-01-24 18:11:19 +0000
4612+++ src/client/mir_connection.cpp 2014-03-06 09:14:28 +0000
4613@@ -16,8 +16,6 @@
4614 * Authored by: Thomas Guest <thomas.guest@canonical.com>
4615 */
4616
4617-#include "mir/logging/logger.h"
4618-
4619 #include "mir_connection.h"
4620 #include "mir_surface.h"
4621 #include "client_platform.h"
4622@@ -28,6 +26,8 @@
4623 #include "connection_surface_map.h"
4624 #include "lifecycle_control.h"
4625
4626+#include "mir/logging/logger.h"
4627+
4628 #include <algorithm>
4629 #include <cstddef>
4630 #include <unistd.h>
4631@@ -458,6 +458,7 @@
4632 display_request->set_output_id(output.output_id);
4633 display_request->set_used(output.used);
4634 display_request->set_current_mode(output.current_mode);
4635+ display_request->set_current_format(output.current_format);
4636 display_request->set_position_x(output.position_x);
4637 display_request->set_position_y(output.position_y);
4638 display_request->set_power_mode(output.power_mode);
4639
4640=== modified file 'src/client/mir_screencast_api.cpp'
4641--- src/client/mir_screencast_api.cpp 2014-01-29 18:02:33 +0000
4642+++ src/client/mir_screencast_api.cpp 2014-03-06 09:14:28 +0000
4643@@ -96,5 +96,5 @@
4644
4645 MirEGLNativeWindowType mir_screencast_egl_native_window(MirScreencast* screencast)
4646 {
4647- return screencast->egl_native_window();
4648+ return reinterpret_cast<MirEGLNativeWindowType>(screencast->egl_native_window());
4649 }
4650
4651=== removed file 'src/client/native_client_platform_factory.h'
4652--- src/client/native_client_platform_factory.h 2013-06-17 09:51:42 +0000
4653+++ src/client/native_client_platform_factory.h 1970-01-01 00:00:00 +0000
4654@@ -1,49 +0,0 @@
4655-/*
4656- * Copyright © 2012 Canonical Ltd.
4657- *
4658- * This program is free software: you can redistribute it and/or modify it
4659- * under the terms of the GNU Lesser General Public License version 3,
4660- * as published by the Free Software Foundation.
4661- *
4662- * This program is distributed in the hope that it will be useful,
4663- * but WITHOUT ANY WARRANTY; without even the implied warranty of
4664- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4665- * GNU Lesser General Public License for more details.
4666- *
4667- * You should have received a copy of the GNU Lesser General Public License
4668- * along with this program. If not, see <http://www.gnu.org/licenses/>.
4669- *
4670- * Authored by: Alexandros Frantzis <alexandros.frantzis@canonical.com>
4671- */
4672-
4673-#ifndef MIR_CLIENT_NATIVE_CLIENT_PLATFORM_FACTORY_
4674-#define MIR_CLIENT_NATIVE_CLIENT_PLATFORM_FACTORY_
4675-
4676-#include "client_platform_factory.h"
4677-
4678-namespace mir
4679-{
4680-namespace client
4681-{
4682-
4683-/**
4684- * Factory for creating the native client platform.
4685- * \ingroup platform_enablement
4686- */
4687-class NativeClientPlatformFactory : public ClientPlatformFactory
4688-{
4689-public:
4690- /**
4691- * Creates a client platform.
4692- *
4693- * This method needs to be implemented by each platform.
4694- *
4695- * \param [in] context information about the client
4696- */
4697- std::shared_ptr<ClientPlatform> create_client_platform(ClientContext* context);
4698-};
4699-
4700-}
4701-}
4702-
4703-#endif /* MIR_CLIENT_NATIVE_CLIENT_PLATFORM_FACTORY_ */
4704
4705=== modified file 'src/platform/CMakeLists.txt'
4706--- src/platform/CMakeLists.txt 2014-01-22 08:32:55 +0000
4707+++ src/platform/CMakeLists.txt 2014-03-06 09:14:28 +0000
4708@@ -17,3 +17,4 @@
4709 install(TARGETS mirplatform LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
4710
4711 add_subdirectory(graphics/)
4712+add_subdirectory(options)
4713
4714=== modified file 'src/platform/graphics/CMakeLists.txt'
4715--- src/platform/graphics/CMakeLists.txt 2014-01-22 08:32:55 +0000
4716+++ src/platform/graphics/CMakeLists.txt 2014-03-06 09:14:28 +0000
4717@@ -8,9 +8,9 @@
4718 egl_extensions.cpp
4719 egl_resources.cpp
4720 display_configuration.cpp
4721- null_display_report.cpp
4722 buffer_basic.cpp
4723 pixel_format_utils.cpp
4724+ overlapping_output_grouping.cpp
4725 )
4726
4727 add_library(
4728@@ -26,11 +26,11 @@
4729 ${EGL_LDFLAGS} ${EGL_LIBRARIES}
4730 )
4731
4732-if (MIR_PLATFORM STREQUAL "android")
4733+if (MIR_BUILD_PLATFORM_ANDROID)
4734 add_subdirectory(android/)
4735 endif()
4736
4737-if (MIR_PLATFORM STREQUAL "mesa")
4738+if (MIR_BUILD_PLATFORM_MESA)
4739 add_subdirectory(mesa/)
4740 endif()
4741
4742
4743=== modified file 'src/platform/graphics/android/CMakeLists.txt'
4744--- src/platform/graphics/android/CMakeLists.txt 2014-01-21 18:09:35 +0000
4745+++ src/platform/graphics/android/CMakeLists.txt 2014-03-06 09:14:28 +0000
4746@@ -4,8 +4,11 @@
4747 ${GLESv2_INCLUDE_DIRS}
4748 )
4749
4750+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpermissive")
4751+add_definitions( -DANDROID )
4752+
4753 add_library(
4754- mirplatformgraphics SHARED
4755+ mirplatformgraphicsandroid SHARED
4756
4757 android_platform.cpp
4758 android_buffer_allocator.cpp
4759@@ -31,8 +34,14 @@
4760 gl_context.cpp
4761 )
4762
4763+set_target_properties(
4764+ mirplatformgraphicsandroid PROPERTIES
4765+ OUTPUT_NAME mirplatformgraphics
4766+ LIBRARY_OUTPUT_DIRECTORY ${LIBRARY_OUTPUT_PATH}/android
4767+)
4768+
4769 target_link_libraries(
4770- mirplatformgraphics
4771+ mirplatformgraphicsandroid
4772
4773 mirplatform
4774 mirsharedandroid
4775@@ -42,4 +51,20 @@
4776 ${GLESv2_LDFLAGS} ${GLESv2_LIBRARIES}
4777 )
4778
4779-install(TARGETS mirplatformgraphics LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
4780+install(TARGETS mirplatformgraphicsandroid LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/mir/platformgraphics/android)
4781+
4782+if (MIR_TEST_PLATFORM STREQUAL "android")
4783+ add_custom_command(TARGET mirplatformgraphicsandroid
4784+ POST_BUILD
4785+ COMMAND ${CMAKE_COMMAND} -E remove libmirplatformgraphics.so
4786+ COMMAND ${CMAKE_COMMAND} -E create_symlink android/$<TARGET_FILE_NAME:mirplatformgraphicsandroid> libmirplatformgraphics.so
4787+ WORKING_DIRECTORY ${LIBRARY_OUTPUT_PATH}
4788+ )
4789+
4790+ install(CODE
4791+ "execute_process(
4792+ COMMAND ln -sf mir/platformgraphics/android/libmirplatformgraphics.so
4793+ WORKING_DIRECTORY \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}
4794+ )"
4795+ )
4796+endif()
4797
4798=== modified file 'src/platform/graphics/android/android_display.cpp'
4799--- src/platform/graphics/android/android_display.cpp 2014-01-31 07:48:24 +0000
4800+++ src/platform/graphics/android/android_display.cpp 2014-03-06 09:14:28 +0000
4801@@ -17,16 +17,17 @@
4802 */
4803
4804 #include "mir/graphics/platform.h"
4805-#include "mir/graphics/display_configuration.h"
4806+#include "android_display_configuration.h"
4807 #include "mir/graphics/display_report.h"
4808 #include "mir/graphics/display_buffer.h"
4809 #include "mir/graphics/gl_context.h"
4810 #include "mir/graphics/egl_resources.h"
4811 #include "android_display.h"
4812 #include "display_builder.h"
4813-#include "display_device.h"
4814 #include "mir/geometry/rectangle.h"
4815
4816+#include <boost/throw_exception.hpp>
4817+
4818 namespace mga=mir::graphics::android;
4819 namespace mg=mir::graphics;
4820 namespace geom=mir::geometry;
4821@@ -35,9 +36,7 @@
4822 std::shared_ptr<DisplayReport> const& display_report)
4823 : display_builder{display_builder},
4824 gl_context{display_builder->display_format(), *display_report},
4825- display_device(display_builder->create_display_device()),
4826- display_buffer{display_builder->create_display_buffer(display_device, gl_context)},
4827- current_configuration{display_buffer->view_area().size}
4828+ display_buffer{display_builder->create_display_buffer(gl_context)}
4829 {
4830 display_report->report_successful_setup_of_native_resources();
4831
4832@@ -54,32 +53,28 @@
4833
4834 std::unique_ptr<mg::DisplayConfiguration> mga::AndroidDisplay::configuration() const
4835 {
4836+<<<<<<< TREE
4837 return std::unique_ptr<mg::DisplayConfiguration>(
4838 new mga::AndroidDisplayConfiguration(current_configuration)
4839 );
4840+=======
4841+ return std::unique_ptr<mg::DisplayConfiguration>(
4842+ new mga::AndroidDisplayConfiguration(display_buffer->configuration()));
4843+>>>>>>> MERGE-SOURCE
4844 }
4845
4846 void mga::AndroidDisplay::configure(mg::DisplayConfiguration const& configuration)
4847 {
4848- MirOrientation orientation = mir_orientation_normal;
4849+ if (!configuration.valid())
4850+ {
4851+ BOOST_THROW_EXCEPTION(
4852+ std::logic_error("Invalid or inconsistent display configuration"));
4853+ }
4854
4855 configuration.for_each_output([&](mg::DisplayConfigurationOutput const& output)
4856 {
4857- // TODO: Properly support multiple outputs
4858- display_device->mode(output.power_mode);
4859- orientation = output.orientation;
4860+ display_buffer->configure(output);
4861 });
4862- current_configuration = dynamic_cast<mga::AndroidDisplayConfiguration const&>(configuration);
4863-
4864- /*
4865- * It's tempting to put orient() into the base class and so avoid this
4866- * cast, but we only need it in the Android implementation right now.
4867- */
4868- if (android::DisplayBuffer* db =
4869- dynamic_cast<mga::DisplayBuffer*>(display_buffer.get()))
4870- {
4871- db->orient(orientation);
4872- }
4873 }
4874
4875 void mga::AndroidDisplay::register_configuration_change_handler(
4876
4877=== modified file 'src/platform/graphics/android/android_display.h'
4878--- src/platform/graphics/android/android_display.h 2014-01-31 07:48:24 +0000
4879+++ src/platform/graphics/android/android_display.h 2014-03-06 09:14:28 +0000
4880@@ -19,9 +19,7 @@
4881 #ifndef MIR_GRAPHICS_ANDROID_ANDROID_DISPLAY_H_
4882 #define MIR_GRAPHICS_ANDROID_ANDROID_DISPLAY_H_
4883
4884-#include "display_buffer.h"
4885 #include "mir/graphics/display.h"
4886-#include "android_display_configuration.h"
4887 #include "gl_context.h"
4888
4889 #include <memory>
4890@@ -35,10 +33,9 @@
4891
4892 namespace android
4893 {
4894-class DisplayDevice;
4895-
4896 class DisplayBuilder;
4897 class DisplaySupportProvider;
4898+class ConfigurableDisplayBuffer;
4899
4900 class AndroidDisplay : public Display
4901 {
4902@@ -69,10 +66,9 @@
4903 private:
4904 std::shared_ptr<DisplayBuilder> const display_builder;
4905 GLContext gl_context;
4906- std::shared_ptr<DisplayDevice> const display_device;
4907+
4908 //we only have a primary display at the moment
4909- std::unique_ptr<graphics::DisplayBuffer> const display_buffer;
4910- AndroidDisplayConfiguration current_configuration;
4911+ std::unique_ptr<ConfigurableDisplayBuffer> const display_buffer;
4912 };
4913
4914 }
4915
4916=== modified file 'src/platform/graphics/android/android_display_configuration.cpp'
4917--- src/platform/graphics/android/android_display_configuration.cpp 2014-01-23 22:03:09 +0000
4918+++ src/platform/graphics/android/android_display_configuration.cpp 2014-03-06 09:14:28 +0000
4919@@ -20,25 +20,9 @@
4920 namespace mga = mg::android;
4921 namespace geom = mir::geometry;
4922
4923-mga::AndroidDisplayConfiguration::AndroidDisplayConfiguration(geom::Size const& display_size)
4924- : configuration{mg::DisplayConfigurationOutputId{1},
4925- mg::DisplayConfigurationCardId{0},
4926- mg::DisplayConfigurationOutputType::lvds,
4927- {
4928- mir_pixel_format_abgr_8888,
4929- mir_pixel_format_xbgr_8888
4930- },
4931- {mg::DisplayConfigurationMode{display_size,0.0f}},
4932- 0,
4933- geom::Size{0,0},
4934- true,
4935- true,
4936- geom::Point{0,0},
4937- 0,
4938- mir_pixel_format_abgr_8888,
4939- mir_power_mode_on,
4940- mir_orientation_normal},
4941- card{mg::DisplayConfigurationCardId{0}, 1}
4942+mga::AndroidDisplayConfiguration::AndroidDisplayConfiguration(mg::DisplayConfigurationOutput && output)
4943+ : configuration(std::move(output)),
4944+ card{mg::DisplayConfigurationCardId{0}, 1}
4945 {
4946 }
4947
4948@@ -68,10 +52,9 @@
4949 f(configuration);
4950 }
4951
4952-void mga::AndroidDisplayConfiguration::configure_output(
4953- mg::DisplayConfigurationOutputId, bool, geom::Point, size_t,
4954- MirPixelFormat, MirPowerMode power_mode, MirOrientation orientation)
4955+void mga::AndroidDisplayConfiguration::for_each_output(std::function<void(mg::UserDisplayConfigurationOutput&)> f)
4956 {
4957- configuration.power_mode = power_mode;
4958- configuration.orientation = orientation;
4959+ mg::UserDisplayConfigurationOutput user(configuration);
4960+ f(user);
4961 }
4962+
4963
4964=== modified file 'src/platform/graphics/android/android_display_configuration.h'
4965--- src/platform/graphics/android/android_display_configuration.h 2014-01-13 06:12:33 +0000
4966+++ src/platform/graphics/android/android_display_configuration.h 2014-03-06 09:14:28 +0000
4967@@ -29,7 +29,7 @@
4968 class AndroidDisplayConfiguration : public graphics::DisplayConfiguration
4969 {
4970 public:
4971- AndroidDisplayConfiguration(geometry::Size const& display_size);
4972+ AndroidDisplayConfiguration(DisplayConfigurationOutput&& output);
4973 AndroidDisplayConfiguration(AndroidDisplayConfiguration const& other);
4974 AndroidDisplayConfiguration& operator=(AndroidDisplayConfiguration const& other);
4975
4976@@ -37,10 +37,7 @@
4977
4978 void for_each_card(std::function<void(DisplayConfigurationCard const&)> f) const override;
4979 void for_each_output(std::function<void(DisplayConfigurationOutput const&)> f) const override;
4980- void configure_output(DisplayConfigurationOutputId id, bool used,
4981- geometry::Point top_left, size_t mode_index,
4982- MirPixelFormat format, MirPowerMode power_mode,
4983- MirOrientation) override;
4984+ void for_each_output(std::function<void(UserDisplayConfigurationOutput&)> f) override;
4985
4986 private:
4987 DisplayConfigurationOutput configuration;
4988
4989=== modified file 'src/platform/graphics/android/android_platform.cpp'
4990--- src/platform/graphics/android/android_platform.cpp 2014-02-04 23:20:36 +0000
4991+++ src/platform/graphics/android/android_platform.cpp 2014-03-06 09:14:28 +0000
4992@@ -29,9 +29,9 @@
4993 #include "mir/graphics/buffer_initializer.h"
4994 #include "mir/graphics/buffer_id.h"
4995 #include "mir/graphics/buffer_ipc_packer.h"
4996+#include "mir/graphics/display_report.h"
4997 #include "mir/options/option.h"
4998
4999-#include "mir/graphics/null_display_report.h"
5000 #include <boost/throw_exception.hpp>
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches