Merge lp:~afrantzis/mir/fix-mako-ci-use-steady-clock into lp:mir/0.1
- fix-mako-ci-use-steady-clock
- Merge into trusty
Status: | Superseded |
---|---|
Proposed branch: | lp:~afrantzis/mir/fix-mako-ci-use-steady-clock |
Merge into: | lp:mir/0.1 |
Diff against target: |
24552 lines (+4644/-4378) 487 files modified
CMakeLists.txt (+5/-5) cmake/MirCommon.cmake (+8/-1) debian/control (+2/-2) debian/libmirserver12.install (+1/-1) debian/mir-test-tools.install (+3/-0) debian/rules (+1/-4) doc/building_source_for_android.md (+0/-1) examples/demo-inprocess-surface-client/inprocess_egl_client.cpp (+1/-1) examples/demo-shell/window_manager.cpp (+6/-2) examples/eglapp.c (+18/-20) examples/fingerpaint.c (+12/-0) examples/render_surfaces.cpp (+6/-3) include/client/mir_toolkit/mir_client_library.h (+17/-17) include/client/mir_toolkit/mir_client_library_debug.h (+1/-1) include/platform/mir/graphics/buffer.h (+2/-2) include/platform/mir/graphics/buffer_properties.h (+4/-4) include/platform/mir/graphics/display_configuration.h (+1/-2) include/platform/mir/graphics/graphic_buffer_allocator.h (+1/-1) include/platform/mir/graphics/internal_surface.h (+1/-1) include/server/mir/compositor/buffer_stream.h (+3/-3) include/server/mir/compositor/compositing_criteria.h (+1/-1) include/server/mir/default_server_configuration.h (+2/-5) include/server/mir/frontend/message_processor_report.h (+1/-1) include/server/mir/frontend/null_message_processor_report.h (+1/-1) include/server/mir/frontend/session_authorizer.h (+1/-1) include/server/mir/frontend/surface.h (+2/-3) include/server/mir/input/input_configuration.h (+1/-1) include/server/mir/input/input_report.h (+2/-2) include/server/mir/input/null_input_report.h (+1/-1) include/server/mir/input/surface.h (+2/-2) include/server/mir/logging/glog_logger.h (+1/-1) include/server/mir/logging/input_report.h (+2/-2) include/server/mir/lttng/input_report.h (+2/-2) include/server/mir/scene/input_registrar.h (+1/-1) include/server/mir/shell/input_targeter.h (+1/-1) include/server/mir/shell/session_listener.h (+1/-1) include/server/mir/shell/surface.h (+2/-2) include/server/mir/shell/surface_configurator.h (+1/-1) include/server/mir/shell/surface_creation_parameters.h (+6/-6) include/shared/mir/geometry/pixel_format.h (+0/-54) include/shared/mir/geometry/rectangle.h (+1/-1) include/shared/mir/graphics/android/android_driver_interpreter.h (+1/-1) include/shared/mir/graphics/android/mir_native_window.h (+1/-1) include/shared/mir/graphics/android/native_buffer.h (+2/-2) include/shared/mir/input/android/android_input_lexicon.h (+1/-1) include/shared/mir/input/input_platform.h (+1/-1) include/shared/mir/input/xkb_mapper.h (+1/-1) include/shared/mir/logging/dumb_console_logger.h (+1/-1) include/shared/mir/logging/logger.h (+3/-15) include/shared/mir_toolkit/client_types.h (+11/-25) include/shared/mir_toolkit/common.h (+24/-0) include/shared/mir_toolkit/event.h (+13/-2) include/shared/mir_toolkit/mir_native_buffer.h (+1/-1) include/test/gmock_set_arg.h (+57/-0) include/test/mir_test/draw/draw_pattern_checkered-inl.h (+5/-6) include/test/mir_test/fake_event_hub_input_configuration.h (+1/-1) include/test/mir_test_doubles/mock_alloc_adaptor.h (+3/-3) include/test/mir_test_doubles/mock_android_native_buffer.h (+1/-1) include/test/mir_test_doubles/mock_android_registrar.h (+1/-1) include/test/mir_test_doubles/mock_buffer.h (+2/-2) include/test/mir_test_doubles/mock_buffer_bundle.h (+2/-2) include/test/mir_test_doubles/mock_buffer_stream.h (+2/-2) include/test/mir_test_doubles/mock_display_device.h (+2/-2) include/test/mir_test_doubles/mock_egl.h (+0/-1) include/test/mir_test_doubles/mock_fb_hal_device.h (+15/-6) include/test/mir_test_doubles/mock_framebuffer_bundle.h (+2/-2) include/test/mir_test_doubles/mock_frontend_surface.h (+2/-2) include/test/mir_test_doubles/mock_hwc_composer_device_1.h (+2/-2) include/test/mir_test_doubles/mock_hwc_layerlist.h (+1/-1) include/test/mir_test_doubles/mock_hwc_vsync_coordinator.h (+1/-1) include/test/mir_test_doubles/mock_input_dispatcher.h (+1/-1) include/test/mir_test_doubles/mock_input_surface.h (+1/-1) include/test/mir_test_doubles/mock_interpreter_resource_cache.h (+1/-1) include/test/mir_test_doubles/mock_session_listener.h (+1/-1) include/test/mir_test_doubles/mock_shell_session.h (+1/-1) include/test/mir_test_doubles/mock_surface.h (+4/-5) include/test/mir_test_doubles/mock_surface_ranker.h (+5/-5) include/test/mir_test_doubles/mock_surface_renderer.h (+2/-4) include/test/mir_test_doubles/mock_surface_state.h (+0/-71) include/test/mir_test_doubles/null_video_devices.h (+2/-2) include/test/mir_test_doubles/null_virtual_terminal.h (+2/-2) include/test/mir_test_doubles/stub_buffer.h (+3/-3) include/test/mir_test_doubles/stub_buffer_allocator.h (+1/-1) include/test/mir_test_doubles/stub_buffer_stream.h (+29/-31) include/test/mir_test_doubles/stub_display_builder.h (+4/-4) include/test/mir_test_doubles/stub_display_configuration.h (+7/-7) include/test/mir_test_doubles/stub_display_device.h (+3/-3) include/test/mir_test_doubles/stub_driver_interpreter.h (+1/-1) include/test/mir_test_doubles/stub_shell_session.h (+1/-1) include/test/mir_test_doubles/stub_surface.h (+0/-74) include/test/mir_test_doubles/stub_surface_builder.h (+14/-18) include/test/mir_test_doubles/stub_surface_ranker.h (+5/-5) include/test/mir_test_framework/cross_process_sync.h (+1/-1) include/test/mir_test_framework/display_server_test_fixture.h (+1/-0) include/test/mir_test_framework/input_testing_client_configuration.h (+67/-0) include/test/mir_test_framework/input_testing_server_configuration.h (+2/-2) include/test/mir_test_framework/testing_client_configuration.h (+1/-1) include/test/mir_test_framework/testing_process_manager.h (+1/-0) include/test/mir_test_framework/testing_server_configuration.h (+9/-0) native-compile.sh (+3/-3) src/client/CMakeLists.txt (+7/-6) src/client/aging_buffer.h (+0/-1) src/client/android/android_client_buffer.cpp (+3/-3) src/client/android/android_client_buffer.h (+3/-3) src/client/android/android_client_buffer_factory.cpp (+1/-1) src/client/android/android_client_buffer_factory.h (+2/-2) src/client/android/android_client_platform.cpp (+2/-2) src/client/android/android_client_platform.h (+1/-1) src/client/android/android_registrar.cpp (+1/-1) src/client/android/android_registrar_gralloc.h (+1/-1) src/client/android/client_surface_interpreter.cpp (+1/-1) src/client/android/client_surface_interpreter.h (+1/-1) src/client/client_buffer.h (+8/-3) src/client/client_buffer_depository.cpp (+1/-1) src/client/client_buffer_depository.h (+2/-2) src/client/client_buffer_factory.h (+2/-2) src/client/client_platform.h (+1/-1) src/client/default_connection_configuration.cpp (+1/-1) src/client/display_configuration.cpp (+5/-5) src/client/egl_native_display_container.h (+3/-3) src/client/logging/input_receiver_report.cpp (+2/-2) src/client/logging/rpc_report.cpp (+13/-13) src/client/mesa/buffer_file_ops.h (+12/-14) src/client/mesa/client_buffer.cpp (+30/-75) src/client/mesa/client_buffer.h (+16/-18) src/client/mesa/client_buffer_factory.cpp (+13/-9) src/client/mesa/client_buffer_factory.h (+11/-13) src/client/mesa/client_platform.cpp (+30/-58) src/client/mesa/client_platform.h (+11/-11) src/client/mesa/mesa_native_display_container.cpp (+10/-10) src/client/mesa/mesa_native_display_container.h (+4/-4) src/client/mesa/native_surface.cpp (+14/-14) src/client/mesa/native_surface.h (+8/-3) src/client/mir_client_library.cpp (+5/-5) src/client/mir_connection.cpp (+6/-6) src/client/mir_connection.h (+1/-1) src/client/mir_surface.cpp (+5/-5) src/client/mir_surface.h (+1/-2) src/client/rpc/mir_socket_rpc_channel.cpp (+1/-1) src/client/surface_map.cpp (+3/-3) src/platform/graphics/CMakeLists.txt (+10/-0) src/platform/graphics/android/android_alloc_adaptor.cpp (+4/-4) src/platform/graphics/android/android_alloc_adaptor.h (+4/-4) src/platform/graphics/android/android_buffer_allocator.cpp (+10/-10) src/platform/graphics/android/android_display.cpp (+3/-3) src/platform/graphics/android/android_display.h (+4/-4) src/platform/graphics/android/android_display_configuration.cpp (+4/-4) src/platform/graphics/android/android_display_configuration.h (+4/-4) src/platform/graphics/android/android_format_conversion-inl.h (+18/-18) src/platform/graphics/android/android_graphic_buffer_allocator.h (+5/-5) src/platform/graphics/android/android_platform.cpp (+7/-11) src/platform/graphics/android/android_platform.h (+3/-3) src/platform/graphics/android/buffer.cpp (+6/-6) src/platform/graphics/android/buffer.h (+4/-4) src/platform/graphics/android/buffer_usage.h (+3/-3) src/platform/graphics/android/display_buffer.cpp (+3/-3) src/platform/graphics/android/display_buffer.h (+4/-4) src/platform/graphics/android/display_builder.h (+5/-5) src/platform/graphics/android/display_device.h (+4/-4) src/platform/graphics/android/display_resource_factory.h (+3/-3) src/platform/graphics/android/fb_device.cpp (+15/-5) src/platform/graphics/android/fb_device.h (+6/-6) src/platform/graphics/android/framebuffer_bundle.h (+5/-5) src/platform/graphics/android/framebuffers.cpp (+12/-12) src/platform/graphics/android/framebuffers.h (+5/-5) src/platform/graphics/android/gl_context.cpp (+6/-7) src/platform/graphics/android/gl_context.h (+5/-5) src/platform/graphics/android/graphic_alloc_adaptor.h (+5/-5) src/platform/graphics/android/graphic_buffer_allocator.h (+5/-5) src/platform/graphics/android/hwc10_device.cpp (+3/-3) src/platform/graphics/android/hwc10_device.h (+4/-4) src/platform/graphics/android/hwc11_device.cpp (+3/-3) src/platform/graphics/android/hwc11_device.h (+6/-6) src/platform/graphics/android/hwc_common_device.cpp (+9/-9) src/platform/graphics/android/hwc_common_device.h (+4/-4) src/platform/graphics/android/hwc_layerlist.cpp (+11/-9) src/platform/graphics/android/hwc_layerlist.h (+3/-3) src/platform/graphics/android/hwc_vsync.cpp (+4/-4) src/platform/graphics/android/hwc_vsync.h (+4/-4) src/platform/graphics/android/hwc_vsync_coordinator.h (+4/-4) src/platform/graphics/android/internal_client.cpp (+4/-5) src/platform/graphics/android/internal_client.h (+3/-3) src/platform/graphics/android/internal_client_window.cpp (+29/-14) src/platform/graphics/android/internal_client_window.h (+17/-9) src/platform/graphics/android/interpreter_cache.cpp (+4/-4) src/platform/graphics/android/interpreter_cache.h (+3/-3) src/platform/graphics/android/interpreter_resource_cache.h (+3/-3) src/platform/graphics/android/output_builder.cpp (+6/-6) src/platform/graphics/android/output_builder.h (+4/-4) src/platform/graphics/android/resource_factory.cpp (+6/-6) src/platform/graphics/android/resource_factory.h (+3/-3) src/platform/graphics/android/server_render_window.cpp (+4/-4) src/platform/graphics/android/server_render_window.h (+6/-6) src/platform/graphics/mesa/CMakeLists.txt (+9/-7) src/platform/graphics/mesa/anonymous_shm_file.cpp (+129/-0) src/platform/graphics/mesa/anonymous_shm_file.h (+82/-0) src/platform/graphics/mesa/black_arrow.c (+1/-1) src/platform/graphics/mesa/buffer_allocator.cpp (+73/-34) src/platform/graphics/mesa/buffer_allocator.h (+16/-12) src/platform/graphics/mesa/buffer_texture_binder.h (+7/-7) src/platform/graphics/mesa/cursor.cpp (+18/-18) src/platform/graphics/mesa/cursor.h (+10/-10) src/platform/graphics/mesa/display.cpp (+39/-36) src/platform/graphics/mesa/display.h (+20/-19) src/platform/graphics/mesa/display_buffer.cpp (+28/-27) src/platform/graphics/mesa/display_buffer.h (+19/-19) src/platform/graphics/mesa/display_helpers.cpp (+31/-31) src/platform/graphics/mesa/display_helpers.h (+7/-7) src/platform/graphics/mesa/drm_close_threadsafe.cpp (+5/-5) src/platform/graphics/mesa/drm_close_threadsafe.h (+7/-7) src/platform/graphics/mesa/drm_mode_resources.cpp (+14/-14) src/platform/graphics/mesa/drm_mode_resources.h (+7/-7) src/platform/graphics/mesa/gbm_buffer.cpp (+22/-22) src/platform/graphics/mesa/gbm_buffer.h (+10/-10) src/platform/graphics/mesa/internal_client.cpp (+8/-8) src/platform/graphics/mesa/internal_client.h (+7/-7) src/platform/graphics/mesa/internal_native_display.cpp (+6/-6) src/platform/graphics/mesa/internal_native_display.h (+7/-7) src/platform/graphics/mesa/internal_native_surface.cpp (+15/-16) src/platform/graphics/mesa/internal_native_surface.h (+8/-8) src/platform/graphics/mesa/kms_display_configuration.h (+7/-7) src/platform/graphics/mesa/kms_output.h (+8/-8) src/platform/graphics/mesa/kms_output_container.h (+7/-7) src/platform/graphics/mesa/kms_page_flipper.cpp (+10/-10) src/platform/graphics/mesa/kms_page_flipper.h (+7/-7) src/platform/graphics/mesa/linux_virtual_terminal.cpp (+10/-10) src/platform/graphics/mesa/linux_virtual_terminal.h (+7/-7) src/platform/graphics/mesa/native_platform.cpp (+17/-17) src/platform/graphics/mesa/native_platform.h (+9/-11) src/platform/graphics/mesa/overlapping_output_grouping.cpp (+9/-9) src/platform/graphics/mesa/overlapping_output_grouping.h (+7/-7) src/platform/graphics/mesa/page_flipper.h (+7/-7) src/platform/graphics/mesa/platform.cpp (+35/-36) src/platform/graphics/mesa/platform.h (+16/-17) src/platform/graphics/mesa/real_kms_display_configuration.cpp (+19/-19) src/platform/graphics/mesa/real_kms_display_configuration.h (+7/-7) src/platform/graphics/mesa/real_kms_output.cpp (+27/-27) src/platform/graphics/mesa/real_kms_output.h (+9/-9) src/platform/graphics/mesa/real_kms_output_container.cpp (+8/-8) src/platform/graphics/mesa/real_kms_output_container.h (+7/-7) src/platform/graphics/mesa/shm_buffer.cpp (+87/-0) src/platform/graphics/mesa/shm_buffer.h (+67/-0) src/platform/graphics/mesa/shm_file.h (+50/-0) src/platform/graphics/mesa/udev_wrapper.cpp (+45/-45) src/platform/graphics/mesa/udev_wrapper.h (+8/-8) src/platform/graphics/mesa/virtual_terminal.h (+7/-7) src/server/CMakeLists.txt (+2/-1) src/server/asio_main_loop.cpp (+1/-1) src/server/compositor/buffer_bundle.h (+2/-2) src/server/compositor/buffer_stream_surfaces.cpp (+9/-5) src/server/compositor/buffer_stream_surfaces.h (+5/-5) src/server/compositor/default_configuration.cpp (+1/-18) src/server/compositor/default_display_buffer_compositor.cpp (+3/-7) src/server/compositor/default_display_buffer_compositor.h (+1/-4) src/server/compositor/default_display_buffer_compositor_factory.cpp (+3/-7) src/server/compositor/default_display_buffer_compositor_factory.h (+1/-4) src/server/compositor/gl_renderer.cpp (+4/-11) src/server/compositor/gl_renderer.h (+2/-6) src/server/compositor/overlay_renderer.h (+0/-53) src/server/compositor/renderer.h (+6/-7) src/server/compositor/rendering_operator.cpp (+8/-7) src/server/compositor/rendering_operator.h (+6/-2) src/server/compositor/switching_bundle.cpp (+5/-5) src/server/compositor/switching_bundle.h (+3/-3) src/server/compositor/temporary_buffers.cpp (+1/-13) src/server/compositor/temporary_buffers.h (+1/-11) src/server/default_server_configuration.cpp (+1/-1) src/server/frontend/CMakeLists.txt (+2/-2) src/server/frontend/event_sender.cpp (+1/-1) src/server/frontend/event_sender.h (+1/-1) src/server/frontend/fd_sets.h (+1/-1) src/server/frontend/message_receiver.h (+2/-2) src/server/frontend/session_mediator.cpp (+9/-12) src/server/frontend/session_mediator.h (+6/-6) src/server/frontend/session_mediator_android.cpp (+1/-1) src/server/frontend/socket_messenger.cpp (+4/-4) src/server/frontend/socket_messenger.h (+6/-6) src/server/frontend/socket_session.cpp (+1/-1) src/server/frontend/surface.cpp (+2/-2) src/server/graphics/CMakeLists.txt (+0/-10) src/server/graphics/nested/nested_display.cpp (+1/-1) src/server/graphics/nested/nested_display_configuration.cpp (+3/-3) src/server/graphics/offscreen/display_buffer.cpp (+0/-6) src/server/graphics/offscreen/display_configuration.cpp (+1/-1) src/server/input/android/android_input_application_handle.cpp (+1/-1) src/server/input/android/android_input_channel.cpp (+1/-1) src/server/input/android/android_input_reader_policy.cpp (+1/-1) src/server/input/android/android_input_registrar.cpp (+1/-1) src/server/input/android/android_input_target_enumerator.h (+2/-2) src/server/input/android/android_input_targeter.cpp (+3/-3) src/server/input/android/android_input_window_handle.cpp (+1/-1) src/server/input/android/android_window_handle_repository.h (+1/-1) src/server/input/android/event_filter_dispatcher_policy.cpp (+1/-1) src/server/input/null_input_configuration.cpp (+1/-1) src/server/input/null_input_configuration.h (+1/-1) src/server/logging/connector_report.cpp (+8/-8) src/server/logging/display_report.cpp (+13/-13) src/server/logging/input_report.cpp (+13/-13) src/server/logging/message_processor_report.cpp (+6/-6) src/server/logging/session_mediator_report.cpp (+9/-9) src/server/scene/CMakeLists.txt (+1/-1) src/server/scene/application_session.cpp (+3/-3) src/server/scene/basic_surface.cpp (+76/-87) src/server/scene/basic_surface.h (+44/-32) src/server/scene/basic_surface_factory.h (+8/-8) src/server/scene/default_configuration.cpp (+2/-2) src/server/scene/default_session_container.cpp (+3/-3) src/server/scene/global_event_sender.cpp (+1/-1) src/server/scene/mediating_display_changer.cpp (+2/-2) src/server/scene/mutable_surface_state.h (+1/-1) src/server/scene/scene_report.cpp (+4/-4) src/server/scene/session_manager.cpp (+1/-1) src/server/scene/surface.h (+0/-81) src/server/scene/surface_allocator.cpp (+8/-2) src/server/scene/surface_allocator.h (+2/-2) src/server/scene/surface_builder.h (+1/-2) src/server/scene/surface_controller.cpp (+1/-1) src/server/scene/surface_controller.h (+3/-3) src/server/scene/surface_data.cpp (+2/-2) src/server/scene/surface_data.h (+5/-2) src/server/scene/surface_impl.cpp (+16/-8) src/server/scene/surface_impl.h (+4/-6) src/server/scene/surface_ranker.h (+11/-15) src/server/scene/surface_source.cpp (+2/-2) src/server/scene/surface_stack.cpp (+2/-3) src/server/scene/surface_stack.h (+6/-6) src/server/scene/surface_state.h (+0/-43) src/server/shell/default_configuration.cpp (+1/-1) src/server/shell/default_focus_mechanism.cpp (+4/-4) src/server/shell/default_focus_mechanism.h (+3/-3) src/server/shell/surface_creation_parameters.cpp (+6/-6) src/shared/CMakeLists.txt (+1/-0) src/shared/env/CMakeLists.txt (+19/-0) src/shared/graphics/android/mir_native_window.cpp (+1/-1) src/shared/graphics/android/syncfence.cpp (+2/-2) src/shared/input/android/android_input_platform.h (+1/-1) src/shared/input/android/android_input_receiver.cpp (+4/-4) src/shared/input/android/android_input_receiver.h (+3/-3) src/shared/input/android/android_input_receiver_thread.h (+2/-2) src/shared/input/xkb_mapper.cpp (+5/-5) src/shared/logging/CMakeLists.txt (+1/-9) src/shared/logging/dumb_console_logger.cpp (+17/-2) tests/CMakeLists.txt (+3/-6) tests/acceptance-tests/CMakeLists.txt (+15/-4) tests/acceptance-tests/test_client_authorization.cpp (+29/-16) tests/acceptance-tests/test_client_focus_notification.cpp (+5/-5) tests/acceptance-tests/test_client_input.cpp (+58/-153) tests/acceptance-tests/test_client_library.cpp (+6/-4) tests/acceptance-tests/test_focus_selection.cpp (+1/-1) tests/acceptance-tests/test_nested_mir.cpp (+5/-5) tests/acceptance-tests/test_server_shutdown.cpp (+20/-12) tests/acceptance-tests/test_shell_control_of_surface_configuration.cpp (+1/-1) tests/acceptance-tests/test_surfaceloop.cpp (+1/-1) tests/draw/android_graphics.cpp (+2/-2) tests/draw/patterns.cpp (+3/-4) tests/integration-tests/CMakeLists.txt (+17/-6) tests/integration-tests/client/test_client_render.cpp (+11/-11) tests/integration-tests/compositor/test_buffer_stream.cpp (+35/-27) tests/integration-tests/compositor/test_swapping_swappers.cpp (+3/-3) tests/integration-tests/graphics/android/test_buffer_integration.cpp (+3/-3) tests/integration-tests/graphics/android/test_display_integration.cpp (+4/-4) tests/integration-tests/graphics/android/test_internal_client.cpp (+9/-9) tests/integration-tests/graphics/mesa/test_buffer_integration.cpp (+6/-9) tests/integration-tests/input/android/test_android_input_manager.cpp (+4/-4) tests/integration-tests/shell/test_session_lifecycle_event.cpp (+2/-2) tests/integration-tests/test_display_info.cpp (+12/-11) tests/integration-tests/test_display_server_main_loop_events.cpp (+1/-1) tests/integration-tests/test_session.cpp (+8/-9) tests/integration-tests/test_surface_first_frame_sync.cpp (+4/-2) tests/integration-tests/test_surfaceloop.cpp (+15/-62) tests/integration-tests/test_swapinterval.cpp (+6/-5) tests/mir_test/display_config_matchers.cpp (+4/-5) tests/mir_test_doubles/CMakeLists.txt (+1/-1) tests/mir_test_doubles/mock_android_hw.cpp (+1/-1) tests/mir_test_doubles/mock_drm.cpp (+20/-20) tests/mir_test_doubles/mock_egl.cpp (+0/-39) tests/mir_test_framework/CMakeLists.txt (+3/-2) tests/mir_test_framework/cross_process_sync.cpp (+1/-1) tests/mir_test_framework/display_server_test_fixture.cpp (+5/-0) tests/mir_test_framework/input_testing_client_configuration.cpp (+89/-0) tests/mir_test_framework/input_testing_server_options.cpp (+1/-1) tests/mir_test_framework/process.cpp (+2/-2) tests/mir_test_framework/socket_detect_server.cpp (+2/-2) tests/mir_test_framework/testing_client_options.cpp (+4/-4) tests/mir_test_framework/testing_process_manager.cpp (+20/-10) tests/mir_test_framework/testing_server_options.cpp (+61/-8) tests/unit-tests/CMakeLists.txt (+14/-8) tests/unit-tests/client/CMakeLists.txt (+2/-2) tests/unit-tests/client/android/test_android_native_window.cpp (+2/-2) tests/unit-tests/client/android/test_client_android_buffer.cpp (+3/-3) tests/unit-tests/client/android/test_client_android_registrar.cpp (+3/-3) tests/unit-tests/client/android/test_client_surface_interpreter.cpp (+2/-2) tests/unit-tests/client/gbm/mock_drm_fd_handler.h (+0/-46) tests/unit-tests/client/input/test_android_input_receiver.cpp (+15/-15) tests/unit-tests/client/input/test_android_input_receiver_thread.cpp (+4/-4) tests/unit-tests/client/input/test_xkb_mapper.cpp (+3/-3) tests/unit-tests/client/mesa/CMakeLists.txt (+2/-2) tests/unit-tests/client/mesa/test_client_buffer.cpp (+55/-112) tests/unit-tests/client/mesa/test_client_platform.cpp (+3/-3) tests/unit-tests/client/mesa/test_mesa_native_display_container.cpp (+2/-2) tests/unit-tests/client/mesa/test_native_surface.cpp (+12/-12) tests/unit-tests/client/test_aging_buffer.cpp (+1/-1) tests/unit-tests/client/test_android_client_buffer_factory.cpp (+2/-2) tests/unit-tests/client/test_client_buffer_depository.cpp (+5/-5) tests/unit-tests/client/test_client_display_conf.cpp (+3/-3) tests/unit-tests/client/test_client_mir_surface.cpp (+13/-13) tests/unit-tests/client/test_client_platform.cpp (+1/-1) tests/unit-tests/client/test_mir_connection.cpp (+3/-3) tests/unit-tests/compositor/test_buffer_stream.cpp (+11/-5) tests/unit-tests/compositor/test_default_display_buffer_compositor.cpp (+44/-93) tests/unit-tests/compositor/test_gl_renderer.cpp (+7/-41) tests/unit-tests/compositor/test_rendering_operator.cpp (+33/-72) tests/unit-tests/compositor/test_switching_bundle.cpp (+5/-17) tests/unit-tests/compositor/test_temporary_buffers.cpp (+4/-27) tests/unit-tests/frontend/CMakeLists.txt (+2/-2) tests/unit-tests/frontend/test_event_sender.cpp (+37/-1) tests/unit-tests/frontend/test_published_socket_connector.cpp (+1/-1) tests/unit-tests/frontend/test_session_mediator.cpp (+42/-71) tests/unit-tests/frontend/test_session_mediator_android.cpp (+2/-2) tests/unit-tests/frontend/test_session_mediator_mesa.cpp (+6/-6) tests/unit-tests/frontend/test_socket_session.cpp (+2/-2) tests/unit-tests/graphics/CMakeLists.txt (+2/-2) tests/unit-tests/graphics/android/test_android_alloc_adaptor.cpp (+4/-4) tests/unit-tests/graphics/android/test_android_buffer_allocator.cpp (+8/-8) tests/unit-tests/graphics/android/test_android_fb.cpp (+10/-10) tests/unit-tests/graphics/android/test_android_platform.cpp (+20/-3) tests/unit-tests/graphics/android/test_buffer.cpp (+6/-6) tests/unit-tests/graphics/android/test_buffer_tex_bind.cpp (+5/-12) tests/unit-tests/graphics/android/test_external_refcount.cpp (+4/-4) tests/unit-tests/graphics/android/test_fb_device.cpp (+29/-5) tests/unit-tests/graphics/android/test_fb_simple_swapper.cpp (+13/-13) tests/unit-tests/graphics/android/test_hwc10_device.cpp (+12/-10) tests/unit-tests/graphics/android/test_hwc11_device.cpp (+5/-3) tests/unit-tests/graphics/android/test_hwc_device.cpp (+5/-5) tests/unit-tests/graphics/android/test_hwc_display.cpp (+7/-7) tests/unit-tests/graphics/android/test_hwc_layerlist.cpp (+18/-17) tests/unit-tests/graphics/android/test_internal_client.cpp (+2/-3) tests/unit-tests/graphics/android/test_internal_client_interpreter.cpp (+22/-44) tests/unit-tests/graphics/android/test_interpreter_buffer_cache.cpp (+2/-2) tests/unit-tests/graphics/android/test_output_builder.cpp (+8/-8) tests/unit-tests/graphics/android/test_pixel_format.cpp (+10/-11) tests/unit-tests/graphics/android/test_resource_factory.cpp (+3/-3) tests/unit-tests/graphics/android/test_server_interpreter.cpp (+10/-10) tests/unit-tests/graphics/android/test_sync_fence.cpp (+1/-1) tests/unit-tests/graphics/mesa/CMakeLists.txt (+9/-7) tests/unit-tests/graphics/mesa/test_anonymous_shm_file.cpp (+260/-0) tests/unit-tests/graphics/mesa/test_buffer_allocator.cpp (+44/-46) tests/unit-tests/graphics/mesa/test_cursor.cpp (+29/-29) tests/unit-tests/graphics/mesa/test_display.cpp (+67/-46) tests/unit-tests/graphics/mesa/test_display_configuration.cpp (+13/-14) tests/unit-tests/graphics/mesa/test_display_multi_monitor.cpp (+12/-12) tests/unit-tests/graphics/mesa/test_gbm_buffer.cpp (+21/-20) tests/unit-tests/graphics/mesa/test_internal_client.cpp (+7/-8) tests/unit-tests/graphics/mesa/test_internal_native_display.cpp (+5/-14) tests/unit-tests/graphics/mesa/test_internal_native_surface.cpp (+16/-44) tests/unit-tests/graphics/mesa/test_kms_page_flipper.cpp (+6/-6) tests/unit-tests/graphics/mesa/test_linux_virtual_terminal.cpp (+23/-23) tests/unit-tests/graphics/mesa/test_native_platform.cpp (+8/-8) tests/unit-tests/graphics/mesa/test_overlapping_output_grouping.cpp (+4/-4) tests/unit-tests/graphics/mesa/test_platform.cpp (+21/-21) tests/unit-tests/graphics/mesa/test_real_kms_output.cpp (+12/-12) tests/unit-tests/graphics/mesa/test_shm_buffer.cpp (+101/-0) tests/unit-tests/graphics/mesa/test_udev_helper.cpp (+69/-69) tests/unit-tests/graphics/test_buffer_properties.cpp (+6/-6) tests/unit-tests/graphics/test_default_display_configuration_policy.cpp (+3/-3) tests/unit-tests/graphics/test_display.cpp (+4/-4) tests/unit-tests/graphics/test_display_configuration.cpp (+1/-1) tests/unit-tests/graphics/test_graphics_platform.cpp (+3/-3) tests/unit-tests/input/android/test_android_input_registrar.cpp (+5/-5) tests/unit-tests/input/android/test_android_input_target_enumerator.cpp (+3/-3) tests/unit-tests/input/android/test_android_input_targeter.cpp (+2/-2) tests/unit-tests/logging/test_display_report.cpp (+1/-1) tests/unit-tests/scene/test_application_session.cpp (+12/-13) tests/unit-tests/scene/test_default_focus_mechanism.cpp (+16/-18) tests/unit-tests/scene/test_global_event_sender.cpp (+1/-1) tests/unit-tests/scene/test_session_manager.cpp (+3/-5) tests/unit-tests/scene/test_surface.cpp (+101/-136) tests/unit-tests/scene/test_surface_controller.cpp (+1/-1) tests/unit-tests/scene/test_surface_data.cpp (+4/-6) tests/unit-tests/scene/test_surface_impl.cpp (+64/-38) tests/unit-tests/scene/test_surface_stack.cpp (+18/-17) tests/unit-tests/scene/test_the_session_container_implementation.cpp (+3/-3) tests/unit-tests/scene/test_threaded_snapshot_strategy.cpp (+2/-2) tests/unit-tests/shell/test_organising_surface_factory.cpp (+1/-1) tests/unit-tests/test_asio_main_loop.cpp (+1/-1) tools/install_on_android.sh (+9/-9) tools/setup-partial-armhf-chroot.sh (+30/-72) |
To merge this branch: | bzr merge lp:~afrantzis/mir/fix-mako-ci-use-steady-clock |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Alan Griffiths | Needs Resubmitting | ||
Review via email: mp+199469@code.launchpad.net |
This proposal has been superseded by a proposal from 2013-12-18.
Commit message
tests: Use steady_clock to keep track of timeouts and intervals
The previously used system_clock is affected by changes in the
system clock. This causes issues when such a change occurs
while we are keeping track of a timeout or an elapsed time interval.
Description of the change
tests: Use steady_clock to keep track of timeouts and intervals
The previously used system_clock is affected by changes in the system clock. This causes issues when such a change occurs while we are keeping track of a timeout or an elapsed time interval.
An instance of this problem occured when running integration tests in CI on real devices, because during startup the devices updated their system clock to match the current date. Our tests happened to run early enough for this to happen while we were waiting for a timeout to occur, most commonly while waiting for the client or server processes to finish.
Note that steady_clock is really steady only in g++ 4.8.1 and later. Previously it was the same as system_clock.
Alan Griffiths (alan-griffiths) wrote : | # |
Preview Diff
1 | === modified file 'CMakeLists.txt' |
2 | --- CMakeLists.txt 2013-11-21 03:23:50 +0000 |
3 | +++ CMakeLists.txt 2013-12-18 14:40:47 +0000 |
4 | @@ -87,13 +87,13 @@ |
5 | ) |
6 | endif(MIR_DISABLE_EPOLL_REACTOR) |
7 | |
8 | -# Default to gbm backend |
9 | +# Default to mesa backend |
10 | set( |
11 | MIR_PLATFORM |
12 | - gbm |
13 | + mesa |
14 | CACHE |
15 | STRING |
16 | - "graphics backend to build (options are 'gbm' or 'android')" |
17 | + "graphics backend to build (options are 'mesa' or 'android')" |
18 | ) |
19 | |
20 | find_package(EGL REQUIRED) |
21 | @@ -124,14 +124,14 @@ |
22 | |
23 | #ctest does not work for android, so turn test discovery off |
24 | set(DISABLE_GTEST_TEST_DISCOVERY ON) |
25 | -elseif (MIR_PLATFORM STREQUAL "gbm") |
26 | +elseif (MIR_PLATFORM STREQUAL "mesa") |
27 | find_package( PkgConfig ) |
28 | pkg_check_modules( GBM REQUIRED gbm>=9.0.0) |
29 | pkg_check_modules( DRM REQUIRED libdrm ) |
30 | pkg_check_modules( UDEV REQUIRED libudev ) |
31 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__GBM__") |
32 | else () |
33 | - message (FATAL_ERROR "MIR_BACKEND must be either 'android' or 'gbm'") |
34 | + message (FATAL_ERROR "MIR_BACKEND must be either 'android' or 'mesa'") |
35 | endif() |
36 | |
37 | set(MIR_ANDROID_INCLUDE_DIRECTORIES) # to be filled by android-input |
38 | |
39 | === modified file 'cmake/MirCommon.cmake' |
40 | --- cmake/MirCommon.cmake 2013-08-28 03:41:48 +0000 |
41 | +++ cmake/MirCommon.cmake 2013-12-18 14:40:47 +0000 |
42 | @@ -19,8 +19,15 @@ |
43 | valgrind) |
44 | |
45 | if(VALGRIND_EXECUTABLE) |
46 | - set(VALGRIND_ARGS "--error-exitcode=1 --trace-children=yes") |
47 | + if(MIR_PLATFORM STREQUAL "android") |
48 | + # don't exit with an error when valgrind find errors |
49 | + #set(VALGRIND_ARGS "--error-exitcode=1") |
50 | + else() |
51 | + set(VALGRIND_ARGS "--error-exitcode=1 --trace-children=yes") |
52 | + endif() |
53 | + |
54 | set(ENABLE_MEMCHECK_FLAG "--enable-memcheck") |
55 | + |
56 | else(VALGRIND_EXECUTABLE) |
57 | message("Not enabling memcheck as valgrind is missing on your system") |
58 | endif(VALGRIND_EXECUTABLE) |
59 | |
60 | === modified file 'debian/control' |
61 | --- debian/control 2013-11-21 03:16:21 +0000 |
62 | +++ debian/control 2013-12-18 14:40:47 +0000 |
63 | @@ -69,7 +69,7 @@ |
64 | . |
65 | Contains the protocol's definition files. |
66 | |
67 | -Package: libmirserver11 |
68 | +Package: libmirserver12 |
69 | Section: libs |
70 | Architecture: i386 amd64 armhf arm64 |
71 | Multi-Arch: same |
72 | @@ -115,7 +115,7 @@ |
73 | Architecture: i386 amd64 armhf arm64 |
74 | Multi-Arch: same |
75 | Pre-Depends: ${misc:Pre-Depends} |
76 | -Depends: libmirserver11 (= ${binary:Version}), |
77 | +Depends: libmirserver12 (= ${binary:Version}), |
78 | libmirprotobuf-dev (= ${binary:Version}), |
79 | mircommon-dev (= ${binary:Version}), |
80 | libglm-dev, |
81 | |
82 | === renamed file 'debian/libmirserver11.install' => 'debian/libmirserver12.install' |
83 | --- debian/libmirserver11.install 2013-11-21 03:16:21 +0000 |
84 | +++ debian/libmirserver12.install 2013-12-18 14:40:47 +0000 |
85 | @@ -1,1 +1,1 @@ |
86 | -usr/lib/*/libmirserver.so.11 |
87 | +usr/lib/*/libmirserver.so.12 |
88 | |
89 | === modified file 'debian/mir-test-tools.install' |
90 | --- debian/mir-test-tools.install 2013-08-28 03:41:48 +0000 |
91 | +++ debian/mir-test-tools.install 2013-12-18 14:40:47 +0000 |
92 | @@ -1,3 +1,6 @@ |
93 | usr/bin/mir_stress |
94 | +usr/bin/mir_unit_tests |
95 | +usr/bin/mir_acceptance_tests |
96 | +usr/bin/mir_integration_tests |
97 | usr/lib/*/mir/tools/libmirclientlttng.so |
98 | usr/lib/*/mir/tools/libmirserverlttng.so |
99 | |
100 | === modified file 'debian/rules' |
101 | --- debian/rules 2013-11-21 03:16:21 +0000 |
102 | +++ debian/rules 2013-12-18 14:40:47 +0000 |
103 | @@ -21,10 +21,7 @@ |
104 | ifeq ($(DEB_HOST_ARCH),armhf) |
105 | dh_auto_configure -- \ |
106 | $(COMMON_CONFIGURE_OPTIONS) \ |
107 | - -DMIR_PLATFORM=android \ |
108 | - -DMIR_ENABLE_UNIT_TESTS=NO \ |
109 | - -DMIR_ENABLE_ACCEPTANCE_TESTS=NO \ |
110 | - -DMIR_ENABLE_INTEGRATION_TESTS=NO |
111 | + -DMIR_PLATFORM=android |
112 | else |
113 | ifeq ($(DEB_HOST_ARCH),powerpc) |
114 | dh_auto_configure -- \ |
115 | |
116 | === modified file 'doc/building_source_for_android.md' |
117 | --- doc/building_source_for_android.md 2013-11-21 03:16:21 +0000 |
118 | +++ doc/building_source_for_android.md 2013-12-18 14:40:47 +0000 |
119 | @@ -66,7 +66,6 @@ |
120 | |
121 | Then you should run: |
122 | |
123 | - $ dpkg --add-architecture armhf |
124 | $ apt-get update |
125 | |
126 | To test, try downloading a package like this: |
127 | |
128 | === modified file 'examples/demo-inprocess-surface-client/inprocess_egl_client.cpp' |
129 | --- examples/demo-inprocess-surface-client/inprocess_egl_client.cpp 2013-11-21 03:16:21 +0000 |
130 | +++ examples/demo-inprocess-surface-client/inprocess_egl_client.cpp 2013-12-18 14:40:47 +0000 |
131 | @@ -92,7 +92,7 @@ |
132 | auto params = msh::a_surface().of_name("Inprocess EGL Demo") |
133 | .of_size(surface_size) |
134 | .of_buffer_usage(mg::BufferUsage::hardware) |
135 | - .of_pixel_format(geom::PixelFormat::argb_8888); |
136 | + .of_pixel_format(mir_pixel_format_argb_8888); |
137 | auto session = shell->open_session("Inprocess client", std::make_shared<NullEventSink>()); |
138 | // TODO: Why do we get an ID? ~racarr |
139 | auto surface = session->get_surface(shell->create_surface_for(session, params)); |
140 | |
141 | === modified file 'examples/demo-shell/window_manager.cpp' |
142 | --- examples/demo-shell/window_manager.cpp 2013-11-21 12:34:49 +0000 |
143 | +++ examples/demo-shell/window_manager.cpp 2013-12-18 14:40:47 +0000 |
144 | @@ -27,6 +27,7 @@ |
145 | #include "mir/compositor/compositor.h" |
146 | |
147 | #include <linux/input.h> |
148 | +#include <android/keycodes.h> // TODO remove this dependency |
149 | |
150 | #include <cassert> |
151 | #include <cstdlib> |
152 | @@ -133,7 +134,9 @@ |
153 | focus_controller->focus_next(); |
154 | return true; |
155 | } |
156 | - if (event.key.modifiers & mir_key_modifier_alt && event.key.scan_code == KEY_P) |
157 | + else if ((event.key.modifiers & mir_key_modifier_alt && |
158 | + event.key.scan_code == KEY_P) || |
159 | + (event.key.key_code == AKEYCODE_POWER)) |
160 | { |
161 | compositor->stop(); |
162 | auto conf = display->configuration(); |
163 | @@ -155,7 +158,8 @@ |
164 | display_off = !display_off; |
165 | |
166 | display->configure(*conf.get()); |
167 | - compositor->start(); |
168 | + if (!display_off) |
169 | + compositor->start(); |
170 | return true; |
171 | } |
172 | } |
173 | |
174 | === modified file 'examples/eglapp.c' |
175 | --- examples/eglapp.c 2013-11-21 03:16:21 +0000 |
176 | +++ examples/eglapp.c 2013-12-18 14:40:47 +0000 |
177 | @@ -93,8 +93,12 @@ |
178 | lastcount = count; |
179 | } |
180 | |
181 | - /* This is one way to handle window resizing. But in future it would be |
182 | - better to have resize events coming from the server */ |
183 | + /* |
184 | + * Querying the surface (actually the current buffer) dimensions here is |
185 | + * the only truly safe way to be sure that the dimensions we think we |
186 | + * have are those of the buffer being rendered to. But this should be |
187 | + * improved in future; https://bugs.launchpad.net/mir/+bug/1194384 |
188 | + */ |
189 | if (eglQuerySurface(egldisplay, eglsurface, EGL_WIDTH, &width) && |
190 | eglQuerySurface(egldisplay, eglsurface, EGL_HEIGHT, &height)) |
191 | { |
192 | @@ -102,7 +106,7 @@ |
193 | } |
194 | } |
195 | |
196 | -static void mir_eglapp_handle_input(MirSurface* surface, MirEvent const* ev, void* context) |
197 | +static void mir_eglapp_handle_event(MirSurface* surface, MirEvent const* ev, void* context) |
198 | { |
199 | (void) surface; |
200 | (void) context; |
201 | @@ -112,22 +116,16 @@ |
202 | { |
203 | running = 0; |
204 | } |
205 | -} |
206 | - |
207 | -static unsigned int get_bpp(MirPixelFormat pf) |
208 | -{ |
209 | - switch (pf) |
210 | + else if (ev->type == mir_event_type_resize) |
211 | { |
212 | - case mir_pixel_format_abgr_8888: |
213 | - case mir_pixel_format_xbgr_8888: |
214 | - case mir_pixel_format_argb_8888: |
215 | - case mir_pixel_format_xrgb_8888: |
216 | - return 32; |
217 | - case mir_pixel_format_bgr_888: |
218 | - return 24; |
219 | - case mir_pixel_format_invalid: |
220 | - default: |
221 | - return 0; |
222 | + /* |
223 | + * FIXME: https://bugs.launchpad.net/mir/+bug/1194384 |
224 | + * It is unsafe to set the width and height here because we're in a |
225 | + * different thread to that doing the rendering. So we either need |
226 | + * support for event queuing (directing them to another thread) or |
227 | + * full single-threaded callbacks. (LP: #1194384). |
228 | + */ |
229 | + printf("Resized to %dx%d\n", ev->resize.width, ev->resize.height); |
230 | } |
231 | } |
232 | |
233 | @@ -172,7 +170,7 @@ |
234 | }; |
235 | MirEventDelegate delegate = |
236 | { |
237 | - mir_eglapp_handle_input, |
238 | + mir_eglapp_handle_event, |
239 | NULL |
240 | }; |
241 | EGLConfig eglconfig; |
242 | @@ -342,7 +340,7 @@ |
243 | |
244 | printf("Server supports %d of %d surface pixel formats. Using format: %d\n", |
245 | nformats, mir_pixel_formats, surfaceparm.pixel_format); |
246 | - unsigned int bpp = get_bpp(surfaceparm.pixel_format); |
247 | + unsigned int bpp = 8 * MIR_BYTES_PER_PIXEL(surfaceparm.pixel_format); |
248 | EGLint attribs[] = |
249 | { |
250 | EGL_SURFACE_TYPE, EGL_WINDOW_BIT, |
251 | |
252 | === modified file 'examples/fingerpaint.c' |
253 | --- examples/fingerpaint.c 2013-09-19 13:24:22 +0000 |
254 | +++ examples/fingerpaint.c 2013-12-18 14:40:47 +0000 |
255 | @@ -247,6 +247,18 @@ |
256 | redraw(surface, canvas); |
257 | } |
258 | } |
259 | + else if (event->type == mir_event_type_resize) |
260 | + { |
261 | + /* FIXME: https://bugs.launchpad.net/mir/+bug/1194384 |
262 | + * mir_event_type_resize will arrive in a different thread to that of |
263 | + * mir_event_type_motion, so we cannot safely redraw from this thread. |
264 | + * Either the callbacks will need to become thread-safe, or we'd have |
265 | + * to employ some non-trivial event queuing and inter-thread signals, |
266 | + * which I think is beyond the scope of this example code. |
267 | + * |
268 | + * redraw(surface, canvas); |
269 | + */ |
270 | + } |
271 | } |
272 | |
273 | static const MirDisplayOutput *find_active_output( |
274 | |
275 | === modified file 'examples/render_surfaces.cpp' |
276 | --- examples/render_surfaces.cpp 2013-11-21 12:34:49 +0000 |
277 | +++ examples/render_surfaces.cpp 2013-12-18 14:40:47 +0000 |
278 | @@ -414,12 +414,15 @@ |
279 | mf::SurfaceId(), {}); |
280 | |
281 | /* |
282 | - * We call advance_client_buffer() twice so that the surface is |
283 | + * We call swap_buffers() twice so that the surface is |
284 | * considers the first buffer to be posted. |
285 | * (TODO There must be a better way!) |
286 | */ |
287 | - s->advance_client_buffer(); |
288 | - s->advance_client_buffer(); |
289 | + { |
290 | + mg::Buffer* buffer{nullptr}; |
291 | + s->swap_buffers(buffer); |
292 | + s->swap_buffers(buffer); |
293 | + } |
294 | |
295 | /* |
296 | * Place each surface at a different starting location and give it a |
297 | |
298 | === modified file 'include/client/mir_toolkit/mir_client_library.h' |
299 | --- include/client/mir_toolkit/mir_client_library.h 2013-11-21 12:34:49 +0000 |
300 | +++ include/client/mir_toolkit/mir_client_library.h 2013-12-18 14:40:47 +0000 |
301 | @@ -66,10 +66,10 @@ |
302 | /** |
303 | * Test for a valid connection |
304 | * \param [in] connection The connection |
305 | - * \return A non-zero value if the supplied connection is |
306 | - * valid, 0 otherwise |
307 | + * \return True if the supplied connection is valid, or |
308 | + * false otherwise. |
309 | */ |
310 | -int mir_connection_is_valid(MirConnection *connection); |
311 | +MirBool mir_connection_is_valid(MirConnection *connection); |
312 | |
313 | /** |
314 | * Retrieve a text description of the last error. The returned string is owned |
315 | @@ -104,7 +104,7 @@ |
316 | void mir_connection_set_lifecycle_event_callback(MirConnection* connection, |
317 | mir_lifecycle_event_callback callback, void* context); |
318 | |
319 | -/** |
320 | +/** |
321 | * \deprecated Use mir_connection_create_display_config |
322 | */ |
323 | __attribute__((__deprecated__("Use mir_connection_create_display_config()"))) |
324 | @@ -112,8 +112,8 @@ |
325 | |
326 | /** |
327 | * Query the display |
328 | - * \warning return value must be destroyed via mir_display_config_destroy() |
329 | - * \warning may return null if connection is invalid |
330 | + * \warning return value must be destroyed via mir_display_config_destroy() |
331 | + * \warning may return null if connection is invalid |
332 | * \param [in] connection The connection |
333 | * \return structure that describes the display configuration |
334 | */ |
335 | @@ -135,7 +135,7 @@ |
336 | |
337 | /** |
338 | * Destroy the DisplayConfiguration resource acquired from mir_connection_create_display_config |
339 | - * \param [in] display_configuration The display_configuration information resource to be destroyed |
340 | + * \param [in] display_configuration The display_configuration information resource to be destroyed |
341 | */ |
342 | void mir_display_config_destroy(MirDisplayConfiguration* display_configuration); |
343 | |
344 | @@ -149,7 +149,7 @@ |
345 | * |
346 | * \warning This request may be denied. Check that the request succeeded with mir_connection_get_error_message. |
347 | * \param [in] connection The connection |
348 | - * \param [in] display_configuration The display_configuration to apply |
349 | + * \param [in] display_configuration The display_configuration to apply |
350 | * \return A handle that can be passed to mir_wait_for |
351 | */ |
352 | MirWaitHandle* mir_connection_apply_display_config(MirConnection *connection, MirDisplayConfiguration* display_configuration); |
353 | @@ -164,10 +164,10 @@ |
354 | /** |
355 | * Get the list of possible formats that a surface can be created with. |
356 | * \param [in] connection The connection |
357 | - * \param [out] formats List of valid formats to create surfaces with |
358 | + * \param [out] formats List of valid formats to create surfaces with |
359 | * \param [in] formats_size size of formats list |
360 | * \param [out] num_valid_formats number of valid formats returned in formats |
361 | - */ |
362 | + */ |
363 | void mir_connection_get_available_surface_formats( |
364 | MirConnection* connection, MirPixelFormat* formats, |
365 | unsigned const int format_size, unsigned int *num_valid_formats); |
366 | @@ -227,10 +227,10 @@ |
367 | /** |
368 | * Test for a valid surface |
369 | * \param [in] surface The surface |
370 | - * \return A non-zero value if the supplied surface is valid, |
371 | - * 0 otherwise |
372 | + * \return True if the supplied surface is valid, or |
373 | + * false otherwise. |
374 | */ |
375 | -int mir_surface_is_valid(MirSurface *surface); |
376 | +MirBool mir_surface_is_valid(MirSurface *surface); |
377 | |
378 | /** |
379 | * Retrieve a text description of the error. The returned string is owned by |
380 | @@ -253,7 +253,7 @@ |
381 | |
382 | /** |
383 | * Get the underlying platform type so the buffer obtained in "raw" representation |
384 | - * in mir_surface_get_current_buffer() can be understood |
385 | + * in mir_surface_get_current_buffer() can be understood |
386 | * \pre The surface is valid |
387 | * \param [in] surface The surface |
388 | * \return One of mir_platform_type_android or mir_platform_type_gbm |
389 | @@ -386,12 +386,12 @@ |
390 | /** |
391 | * Set the swapinterval for mir_surface_swap_buffers. EGL users should use |
392 | * eglSwapInterval directly. |
393 | - * At the time being, only swapinterval of 0 or 1 is supported. |
394 | + * At the time being, only swapinterval of 0 or 1 is supported. |
395 | * \param [in] surface The surface to operate on |
396 | * \param [in] interval The number of vblank signals that |
397 | - * mir_surface_swap_buffers will wait for |
398 | + * mir_surface_swap_buffers will wait for |
399 | * \return A wait handle that can be passed to mir_wait_for, |
400 | - * or NULL if the interval could not be supported |
401 | + * or NULL if the interval could not be supported |
402 | */ |
403 | MirWaitHandle* mir_surface_set_swapinterval(MirSurface* surface, int interval); |
404 | |
405 | |
406 | === modified file 'include/client/mir_toolkit/mir_client_library_debug.h' |
407 | --- include/client/mir_toolkit/mir_client_library_debug.h 2013-09-11 20:57:29 +0000 |
408 | +++ include/client/mir_toolkit/mir_client_library_debug.h 2013-12-18 14:40:47 +0000 |
409 | @@ -38,6 +38,6 @@ |
410 | * This is the buffer that is currently being drawn to, |
411 | * and would be returned by mir_surface_get_current_buffer. |
412 | */ |
413 | -uint32_t mir_debug_surface_current_buffer_id(MirSurface *surface); |
414 | +uint32_t mir_debug_surface_current_buffer_id(MirSurface *surface); |
415 | |
416 | #endif /* MIR_CLIENT_LIBRARY_DEBUG_H */ |
417 | |
418 | === modified file 'include/platform/mir/graphics/buffer.h' |
419 | --- include/platform/mir/graphics/buffer.h 2013-10-15 08:53:10 +0000 |
420 | +++ include/platform/mir/graphics/buffer.h 2013-12-18 14:40:47 +0000 |
421 | @@ -21,7 +21,7 @@ |
422 | |
423 | #include "mir/graphics/native_buffer.h" |
424 | #include "mir/geometry/size.h" |
425 | -#include "mir/geometry/pixel_format.h" |
426 | +#include "mir_toolkit/common.h" |
427 | |
428 | #include <memory> |
429 | |
430 | @@ -40,7 +40,7 @@ |
431 | virtual BufferID id() const = 0; |
432 | virtual geometry::Size size() const = 0; |
433 | virtual geometry::Stride stride() const = 0; |
434 | - virtual geometry::PixelFormat pixel_format() const = 0; |
435 | + virtual MirPixelFormat pixel_format() const = 0; |
436 | virtual void bind_to_texture() = 0; |
437 | virtual bool can_bypass() const = 0; |
438 | |
439 | |
440 | === modified file 'include/platform/mir/graphics/buffer_properties.h' |
441 | --- include/platform/mir/graphics/buffer_properties.h 2013-08-28 03:41:48 +0000 |
442 | +++ include/platform/mir/graphics/buffer_properties.h 2013-12-18 14:40:47 +0000 |
443 | @@ -20,7 +20,7 @@ |
444 | #define MIR_GRAPHICS_BUFFER_PROPERTIES_H_ |
445 | |
446 | #include "mir/geometry/size.h" |
447 | -#include "mir/geometry/pixel_format.h" |
448 | +#include "mir_toolkit/common.h" |
449 | |
450 | namespace mir |
451 | { |
452 | @@ -49,13 +49,13 @@ |
453 | { |
454 | BufferProperties() : |
455 | size(), |
456 | - format(geometry::PixelFormat::invalid), |
457 | + format(mir_pixel_format_invalid), |
458 | usage(BufferUsage::undefined) |
459 | { |
460 | } |
461 | |
462 | BufferProperties(const geometry::Size& size, |
463 | - const geometry::PixelFormat& format, |
464 | + const MirPixelFormat& format, |
465 | BufferUsage usage) : |
466 | size{size}, |
467 | format{format}, |
468 | @@ -64,7 +64,7 @@ |
469 | } |
470 | |
471 | geometry::Size size; |
472 | - geometry::PixelFormat format; |
473 | + MirPixelFormat format; |
474 | BufferUsage usage; |
475 | }; |
476 | |
477 | |
478 | === modified file 'include/platform/mir/graphics/display_configuration.h' |
479 | --- include/platform/mir/graphics/display_configuration.h 2013-09-12 21:36:55 +0000 |
480 | +++ include/platform/mir/graphics/display_configuration.h 2013-12-18 14:40:47 +0000 |
481 | @@ -22,7 +22,6 @@ |
482 | #include "mir/int_wrapper.h" |
483 | #include "mir/geometry/size.h" |
484 | #include "mir/geometry/point.h" |
485 | -#include "mir/geometry/pixel_format.h" |
486 | #include "mir_toolkit/common.h" |
487 | |
488 | #include <functional> |
489 | @@ -89,7 +88,7 @@ |
490 | /** The type of the output. */ |
491 | DisplayConfigurationOutputType type; |
492 | /** The pixel formats supported by the output */ |
493 | - std::vector<geometry::PixelFormat> pixel_formats; |
494 | + std::vector<MirPixelFormat> pixel_formats; |
495 | /** The modes supported by the output. */ |
496 | std::vector<DisplayConfigurationMode> modes; |
497 | /** The index in the 'modes' vector of the preferred output mode. */ |
498 | |
499 | === modified file 'include/platform/mir/graphics/graphic_buffer_allocator.h' |
500 | --- include/platform/mir/graphics/graphic_buffer_allocator.h 2013-08-28 03:41:48 +0000 |
501 | +++ include/platform/mir/graphics/graphic_buffer_allocator.h 2013-12-18 14:40:47 +0000 |
502 | @@ -50,7 +50,7 @@ |
503 | /** |
504 | * The supported buffer pixel formats. |
505 | */ |
506 | - virtual std::vector<geometry::PixelFormat> supported_pixel_formats() = 0; |
507 | + virtual std::vector<MirPixelFormat> supported_pixel_formats() = 0; |
508 | |
509 | protected: |
510 | GraphicBufferAllocator() = default; |
511 | |
512 | === modified file 'include/platform/mir/graphics/internal_surface.h' |
513 | --- include/platform/mir/graphics/internal_surface.h 2013-08-28 03:41:48 +0000 |
514 | +++ include/platform/mir/graphics/internal_surface.h 2013-12-18 14:40:47 +0000 |
515 | @@ -35,7 +35,7 @@ |
516 | public: |
517 | virtual ~InternalSurface() = default; |
518 | |
519 | - virtual std::shared_ptr<Buffer> advance_client_buffer() = 0; |
520 | + virtual void swap_buffers(graphics::Buffer*&) = 0; |
521 | virtual geometry::Size size() const = 0; |
522 | virtual MirPixelFormat pixel_format() const = 0; |
523 | |
524 | |
525 | === modified file 'include/server/mir/compositor/buffer_stream.h' |
526 | --- include/server/mir/compositor/buffer_stream.h 2013-11-21 03:16:21 +0000 |
527 | +++ include/server/mir/compositor/buffer_stream.h 2013-12-18 14:40:47 +0000 |
528 | @@ -21,7 +21,7 @@ |
529 | #define MIR_COMPOSITOR_BUFFER_STREAM_H_ |
530 | |
531 | #include "mir/geometry/size.h" |
532 | -#include "mir/geometry/pixel_format.h" |
533 | +#include "mir_toolkit/common.h" |
534 | #include "mir/graphics/buffer_id.h" |
535 | |
536 | #include <memory> |
537 | @@ -41,11 +41,11 @@ |
538 | public: |
539 | virtual ~BufferStream() = default; |
540 | |
541 | - virtual std::shared_ptr<graphics::Buffer> secure_client_buffer() = 0; |
542 | + virtual void swap_client_buffers(graphics::Buffer*& buffer) = 0; |
543 | virtual std::shared_ptr<graphics::Buffer> |
544 | lock_compositor_buffer(unsigned long frameno) = 0; |
545 | virtual std::shared_ptr<graphics::Buffer> lock_snapshot_buffer() = 0; |
546 | - virtual geometry::PixelFormat get_stream_pixel_format() = 0; |
547 | + virtual MirPixelFormat get_stream_pixel_format() = 0; |
548 | virtual geometry::Size stream_size() = 0; |
549 | virtual void resize(geometry::Size const& size) = 0; |
550 | virtual void allow_framedropping(bool) = 0; |
551 | |
552 | === modified file 'include/server/mir/compositor/compositing_criteria.h' |
553 | --- include/server/mir/compositor/compositing_criteria.h 2013-10-07 07:56:05 +0000 |
554 | +++ include/server/mir/compositor/compositing_criteria.h 2013-12-18 14:40:47 +0000 |
555 | @@ -30,7 +30,7 @@ |
556 | namespace compositor |
557 | { |
558 | |
559 | -class CompositingCriteria |
560 | +class CompositingCriteria |
561 | { |
562 | public: |
563 | virtual float alpha() const = 0; |
564 | |
565 | === modified file 'include/server/mir/default_server_configuration.h' |
566 | --- include/server/mir/default_server_configuration.h 2013-11-21 12:34:49 +0000 |
567 | +++ include/server/mir/default_server_configuration.h 2013-12-18 14:40:47 +0000 |
568 | @@ -35,7 +35,6 @@ |
569 | class Drawer; |
570 | class DisplayBufferCompositorFactory; |
571 | class Compositor; |
572 | -class OverlayRenderer; |
573 | class RendererFactory; |
574 | } |
575 | namespace frontend |
576 | @@ -55,7 +54,6 @@ |
577 | namespace shell |
578 | { |
579 | class SurfaceFactory; |
580 | -class SurfaceController; |
581 | class InputTargeter; |
582 | class FocusSetter; |
583 | class PlacementStrategy; |
584 | @@ -82,6 +80,7 @@ |
585 | class SurfaceBuilder; |
586 | class SurfaceStackModel; |
587 | class SurfaceStack; |
588 | +class SurfaceRanker; |
589 | class SurfaceController; |
590 | class InputRegistrar; |
591 | class SceneReport; |
592 | @@ -152,7 +151,6 @@ |
593 | * configurable interfaces for modifying compositor |
594 | * @{ */ |
595 | virtual std::shared_ptr<compositor::DisplayBufferCompositorFactory> the_display_buffer_compositor_factory(); |
596 | - virtual std::shared_ptr<compositor::OverlayRenderer> the_overlay_renderer(); |
597 | /** @} */ |
598 | |
599 | /** @name compositor configuration - dependencies |
600 | @@ -191,7 +189,6 @@ |
601 | virtual std::shared_ptr<shell::SessionListener> the_shell_session_listener(); |
602 | virtual std::shared_ptr<shell::DisplayLayout> the_shell_display_layout(); |
603 | virtual std::shared_ptr<shell::SurfaceConfigurator> the_shell_surface_configurator(); |
604 | - virtual std::shared_ptr<shell::SurfaceController> the_shell_surface_controller(); |
605 | /** @} */ |
606 | |
607 | /** @name internal scene configuration |
608 | @@ -204,6 +201,7 @@ |
609 | virtual std::shared_ptr<scene::SessionEventSink> the_session_event_sink(); |
610 | virtual std::shared_ptr<scene::SessionEventHandlerRegister> the_session_event_handler_register(); |
611 | virtual std::shared_ptr<scene::SurfaceStackModel> the_surface_stack_model(); |
612 | + virtual std::shared_ptr<scene::SurfaceRanker> the_surface_ranker(); |
613 | /** @} */ |
614 | |
615 | /** @name scene configuration - dependencies |
616 | @@ -279,7 +277,6 @@ |
617 | CachedPtr<shell::DisplayLayout> shell_display_layout; |
618 | CachedPtr<shell::SurfaceConfigurator> shell_surface_configurator; |
619 | CachedPtr<compositor::DisplayBufferCompositorFactory> display_buffer_compositor_factory; |
620 | - CachedPtr<compositor::OverlayRenderer> overlay_renderer; |
621 | CachedPtr<compositor::Compositor> compositor; |
622 | CachedPtr<logging::Logger> logger; |
623 | CachedPtr<graphics::DisplayReport> display_report; |
624 | |
625 | === modified file 'include/server/mir/frontend/message_processor_report.h' |
626 | --- include/server/mir/frontend/message_processor_report.h 2013-08-28 03:41:48 +0000 |
627 | +++ include/server/mir/frontend/message_processor_report.h 2013-12-18 14:40:47 +0000 |
628 | @@ -44,7 +44,7 @@ |
629 | virtual void exception_handled(void const* mediator, int id, std::exception const& error) = 0; |
630 | |
631 | virtual void exception_handled(void const* mediator, std::exception const& error) = 0; |
632 | - |
633 | + |
634 | virtual void sent_event(void const* mediator, MirSurfaceEvent const& ev) = 0; |
635 | |
636 | private: |
637 | |
638 | === modified file 'include/server/mir/frontend/null_message_processor_report.h' |
639 | --- include/server/mir/frontend/null_message_processor_report.h 2013-08-28 03:41:48 +0000 |
640 | +++ include/server/mir/frontend/null_message_processor_report.h 2013-12-18 14:40:47 +0000 |
641 | @@ -36,7 +36,7 @@ |
642 | void exception_handled(void const*, int, std::exception const&); |
643 | |
644 | void exception_handled(void const*, std::exception const&); |
645 | - |
646 | + |
647 | void sent_event(void const*, MirSurfaceEvent const& e); |
648 | }; |
649 | } |
650 | |
651 | === modified file 'include/server/mir/frontend/session_authorizer.h' |
652 | --- include/server/mir/frontend/session_authorizer.h 2013-08-28 03:41:48 +0000 |
653 | +++ include/server/mir/frontend/session_authorizer.h 2013-12-18 14:40:47 +0000 |
654 | @@ -30,7 +30,7 @@ |
655 | { |
656 | public: |
657 | virtual ~SessionAuthorizer() {} |
658 | - |
659 | + |
660 | virtual bool connection_is_allowed(pid_t pid) = 0; |
661 | virtual bool configure_display_is_allowed(pid_t pid) = 0; |
662 | protected: |
663 | |
664 | === modified file 'include/server/mir/frontend/surface.h' |
665 | --- include/server/mir/frontend/surface.h 2013-11-21 03:16:21 +0000 |
666 | +++ include/server/mir/frontend/surface.h 2013-12-18 14:40:47 +0000 |
667 | @@ -20,7 +20,6 @@ |
668 | #ifndef MIR_FRONTEND_SURFACE_H_ |
669 | #define MIR_FRONTEND_SURFACE_H_ |
670 | |
671 | -#include "mir/geometry/pixel_format.h" |
672 | #include "mir/geometry/point.h" |
673 | #include "mir/geometry/size.h" |
674 | #include "mir_toolkit/common.h" |
675 | @@ -55,9 +54,9 @@ |
676 | virtual void force_requests_to_complete() = 0; |
677 | |
678 | virtual geometry::Size size() const = 0; |
679 | - virtual geometry::PixelFormat pixel_format() const = 0; |
680 | + virtual MirPixelFormat pixel_format() const = 0; |
681 | |
682 | - virtual std::shared_ptr<graphics::Buffer> advance_client_buffer() = 0; |
683 | + virtual void swap_buffers(graphics::Buffer*&) = 0; |
684 | |
685 | virtual bool supports_input() const = 0; |
686 | virtual int client_input_fd() const = 0; |
687 | |
688 | === modified file 'include/server/mir/input/input_configuration.h' |
689 | --- include/server/mir/input/input_configuration.h 2013-11-20 15:56:58 +0000 |
690 | +++ include/server/mir/input/input_configuration.h 2013-12-18 14:40:47 +0000 |
691 | @@ -44,7 +44,7 @@ |
692 | virtual std::shared_ptr<scene::InputRegistrar> the_input_registrar() = 0; |
693 | virtual std::shared_ptr<shell::InputTargeter> the_input_targeter() = 0; |
694 | virtual std::shared_ptr<input::InputManager> the_input_manager() = 0; |
695 | - |
696 | + |
697 | virtual void set_input_targets(std::shared_ptr<input::InputTargets> const& targets) = 0; |
698 | |
699 | protected: |
700 | |
701 | === modified file 'include/server/mir/input/input_report.h' |
702 | --- include/server/mir/input/input_report.h 2013-05-29 14:11:56 +0000 |
703 | +++ include/server/mir/input/input_report.h 2013-12-18 14:40:47 +0000 |
704 | @@ -31,7 +31,7 @@ |
705 | { |
706 | public: |
707 | virtual ~InputReport() = default; |
708 | - |
709 | + |
710 | virtual void received_event_from_kernel(int64_t when, int type, int code, int value) = 0; |
711 | |
712 | virtual void published_key_event(int dest_fd, uint32_t seq_id, int64_t event_time) = 0; |
713 | @@ -39,7 +39,7 @@ |
714 | virtual void published_motion_event(int dest_fd, uint32_t seq_id, int64_t event_time) = 0; |
715 | |
716 | virtual void received_event_finished_signal(int src_fd, uint32_t seq_id) = 0; |
717 | - |
718 | + |
719 | protected: |
720 | InputReport() = default; |
721 | InputReport(InputReport const&) = delete; |
722 | |
723 | === modified file 'include/server/mir/input/null_input_report.h' |
724 | --- include/server/mir/input/null_input_report.h 2013-05-29 14:11:56 +0000 |
725 | +++ include/server/mir/input/null_input_report.h 2013-12-18 14:40:47 +0000 |
726 | @@ -32,7 +32,7 @@ |
727 | public: |
728 | NullInputReport() = default; |
729 | virtual ~NullInputReport() noexcept(true) = default; |
730 | - |
731 | + |
732 | void received_event_from_kernel(int64_t when, int type, int code, int value); |
733 | |
734 | void published_key_event(int dest_fd, uint32_t seq_id, int64_t event_time); |
735 | |
736 | === modified file 'include/server/mir/input/surface.h' |
737 | --- include/server/mir/input/surface.h 2013-07-16 15:49:19 +0000 |
738 | +++ include/server/mir/input/surface.h 2013-12-18 14:40:47 +0000 |
739 | @@ -27,7 +27,7 @@ |
740 | { |
741 | namespace input |
742 | { |
743 | -class Surface |
744 | +class Surface |
745 | { |
746 | public: |
747 | virtual std::string const& name() const = 0; |
748 | @@ -36,7 +36,7 @@ |
749 | virtual bool contains(geometry::Point const& point) const = 0; |
750 | |
751 | protected: |
752 | - Surface() = default; |
753 | + Surface() = default; |
754 | virtual ~Surface() = default; |
755 | Surface(const Surface&) = delete; |
756 | Surface& operator=(const Surface& ) = delete; |
757 | |
758 | === modified file 'include/server/mir/logging/glog_logger.h' |
759 | --- include/server/mir/logging/glog_logger.h 2013-03-26 17:53:30 +0000 |
760 | +++ include/server/mir/logging/glog_logger.h 2013-12-18 14:40:47 +0000 |
761 | @@ -35,7 +35,7 @@ |
762 | virtual void log( |
763 | Severity severity, |
764 | const std::string& message, |
765 | - const std::string& component); |
766 | + const std::string& component) override; |
767 | }; |
768 | } |
769 | } |
770 | |
771 | === modified file 'include/server/mir/logging/input_report.h' |
772 | --- include/server/mir/logging/input_report.h 2013-05-29 14:11:56 +0000 |
773 | +++ include/server/mir/logging/input_report.h 2013-12-18 14:40:47 +0000 |
774 | @@ -39,14 +39,14 @@ |
775 | public: |
776 | InputReport(std::shared_ptr<Logger> const& logger); |
777 | virtual ~InputReport() noexcept(true) = default; |
778 | - |
779 | + |
780 | void received_event_from_kernel(int64_t when, int type, int code, int value); |
781 | |
782 | void published_key_event(int dest_fd, uint32_t seq_id, int64_t event_time); |
783 | void published_motion_event(int dest_fd, uint32_t seq_id, int64_t event_time); |
784 | |
785 | void received_event_finished_signal(int src_fd, uint32_t seq_id); |
786 | - |
787 | + |
788 | private: |
789 | char const* component(); |
790 | std::shared_ptr<Logger> const logger; |
791 | |
792 | === modified file 'include/server/mir/lttng/input_report.h' |
793 | --- include/server/mir/lttng/input_report.h 2013-06-03 12:15:44 +0000 |
794 | +++ include/server/mir/lttng/input_report.h 2013-12-18 14:40:47 +0000 |
795 | @@ -32,14 +32,14 @@ |
796 | public: |
797 | InputReport() = default; |
798 | virtual ~InputReport() noexcept(true) = default; |
799 | - |
800 | + |
801 | void received_event_from_kernel(int64_t when, int type, int code, int value); |
802 | |
803 | void published_key_event(int dest_fd, uint32_t seq_id, int64_t event_time); |
804 | void published_motion_event(int dest_fd, uint32_t seq_id, int64_t event_time); |
805 | |
806 | void received_event_finished_signal(int src_fd, uint32_t seq_id); |
807 | - |
808 | + |
809 | private: |
810 | ServerTracepointProvider tp_provider; |
811 | }; |
812 | |
813 | === modified file 'include/server/mir/scene/input_registrar.h' |
814 | --- include/server/mir/scene/input_registrar.h 2013-11-20 16:22:32 +0000 |
815 | +++ include/server/mir/scene/input_registrar.h 2013-12-18 14:40:47 +0000 |
816 | @@ -41,7 +41,7 @@ |
817 | { |
818 | public: |
819 | virtual ~InputRegistrar() = default; |
820 | - |
821 | + |
822 | virtual void input_channel_opened(std::shared_ptr<input::InputChannel> const& opened_channel, |
823 | std::shared_ptr<input::Surface> const& info, |
824 | input::InputReceptionMode input_mode) = 0; |
825 | |
826 | === modified file 'include/server/mir/shell/input_targeter.h' |
827 | --- include/server/mir/shell/input_targeter.h 2013-08-28 03:41:48 +0000 |
828 | +++ include/server/mir/shell/input_targeter.h 2013-12-18 14:40:47 +0000 |
829 | @@ -36,7 +36,7 @@ |
830 | { |
831 | public: |
832 | virtual ~InputTargeter() = default; |
833 | - |
834 | + |
835 | virtual void focus_changed(std::shared_ptr<input::InputChannel const> const& focus_channel) = 0; |
836 | virtual void focus_cleared() = 0; |
837 | |
838 | |
839 | === modified file 'include/server/mir/shell/session_listener.h' |
840 | --- include/server/mir/shell/session_listener.h 2013-08-28 03:41:48 +0000 |
841 | +++ include/server/mir/shell/session_listener.h 2013-12-18 14:40:47 +0000 |
842 | @@ -35,7 +35,7 @@ |
843 | virtual void stopping(std::shared_ptr<Session> const& session) = 0; |
844 | virtual void focused(std::shared_ptr<Session> const& session) = 0; |
845 | virtual void unfocused() = 0; |
846 | - |
847 | + |
848 | virtual void surface_created(Session& session, std::shared_ptr<Surface> const& surface) = 0; |
849 | virtual void destroying_surface(Session& session, std::shared_ptr<Surface> const& surface) = 0; |
850 | |
851 | |
852 | === modified file 'include/server/mir/shell/surface.h' |
853 | --- include/server/mir/shell/surface.h 2013-11-21 03:16:21 +0000 |
854 | +++ include/server/mir/shell/surface.h 2013-12-18 14:40:47 +0000 |
855 | @@ -29,10 +29,10 @@ |
856 | |
857 | namespace mir |
858 | { |
859 | +namespace scene { class SurfaceRanker; } |
860 | namespace shell |
861 | { |
862 | class InputTargeter; |
863 | -class SurfaceController; |
864 | |
865 | class Surface : public frontend::Surface, public shell::SurfaceBufferAccess |
866 | { |
867 | @@ -50,7 +50,7 @@ |
868 | |
869 | virtual void allow_framedropping(bool) = 0; |
870 | |
871 | - virtual void raise(std::shared_ptr<SurfaceController> const& controller) = 0; |
872 | + virtual void raise(std::shared_ptr<scene::SurfaceRanker> const& controller) = 0; |
873 | |
874 | virtual void resize(geometry::Size const& size) = 0; |
875 | virtual void set_rotation(float degrees, glm::vec3 const& axis) = 0; |
876 | |
877 | === modified file 'include/server/mir/shell/surface_configurator.h' |
878 | --- include/server/mir/shell/surface_configurator.h 2013-07-29 22:55:20 +0000 |
879 | +++ include/server/mir/shell/surface_configurator.h 2013-12-18 14:40:47 +0000 |
880 | @@ -34,7 +34,7 @@ |
881 | { |
882 | public: |
883 | virtual ~SurfaceConfigurator() = default; |
884 | - |
885 | + |
886 | /// Returns the selected value. |
887 | virtual int select_attribute_value(Surface const& surface, MirSurfaceAttrib attrib, |
888 | int requested_value) = 0; |
889 | |
890 | === modified file 'include/server/mir/shell/surface_creation_parameters.h' |
891 | --- include/server/mir/shell/surface_creation_parameters.h 2013-11-20 15:56:58 +0000 |
892 | +++ include/server/mir/shell/surface_creation_parameters.h 2013-12-18 14:40:47 +0000 |
893 | @@ -19,7 +19,7 @@ |
894 | #ifndef MIR_SHELL_SURFACE_CREATION_PARAMETERS_H_ |
895 | #define MIR_SHELL_SURFACE_CREATION_PARAMETERS_H_ |
896 | |
897 | -#include "mir/geometry/pixel_format.h" |
898 | +#include "mir_toolkit/common.h" |
899 | #include "mir/geometry/point.h" |
900 | #include "mir/geometry/size.h" |
901 | #include "mir/graphics/buffer_properties.h" |
902 | @@ -44,15 +44,15 @@ |
903 | SurfaceCreationParameters& of_size(geometry::Size new_size); |
904 | |
905 | SurfaceCreationParameters& of_size(geometry::Width::ValueType width, geometry::Height::ValueType height); |
906 | - |
907 | + |
908 | SurfaceCreationParameters& of_position(geometry::Point const& top_left); |
909 | |
910 | SurfaceCreationParameters& of_buffer_usage(graphics::BufferUsage new_buffer_usage); |
911 | |
912 | - SurfaceCreationParameters& of_pixel_format(geometry::PixelFormat new_pixel_format); |
913 | - |
914 | + SurfaceCreationParameters& of_pixel_format(MirPixelFormat new_pixel_format); |
915 | + |
916 | SurfaceCreationParameters& of_depth(scene::DepthId const& new_depth); |
917 | - |
918 | + |
919 | SurfaceCreationParameters& with_input_mode(input::InputReceptionMode const& new_mode); |
920 | |
921 | SurfaceCreationParameters& with_output_id(graphics::DisplayConfigurationOutputId const& output_id); |
922 | @@ -61,7 +61,7 @@ |
923 | geometry::Size size; |
924 | geometry::Point top_left; |
925 | graphics::BufferUsage buffer_usage; |
926 | - geometry::PixelFormat pixel_format; |
927 | + MirPixelFormat pixel_format; |
928 | scene::DepthId depth; |
929 | input::InputReceptionMode input_mode; |
930 | graphics::DisplayConfigurationOutputId output_id; |
931 | |
932 | === removed file 'include/shared/mir/geometry/pixel_format.h' |
933 | --- include/shared/mir/geometry/pixel_format.h 2013-10-07 08:25:04 +0000 |
934 | +++ include/shared/mir/geometry/pixel_format.h 1970-01-01 00:00:00 +0000 |
935 | @@ -1,54 +0,0 @@ |
936 | -/* |
937 | - * Copyright © 2012 Canonical Ltd. |
938 | - * |
939 | - * This program is free software: you can redistribute it and/or modify it |
940 | - * under the terms of the GNU Lesser General Public License version 3, |
941 | - * as published by the Free Software Foundation. |
942 | - * |
943 | - * This program is distributed in the hope that it will be useful, |
944 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
945 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
946 | - * GNU Lesser General Public License for more details. |
947 | - * |
948 | - * You should have received a copy of the GNU Lesser General Public License |
949 | - * along with this program. If not, see <http://www.gnu.org/licenses/>. |
950 | - * |
951 | - * Authored by: Alan Griffiths <alan@octopull.co.uk> |
952 | - */ |
953 | - |
954 | - |
955 | -#ifndef MIR_COMPOSITOR_PIXEL_FORMAT_H_ |
956 | -#define MIR_COMPOSITOR_PIXEL_FORMAT_H_ |
957 | - |
958 | -#include <cstdint> |
959 | -#include <cstddef> |
960 | - |
961 | -namespace mir |
962 | -{ |
963 | -namespace geometry |
964 | -{ |
965 | -enum class PixelFormat : uint32_t |
966 | -{ |
967 | - invalid, |
968 | - abgr_8888, |
969 | - xbgr_8888, |
970 | - argb_8888, |
971 | - xrgb_8888, |
972 | - bgr_888 |
973 | -}; |
974 | - |
975 | -static inline size_t bytes_per_pixel(PixelFormat fmt) |
976 | -{ |
977 | - return (fmt == PixelFormat::bgr_888) ? 3 : 4; |
978 | -} |
979 | - |
980 | -static inline bool has_alpha(PixelFormat fmt) |
981 | -{ |
982 | - return (fmt == PixelFormat::abgr_8888) || |
983 | - (fmt == PixelFormat::argb_8888); |
984 | -} |
985 | - |
986 | -} |
987 | -} |
988 | - |
989 | -#endif /* MIR_COMPOSITOR_PIXEL_FORMAT_H_ */ |
990 | |
991 | === modified file 'include/shared/mir/geometry/rectangle.h' |
992 | --- include/shared/mir/geometry/rectangle.h 2013-11-21 03:16:21 +0000 |
993 | +++ include/shared/mir/geometry/rectangle.h 2013-12-18 14:40:47 +0000 |
994 | @@ -35,7 +35,7 @@ |
995 | Point top_left; |
996 | Size size; |
997 | |
998 | - /** |
999 | + /** |
1000 | * The bottom right boundary point of the rectangle. |
1001 | * |
1002 | * Note that the returned point is *not* included in the rectangle |
1003 | |
1004 | === modified file 'include/shared/mir/graphics/android/android_driver_interpreter.h' |
1005 | --- include/shared/mir/graphics/android/android_driver_interpreter.h 2013-10-15 08:53:10 +0000 |
1006 | +++ include/shared/mir/graphics/android/android_driver_interpreter.h 2013-12-18 14:40:47 +0000 |
1007 | @@ -36,7 +36,7 @@ |
1008 | virtual void driver_returns_buffer(ANativeWindowBuffer*, int fence) = 0; |
1009 | virtual void dispatch_driver_request_format(int format) = 0; |
1010 | virtual int driver_requests_info(int key) const = 0; |
1011 | - virtual void sync_to_display(bool sync) = 0; |
1012 | + virtual void sync_to_display(bool sync) = 0; |
1013 | protected: |
1014 | AndroidDriverInterpreter() {}; |
1015 | virtual ~AndroidDriverInterpreter() {}; |
1016 | |
1017 | === modified file 'include/shared/mir/graphics/android/mir_native_window.h' |
1018 | --- include/shared/mir/graphics/android/mir_native_window.h 2013-11-21 03:16:21 +0000 |
1019 | +++ include/shared/mir/graphics/android/mir_native_window.h 2013-12-18 14:40:47 +0000 |
1020 | @@ -25,7 +25,7 @@ |
1021 | |
1022 | namespace mir |
1023 | { |
1024 | -namespace graphics |
1025 | +namespace graphics |
1026 | { |
1027 | namespace android |
1028 | { |
1029 | |
1030 | === modified file 'include/shared/mir/graphics/android/native_buffer.h' |
1031 | --- include/shared/mir/graphics/android/native_buffer.h 2013-10-15 08:53:10 +0000 |
1032 | +++ include/shared/mir/graphics/android/native_buffer.h 2013-12-18 14:40:47 +0000 |
1033 | @@ -27,7 +27,7 @@ |
1034 | namespace graphics |
1035 | { |
1036 | |
1037 | -class NativeBuffer |
1038 | +class NativeBuffer |
1039 | { |
1040 | public: |
1041 | virtual ~NativeBuffer() = default; |
1042 | @@ -37,7 +37,7 @@ |
1043 | virtual android::NativeFence copy_fence() const = 0; |
1044 | |
1045 | virtual void wait_for_content() = 0; |
1046 | - virtual void update_fence(android::NativeFence& fence) = 0; |
1047 | + virtual void update_fence(android::NativeFence& fence) = 0; |
1048 | |
1049 | protected: |
1050 | NativeBuffer() = default; |
1051 | |
1052 | === modified file 'include/shared/mir/input/android/android_input_lexicon.h' |
1053 | --- include/shared/mir/input/android/android_input_lexicon.h 2013-04-24 05:22:20 +0000 |
1054 | +++ include/shared/mir/input/android/android_input_lexicon.h 2013-12-18 14:40:47 +0000 |
1055 | @@ -36,7 +36,7 @@ |
1056 | namespace android |
1057 | { |
1058 | |
1059 | -/// The Lexicon translates droidinput event types to MirEvent types prior to |
1060 | +/// The Lexicon translates droidinput event types to MirEvent types prior to |
1061 | /// shell or client handling. |
1062 | class Lexicon |
1063 | { |
1064 | |
1065 | === modified file 'include/shared/mir/input/input_platform.h' |
1066 | --- include/shared/mir/input/input_platform.h 2013-11-21 03:16:21 +0000 |
1067 | +++ include/shared/mir/input/input_platform.h 2013-12-18 14:40:47 +0000 |
1068 | @@ -37,7 +37,7 @@ |
1069 | class InputPlatform |
1070 | { |
1071 | public: |
1072 | - virtual ~InputPlatform() {}; |
1073 | + virtual ~InputPlatform() {}; |
1074 | |
1075 | virtual std::shared_ptr<InputReceiverThread> create_input_thread(int fd, std::function<void(MirEvent *)> const& callback) = 0; |
1076 | |
1077 | |
1078 | === modified file 'include/shared/mir/input/xkb_mapper.h' |
1079 | --- include/shared/mir/input/xkb_mapper.h 2013-05-17 19:42:09 +0000 |
1080 | +++ include/shared/mir/input/xkb_mapper.h 2013-12-18 14:40:47 +0000 |
1081 | @@ -37,7 +37,7 @@ |
1082 | public: |
1083 | XKBMapper(); |
1084 | virtual ~XKBMapper() = default; |
1085 | - |
1086 | + |
1087 | void update_state_and_map_event(MirKeyEvent& key_ev); |
1088 | |
1089 | protected: |
1090 | |
1091 | === modified file 'include/shared/mir/logging/dumb_console_logger.h' |
1092 | --- include/shared/mir/logging/dumb_console_logger.h 2013-06-03 08:14:01 +0000 |
1093 | +++ include/shared/mir/logging/dumb_console_logger.h 2013-12-18 14:40:47 +0000 |
1094 | @@ -30,7 +30,7 @@ |
1095 | public: |
1096 | |
1097 | protected: |
1098 | - void log(Severity severity, const std::string& message, const std::string& component); |
1099 | + void log(Severity severity, const std::string& message, const std::string& component) override; |
1100 | }; |
1101 | } |
1102 | } |
1103 | |
1104 | === modified file 'include/shared/mir/logging/logger.h' |
1105 | --- include/shared/mir/logging/logger.h 2013-06-03 08:14:01 +0000 |
1106 | +++ include/shared/mir/logging/logger.h 2013-12-18 14:40:47 +0000 |
1107 | @@ -39,28 +39,16 @@ |
1108 | debug = 4 |
1109 | }; |
1110 | |
1111 | - template<Severity severity> |
1112 | - void log(const std::string& message) |
1113 | - { |
1114 | - static const std::string unknown_component("UnknownComponent"); |
1115 | - log(severity, message, unknown_component); |
1116 | - } |
1117 | |
1118 | - template<Severity severity> |
1119 | - void log(const std::string& message, const std::string& component) |
1120 | - { |
1121 | - log(severity, message, component); |
1122 | - } |
1123 | + virtual void log(Severity severity, |
1124 | + const std::string& message, |
1125 | + const std::string& component = "UnknownComponent") = 0; |
1126 | |
1127 | protected: |
1128 | Logger() {} |
1129 | virtual ~Logger() = default; |
1130 | Logger(const Logger&) = delete; |
1131 | Logger& operator=(const Logger&) = delete; |
1132 | - |
1133 | - virtual void log(Severity severity, |
1134 | - const std::string& message, |
1135 | - const std::string& component) = 0; |
1136 | }; |
1137 | } |
1138 | } |
1139 | |
1140 | === modified file 'include/shared/mir_toolkit/client_types.h' |
1141 | --- include/shared/mir_toolkit/client_types.h 2013-11-21 03:16:21 +0000 |
1142 | +++ include/shared/mir_toolkit/client_types.h 2013-12-18 14:40:47 +0000 |
1143 | @@ -34,6 +34,12 @@ |
1144 | extern "C" { |
1145 | #endif |
1146 | |
1147 | +typedef enum MirBool |
1148 | +{ |
1149 | + mir_false = 0, |
1150 | + mir_true = 1 |
1151 | +} MirBool; |
1152 | + |
1153 | /* Display server connection API */ |
1154 | typedef void* MirEGLNativeWindowType; |
1155 | typedef void* MirEGLNativeDisplayType; |
1156 | @@ -97,26 +103,6 @@ |
1157 | MirConnection* connection, void* context); |
1158 | |
1159 | /** |
1160 | - * The order of components in a format enum matches the |
1161 | - * order of the components as they would be written in an |
1162 | - * integer representing a pixel value of that format. |
1163 | - * |
1164 | - * For example, abgr_8888 corresponds to 0xAABBGGRR, which will |
1165 | - * end up as R,G,B,A in memory in a little endian system, and |
1166 | - * as A,B,G,R in memory in a big endian system. |
1167 | - */ |
1168 | -typedef enum MirPixelFormat |
1169 | -{ |
1170 | - mir_pixel_format_invalid, |
1171 | - mir_pixel_format_abgr_8888, |
1172 | - mir_pixel_format_xbgr_8888, |
1173 | - mir_pixel_format_argb_8888, |
1174 | - mir_pixel_format_xrgb_8888, |
1175 | - mir_pixel_format_bgr_888, |
1176 | - mir_pixel_formats |
1177 | -} MirPixelFormat; |
1178 | - |
1179 | -/** |
1180 | * MirBufferUsage specifies how a surface can and will be used. A "hardware" |
1181 | * surface can be used for OpenGL accelerated rendering. A "software" surface |
1182 | * is one that can be addressed in main memory and blitted to directly. |
1183 | @@ -157,7 +143,7 @@ |
1184 | typedef enum MirPlatformType |
1185 | { |
1186 | mir_platform_type_gbm, |
1187 | - mir_platform_type_android |
1188 | + mir_platform_type_android |
1189 | } MirPlatformType; |
1190 | |
1191 | typedef struct MirPlatformPackage |
1192 | @@ -184,7 +170,7 @@ |
1193 | |
1194 | } MirGraphicsRegion; |
1195 | |
1196 | -/** |
1197 | +/** |
1198 | * DEPRECATED. use MirDisplayConfiguration |
1199 | */ |
1200 | enum { mir_supported_pixel_format_max = 32 }; |
1201 | @@ -192,7 +178,7 @@ |
1202 | { |
1203 | uint32_t width; |
1204 | uint32_t height; |
1205 | - |
1206 | + |
1207 | int supported_pixel_format_items; |
1208 | MirPixelFormat supported_pixel_format[mir_supported_pixel_format_max]; |
1209 | } MirDisplayInfo; |
1210 | @@ -240,7 +226,7 @@ |
1211 | uint32_t num_modes; |
1212 | MirDisplayMode* modes; |
1213 | uint32_t preferred_mode; |
1214 | - uint32_t current_mode; |
1215 | + uint32_t current_mode; |
1216 | |
1217 | uint32_t num_output_formats; |
1218 | MirPixelFormat* output_formats; |
1219 | @@ -257,7 +243,7 @@ |
1220 | |
1221 | uint32_t physical_width_mm; |
1222 | uint32_t physical_height_mm; |
1223 | - |
1224 | + |
1225 | MirPowerMode power_mode; |
1226 | } MirDisplayOutput; |
1227 | |
1228 | |
1229 | === modified file 'include/shared/mir_toolkit/common.h' |
1230 | --- include/shared/mir_toolkit/common.h 2013-11-21 03:16:21 +0000 |
1231 | +++ include/shared/mir_toolkit/common.h 2013-12-18 14:40:47 +0000 |
1232 | @@ -86,6 +86,30 @@ |
1233 | mir_power_mode_suspend, /* Blanked, lowest power. */ |
1234 | mir_power_mode_off /* Powered down. */ |
1235 | } MirPowerMode; |
1236 | + |
1237 | +/** |
1238 | + * The order of components in a format enum matches the |
1239 | + * order of the components as they would be written in an |
1240 | + * integer representing a pixel value of that format. |
1241 | + * |
1242 | + * For example, abgr_8888 corresponds to 0xAABBGGRR, which will |
1243 | + * end up as R,G,B,A in memory in a little endian system, and |
1244 | + * as A,B,G,R in memory in a big endian system. |
1245 | + */ |
1246 | +typedef enum MirPixelFormat |
1247 | +{ |
1248 | + mir_pixel_format_invalid, |
1249 | + mir_pixel_format_abgr_8888, |
1250 | + mir_pixel_format_xbgr_8888, |
1251 | + mir_pixel_format_argb_8888, |
1252 | + mir_pixel_format_xrgb_8888, |
1253 | + mir_pixel_format_bgr_888, |
1254 | + mir_pixel_formats |
1255 | +} MirPixelFormat; |
1256 | + |
1257 | +/* This could be improved... https://bugs.launchpad.net/mir/+bug/1236254 */ |
1258 | +#define MIR_BYTES_PER_PIXEL(f) (((f) == mir_pixel_format_bgr_888) ? 3 : 4) |
1259 | + |
1260 | /**@}*/ |
1261 | |
1262 | #endif |
1263 | |
1264 | === modified file 'include/shared/mir_toolkit/event.h' |
1265 | --- include/shared/mir_toolkit/event.h 2013-11-21 03:16:21 +0000 |
1266 | +++ include/shared/mir_toolkit/event.h 2013-12-18 14:40:47 +0000 |
1267 | @@ -39,7 +39,8 @@ |
1268 | { |
1269 | mir_event_type_key, |
1270 | mir_event_type_motion, |
1271 | - mir_event_type_surface |
1272 | + mir_event_type_surface, |
1273 | + mir_event_type_resize |
1274 | } MirEventType; |
1275 | |
1276 | typedef enum { |
1277 | @@ -141,7 +142,7 @@ |
1278 | |
1279 | int32_t device_id; |
1280 | int32_t source_id; |
1281 | - /* |
1282 | + /* |
1283 | * TODO(racarr): We would like to store this as a MirMotionAction but the android input stack |
1284 | * encodes some non enumerable values in it. It's convenient to keep things |
1285 | * this way for now until we can drop SF/Hybris support in QtUbuntu. |
1286 | @@ -194,12 +195,22 @@ |
1287 | int value; |
1288 | } MirSurfaceEvent; |
1289 | |
1290 | +typedef struct |
1291 | +{ |
1292 | + MirEventType type; |
1293 | + |
1294 | + int surface_id; |
1295 | + int width; |
1296 | + int height; |
1297 | +} MirResizeEvent; |
1298 | + |
1299 | typedef union |
1300 | { |
1301 | MirEventType type; |
1302 | MirKeyEvent key; |
1303 | MirMotionEvent motion; |
1304 | MirSurfaceEvent surface; |
1305 | + MirResizeEvent resize; |
1306 | } MirEvent; |
1307 | |
1308 | #ifdef __cplusplus |
1309 | |
1310 | === modified file 'include/shared/mir_toolkit/mir_native_buffer.h' |
1311 | --- include/shared/mir_toolkit/mir_native_buffer.h 2013-11-21 03:16:21 +0000 |
1312 | +++ include/shared/mir_toolkit/mir_native_buffer.h 2013-12-18 14:40:47 +0000 |
1313 | @@ -52,6 +52,6 @@ |
1314 | struct ANativeWindowBuffer; |
1315 | typedef struct ANativeWindowBuffer MirNativeBuffer; |
1316 | #else |
1317 | -typedef struct MirBufferPackage MirNativeBuffer; |
1318 | +typedef struct MirBufferPackage MirNativeBuffer; |
1319 | #endif |
1320 | #endif /* MIR_CLIENT_MIR_NATIVE_BUFFER_H_ */ |
1321 | |
1322 | === added file 'include/test/gmock_set_arg.h' |
1323 | --- include/test/gmock_set_arg.h 1970-01-01 00:00:00 +0000 |
1324 | +++ include/test/gmock_set_arg.h 2013-12-18 14:40:47 +0000 |
1325 | @@ -0,0 +1,57 @@ |
1326 | +/* |
1327 | + * Copyright © 2013 Canonical Ltd. |
1328 | + * |
1329 | + * This program is free software: you can redistribute it and/or modify it |
1330 | + * under the terms of the GNU General Public License version 3, |
1331 | + * as published by the Free Software Foundation. |
1332 | + * |
1333 | + * This program is distributed in the hope that it will be useful, |
1334 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
1335 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1336 | + * GNU General Public License for more details. |
1337 | + * |
1338 | + * You should have received a copy of the GNU General Public License |
1339 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
1340 | + * |
1341 | + * Authored by: Alan Griffiths <alan@octopull.co.uk> |
1342 | + */ |
1343 | + |
1344 | +#ifndef GMOCK_SET_ARG_H_ |
1345 | +#define GMOCK_SET_ARG_H_ |
1346 | + |
1347 | +#include <gmock/gmock.h> |
1348 | + |
1349 | +namespace testing |
1350 | +{ |
1351 | +namespace internal |
1352 | +{ |
1353 | +template <size_t N, typename A, bool kIsProto> |
1354 | +class SetArgumentAction { |
1355 | + public: |
1356 | + // Constructs an action that sets the variable pointed to by the |
1357 | + // N-th function argument to 'value'. |
1358 | + explicit SetArgumentAction(const A& value) : value_(value) {} |
1359 | + |
1360 | + template <typename Result, typename ArgumentTuple> |
1361 | + void Perform(const ArgumentTuple& args) const { |
1362 | + CompileAssertTypesEqual<void, Result>(); |
1363 | + ::std::tr1::get<N>(args) = value_; |
1364 | + } |
1365 | + |
1366 | + private: |
1367 | + const A value_; |
1368 | + |
1369 | + GTEST_DISALLOW_ASSIGN_(SetArgumentAction); |
1370 | +}; |
1371 | +} |
1372 | +template <size_t N, typename T> |
1373 | +PolymorphicAction< |
1374 | + internal::SetArgumentAction< |
1375 | + N, T, internal::IsAProtocolMessage<T>::value> > |
1376 | +SetArg(const T& x) { |
1377 | + return MakePolymorphicAction(internal::SetArgumentAction< |
1378 | + N, T, internal::IsAProtocolMessage<T>::value>(x)); |
1379 | +} |
1380 | +} |
1381 | + |
1382 | +#endif /* GMOCK_SET_ARG_H_ */ |
1383 | |
1384 | === modified file 'include/test/mir_test/draw/draw_pattern_checkered-inl.h' |
1385 | --- include/test/mir_test/draw/draw_pattern_checkered-inl.h 2013-11-21 03:16:21 +0000 |
1386 | +++ include/test/mir_test/draw/draw_pattern_checkered-inl.h 2013-12-18 14:40:47 +0000 |
1387 | @@ -16,8 +16,7 @@ |
1388 | * Authored by: Kevin DuBois <kevin.dubois@canonical.com> |
1389 | */ |
1390 | |
1391 | -#include "mir/geometry/pixel_format.h" |
1392 | -namespace geom = mir::geometry; |
1393 | +#include "mir_toolkit/common.h" |
1394 | |
1395 | template<size_t Rows, size_t Cols> |
1396 | DrawPatternCheckered<Rows,Cols>::DrawPatternCheckered(uint32_t (&pattern) [Rows][Cols]) |
1397 | @@ -32,14 +31,14 @@ |
1398 | if (region.pixel_format != mir_pixel_format_abgr_8888) |
1399 | throw(std::runtime_error("cannot draw region, incorrect format")); |
1400 | |
1401 | - auto bpp = geom::bytes_per_pixel(geom::PixelFormat::abgr_8888); |
1402 | + auto bpp = MIR_BYTES_PER_PIXEL(mir_pixel_format_abgr_8888); |
1403 | for(int i=0; i < region.width; i++) |
1404 | { |
1405 | for(int j=0; j<region.height; j++) |
1406 | { |
1407 | int key_row = i % Rows; |
1408 | int key_col = j % Cols; |
1409 | - uint32_t *pixel = reinterpret_cast<uint32_t*>(®ion.vaddr[j*region.stride + (i * bpp)]); |
1410 | + uint32_t *pixel = reinterpret_cast<uint32_t*>(®ion.vaddr[j*region.stride + (i * bpp)]); |
1411 | *pixel = color_pattern[key_row][key_col]; |
1412 | } |
1413 | } |
1414 | @@ -51,14 +50,14 @@ |
1415 | if (region.pixel_format != mir_pixel_format_abgr_8888) |
1416 | throw(std::runtime_error("cannot check region, incorrect format")); |
1417 | |
1418 | - auto bpp = geom::bytes_per_pixel(geom::PixelFormat::abgr_8888); |
1419 | + auto bpp = MIR_BYTES_PER_PIXEL(mir_pixel_format_abgr_8888); |
1420 | for(int i=0; i< region.width; i++) |
1421 | { |
1422 | for(int j=0; j<region.height; j++) |
1423 | { |
1424 | int key_row = i % Rows; |
1425 | int key_col = j % Cols; |
1426 | - uint32_t *pixel = reinterpret_cast<uint32_t*>(®ion.vaddr[j*region.stride + (i * bpp)]); |
1427 | + uint32_t *pixel = reinterpret_cast<uint32_t*>(®ion.vaddr[j*region.stride + (i * bpp)]); |
1428 | if ( *pixel != color_pattern[key_row][key_col] ) |
1429 | { |
1430 | return false; |
1431 | |
1432 | === modified file 'include/test/mir_test/fake_event_hub_input_configuration.h' |
1433 | --- include/test/mir_test/fake_event_hub_input_configuration.h 2013-08-30 07:47:16 +0000 |
1434 | +++ include/test/mir_test/fake_event_hub_input_configuration.h 2013-12-18 14:40:47 +0000 |
1435 | @@ -59,7 +59,7 @@ |
1436 | |
1437 | droidinput::sp<droidinput::EventHubInterface> the_event_hub(); |
1438 | input::android::FakeEventHub* the_fake_event_hub(); |
1439 | - |
1440 | + |
1441 | bool is_key_repeat_enabled() override { return false; } |
1442 | |
1443 | |
1444 | |
1445 | === modified file 'include/test/mir_test_doubles/mock_alloc_adaptor.h' |
1446 | --- include/test/mir_test_doubles/mock_alloc_adaptor.h 2013-10-15 08:53:10 +0000 |
1447 | +++ include/test/mir_test_doubles/mock_alloc_adaptor.h 2013-12-18 14:40:47 +0000 |
1448 | @@ -19,7 +19,7 @@ |
1449 | #ifndef MIR_TEST_DOUBLES_MOCK_ALLOC_ADAPTOR_H_ |
1450 | #define MIR_TEST_DOUBLES_MOCK_ALLOC_ADAPTOR_H_ |
1451 | |
1452 | -#include "src/server/graphics/android/graphic_alloc_adaptor.h" |
1453 | +#include "src/platform/graphics/android/graphic_alloc_adaptor.h" |
1454 | |
1455 | #include <system/window.h> |
1456 | #include <gmock/gmock.h> |
1457 | @@ -34,8 +34,8 @@ |
1458 | class MockAllocAdaptor : public graphics::android::GraphicAllocAdaptor |
1459 | { |
1460 | public: |
1461 | - MOCK_METHOD3(alloc_buffer, |
1462 | - std::shared_ptr<graphics::NativeBuffer>(geometry::Size, geometry::PixelFormat, graphics::android::BufferUsage)); |
1463 | + MOCK_METHOD3(alloc_buffer, |
1464 | + std::shared_ptr<graphics::NativeBuffer>(geometry::Size, MirPixelFormat, graphics::android::BufferUsage)); |
1465 | }; |
1466 | |
1467 | } |
1468 | |
1469 | === modified file 'include/test/mir_test_doubles/mock_android_native_buffer.h' |
1470 | --- include/test/mir_test_doubles/mock_android_native_buffer.h 2013-10-11 21:30:50 +0000 |
1471 | +++ include/test/mir_test_doubles/mock_android_native_buffer.h 2013-12-18 14:40:47 +0000 |
1472 | @@ -20,7 +20,7 @@ |
1473 | #define MIR_TEST_DOUBLES_MOCK_ANDROID_NATIVE_BUFFER_H_ |
1474 | |
1475 | #include "mir/graphics/android/native_buffer.h" |
1476 | -#include <gmock/gmock.h> |
1477 | +#include <gmock/gmock.h> |
1478 | |
1479 | namespace mir |
1480 | { |
1481 | |
1482 | === modified file 'include/test/mir_test_doubles/mock_android_registrar.h' |
1483 | --- include/test/mir_test_doubles/mock_android_registrar.h 2013-06-21 22:14:10 +0000 |
1484 | +++ include/test/mir_test_doubles/mock_android_registrar.h 2013-12-18 14:40:47 +0000 |
1485 | @@ -36,7 +36,7 @@ |
1486 | struct MockAndroidRegistrar : public client::android::AndroidRegistrar |
1487 | { |
1488 | ~MockAndroidRegistrar() noexcept {} |
1489 | - MOCK_CONST_METHOD1(register_buffer, |
1490 | + MOCK_CONST_METHOD1(register_buffer, |
1491 | std::shared_ptr<const native_handle_t>(std::shared_ptr<MirBufferPackage> const&)); |
1492 | MOCK_METHOD2(secure_for_cpu, std::shared_ptr<char>(std::shared_ptr<const native_handle_t>, geometry::Rectangle)); |
1493 | }; |
1494 | |
1495 | === modified file 'include/test/mir_test_doubles/mock_buffer.h' |
1496 | --- include/test/mir_test_doubles/mock_buffer.h 2013-10-15 08:53:10 +0000 |
1497 | +++ include/test/mir_test_doubles/mock_buffer.h 2013-12-18 14:40:47 +0000 |
1498 | @@ -42,7 +42,7 @@ |
1499 | |
1500 | MockBuffer(geometry::Size size, |
1501 | geometry::Stride s, |
1502 | - geometry::PixelFormat pf) |
1503 | + MirPixelFormat pf) |
1504 | { |
1505 | using namespace testing; |
1506 | ON_CALL(*this, size()) |
1507 | @@ -60,7 +60,7 @@ |
1508 | |
1509 | MOCK_CONST_METHOD0(size, geometry::Size()); |
1510 | MOCK_CONST_METHOD0(stride, geometry::Stride()); |
1511 | - MOCK_CONST_METHOD0(pixel_format, geometry::PixelFormat()); |
1512 | + MOCK_CONST_METHOD0(pixel_format, MirPixelFormat()); |
1513 | MOCK_CONST_METHOD0(native_buffer_handle, std::shared_ptr<graphics::NativeBuffer>()); |
1514 | |
1515 | MOCK_METHOD0(bind_to_texture, void()); |
1516 | |
1517 | === modified file 'include/test/mir_test_doubles/mock_buffer_bundle.h' |
1518 | --- include/test/mir_test_doubles/mock_buffer_bundle.h 2013-11-21 03:16:21 +0000 |
1519 | +++ include/test/mir_test_doubles/mock_buffer_bundle.h 2013-12-18 14:40:47 +0000 |
1520 | @@ -37,8 +37,8 @@ |
1521 | ~MockBufferBundle() noexcept |
1522 | {} |
1523 | |
1524 | - MOCK_METHOD0(client_acquire, std::shared_ptr<graphics::Buffer>()); |
1525 | - MOCK_METHOD1(client_release, void(std::shared_ptr<graphics::Buffer> const&)); |
1526 | + MOCK_METHOD0(client_acquire, graphics::Buffer*()); |
1527 | + MOCK_METHOD1(client_release, void(graphics::Buffer*)); |
1528 | MOCK_METHOD1(compositor_acquire, std::shared_ptr<graphics::Buffer>(unsigned long)); |
1529 | MOCK_METHOD1(compositor_release, void(std::shared_ptr<graphics::Buffer> const&)); |
1530 | MOCK_METHOD0(snapshot_acquire, std::shared_ptr<graphics::Buffer>()); |
1531 | |
1532 | === modified file 'include/test/mir_test_doubles/mock_buffer_stream.h' |
1533 | --- include/test/mir_test_doubles/mock_buffer_stream.h 2013-11-21 03:16:21 +0000 |
1534 | +++ include/test/mir_test_doubles/mock_buffer_stream.h 2013-12-18 14:40:47 +0000 |
1535 | @@ -31,12 +31,12 @@ |
1536 | { |
1537 | struct MockBufferStream : public compositor::BufferStream |
1538 | { |
1539 | - MOCK_METHOD0(secure_client_buffer, std::shared_ptr<graphics::Buffer>()); |
1540 | + MOCK_METHOD1(swap_client_buffers, void(graphics::Buffer*&)); |
1541 | MOCK_METHOD1(lock_compositor_buffer, |
1542 | std::shared_ptr<graphics::Buffer>(unsigned long)); |
1543 | MOCK_METHOD0(lock_snapshot_buffer, std::shared_ptr<graphics::Buffer>()); |
1544 | |
1545 | - MOCK_METHOD0(get_stream_pixel_format, geometry::PixelFormat()); |
1546 | + MOCK_METHOD0(get_stream_pixel_format, MirPixelFormat()); |
1547 | MOCK_METHOD0(stream_size, geometry::Size()); |
1548 | MOCK_METHOD1(resize, void(geometry::Size const&)); |
1549 | MOCK_METHOD0(force_client_completion, void()); |
1550 | |
1551 | === modified file 'include/test/mir_test_doubles/mock_display_device.h' |
1552 | --- include/test/mir_test_doubles/mock_display_device.h 2013-11-21 17:20:14 +0000 |
1553 | +++ include/test/mir_test_doubles/mock_display_device.h 2013-12-18 14:40:47 +0000 |
1554 | @@ -20,9 +20,9 @@ |
1555 | #define MIR_TEST_DOUBLES_MOCK_DISPLAY_DEVICE_H_ |
1556 | |
1557 | #include "mir/graphics/buffer.h" |
1558 | -#include "src/server/graphics/android/display_device.h" |
1559 | +#include "src/platform/graphics/android/display_device.h" |
1560 | #include <gmock/gmock.h> |
1561 | - |
1562 | + |
1563 | namespace mir |
1564 | { |
1565 | namespace test |
1566 | |
1567 | === modified file 'include/test/mir_test_doubles/mock_egl.h' |
1568 | --- include/test/mir_test_doubles/mock_egl.h 2013-11-21 03:16:21 +0000 |
1569 | +++ include/test/mir_test_doubles/mock_egl.h 2013-12-18 14:40:47 +0000 |
1570 | @@ -58,7 +58,6 @@ |
1571 | public: |
1572 | MockEGL(); |
1573 | ~MockEGL(); |
1574 | - void silence_uninteresting(); |
1575 | |
1576 | typedef void (*generic_function_pointer_t)(void); |
1577 | |
1578 | |
1579 | === modified file 'include/test/mir_test_doubles/mock_fb_hal_device.h' |
1580 | --- include/test/mir_test_doubles/mock_fb_hal_device.h 2013-11-19 22:02:08 +0000 |
1581 | +++ include/test/mir_test_doubles/mock_fb_hal_device.h 2013-12-18 14:40:47 +0000 |
1582 | @@ -52,10 +52,11 @@ |
1583 | {0,0,0,0,0,0,0}, |
1584 | nullptr, nullptr,nullptr,nullptr, nullptr,nullptr, |
1585 | {0,0,0,0,0,0} |
1586 | - }) |
1587 | + }) |
1588 | { |
1589 | post = hook_post; |
1590 | - setSwapInterval = hook_setSwapInterval; |
1591 | + setSwapInterval = hook_setSwapInterval; |
1592 | + enableScreen = hook_enableScreen; |
1593 | } |
1594 | |
1595 | MockFBHalDevice() |
1596 | @@ -72,12 +73,20 @@ |
1597 | static int hook_setSwapInterval(struct framebuffer_device_t* mock_fb, int interval) |
1598 | { |
1599 | MockFBHalDevice* mocker = static_cast<MockFBHalDevice*>(mock_fb); |
1600 | - return mocker->setSwapInterval_interface(mock_fb, interval); |
1601 | - } |
1602 | - |
1603 | + return mocker->setSwapInterval_interface(mock_fb, interval); |
1604 | + } |
1605 | + |
1606 | + static int hook_enableScreen(struct framebuffer_device_t* mock_fb, int enable) |
1607 | + { |
1608 | + MockFBHalDevice* mocker = static_cast<MockFBHalDevice*>(mock_fb); |
1609 | + return mocker->enableScreen_interface(mock_fb, enable); |
1610 | + } |
1611 | + |
1612 | + |
1613 | + MOCK_METHOD2(enableScreen_interface, int(struct framebuffer_device_t*, int)); |
1614 | MOCK_METHOD2(post_interface, int(struct framebuffer_device_t*, buffer_handle_t)); |
1615 | MOCK_METHOD2(setSwapInterval_interface, int(struct framebuffer_device_t*, int)); |
1616 | - |
1617 | + |
1618 | hw_device_t empty_module; |
1619 | }; |
1620 | |
1621 | |
1622 | === modified file 'include/test/mir_test_doubles/mock_framebuffer_bundle.h' |
1623 | --- include/test/mir_test_doubles/mock_framebuffer_bundle.h 2013-11-19 22:41:51 +0000 |
1624 | +++ include/test/mir_test_doubles/mock_framebuffer_bundle.h 2013-12-18 14:40:47 +0000 |
1625 | @@ -19,7 +19,7 @@ |
1626 | #ifndef MIR_TEST_DOUBLES_MOCK_FRAMEBUFFER_BUNDLE_H_ |
1627 | #define MIR_TEST_DOUBLES_MOCK_FRAMEBUFFER_BUNDLE_H_ |
1628 | |
1629 | -#include "src/server/graphics/android/framebuffer_bundle.h" |
1630 | +#include "src/platform/graphics/android/framebuffer_bundle.h" |
1631 | #include "stub_buffer.h" |
1632 | #include <gmock/gmock.h> |
1633 | |
1634 | @@ -38,7 +38,7 @@ |
1635 | ON_CALL(*this, last_rendered_buffer()) |
1636 | .WillByDefault(Return(std::make_shared<StubBuffer>())); |
1637 | } |
1638 | - MOCK_METHOD0(fb_format, geometry::PixelFormat()); |
1639 | + MOCK_METHOD0(fb_format, MirPixelFormat()); |
1640 | MOCK_METHOD0(fb_size, geometry::Size()); |
1641 | MOCK_METHOD0(buffer_for_render, std::shared_ptr<graphics::Buffer>()); |
1642 | MOCK_METHOD0(last_rendered_buffer, std::shared_ptr<graphics::Buffer>()); |
1643 | |
1644 | === modified file 'include/test/mir_test_doubles/mock_frontend_surface.h' |
1645 | --- include/test/mir_test_doubles/mock_frontend_surface.h 2013-11-21 03:16:21 +0000 |
1646 | +++ include/test/mir_test_doubles/mock_frontend_surface.h 2013-12-18 14:40:47 +0000 |
1647 | @@ -39,10 +39,10 @@ |
1648 | |
1649 | MOCK_METHOD0(destroy, void()); |
1650 | MOCK_METHOD0(force_requests_to_complete, void()); |
1651 | - MOCK_METHOD0(advance_client_buffer, std::shared_ptr<graphics::Buffer>()); |
1652 | + MOCK_METHOD1(swap_buffers, void(graphics::Buffer*&)); |
1653 | |
1654 | MOCK_CONST_METHOD0(size, geometry::Size()); |
1655 | - MOCK_CONST_METHOD0(pixel_format, geometry::PixelFormat()); |
1656 | + MOCK_CONST_METHOD0(pixel_format, MirPixelFormat()); |
1657 | |
1658 | MOCK_CONST_METHOD0(supports_input, bool()); |
1659 | MOCK_CONST_METHOD0(client_input_fd, int()); |
1660 | |
1661 | === modified file 'include/test/mir_test_doubles/mock_hwc_composer_device_1.h' |
1662 | --- include/test/mir_test_doubles/mock_hwc_composer_device_1.h 2013-11-21 03:16:21 +0000 |
1663 | +++ include/test/mir_test_doubles/mock_hwc_composer_device_1.h 2013-12-18 14:40:47 +0000 |
1664 | @@ -66,7 +66,7 @@ |
1665 | |
1666 | void hwc_set_return_fence(int fence) |
1667 | { |
1668 | - fb_fence = fence; |
1669 | + fb_fence = fence; |
1670 | } |
1671 | |
1672 | int save_last_prepare_arguments(struct hwc_composer_device_1 *, size_t, hwc_display_contents_1_t** displays) |
1673 | @@ -87,7 +87,7 @@ |
1674 | set_layerlist.back().visibleRegionScreen = {0, nullptr}; |
1675 | } |
1676 | |
1677 | - if (primary_display->hwLayers) |
1678 | + if (primary_display->numHwLayers >= 2) |
1679 | { |
1680 | primary_display->hwLayers[1].releaseFenceFd = fb_fence; |
1681 | } |
1682 | |
1683 | === modified file 'include/test/mir_test_doubles/mock_hwc_layerlist.h' |
1684 | --- include/test/mir_test_doubles/mock_hwc_layerlist.h 2013-09-25 15:46:05 +0000 |
1685 | +++ include/test/mir_test_doubles/mock_hwc_layerlist.h 2013-12-18 14:40:47 +0000 |
1686 | @@ -19,7 +19,7 @@ |
1687 | #ifndef MIR_TEST_DOUBLES_MOCK_HWC_LAYERLIST_H_ |
1688 | #define MIR_TEST_DOUBLES_MOCK_HWC_LAYERLIST_H_ |
1689 | |
1690 | -#include "src/server/graphics/android/hwc_layerlist.h" |
1691 | +#include "src/platform/graphics/android/hwc_layerlist.h" |
1692 | |
1693 | #include <gmock/gmock.h> |
1694 | |
1695 | |
1696 | === modified file 'include/test/mir_test_doubles/mock_hwc_vsync_coordinator.h' |
1697 | --- include/test/mir_test_doubles/mock_hwc_vsync_coordinator.h 2013-05-20 15:29:28 +0000 |
1698 | +++ include/test/mir_test_doubles/mock_hwc_vsync_coordinator.h 2013-12-18 14:40:47 +0000 |
1699 | @@ -19,7 +19,7 @@ |
1700 | #ifndef MIR_TEST_DOUBLES_MOCK_HWC_VSYNC_COORDINATOR_H_ |
1701 | #define MIR_TEST_DOUBLES_MOCK_HWC_VSYNC_COORDINATOR_H_ |
1702 | |
1703 | -#include "src/server/graphics/android/hwc_vsync_coordinator.h" |
1704 | +#include "src/platform/graphics/android/hwc_vsync_coordinator.h" |
1705 | |
1706 | #include <gmock/gmock.h> |
1707 | |
1708 | |
1709 | === modified file 'include/test/mir_test_doubles/mock_input_dispatcher.h' |
1710 | --- include/test/mir_test_doubles/mock_input_dispatcher.h 2013-05-24 18:23:48 +0000 |
1711 | +++ include/test/mir_test_doubles/mock_input_dispatcher.h 2013-12-18 14:40:47 +0000 |
1712 | @@ -45,7 +45,7 @@ |
1713 | MOCK_METHOD2(transferTouchFocus, bool(droidinput::sp<droidinput::InputChannel> const&, droidinput::sp<droidinput::InputChannel> const&)); |
1714 | MOCK_METHOD3(registerInputChannel, droidinput::status_t(droidinput::sp<droidinput::InputChannel> const&, droidinput::sp<droidinput::InputWindowHandle> const&, bool)); |
1715 | MOCK_METHOD1(unregisterInputChannel, droidinput::status_t(droidinput::sp<droidinput::InputChannel> const&)); |
1716 | - |
1717 | + |
1718 | MOCK_METHOD1(setKeyboardFocus, void(droidinput::sp<droidinput::InputWindowHandle> const&)); |
1719 | MOCK_METHOD1(notifyWindowRemoved, void(droidinput::sp<droidinput::InputWindowHandle> const&)); |
1720 | |
1721 | |
1722 | === modified file 'include/test/mir_test_doubles/mock_input_surface.h' |
1723 | --- include/test/mir_test_doubles/mock_input_surface.h 2013-08-28 03:41:48 +0000 |
1724 | +++ include/test/mir_test_doubles/mock_input_surface.h 2013-12-18 14:40:47 +0000 |
1725 | @@ -29,7 +29,7 @@ |
1726 | namespace doubles |
1727 | { |
1728 | |
1729 | -class MockInputSurface : public input::Surface |
1730 | +class MockInputSurface : public input::Surface |
1731 | { |
1732 | public: |
1733 | MockInputSurface() |
1734 | |
1735 | === modified file 'include/test/mir_test_doubles/mock_interpreter_resource_cache.h' |
1736 | --- include/test/mir_test_doubles/mock_interpreter_resource_cache.h 2013-10-15 08:53:10 +0000 |
1737 | +++ include/test/mir_test_doubles/mock_interpreter_resource_cache.h 2013-12-18 14:40:47 +0000 |
1738 | @@ -18,7 +18,7 @@ |
1739 | #ifndef MIR_TEST_DOUBLES_MOCK_INTERPRETER_RESOURCE_CACHE_H_ |
1740 | #define MIR_TEST_DOUBLES_MOCK_INTERPRETER_RESOURCE_CACHE_H_ |
1741 | |
1742 | -#include "src/server/graphics/android/interpreter_resource_cache.h" |
1743 | +#include "src/platform/graphics/android/interpreter_resource_cache.h" |
1744 | |
1745 | namespace mir |
1746 | { |
1747 | |
1748 | === modified file 'include/test/mir_test_doubles/mock_session_listener.h' |
1749 | --- include/test/mir_test_doubles/mock_session_listener.h 2013-07-18 22:51:42 +0000 |
1750 | +++ include/test/mir_test_doubles/mock_session_listener.h 2013-12-18 14:40:47 +0000 |
1751 | @@ -38,7 +38,7 @@ |
1752 | MOCK_METHOD1(stopping, void(std::shared_ptr<shell::Session> const&)); |
1753 | MOCK_METHOD1(focused, void(std::shared_ptr<shell::Session> const&)); |
1754 | MOCK_METHOD0(unfocused, void()); |
1755 | - |
1756 | + |
1757 | MOCK_METHOD2(surface_created, void(shell::Session&, std::shared_ptr<shell::Surface> const&)); |
1758 | MOCK_METHOD2(destroying_surface, void(shell::Session&, std::shared_ptr<shell::Surface> const&)); |
1759 | }; |
1760 | |
1761 | === modified file 'include/test/mir_test_doubles/mock_shell_session.h' |
1762 | --- include/test/mir_test_doubles/mock_shell_session.h 2013-11-21 03:16:21 +0000 |
1763 | +++ include/test/mir_test_doubles/mock_shell_session.h 2013-12-18 14:40:47 +0000 |
1764 | @@ -46,7 +46,7 @@ |
1765 | |
1766 | MOCK_METHOD0(hide, void()); |
1767 | MOCK_METHOD0(show, void()); |
1768 | - |
1769 | + |
1770 | MOCK_METHOD1(send_display_config, void(graphics::DisplayConfiguration const&)); |
1771 | MOCK_METHOD3(configure_surface, int(frontend::SurfaceId, MirSurfaceAttrib, int)); |
1772 | |
1773 | |
1774 | === modified file 'include/test/mir_test_doubles/mock_surface.h' |
1775 | --- include/test/mir_test_doubles/mock_surface.h 2013-11-21 12:34:49 +0000 |
1776 | +++ include/test/mir_test_doubles/mock_surface.h 2013-12-18 14:40:47 +0000 |
1777 | @@ -38,9 +38,8 @@ |
1778 | |
1779 | struct MockSurface : public scene::SurfaceImpl |
1780 | { |
1781 | - MockSurface(shell::Session* session, std::shared_ptr<scene::SurfaceBuilder> const& builder) : |
1782 | - scene::SurfaceImpl(session, builder, std::make_shared<NullSurfaceConfigurator>(), shell::a_surface(), |
1783 | - frontend::SurfaceId{}, std::make_shared<NullEventSink>()) |
1784 | + MockSurface(std::shared_ptr<scene::SurfaceBuilder> const& builder) : |
1785 | + scene::SurfaceImpl(builder, std::make_shared<NullSurfaceConfigurator>(), shell::a_surface(), frontend::SurfaceId{}, std::make_shared<NullEventSink>()) |
1786 | { |
1787 | } |
1788 | |
1789 | @@ -49,14 +48,14 @@ |
1790 | MOCK_METHOD0(hide, void()); |
1791 | MOCK_METHOD0(show, void()); |
1792 | MOCK_METHOD0(visible, bool()); |
1793 | - MOCK_METHOD1(raise, void(std::shared_ptr<shell::SurfaceController> const&)); |
1794 | + MOCK_METHOD1(raise, void(std::shared_ptr<scene::SurfaceRanker> const&)); |
1795 | |
1796 | MOCK_METHOD0(force_requests_to_complete, void()); |
1797 | MOCK_METHOD0(advance_client_buffer, std::shared_ptr<graphics::Buffer>()); |
1798 | |
1799 | MOCK_CONST_METHOD0(name, std::string()); |
1800 | MOCK_CONST_METHOD0(size, geometry::Size()); |
1801 | - MOCK_CONST_METHOD0(pixel_format, geometry::PixelFormat()); |
1802 | + MOCK_CONST_METHOD0(pixel_format, MirPixelFormat()); |
1803 | |
1804 | MOCK_CONST_METHOD0(supports_input, bool()); |
1805 | MOCK_CONST_METHOD0(client_input_fd, int()); |
1806 | |
1807 | === renamed file 'include/test/mir_test_doubles/mock_surface_controller.h' => 'include/test/mir_test_doubles/mock_surface_ranker.h' |
1808 | --- include/test/mir_test_doubles/mock_surface_controller.h 2013-11-21 12:34:49 +0000 |
1809 | +++ include/test/mir_test_doubles/mock_surface_ranker.h 2013-12-18 14:40:47 +0000 |
1810 | @@ -17,10 +17,10 @@ |
1811 | */ |
1812 | |
1813 | |
1814 | -#ifndef MIR_TEST_DOUBLES_MOCK_SURFACE_CONTROLLER_H_ |
1815 | -#define MIR_TEST_DOUBLES_MOCK_SURFACE_CONTROLLER_H_ |
1816 | +#ifndef MIR_TEST_DOUBLES_MOCK_SURFACE_RANKER_H_ |
1817 | +#define MIR_TEST_DOUBLES_MOCK_SURFACE_RANKER_H_ |
1818 | |
1819 | -#include "mir/shell/surface_controller.h" |
1820 | +#include "src/server/scene/surface_ranker.h" |
1821 | |
1822 | #include <gmock/gmock.h> |
1823 | |
1824 | @@ -31,7 +31,7 @@ |
1825 | namespace doubles |
1826 | { |
1827 | |
1828 | -struct MockSurfaceController : public shell::SurfaceController |
1829 | +struct MockSurfaceRanker : public scene::SurfaceRanker |
1830 | { |
1831 | MOCK_METHOD1(raise, void(std::weak_ptr<scene::BasicSurface> const&)); |
1832 | }; |
1833 | @@ -41,4 +41,4 @@ |
1834 | } |
1835 | |
1836 | |
1837 | -#endif /* MIR_TEST_DOUBLES_MOCK_SURFACE_CONTROLLER_H_ */ |
1838 | +#endif /* MIR_TEST_DOUBLES_MOCK_SURFACE_RANKER_H_ */ |
1839 | |
1840 | === modified file 'include/test/mir_test_doubles/mock_surface_renderer.h' |
1841 | --- include/test/mir_test_doubles/mock_surface_renderer.h 2013-11-21 03:16:21 +0000 |
1842 | +++ include/test/mir_test_doubles/mock_surface_renderer.h 2013-12-18 14:40:47 +0000 |
1843 | @@ -18,7 +18,6 @@ |
1844 | #ifndef MIR_TEST_DOUBLES_MOCK_SURFACE_RENDERER_H_ |
1845 | #define MIR_TEST_DOUBLES_MOCK_SURFACE_RENDERER_H_ |
1846 | |
1847 | -#include "mir/compositor/buffer_stream.h" |
1848 | #include "src/server/compositor/renderer.h" |
1849 | |
1850 | #include <gmock/gmock.h> |
1851 | @@ -32,9 +31,8 @@ |
1852 | |
1853 | struct MockSurfaceRenderer : public compositor::Renderer |
1854 | { |
1855 | - MOCK_METHOD3(render, void( |
1856 | - std::function<void(std::shared_ptr<void> const&)>, compositor::CompositingCriteria const&, compositor::BufferStream&)); |
1857 | - MOCK_METHOD1(clear, void(unsigned long)); |
1858 | + MOCK_CONST_METHOD2(render, void(compositor::CompositingCriteria const&, graphics::Buffer&)); |
1859 | + MOCK_CONST_METHOD0(clear, void()); |
1860 | |
1861 | ~MockSurfaceRenderer() noexcept {} |
1862 | }; |
1863 | |
1864 | === removed file 'include/test/mir_test_doubles/mock_surface_state.h' |
1865 | --- include/test/mir_test_doubles/mock_surface_state.h 2013-11-21 12:34:49 +0000 |
1866 | +++ include/test/mir_test_doubles/mock_surface_state.h 1970-01-01 00:00:00 +0000 |
1867 | @@ -1,71 +0,0 @@ |
1868 | -/* |
1869 | - * Copyright © 2013 Canonical Ltd. |
1870 | - * |
1871 | - * This program is free software: you can redistribute it and/or modify it |
1872 | - * under the terms of the GNU General Public License version 3, |
1873 | - * as published by the Free Software Foundation. |
1874 | - * |
1875 | - * This program is distributed in the hope that it will be useful, |
1876 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
1877 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1878 | - * GNU General Public License for more details. |
1879 | - * |
1880 | - * You should have received a copy of the GNU General Public License |
1881 | - * along with this program. If not, see <http://www.gnu.org/licenses/>. |
1882 | - * |
1883 | - * Authored by: Kevin DuBois <kevin.dubois@canonical.com> |
1884 | - */ |
1885 | - |
1886 | -#ifndef MIR_TEST_DOUBLES_MOCK_SURFACE_STATE_H_ |
1887 | -#define MIR_TEST_DOUBLES_MOCK_SURFACE_STATE_H_ |
1888 | - |
1889 | -#include "src/server/scene/surface_state.h" |
1890 | -#include <gmock/gmock.h> |
1891 | - |
1892 | -namespace mir |
1893 | -{ |
1894 | -namespace test |
1895 | -{ |
1896 | -namespace doubles |
1897 | -{ |
1898 | - |
1899 | -class MockSurfaceState : public scene::SurfaceState |
1900 | -{ |
1901 | -public: |
1902 | - MockSurfaceState() |
1903 | - { |
1904 | - using namespace testing; |
1905 | - ON_CALL(*this, position()) |
1906 | - .WillByDefault( |
1907 | - Return(geometry::Point{})); |
1908 | - ON_CALL(*this, size()) |
1909 | - .WillByDefault( |
1910 | - Return(geometry::Size{})); |
1911 | - static std::string n; |
1912 | - ON_CALL(*this, name()) |
1913 | - .WillByDefault(testing::ReturnRef(n)); |
1914 | - } |
1915 | - |
1916 | - ~MockSurfaceState() noexcept {} |
1917 | - MOCK_CONST_METHOD0(position, geometry::Point()); |
1918 | - MOCK_CONST_METHOD0(size, geometry::Size()); |
1919 | - MOCK_CONST_METHOD0(name, std::string const&()); |
1920 | - MOCK_METHOD2(apply_rotation, void(float, glm::vec3 const&)); |
1921 | - MOCK_METHOD1(move_to, void(geometry::Point)); |
1922 | - MOCK_METHOD1(resize, void(geometry::Size const&)); |
1923 | - MOCK_CONST_METHOD1(contains, bool(geometry::Point const&)); |
1924 | - MOCK_METHOD1(set_input_region, void(std::vector<geometry::Rectangle> const&)); |
1925 | - MOCK_CONST_METHOD0(alpha, float()); |
1926 | - MOCK_METHOD1(apply_alpha, void(float)); |
1927 | - MOCK_CONST_METHOD0(transformation, glm::mat4 const&()); |
1928 | - MOCK_METHOD0(frame_posted, void()); |
1929 | - MOCK_METHOD1(set_hidden, void(bool)); |
1930 | - MOCK_CONST_METHOD1(should_be_rendered_in, bool(geometry::Rectangle const&)); |
1931 | - MOCK_CONST_METHOD0(shaped, bool()); |
1932 | -}; |
1933 | - |
1934 | -typedef ::testing::NiceMock<MockSurfaceState> StubSurfaceState; |
1935 | -} |
1936 | -} |
1937 | -} |
1938 | -#endif /* MIR_TEST_DOUBLES_MOCK_SURFACE_STATE_H_ */ |
1939 | |
1940 | === modified file 'include/test/mir_test_doubles/null_video_devices.h' |
1941 | --- include/test/mir_test_doubles/null_video_devices.h 2013-08-28 03:41:48 +0000 |
1942 | +++ include/test/mir_test_doubles/null_video_devices.h 2013-12-18 14:40:47 +0000 |
1943 | @@ -19,7 +19,7 @@ |
1944 | #ifndef MIR_TEST_DOUBLES_NULL_VIDEO_DEVICES_H_ |
1945 | #define MIR_TEST_DOUBLES_NULL_VIDEO_DEVICES_H_ |
1946 | |
1947 | -#include "src/server/graphics/gbm/video_devices.h" |
1948 | +#include "src/platform/graphics/mesa/video_devices.h" |
1949 | |
1950 | namespace mir |
1951 | { |
1952 | @@ -28,7 +28,7 @@ |
1953 | namespace doubles |
1954 | { |
1955 | |
1956 | -class NullVideoDevices : public graphics::gbm::VideoDevices |
1957 | +class NullVideoDevices : public graphics::mesa::VideoDevices |
1958 | { |
1959 | public: |
1960 | void register_change_handler( |
1961 | |
1962 | === modified file 'include/test/mir_test_doubles/null_virtual_terminal.h' |
1963 | --- include/test/mir_test_doubles/null_virtual_terminal.h 2013-08-28 03:41:48 +0000 |
1964 | +++ include/test/mir_test_doubles/null_virtual_terminal.h 2013-12-18 14:40:47 +0000 |
1965 | @@ -19,7 +19,7 @@ |
1966 | #ifndef MIR_TEST_DOUBLES_NULL_VIRTUAL_TERMINAL_H_ |
1967 | #define MIR_TEST_DOUBLES_NULL_VIRTUAL_TERMINAL_H_ |
1968 | |
1969 | -#include "src/server/graphics/gbm/virtual_terminal.h" |
1970 | +#include "src/platform/graphics/mesa/virtual_terminal.h" |
1971 | |
1972 | namespace mir |
1973 | { |
1974 | @@ -28,7 +28,7 @@ |
1975 | namespace doubles |
1976 | { |
1977 | |
1978 | -class NullVirtualTerminal : public graphics::gbm::VirtualTerminal |
1979 | +class NullVirtualTerminal : public graphics::mesa::VirtualTerminal |
1980 | { |
1981 | public: |
1982 | void set_graphics_mode() {} |
1983 | |
1984 | === modified file 'include/test/mir_test_doubles/stub_buffer.h' |
1985 | --- include/test/mir_test_doubles/stub_buffer.h 2013-10-15 08:53:10 +0000 |
1986 | +++ include/test/mir_test_doubles/stub_buffer.h 2013-12-18 14:40:47 +0000 |
1987 | @@ -40,7 +40,7 @@ |
1988 | public: |
1989 | StubBuffer() |
1990 | : buf_size{0, 0}, |
1991 | - buf_pixel_format{geometry::PixelFormat::abgr_8888} |
1992 | + buf_pixel_format{mir_pixel_format_abgr_8888} |
1993 | { |
1994 | } |
1995 | |
1996 | @@ -54,7 +54,7 @@ |
1997 | |
1998 | virtual geometry::Stride stride() const { return geometry::Stride(); } |
1999 | |
2000 | - virtual geometry::PixelFormat pixel_format() const { return buf_pixel_format; } |
2001 | + virtual MirPixelFormat pixel_format() const { return buf_pixel_format; } |
2002 | |
2003 | virtual std::shared_ptr<graphics::NativeBuffer> native_buffer_handle() const |
2004 | { |
2005 | @@ -69,7 +69,7 @@ |
2006 | virtual bool can_bypass() const override { return false; } |
2007 | |
2008 | geometry::Size const buf_size; |
2009 | - geometry::PixelFormat const buf_pixel_format; |
2010 | + MirPixelFormat const buf_pixel_format; |
2011 | }; |
2012 | } |
2013 | } |
2014 | |
2015 | === modified file 'include/test/mir_test_doubles/stub_buffer_allocator.h' |
2016 | --- include/test/mir_test_doubles/stub_buffer_allocator.h 2013-11-21 03:16:21 +0000 |
2017 | +++ include/test/mir_test_doubles/stub_buffer_allocator.h 2013-12-18 14:40:47 +0000 |
2018 | @@ -43,7 +43,7 @@ |
2019 | return std::make_shared<StubBuffer>(properties); |
2020 | } |
2021 | |
2022 | - std::vector<geometry::PixelFormat> supported_pixel_formats() |
2023 | + std::vector<MirPixelFormat> supported_pixel_formats() |
2024 | { |
2025 | return {}; |
2026 | } |
2027 | |
2028 | === modified file 'include/test/mir_test_doubles/stub_buffer_stream.h' |
2029 | --- include/test/mir_test_doubles/stub_buffer_stream.h 2013-11-21 03:16:21 +0000 |
2030 | +++ include/test/mir_test_doubles/stub_buffer_stream.h 2013-12-18 14:40:47 +0000 |
2031 | @@ -34,30 +34,28 @@ |
2032 | public: |
2033 | StubBufferStream() |
2034 | { |
2035 | - stub_client_buffer = std::make_shared<StubBuffer>(); |
2036 | stub_compositor_buffer = std::make_shared<StubBuffer>(); |
2037 | } |
2038 | - std::shared_ptr<graphics::Buffer> secure_client_buffer() |
2039 | - { |
2040 | - return stub_client_buffer; |
2041 | - } |
2042 | - |
2043 | - std::shared_ptr<graphics::Buffer> lock_compositor_buffer(unsigned long) |
2044 | - { |
2045 | - return stub_compositor_buffer; |
2046 | - } |
2047 | - |
2048 | - std::shared_ptr<graphics::Buffer> lock_snapshot_buffer() |
2049 | - { |
2050 | - return stub_compositor_buffer; |
2051 | - } |
2052 | - |
2053 | - geometry::PixelFormat get_stream_pixel_format() |
2054 | - { |
2055 | - return geometry::PixelFormat(); |
2056 | - } |
2057 | - |
2058 | - geometry::Size stream_size() |
2059 | + void swap_client_buffers(graphics::Buffer*& buffer) override |
2060 | + { |
2061 | + buffer = &stub_client_buffer; |
2062 | + } |
2063 | + std::shared_ptr<graphics::Buffer> lock_compositor_buffer(unsigned long) override |
2064 | + { |
2065 | + return stub_compositor_buffer; |
2066 | + } |
2067 | + |
2068 | + std::shared_ptr<graphics::Buffer> lock_snapshot_buffer() override |
2069 | + { |
2070 | + return stub_compositor_buffer; |
2071 | + } |
2072 | + |
2073 | + MirPixelFormat get_stream_pixel_format() override |
2074 | + { |
2075 | + return MirPixelFormat(); |
2076 | + } |
2077 | + |
2078 | + geometry::Size stream_size() override |
2079 | { |
2080 | return geometry::Size(); |
2081 | } |
2082 | @@ -66,15 +64,15 @@ |
2083 | { |
2084 | } |
2085 | |
2086 | - void force_requests_to_complete() |
2087 | - { |
2088 | - } |
2089 | - |
2090 | - void allow_framedropping(bool) |
2091 | - { |
2092 | - } |
2093 | - |
2094 | - std::shared_ptr<graphics::Buffer> stub_client_buffer; |
2095 | + void force_requests_to_complete() override |
2096 | + { |
2097 | + } |
2098 | + |
2099 | + void allow_framedropping(bool) override |
2100 | + { |
2101 | + } |
2102 | + |
2103 | + StubBuffer stub_client_buffer; |
2104 | std::shared_ptr<graphics::Buffer> stub_compositor_buffer; |
2105 | }; |
2106 | |
2107 | |
2108 | === modified file 'include/test/mir_test_doubles/stub_display_builder.h' |
2109 | --- include/test/mir_test_doubles/stub_display_builder.h 2013-11-19 19:11:49 +0000 |
2110 | +++ include/test/mir_test_doubles/stub_display_builder.h 2013-12-18 14:40:47 +0000 |
2111 | @@ -19,7 +19,7 @@ |
2112 | #ifndef MIR_TEST_DOUBLES_STUB_DISPLAY_BUILDER_H_ |
2113 | #define MIR_TEST_DOUBLES_STUB_DISPLAY_BUILDER_H_ |
2114 | |
2115 | -#include "src/server/graphics/android/display_builder.h" |
2116 | +#include "src/platform/graphics/android/display_builder.h" |
2117 | #include "stub_display_buffer.h" |
2118 | #include "stub_display_device.h" |
2119 | #include <gmock/gmock.h> |
2120 | @@ -52,9 +52,9 @@ |
2121 | { |
2122 | } |
2123 | |
2124 | - geometry::PixelFormat display_format() |
2125 | + MirPixelFormat display_format() |
2126 | { |
2127 | - return geometry::PixelFormat::abgr_8888; |
2128 | + return mir_pixel_format_abgr_8888; |
2129 | } |
2130 | |
2131 | std::unique_ptr<graphics::DisplayBuffer> create_display_buffer( |
2132 | @@ -64,7 +64,7 @@ |
2133 | return std::unique_ptr<graphics::DisplayBuffer>( |
2134 | new StubDisplayBuffer(geometry::Rectangle{{0,0},sz})); |
2135 | } |
2136 | - |
2137 | + |
2138 | std::shared_ptr<graphics::android::DisplayDevice> create_display_device() |
2139 | { |
2140 | return stub_dev; |
2141 | |
2142 | === modified file 'include/test/mir_test_doubles/stub_display_configuration.h' |
2143 | --- include/test/mir_test_doubles/stub_display_configuration.h 2013-11-21 03:16:21 +0000 |
2144 | +++ include/test/mir_test_doubles/stub_display_configuration.h 2013-12-18 14:40:47 +0000 |
2145 | @@ -21,7 +21,7 @@ |
2146 | |
2147 | #include "mir/graphics/display_configuration.h" |
2148 | #include "mir/geometry/rectangle.h" |
2149 | -#include "mir/geometry/pixel_format.h" |
2150 | +#include "mir_toolkit/common.h" |
2151 | |
2152 | #include <vector> |
2153 | |
2154 | @@ -43,15 +43,15 @@ |
2155 | StubDisplayConfig(unsigned int num_displays) |
2156 | : StubDisplayConfig(num_displays, |
2157 | { |
2158 | - geometry::PixelFormat::bgr_888, |
2159 | - geometry::PixelFormat::abgr_8888, |
2160 | - geometry::PixelFormat::xbgr_8888 |
2161 | + mir_pixel_format_bgr_888, |
2162 | + mir_pixel_format_abgr_8888, |
2163 | + mir_pixel_format_xbgr_8888 |
2164 | }) |
2165 | { |
2166 | } |
2167 | |
2168 | StubDisplayConfig(unsigned int num_displays, |
2169 | - std::vector<geometry::PixelFormat> const& pfs) |
2170 | + std::vector<MirPixelFormat> const& pfs) |
2171 | { |
2172 | /* construct a non-trivial dummy display config to send */ |
2173 | int mode_index = 0; |
2174 | @@ -67,7 +67,7 @@ |
2175 | modes.push_back(mode); |
2176 | } |
2177 | |
2178 | - size_t mode_index = modes.size() - 1; |
2179 | + size_t mode_index = modes.size() - 1; |
2180 | geometry::Size physical_size{}; |
2181 | geometry::Point top_left{}; |
2182 | graphics::DisplayConfigurationOutput output{ |
2183 | @@ -105,7 +105,7 @@ |
2184 | graphics::DisplayConfigurationOutputId{id}, |
2185 | graphics::DisplayConfigurationCardId{0}, |
2186 | graphics::DisplayConfigurationOutputType::vga, |
2187 | - std::vector<geometry::PixelFormat>{geometry::PixelFormat::abgr_8888}, |
2188 | + std::vector<MirPixelFormat>{mir_pixel_format_abgr_8888}, |
2189 | {{rect.size, 60.0}}, |
2190 | 0, geometry::Size{}, true, true, rect.top_left, 0, 0, mir_power_mode_on |
2191 | }; |
2192 | |
2193 | === modified file 'include/test/mir_test_doubles/stub_display_device.h' |
2194 | --- include/test/mir_test_doubles/stub_display_device.h 2013-11-21 17:20:14 +0000 |
2195 | +++ include/test/mir_test_doubles/stub_display_device.h 2013-12-18 14:40:47 +0000 |
2196 | @@ -18,8 +18,8 @@ |
2197 | #ifndef MIR_TEST_DOUBLES_STUB_DISPLAY_DEVICE_H_ |
2198 | #define MIR_TEST_DOUBLES_STUB_DISPLAY_DEVICE_H_ |
2199 | |
2200 | -#include "src/server/graphics/android/display_device.h" |
2201 | - |
2202 | +#include "src/platform/graphics/android/display_device.h" |
2203 | + |
2204 | namespace mir |
2205 | { |
2206 | namespace test |
2207 | @@ -41,7 +41,7 @@ |
2208 | void prepare_composition() |
2209 | { |
2210 | } |
2211 | - void gpu_render(EGLDisplay, EGLSurface) |
2212 | + void gpu_render(EGLDisplay, EGLSurface) |
2213 | { |
2214 | } |
2215 | void post(graphics::Buffer const&) |
2216 | |
2217 | === modified file 'include/test/mir_test_doubles/stub_driver_interpreter.h' |
2218 | --- include/test/mir_test_doubles/stub_driver_interpreter.h 2013-10-17 22:15:46 +0000 |
2219 | +++ include/test/mir_test_doubles/stub_driver_interpreter.h 2013-12-18 14:40:47 +0000 |
2220 | @@ -49,7 +49,7 @@ |
2221 | void driver_returns_buffer(ANativeWindowBuffer*, int) |
2222 | { |
2223 | } |
2224 | - void dispatch_driver_request_format(int) |
2225 | + void dispatch_driver_request_format(int) |
2226 | { |
2227 | } |
2228 | int driver_requests_info(int index) const |
2229 | |
2230 | === modified file 'include/test/mir_test_doubles/stub_shell_session.h' |
2231 | --- include/test/mir_test_doubles/stub_shell_session.h 2013-11-21 03:16:21 +0000 |
2232 | +++ include/test/mir_test_doubles/stub_shell_session.h 2013-12-18 14:40:47 +0000 |
2233 | @@ -66,7 +66,7 @@ |
2234 | void take_snapshot(shell::SnapshotCallback const&) override |
2235 | { |
2236 | } |
2237 | - |
2238 | + |
2239 | std::shared_ptr<shell::Surface> default_surface() const override |
2240 | { |
2241 | return std::shared_ptr<shell::Surface>(); |
2242 | |
2243 | === removed file 'include/test/mir_test_doubles/stub_surface.h' |
2244 | --- include/test/mir_test_doubles/stub_surface.h 2013-11-21 03:16:21 +0000 |
2245 | +++ include/test/mir_test_doubles/stub_surface.h 1970-01-01 00:00:00 +0000 |
2246 | @@ -1,74 +0,0 @@ |
2247 | -/* |
2248 | - * Copyright © 2013 Canonical Ltd. |
2249 | - * |
2250 | - * This program is free software: you can redistribute it and/or modify it |
2251 | - * under the terms of the GNU General Public License version 3, |
2252 | - * as published by the Free Software Foundation. |
2253 | - * |
2254 | - * This program is distributed in the hope that it will be useful, |
2255 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
2256 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2257 | - * GNU General Public License for more details. |
2258 | - * |
2259 | - * You should have received a copy of the GNU General Public License |
2260 | - * along with this program. If not, see <http://www.gnu.org/licenses/>. |
2261 | - * |
2262 | - * Authored by: Robert Carr <robert.carr@canonical.com> |
2263 | - */ |
2264 | - |
2265 | -#ifndef MIR_TEST_DOUBLES_STUB_SURFACE_H_ |
2266 | -#define MIR_TEST_DOUBLES_STUB_SURFACE_H_ |
2267 | - |
2268 | -#include "mir/frontend/surface.h" |
2269 | - |
2270 | -namespace mir |
2271 | -{ |
2272 | -namespace test |
2273 | -{ |
2274 | -namespace doubles |
2275 | -{ |
2276 | - |
2277 | -class StubSurface : public frontend::Surface |
2278 | -{ |
2279 | -public: |
2280 | - virtual ~StubSurface() = default; |
2281 | - |
2282 | - void hide() {} |
2283 | - void show() {} |
2284 | - void force_requests_to_complete() {} |
2285 | - |
2286 | - geometry::Size size() const |
2287 | - { |
2288 | - return geometry::Size(); |
2289 | - } |
2290 | - geometry::PixelFormat pixel_format() const |
2291 | - { |
2292 | - return geometry::PixelFormat(); |
2293 | - } |
2294 | - |
2295 | - std::shared_ptr<graphics::Buffer> advance_client_buffer() |
2296 | - { |
2297 | - return std::shared_ptr<graphics::Buffer>(); |
2298 | - } |
2299 | - |
2300 | - virtual int configure(MirSurfaceAttrib, int) |
2301 | - { |
2302 | - return 0; |
2303 | - } |
2304 | - |
2305 | - virtual bool supports_input() const |
2306 | - { |
2307 | - return false; |
2308 | - } |
2309 | - |
2310 | - virtual int client_input_fd() const |
2311 | - { |
2312 | - return 0; |
2313 | - } |
2314 | -}; |
2315 | - |
2316 | -} |
2317 | -} |
2318 | -} // namespace mir |
2319 | - |
2320 | -#endif // MIR_TEST_DOUBLES_STUB_SURFACE_H_ |
2321 | |
2322 | === modified file 'include/test/mir_test_doubles/stub_surface_builder.h' |
2323 | --- include/test/mir_test_doubles/stub_surface_builder.h 2013-11-21 12:34:49 +0000 |
2324 | +++ include/test/mir_test_doubles/stub_surface_builder.h 2013-12-18 14:40:47 +0000 |
2325 | @@ -21,13 +21,13 @@ |
2326 | #define MIR_TEST_DOUBLES_STUB_SURFACE_BUILDER_H_ |
2327 | |
2328 | #include "src/server/scene/surface_builder.h" |
2329 | -#include "src/server/scene/surface.h" |
2330 | +#include "src/server/scene/basic_surface.h" |
2331 | +#include "src/server/scene/surface_data.h" |
2332 | #include "mir/scene/scene_report.h" |
2333 | #include "mir/shell/surface_creation_parameters.h" |
2334 | |
2335 | #include "mir_test_doubles/stub_buffer_stream.h" |
2336 | -#include "mir_test_doubles/mock_surface_state.h" |
2337 | - |
2338 | +#include <memory> |
2339 | namespace mir |
2340 | { |
2341 | namespace test |
2342 | @@ -39,30 +39,26 @@ |
2343 | { |
2344 | public: |
2345 | StubSurfaceBuilder() : |
2346 | - buffer_stream(std::make_shared<StubBufferStream>()), |
2347 | - dummy_surface() |
2348 | - { |
2349 | - } |
2350 | - |
2351 | - std::weak_ptr<scene::BasicSurface> create_surface(shell::Session*, shell::SurfaceCreationParameters const&) |
2352 | - { |
2353 | - auto state = std::make_shared<MockSurfaceState>(); |
2354 | - dummy_surface = std::make_shared<scene::Surface>( |
2355 | - state, buffer_stream, |
2356 | + dummy_surface(std::make_shared<scene::BasicSurface>( |
2357 | + std::make_shared<scene::SurfaceData>( |
2358 | + std::string("stub"), geometry::Rectangle{{},{}}, [](){}, false), |
2359 | + std::make_shared<StubBufferStream>(), |
2360 | std::shared_ptr<input::InputChannel>(), |
2361 | - report); |
2362 | + std::make_shared<scene::NullSceneReport>())) |
2363 | + { |
2364 | + } |
2365 | |
2366 | + std::weak_ptr<scene::BasicSurface> create_surface(shell::SurfaceCreationParameters const&) |
2367 | + { |
2368 | return dummy_surface; |
2369 | } |
2370 | |
2371 | void destroy_surface(std::weak_ptr<scene::BasicSurface> const& ) |
2372 | { |
2373 | } |
2374 | + |
2375 | private: |
2376 | - std::shared_ptr<compositor::BufferStream> const buffer_stream; |
2377 | - std::shared_ptr<scene::BasicSurface> dummy_surface; |
2378 | - std::shared_ptr<scene::SceneReport> report = std::make_shared<scene::NullSceneReport>(); |
2379 | - |
2380 | + std::shared_ptr<scene::BasicSurface> dummy_surface; |
2381 | }; |
2382 | } |
2383 | } |
2384 | |
2385 | === renamed file 'include/test/mir_test_doubles/stub_surface_controller.h' => 'include/test/mir_test_doubles/stub_surface_ranker.h' |
2386 | --- include/test/mir_test_doubles/stub_surface_controller.h 2013-11-21 12:34:49 +0000 |
2387 | +++ include/test/mir_test_doubles/stub_surface_ranker.h 2013-12-18 14:40:47 +0000 |
2388 | @@ -17,10 +17,10 @@ |
2389 | */ |
2390 | |
2391 | |
2392 | -#ifndef MIR_TEST_DOUBLES_STUB_SURFACE_CONTROLLER_H_ |
2393 | -#define MIR_TEST_DOUBLES_STUB_SURFACE_CONTROLLER_H_ |
2394 | +#ifndef MIR_TEST_DOUBLES_STUB_SURFACE_RANKER_H_ |
2395 | +#define MIR_TEST_DOUBLES_STUB_SURFACE_RANKER_H_ |
2396 | |
2397 | -#include "mir/shell/surface_controller.h" |
2398 | +#include "src/server/scene/surface_ranker.h" |
2399 | |
2400 | namespace mir |
2401 | { |
2402 | @@ -29,7 +29,7 @@ |
2403 | namespace doubles |
2404 | { |
2405 | |
2406 | -struct StubSurfaceController : public shell::SurfaceController |
2407 | +struct StubSurfaceRanker : public scene::SurfaceRanker |
2408 | { |
2409 | void raise(std::weak_ptr<scene::BasicSurface> const&) override |
2410 | { |
2411 | @@ -41,4 +41,4 @@ |
2412 | } |
2413 | |
2414 | |
2415 | -#endif /* MIR_TEST_DOUBLES_STUB_SURFACE_CONTROLLER_H_ */ |
2416 | +#endif /* MIR_TEST_DOUBLES_STUB_SURFACE_RANKER_H_ */ |
2417 | |
2418 | === modified file 'include/test/mir_test_framework/cross_process_sync.h' |
2419 | --- include/test/mir_test_framework/cross_process_sync.h 2013-09-20 22:16:11 +0000 |
2420 | +++ include/test/mir_test_framework/cross_process_sync.h 2013-12-18 14:40:47 +0000 |
2421 | @@ -45,7 +45,7 @@ |
2422 | // Throws std::runtime_error if not successful. |
2423 | unsigned int wait_for_signal_ready_for(const std::chrono::milliseconds& duration); |
2424 | unsigned int wait_for_signal_ready_for(); |
2425 | - |
2426 | + |
2427 | void signal_ready(); |
2428 | unsigned int wait_for_signal_ready(); |
2429 | |
2430 | |
2431 | === modified file 'include/test/mir_test_framework/display_server_test_fixture.h' |
2432 | --- include/test/mir_test_framework/display_server_test_fixture.h 2013-09-26 15:07:59 +0000 |
2433 | +++ include/test/mir_test_framework/display_server_test_fixture.h 2013-12-18 14:40:47 +0000 |
2434 | @@ -64,6 +64,7 @@ |
2435 | void launch_client_process(TestingClientConfiguration& config); |
2436 | |
2437 | bool shutdown_server_process(); |
2438 | + Result wait_for_shutdown_server_process(); |
2439 | void kill_client_processes(); |
2440 | void terminate_client_processes(); |
2441 | |
2442 | |
2443 | === added file 'include/test/mir_test_framework/input_testing_client_configuration.h' |
2444 | --- include/test/mir_test_framework/input_testing_client_configuration.h 1970-01-01 00:00:00 +0000 |
2445 | +++ include/test/mir_test_framework/input_testing_client_configuration.h 2013-12-18 14:40:47 +0000 |
2446 | @@ -0,0 +1,67 @@ |
2447 | +/* |
2448 | + * Copyright © 2013 Canonical Ltd. |
2449 | + * |
2450 | + * This program is free software: you can redistribute it and/or modify it |
2451 | + * under the terms of the GNU General Public License version 3, |
2452 | + * as published by the Free Software Foundation. |
2453 | + * |
2454 | + * This program is distributed in the hope that it will be useful, |
2455 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
2456 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2457 | + * GNU General Public License for more details. |
2458 | + * |
2459 | + * You should have received a copy of the GNU General Public License |
2460 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
2461 | + * |
2462 | + * Authored by: Robert Carr <robert.carr@canonical.com>n |
2463 | + */ |
2464 | + |
2465 | +#ifndef MIR_TEST_FRAMEWORK_INPUT_TESTING_CLIENT_CONFIGURATION |
2466 | +#define MIR_TEST_FRAMEWORK_INPUT_TESTING_CLIENT_CONFIGURATION |
2467 | + |
2468 | +#include "mir_test_framework/testing_client_configuration.h" |
2469 | +#include "mir_test_framework/cross_process_sync.h" |
2470 | +#include "mir_test/wait_condition.h" |
2471 | + |
2472 | +#include <mir_toolkit/event.h> |
2473 | + |
2474 | +#include <gmock/gmock.h> |
2475 | + |
2476 | +#include <string> |
2477 | + |
2478 | +namespace mir_test_framework |
2479 | +{ |
2480 | + |
2481 | +/// A fixture to be used with InputTestingServerConfiguration for input acceptance testing scenarios. |
2482 | +/// By default, the client will connect and a surface will be created. |
2483 | +/// The framework ensures the server will not send events before client is ready through CrossProcessSync. |
2484 | +class InputTestingClientConfiguration : public TestingClientConfiguration |
2485 | +{ |
2486 | +public: |
2487 | + InputTestingClientConfiguration(std::string const& client_name, CrossProcessSync const& input_cb_setup_fence); |
2488 | + virtual ~InputTestingClientConfiguration() = default; |
2489 | + |
2490 | + void exec(); |
2491 | + |
2492 | + struct MockInputHandler |
2493 | + { |
2494 | + MOCK_METHOD1(handle_input, void(MirEvent const*)); |
2495 | + }; |
2496 | + // This function will be called at an appropriate time for input expectations to be set. |
2497 | + // on handler. It is expected that mt::WakeUp(all_events_received) will be triggered by |
2498 | + // the last expectation, as this is what triggers the verification of the Mock and |
2499 | + // termination of the testing client. |
2500 | + virtual void expect_input(MockInputHandler &handler, mir::test::WaitCondition& all_events_received) = 0; |
2501 | + |
2502 | + // This fixture is intended to be used with InputTestingServer |
2503 | + // which allows for setting surface sizes as part of the |
2504 | + // input-testing shell. |
2505 | + static int const surface_width = 100; |
2506 | + static int const surface_height = 100; |
2507 | +private: |
2508 | + std::string const client_name; |
2509 | + CrossProcessSync input_cb_setup_fence; |
2510 | +}; |
2511 | + |
2512 | +} |
2513 | +#endif /* MIR_TEST_FRAMEWORK_INPUT_TESTING_CLIENT_CONFIGURATION */ |
2514 | |
2515 | === modified file 'include/test/mir_test_framework/input_testing_server_configuration.h' |
2516 | --- include/test/mir_test_framework/input_testing_server_configuration.h 2013-11-21 03:16:21 +0000 |
2517 | +++ include/test/mir_test_framework/input_testing_server_configuration.h 2013-12-18 14:40:47 +0000 |
2518 | @@ -59,7 +59,7 @@ |
2519 | |
2520 | void exec(); |
2521 | void on_exit(); |
2522 | - |
2523 | + |
2524 | std::shared_ptr<mir::input::InputConfiguration> the_input_configuration() override; |
2525 | |
2526 | mir::input::android::FakeEventHub* fake_event_hub; |
2527 | @@ -71,7 +71,7 @@ |
2528 | |
2529 | private: |
2530 | std::thread input_injection_thread; |
2531 | - |
2532 | + |
2533 | std::shared_ptr<mir::test::doubles::FakeEventHubInputConfiguration> input_configuration; |
2534 | }; |
2535 | |
2536 | |
2537 | === modified file 'include/test/mir_test_framework/testing_client_configuration.h' |
2538 | --- include/test/mir_test_framework/testing_client_configuration.h 2013-09-25 18:25:11 +0000 |
2539 | +++ include/test/mir_test_framework/testing_client_configuration.h 2013-12-18 14:40:47 +0000 |
2540 | @@ -36,7 +36,7 @@ |
2541 | virtual bool use_real_graphics(mir::options::Option const& options) |
2542 | { |
2543 | return options.get("tests-use-real-graphics", false); |
2544 | - } |
2545 | + } |
2546 | }; |
2547 | |
2548 | } |
2549 | |
2550 | === modified file 'include/test/mir_test_framework/testing_process_manager.h' |
2551 | --- include/test/mir_test_framework/testing_process_manager.h 2013-09-25 18:25:11 +0000 |
2552 | +++ include/test/mir_test_framework/testing_process_manager.h 2013-12-18 14:40:47 +0000 |
2553 | @@ -58,6 +58,7 @@ |
2554 | void tear_down_server(); |
2555 | void tear_down_all(); |
2556 | Result shutdown_server_process(); |
2557 | + Result wait_for_shutdown_server_process(); |
2558 | void kill_client_processes(); |
2559 | void terminate_client_processes(); |
2560 | void run_in_test_process(std::function<void()> const& run_code); |
2561 | |
2562 | === modified file 'include/test/mir_test_framework/testing_server_configuration.h' |
2563 | --- include/test/mir_test_framework/testing_server_configuration.h 2013-09-24 10:25:41 +0000 |
2564 | +++ include/test/mir_test_framework/testing_server_configuration.h 2013-12-18 14:40:47 +0000 |
2565 | @@ -21,6 +21,7 @@ |
2566 | #define MIR_TEST_TESTING_SERVER_CONFIGURATION_H_ |
2567 | |
2568 | #include "mir/default_server_configuration.h" |
2569 | +#include "mir_test_framework/cross_process_sync.h" |
2570 | |
2571 | namespace mir |
2572 | { |
2573 | @@ -39,6 +40,9 @@ |
2574 | // Code to run in server process |
2575 | virtual void exec(); |
2576 | |
2577 | + // Code to run in server process after server starts |
2578 | + virtual void on_start(); |
2579 | + |
2580 | // Code to run in server process after server exits |
2581 | virtual void on_exit(); |
2582 | |
2583 | @@ -50,12 +54,17 @@ |
2584 | // which do not leverage input. |
2585 | std::shared_ptr<input::InputConfiguration> the_input_configuration(); |
2586 | |
2587 | + std::shared_ptr<mir::ServerStatusListener> the_server_status_listener() override; |
2588 | + |
2589 | virtual std::string the_socket_file() const; |
2590 | using DefaultServerConfiguration::the_options; |
2591 | |
2592 | + virtual void wait_for_server_start(); |
2593 | |
2594 | private: |
2595 | std::shared_ptr<graphics::Platform> graphics_platform; |
2596 | + CrossProcessSync server_started_sync; |
2597 | + bool using_server_started_sync; |
2598 | }; |
2599 | |
2600 | std::string const& test_socket_file(); |
2601 | |
2602 | === modified file 'native-compile.sh' |
2603 | --- native-compile.sh 2012-11-19 19:21:52 +0000 |
2604 | +++ native-compile.sh 2013-12-18 14:40:47 +0000 |
2605 | @@ -12,6 +12,6 @@ |
2606 | cmake --build ${BUILD_DIR} |
2607 | |
2608 | GTEST_OUTPUT=xml:./ |
2609 | -${BUILD_DIR}/bin/acceptance-tests |
2610 | -${BUILD_DIR}/bin/integration-tests |
2611 | -${BUILD_DIR}/bin/unit-tests |
2612 | +${BUILD_DIR}/bin/mir_acceptance_tests |
2613 | +${BUILD_DIR}/bin/mir_integration_tests |
2614 | +${BUILD_DIR}/bin/mir_unit_tests |
2615 | |
2616 | === modified file 'src/client/CMakeLists.txt' |
2617 | --- src/client/CMakeLists.txt 2013-11-21 03:16:21 +0000 |
2618 | +++ src/client/CMakeLists.txt 2013-12-18 14:40:47 +0000 |
2619 | @@ -50,15 +50,15 @@ |
2620 | ) |
2621 | endif() |
2622 | |
2623 | -if( MIR_PLATFORM STREQUAL "gbm") |
2624 | +if( MIR_PLATFORM STREQUAL "mesa") |
2625 | set( |
2626 | CLIENT_SOURCES |
2627 | |
2628 | - gbm/gbm_client_platform.cpp |
2629 | - gbm/gbm_client_buffer_factory.cpp |
2630 | - gbm/gbm_client_buffer.cpp |
2631 | - gbm/mesa_native_display_container.cpp |
2632 | - gbm/gbm_native_surface.cpp |
2633 | + mesa/client_platform.cpp |
2634 | + mesa/client_buffer_factory.cpp |
2635 | + mesa/client_buffer.cpp |
2636 | + mesa/mesa_native_display_container.cpp |
2637 | + mesa/native_surface.cpp |
2638 | ${CLIENT_SOURCES} |
2639 | ) |
2640 | endif() |
2641 | @@ -92,6 +92,7 @@ |
2642 | mirprotobuf |
2643 | mirsharedinput |
2644 | mirsharedlogging |
2645 | + mirsharedenv |
2646 | mirclientrpc |
2647 | mirclientlttngstatic |
2648 | |
2649 | |
2650 | === modified file 'src/client/aging_buffer.h' |
2651 | --- src/client/aging_buffer.h 2013-06-14 09:00:20 +0000 |
2652 | +++ src/client/aging_buffer.h 2013-12-18 14:40:47 +0000 |
2653 | @@ -30,7 +30,6 @@ |
2654 | { |
2655 | public: |
2656 | AgingBuffer(); |
2657 | - ~AgingBuffer() noexcept {} |
2658 | |
2659 | virtual uint32_t age() const; |
2660 | virtual void increment_age(); |
2661 | |
2662 | === modified file 'src/client/android/android_client_buffer.cpp' |
2663 | --- src/client/android/android_client_buffer.cpp 2013-11-21 03:16:21 +0000 |
2664 | +++ src/client/android/android_client_buffer.cpp 2013-12-18 14:40:47 +0000 |
2665 | @@ -29,7 +29,7 @@ |
2666 | |
2667 | mcla::AndroidClientBuffer::AndroidClientBuffer(std::shared_ptr<AndroidRegistrar> const& registrar, |
2668 | std::shared_ptr<const native_handle_t> const& handle, |
2669 | - geom::Size size, geom::PixelFormat pf, geometry::Stride stride) |
2670 | + geom::Size size, MirPixelFormat pf, geometry::Stride stride) |
2671 | : buffer_registrar(registrar), |
2672 | native_handle(handle), |
2673 | buffer_pf(pf), buffer_stride{stride}, buffer_size(size) |
2674 | @@ -48,7 +48,7 @@ |
2675 | //note: mir uses stride in bytes, ANativeWindowBuffer needs it in pixel units. some drivers care |
2676 | //about byte-stride, they will pass stride via ANativeWindowBuffer::handle (which is opaque to us) |
2677 | anwb->stride = stride.as_uint32_t() / |
2678 | - geom::bytes_per_pixel(buffer_pf); |
2679 | + MIR_BYTES_PER_PIXEL(buffer_pf); |
2680 | anwb->usage = GRALLOC_USAGE_HW_TEXTURE | GRALLOC_USAGE_HW_RENDER; |
2681 | anwb->handle = native_handle.get(); |
2682 | |
2683 | @@ -82,7 +82,7 @@ |
2684 | return buffer_stride; |
2685 | } |
2686 | |
2687 | -geom::PixelFormat mcla::AndroidClientBuffer::pixel_format() const |
2688 | +MirPixelFormat mcla::AndroidClientBuffer::pixel_format() const |
2689 | { |
2690 | return buffer_pf; |
2691 | } |
2692 | |
2693 | === modified file 'src/client/android/android_client_buffer.h' |
2694 | --- src/client/android/android_client_buffer.h 2013-11-21 03:16:21 +0000 |
2695 | +++ src/client/android/android_client_buffer.h 2013-12-18 14:40:47 +0000 |
2696 | @@ -39,13 +39,13 @@ |
2697 | public: |
2698 | AndroidClientBuffer(std::shared_ptr<AndroidRegistrar> const&, |
2699 | std::shared_ptr<const native_handle_t> const&, |
2700 | - geometry::Size size, geometry::PixelFormat pf, geometry::Stride stride); |
2701 | + geometry::Size size, MirPixelFormat pf, geometry::Stride stride); |
2702 | ~AndroidClientBuffer() noexcept; |
2703 | |
2704 | std::shared_ptr<MemoryRegion> secure_for_cpu_write(); |
2705 | geometry::Size size() const; |
2706 | geometry::Stride stride() const; |
2707 | - geometry::PixelFormat pixel_format() const; |
2708 | + MirPixelFormat pixel_format() const; |
2709 | std::shared_ptr<mir::graphics::NativeBuffer> native_buffer_handle() const; |
2710 | |
2711 | AndroidClientBuffer(const AndroidClientBuffer&) = delete; |
2712 | @@ -56,7 +56,7 @@ |
2713 | std::shared_ptr<AndroidRegistrar> buffer_registrar; |
2714 | std::shared_ptr<graphics::android::AndroidNativeBuffer> native_window_buffer; |
2715 | std::shared_ptr<const native_handle_t> native_handle; |
2716 | - const geometry::PixelFormat buffer_pf; |
2717 | + const MirPixelFormat buffer_pf; |
2718 | geometry::Stride const buffer_stride; |
2719 | geometry::Size const buffer_size; |
2720 | }; |
2721 | |
2722 | === modified file 'src/client/android/android_client_buffer_factory.cpp' |
2723 | --- src/client/android/android_client_buffer_factory.cpp 2013-11-21 03:16:21 +0000 |
2724 | +++ src/client/android/android_client_buffer_factory.cpp 2013-12-18 14:40:47 +0000 |
2725 | @@ -29,7 +29,7 @@ |
2726 | { |
2727 | } |
2728 | |
2729 | -std::shared_ptr<mcl::ClientBuffer> mcla::AndroidClientBufferFactory::create_buffer(std::shared_ptr<MirBufferPackage> const& package, geom::Size size, geom::PixelFormat pf) |
2730 | +std::shared_ptr<mcl::ClientBuffer> mcla::AndroidClientBufferFactory::create_buffer(std::shared_ptr<MirBufferPackage> const& package, geom::Size size, MirPixelFormat pf) |
2731 | { |
2732 | (void)size; // TODO: remove this unused parameter |
2733 | auto handle = registrar->register_buffer(package); |
2734 | |
2735 | === modified file 'src/client/android/android_client_buffer_factory.h' |
2736 | --- src/client/android/android_client_buffer_factory.h 2013-04-24 05:22:20 +0000 |
2737 | +++ src/client/android/android_client_buffer_factory.h 2013-12-18 14:40:47 +0000 |
2738 | @@ -23,7 +23,7 @@ |
2739 | #include <memory> |
2740 | |
2741 | #include "mir_toolkit/mir_client_library.h" |
2742 | -#include "mir/geometry/pixel_format.h" |
2743 | +#include "mir_toolkit/common.h" |
2744 | #include "mir/geometry/size.h" |
2745 | |
2746 | #include "../client_buffer_factory.h" |
2747 | @@ -44,7 +44,7 @@ |
2748 | explicit AndroidClientBufferFactory(std::shared_ptr<AndroidRegistrar> const&); |
2749 | |
2750 | virtual std::shared_ptr<ClientBuffer> create_buffer(std::shared_ptr<MirBufferPackage> const& package, |
2751 | - geometry::Size size, geometry::PixelFormat pf); |
2752 | + geometry::Size size, MirPixelFormat pf); |
2753 | private: |
2754 | std::shared_ptr<AndroidRegistrar> registrar; |
2755 | }; |
2756 | |
2757 | === modified file 'src/client/android/android_client_platform.cpp' |
2758 | --- src/client/android/android_client_platform.cpp 2013-10-15 08:53:10 +0000 |
2759 | +++ src/client/android/android_client_platform.cpp 2013-12-18 14:40:47 +0000 |
2760 | @@ -105,9 +105,9 @@ |
2761 | |
2762 | MirPlatformType mcla::AndroidClientPlatform::platform_type() const |
2763 | { |
2764 | - return mir_platform_type_android; |
2765 | + return mir_platform_type_android; |
2766 | } |
2767 | - |
2768 | + |
2769 | MirNativeBuffer* mcla::AndroidClientPlatform::convert_native_buffer(graphics::NativeBuffer* buf) const |
2770 | { |
2771 | return buf->anwb(); |
2772 | |
2773 | === modified file 'src/client/android/android_client_platform.h' |
2774 | --- src/client/android/android_client_platform.h 2013-10-15 08:53:10 +0000 |
2775 | +++ src/client/android/android_client_platform.h 2013-12-18 14:40:47 +0000 |
2776 | @@ -32,7 +32,7 @@ |
2777 | class AndroidClientPlatform : public ClientPlatform |
2778 | { |
2779 | public: |
2780 | - MirPlatformType platform_type() const; |
2781 | + MirPlatformType platform_type() const; |
2782 | std::shared_ptr<ClientBufferFactory> create_buffer_factory(); |
2783 | std::shared_ptr<EGLNativeWindowType> create_egl_native_window(ClientSurface *surface); |
2784 | std::shared_ptr<EGLNativeDisplayType> create_egl_native_display(); |
2785 | |
2786 | === modified file 'src/client/android/android_registrar.cpp' |
2787 | --- src/client/android/android_registrar.cpp 2013-08-28 03:41:48 +0000 |
2788 | +++ src/client/android/android_registrar.cpp 2013-12-18 14:40:47 +0000 |
2789 | @@ -75,7 +75,7 @@ |
2790 | std::shared_ptr<MirBufferPackage> const& package) const |
2791 | { |
2792 | int native_handle_header_size = sizeof(native_handle_t); |
2793 | - int total_size = sizeof(int) * |
2794 | + int total_size = sizeof(int) * |
2795 | (package->fd_items + package->data_items + native_handle_header_size); |
2796 | native_handle_t* handle = static_cast<native_handle_t*>(::operator new(total_size)); |
2797 | handle->version = native_handle_header_size; |
2798 | |
2799 | === modified file 'src/client/android/android_registrar_gralloc.h' |
2800 | --- src/client/android/android_registrar_gralloc.h 2013-06-21 23:24:37 +0000 |
2801 | +++ src/client/android/android_registrar_gralloc.h 2013-12-18 14:40:47 +0000 |
2802 | @@ -20,7 +20,7 @@ |
2803 | #ifndef MIR_CLIENT_ANDROID_ANDROID_REGISTRAR_GRALLOC_H_ |
2804 | #define MIR_CLIENT_ANDROID_ANDROID_REGISTRAR_GRALLOC_H_ |
2805 | |
2806 | -#include "mir/geometry/pixel_format.h" |
2807 | +#include "mir_toolkit/common.h" |
2808 | #include "android_registrar.h" |
2809 | #include <hardware/gralloc.h> |
2810 | |
2811 | |
2812 | === modified file 'src/client/android/client_surface_interpreter.cpp' |
2813 | --- src/client/android/client_surface_interpreter.cpp 2013-11-21 03:16:21 +0000 |
2814 | +++ src/client/android/client_surface_interpreter.cpp 2013-12-18 14:40:47 +0000 |
2815 | @@ -29,7 +29,7 @@ |
2816 | : surface(surface), |
2817 | driver_pixel_format(-1), |
2818 | sync_ops(std::make_shared<mga::RealSyncFileOps>()) |
2819 | - |
2820 | + |
2821 | { |
2822 | } |
2823 | |
2824 | |
2825 | === modified file 'src/client/android/client_surface_interpreter.h' |
2826 | --- src/client/android/client_surface_interpreter.h 2013-10-15 08:53:10 +0000 |
2827 | +++ src/client/android/client_surface_interpreter.h 2013-12-18 14:40:47 +0000 |
2828 | @@ -30,7 +30,7 @@ |
2829 | { |
2830 | class SyncFileOps; |
2831 | } |
2832 | -} |
2833 | +} |
2834 | namespace client |
2835 | { |
2836 | namespace android |
2837 | |
2838 | === modified file 'src/client/client_buffer.h' |
2839 | --- src/client/client_buffer.h 2013-10-15 08:53:10 +0000 |
2840 | +++ src/client/client_buffer.h 2013-12-18 14:40:47 +0000 |
2841 | @@ -22,7 +22,6 @@ |
2842 | |
2843 | #include "mir/graphics/native_buffer.h" |
2844 | #include "mir_toolkit/common.h" |
2845 | -#include "mir/geometry/pixel_format.h" |
2846 | #include "mir/geometry/size.h" |
2847 | |
2848 | #include <memory> |
2849 | @@ -46,7 +45,7 @@ |
2850 | geometry::Width width; |
2851 | geometry::Height height; |
2852 | geometry::Stride stride; |
2853 | - geometry::PixelFormat format; |
2854 | + MirPixelFormat format; |
2855 | std::shared_ptr<char> vaddr; |
2856 | }; |
2857 | |
2858 | @@ -54,14 +53,20 @@ |
2859 | { |
2860 | public: |
2861 | virtual ~ClientBuffer() = default; |
2862 | + |
2863 | virtual std::shared_ptr<MemoryRegion> secure_for_cpu_write() = 0; |
2864 | virtual geometry::Size size() const = 0; |
2865 | virtual geometry::Stride stride() const = 0; |
2866 | - virtual geometry::PixelFormat pixel_format() const = 0; |
2867 | + virtual MirPixelFormat pixel_format() const = 0; |
2868 | virtual uint32_t age() const = 0; |
2869 | virtual void increment_age() = 0; |
2870 | virtual void mark_as_submitted() = 0; |
2871 | virtual std::shared_ptr<graphics::NativeBuffer> native_buffer_handle() const = 0; |
2872 | + |
2873 | +protected: |
2874 | + ClientBuffer() = default; |
2875 | + ClientBuffer(ClientBuffer const&) = delete; |
2876 | + ClientBuffer& operator=(ClientBuffer const&) = delete; |
2877 | }; |
2878 | |
2879 | } |
2880 | |
2881 | === modified file 'src/client/client_buffer_depository.cpp' |
2882 | --- src/client/client_buffer_depository.cpp 2013-08-28 03:41:48 +0000 |
2883 | +++ src/client/client_buffer_depository.cpp 2013-12-18 14:40:47 +0000 |
2884 | @@ -33,7 +33,7 @@ |
2885 | { |
2886 | } |
2887 | |
2888 | -void mcl::ClientBufferDepository::deposit_package(std::shared_ptr<MirBufferPackage> const& package, int id, geometry::Size size, geometry::PixelFormat pf) |
2889 | +void mcl::ClientBufferDepository::deposit_package(std::shared_ptr<MirBufferPackage> const& package, int id, geometry::Size size, MirPixelFormat pf) |
2890 | { |
2891 | auto existing_buffer_id_pair = buffers.end(); |
2892 | for (auto pair = buffers.begin(); pair != buffers.end(); ++pair) |
2893 | |
2894 | === modified file 'src/client/client_buffer_depository.h' |
2895 | --- src/client/client_buffer_depository.h 2013-08-28 03:41:48 +0000 |
2896 | +++ src/client/client_buffer_depository.h 2013-12-18 14:40:47 +0000 |
2897 | @@ -23,7 +23,7 @@ |
2898 | #include <list> |
2899 | #include <memory> |
2900 | |
2901 | -#include "mir/geometry/pixel_format.h" |
2902 | +#include "mir_toolkit/common.h" |
2903 | #include "mir/geometry/size.h" |
2904 | |
2905 | namespace mir |
2906 | @@ -59,7 +59,7 @@ |
2907 | /// This also marks the previous current buffer (if any) as being submitted to the server. |
2908 | /// \post current_buffer() will return a ClientBuffer constructed from this IPC data. |
2909 | void deposit_package(std::shared_ptr<MirBufferPackage> const&, int id, |
2910 | - geometry::Size, geometry::PixelFormat); |
2911 | + geometry::Size, MirPixelFormat); |
2912 | std::shared_ptr<ClientBuffer> current_buffer(); |
2913 | uint32_t current_buffer_id() const; |
2914 | |
2915 | |
2916 | === modified file 'src/client/client_buffer_factory.h' |
2917 | --- src/client/client_buffer_factory.h 2013-06-17 09:51:42 +0000 |
2918 | +++ src/client/client_buffer_factory.h 2013-12-18 14:40:47 +0000 |
2919 | @@ -23,7 +23,7 @@ |
2920 | #include <memory> |
2921 | |
2922 | #include "mir_toolkit/mir_client_library.h" |
2923 | -#include "mir/geometry/pixel_format.h" |
2924 | +#include "mir_toolkit/common.h" |
2925 | #include "mir/geometry/size.h" |
2926 | |
2927 | namespace mir |
2928 | @@ -46,7 +46,7 @@ |
2929 | * \param [in] pf the buffer's pixel format |
2930 | */ |
2931 | virtual std::shared_ptr<ClientBuffer> create_buffer(std::shared_ptr<MirBufferPackage> const& package, |
2932 | - geometry::Size size, geometry::PixelFormat pf) = 0; |
2933 | + geometry::Size size, MirPixelFormat pf) = 0; |
2934 | |
2935 | protected: |
2936 | ClientBufferFactory() = default; |
2937 | |
2938 | === modified file 'src/client/client_platform.h' |
2939 | --- src/client/client_platform.h 2013-10-15 08:53:10 +0000 |
2940 | +++ src/client/client_platform.h 2013-12-18 14:40:47 +0000 |
2941 | @@ -46,7 +46,7 @@ |
2942 | |
2943 | virtual ~ClientPlatform() { /* TODO: make nothrow */ } |
2944 | |
2945 | - virtual MirPlatformType platform_type() const = 0; |
2946 | + virtual MirPlatformType platform_type() const = 0; |
2947 | virtual std::shared_ptr<ClientBufferFactory> create_buffer_factory() = 0; |
2948 | virtual std::shared_ptr<EGLNativeWindowType> create_egl_native_window(ClientSurface *surface) = 0; |
2949 | virtual std::shared_ptr<EGLNativeDisplayType> create_egl_native_display() = 0; |
2950 | |
2951 | === modified file 'src/client/default_connection_configuration.cpp' |
2952 | --- src/client/default_connection_configuration.cpp 2013-11-21 03:16:21 +0000 |
2953 | +++ src/client/default_connection_configuration.cpp 2013-12-18 14:40:47 +0000 |
2954 | @@ -128,7 +128,7 @@ |
2955 | { |
2956 | auto val_raw = getenv("MIR_CLIENT_INPUT_RECEIVER_REPORT"); |
2957 | std::string const val{val_raw ? val_raw : off_opt_val}; |
2958 | - |
2959 | + |
2960 | if (val == log_opt_val) |
2961 | return std::make_shared<mcl::logging::InputReceiverReport>(the_logger()); |
2962 | else |
2963 | |
2964 | === modified file 'src/client/display_configuration.cpp' |
2965 | --- src/client/display_configuration.cpp 2013-10-15 08:53:10 +0000 |
2966 | +++ src/client/display_configuration.cpp 2013-12-18 14:40:47 +0000 |
2967 | @@ -48,8 +48,8 @@ |
2968 | { |
2969 | num_modes = num_modes_; |
2970 | modes = new MirDisplayMode[num_modes]; |
2971 | - |
2972 | - num_output_formats = num_formats; |
2973 | + |
2974 | + num_output_formats = num_formats; |
2975 | output_formats = new MirPixelFormat[num_formats]; |
2976 | } |
2977 | |
2978 | @@ -77,8 +77,8 @@ |
2979 | for (auto i = 0u; i < output.num_modes; i++) |
2980 | { |
2981 | auto mode = msg.mode(i); |
2982 | - output.modes[i].horizontal_resolution = mode.horizontal_resolution(); |
2983 | - output.modes[i].vertical_resolution = mode.vertical_resolution(); |
2984 | + output.modes[i].horizontal_resolution = mode.horizontal_resolution(); |
2985 | + output.modes[i].vertical_resolution = mode.vertical_resolution(); |
2986 | output.modes[i].refresh_rate = mode.refresh_rate(); |
2987 | } |
2988 | output.preferred_mode = msg.preferred_mode(); |
2989 | @@ -161,7 +161,7 @@ |
2990 | { |
2991 | auto new_info = &new_config->outputs[i]; |
2992 | MirDisplayOutput* output = outputs[i].get(); |
2993 | - std::memcpy(new_info, output, sizeof(MirDisplayOutput)); |
2994 | + std::memcpy(new_info, output, sizeof(MirDisplayOutput)); |
2995 | |
2996 | new_info->output_formats = new MirPixelFormat[new_info->num_output_formats]; |
2997 | auto format_size = sizeof(MirPixelFormat) * new_info->num_output_formats; |
2998 | |
2999 | === modified file 'src/client/egl_native_display_container.h' |
3000 | --- src/client/egl_native_display_container.h 2013-05-02 00:11:18 +0000 |
3001 | +++ src/client/egl_native_display_container.h 2013-12-18 14:40:47 +0000 |
3002 | @@ -16,8 +16,8 @@ |
3003 | * Authored by: Robert Carr <robert.carr@canonical.com> |
3004 | */ |
3005 | |
3006 | -#ifndef MIR_CLIENT_GBM_EGL_NATIVE_DISPLAY_CONTAINER_H_ |
3007 | -#define MIR_CLIENT_GBM_EGL_NATIVE_DISPLAY_CONTAINER_H_ |
3008 | +#ifndef MIR_CLIENT_EGL_NATIVE_DISPLAY_CONTAINER_H_ |
3009 | +#define MIR_CLIENT_EGL_NATIVE_DISPLAY_CONTAINER_H_ |
3010 | |
3011 | #include "mir_toolkit/client_types.h" |
3012 | |
3013 | @@ -47,4 +47,4 @@ |
3014 | } |
3015 | } // namespace mir |
3016 | |
3017 | -#endif // MIR_CLIENT_GBM_EGL_NATIVE_DISPLAY_CONTAINER_H_ |
3018 | +#endif // MIR_CLIENT_EGL_NATIVE_DISPLAY_CONTAINER_H_ |
3019 | |
3020 | === modified file 'src/client/logging/input_receiver_report.cpp' |
3021 | --- src/client/logging/input_receiver_report.cpp 2013-11-05 22:31:59 +0000 |
3022 | +++ src/client/logging/input_receiver_report.cpp 2013-12-18 14:40:47 +0000 |
3023 | @@ -118,8 +118,8 @@ |
3024 | std::stringstream ss; |
3025 | |
3026 | ss << "Received event:" << std::endl; |
3027 | - |
3028 | + |
3029 | format_event(ss, event); |
3030 | |
3031 | - logger->log<ml::Logger::debug>(ss.str(), component); |
3032 | + logger->log(ml::Logger::debug, ss.str(), component); |
3033 | } |
3034 | |
3035 | === modified file 'src/client/logging/rpc_report.cpp' |
3036 | --- src/client/logging/rpc_report.cpp 2013-10-14 11:37:26 +0000 |
3037 | +++ src/client/logging/rpc_report.cpp 2013-12-18 14:40:47 +0000 |
3038 | @@ -45,7 +45,7 @@ |
3039 | ss << "Invocation request: id: " << invocation.id() |
3040 | << " method_name: " << invocation.method_name(); |
3041 | |
3042 | - logger->log<ml::Logger::debug>(ss.str(), component); |
3043 | + logger->log(ml::Logger::debug, ss.str(), component); |
3044 | } |
3045 | |
3046 | void mcll::RpcReport::invocation_succeeded( |
3047 | @@ -55,7 +55,7 @@ |
3048 | ss << "Invocation succeeded: id: " << invocation.id() |
3049 | << " method_name: " << invocation.method_name(); |
3050 | |
3051 | - logger->log<ml::Logger::debug>(ss.str(), component); |
3052 | + logger->log(ml::Logger::debug, ss.str(), component); |
3053 | } |
3054 | |
3055 | void mcll::RpcReport::invocation_failed( |
3056 | @@ -67,7 +67,7 @@ |
3057 | << " method_name: " << invocation.method_name() |
3058 | << " error: " << error.message(); |
3059 | |
3060 | - logger->log<ml::Logger::error>(ss.str(), component); |
3061 | + logger->log(ml::Logger::error, ss.str(), component); |
3062 | } |
3063 | |
3064 | void mcll::RpcReport::header_receipt_failed( |
3065 | @@ -76,7 +76,7 @@ |
3066 | std::stringstream ss; |
3067 | ss << "Header receipt failed: " << " error: " << error.message(); |
3068 | |
3069 | - logger->log<ml::Logger::error>(ss.str(), component); |
3070 | + logger->log(ml::Logger::error, ss.str(), component); |
3071 | } |
3072 | |
3073 | void mcll::RpcReport::result_receipt_succeeded( |
3074 | @@ -85,7 +85,7 @@ |
3075 | std::stringstream ss; |
3076 | ss << "Result received: id: " << result.id(); |
3077 | |
3078 | - logger->log<ml::Logger::debug>(ss.str(), component); |
3079 | + logger->log(ml::Logger::debug, ss.str(), component); |
3080 | } |
3081 | |
3082 | void mcll::RpcReport::result_receipt_failed( |
3083 | @@ -94,7 +94,7 @@ |
3084 | std::stringstream ss; |
3085 | ss << "Result receipt failed: reason: " << ex.what(); |
3086 | |
3087 | - logger->log<ml::Logger::error>(ss.str(), component); |
3088 | + logger->log(ml::Logger::error, ss.str(), component); |
3089 | } |
3090 | |
3091 | void mcll::RpcReport::event_parsing_succeeded( |
3092 | @@ -104,7 +104,7 @@ |
3093 | /* TODO: Log more information about event */ |
3094 | ss << "Event parsed"; |
3095 | |
3096 | - logger->log<ml::Logger::debug>(ss.str(), component); |
3097 | + logger->log(ml::Logger::debug, ss.str(), component); |
3098 | } |
3099 | |
3100 | void mcll::RpcReport::event_parsing_failed( |
3101 | @@ -114,7 +114,7 @@ |
3102 | /* TODO: Log more information about event */ |
3103 | ss << "Event parsing failed"; |
3104 | |
3105 | - logger->log<ml::Logger::warning>(ss.str(), component); |
3106 | + logger->log(ml::Logger::warning, ss.str(), component); |
3107 | } |
3108 | |
3109 | void mcll::RpcReport::orphaned_result( |
3110 | @@ -123,7 +123,7 @@ |
3111 | std::stringstream ss; |
3112 | ss << "Orphaned result: " << result.ShortDebugString(); |
3113 | |
3114 | - logger->log<ml::Logger::error>(ss.str(), component); |
3115 | + logger->log(ml::Logger::error, ss.str(), component); |
3116 | } |
3117 | |
3118 | void mcll::RpcReport::complete_response( |
3119 | @@ -132,7 +132,7 @@ |
3120 | std::stringstream ss; |
3121 | ss << "Complete response: id: " << result.id(); |
3122 | |
3123 | - logger->log<ml::Logger::debug>(ss.str(), component); |
3124 | + logger->log(ml::Logger::debug, ss.str(), component); |
3125 | } |
3126 | |
3127 | void mcll::RpcReport::result_processing_failed( |
3128 | @@ -142,7 +142,7 @@ |
3129 | std::stringstream ss; |
3130 | ss << "Result processing failed: reason: " << ex.what(); |
3131 | |
3132 | - logger->log<ml::Logger::error>(ss.str(), component); |
3133 | + logger->log(ml::Logger::error, ss.str(), component); |
3134 | } |
3135 | |
3136 | void mcll::RpcReport::file_descriptors_received( |
3137 | @@ -154,7 +154,7 @@ |
3138 | for (auto f : fds) |
3139 | ss << f << " "; |
3140 | |
3141 | - logger->log<ml::Logger::debug>(ss.str(), component); |
3142 | + logger->log(ml::Logger::debug, ss.str(), component); |
3143 | } |
3144 | |
3145 | void mcll::RpcReport::connection_failure(std::exception const& x) |
3146 | @@ -162,5 +162,5 @@ |
3147 | std::stringstream ss; |
3148 | ss << "Connection failure: " << boost::diagnostic_information(x) << std::endl; |
3149 | |
3150 | - logger->log<ml::Logger::warning>(ss.str(), component); |
3151 | + logger->log(ml::Logger::warning, ss.str(), component); |
3152 | } |
3153 | |
3154 | === renamed directory 'src/client/gbm' => 'src/client/mesa' |
3155 | === renamed file 'src/client/gbm/drm_fd_handler.h' => 'src/client/mesa/buffer_file_ops.h' |
3156 | --- src/client/gbm/drm_fd_handler.h 2013-04-24 05:22:20 +0000 |
3157 | +++ src/client/mesa/buffer_file_ops.h 2013-12-18 14:40:47 +0000 |
3158 | @@ -16,8 +16,8 @@ |
3159 | * Authored by: Alexandros Frantzis <alexandros.frantzis@canonical.com> |
3160 | */ |
3161 | |
3162 | -#ifndef MIR_CLIENT_GBM_DRM_FD_HANDLER_ |
3163 | -#define MIR_CLIENT_GBM_DRM_FD_HANDLER_ |
3164 | +#ifndef MIR_CLIENT_MESA_BUFFER_FILE_OPS_ |
3165 | +#define MIR_CLIENT_MESA_BUFFER_FILE_OPS_ |
3166 | |
3167 | #include <sys/types.h> |
3168 | |
3169 | @@ -25,28 +25,26 @@ |
3170 | { |
3171 | namespace client |
3172 | { |
3173 | -namespace gbm |
3174 | +namespace mesa |
3175 | { |
3176 | |
3177 | -class DRMFDHandler |
3178 | +class BufferFileOps |
3179 | { |
3180 | public: |
3181 | - virtual ~DRMFDHandler() {} |
3182 | + virtual ~BufferFileOps() = default; |
3183 | |
3184 | - virtual int ioctl(unsigned long request, void* arg) = 0; |
3185 | - virtual int primeFDToHandle(int prime_fd, uint32_t *handle) = 0; |
3186 | - virtual int close(int fd) = 0; |
3187 | - virtual void* map(size_t size, off_t offset) = 0; |
3188 | - virtual void unmap(void* addr, size_t size) = 0; |
3189 | + virtual int close(int fd) const = 0; |
3190 | + virtual void* map(int fd, off_t offset, size_t size) const = 0; |
3191 | + virtual void unmap(void* addr, size_t size) const = 0; |
3192 | |
3193 | protected: |
3194 | - DRMFDHandler() = default; |
3195 | - DRMFDHandler(const DRMFDHandler&) = delete; |
3196 | - DRMFDHandler& operator=(const DRMFDHandler&) = delete; |
3197 | + BufferFileOps() = default; |
3198 | + BufferFileOps(BufferFileOps const&) = delete; |
3199 | + BufferFileOps& operator=(BufferFileOps const&) = delete; |
3200 | }; |
3201 | |
3202 | } |
3203 | } |
3204 | } |
3205 | |
3206 | -#endif /* MIR_CLIENT_GBM_DRM_FD_HANDLER_ */ |
3207 | +#endif /* MIR_CLIENT_MESA_BUFFER_FILE_OPS_ */ |
3208 | |
3209 | === renamed file 'src/client/gbm/gbm_client_buffer.cpp' => 'src/client/mesa/client_buffer.cpp' |
3210 | --- src/client/gbm/gbm_client_buffer.cpp 2013-11-21 03:16:21 +0000 |
3211 | +++ src/client/mesa/client_buffer.cpp 2013-12-18 14:40:47 +0000 |
3212 | @@ -17,91 +17,47 @@ |
3213 | */ |
3214 | |
3215 | #include "mir_toolkit/mir_client_library.h" |
3216 | -#include "gbm_client_buffer.h" |
3217 | -#include "drm_fd_handler.h" |
3218 | +#include "client_buffer.h" |
3219 | +#include "buffer_file_ops.h" |
3220 | |
3221 | #include <boost/exception/errinfo_errno.hpp> |
3222 | #include <boost/throw_exception.hpp> |
3223 | |
3224 | #include <stdexcept> |
3225 | |
3226 | -#include <xf86drm.h> |
3227 | -#include <string.h> |
3228 | #include <errno.h> |
3229 | #include <sys/mman.h> |
3230 | |
3231 | namespace mcl=mir::client; |
3232 | -namespace mclg=mir::client::gbm; |
3233 | +namespace mclm=mir::client::mesa; |
3234 | namespace geom=mir::geometry; |
3235 | |
3236 | namespace |
3237 | { |
3238 | |
3239 | -struct GEMHandle |
3240 | -{ |
3241 | - GEMHandle(std::shared_ptr<mclg::DRMFDHandler> const& drm_fd_handler, |
3242 | - int prime_fd) |
3243 | - : drm_fd_handler{drm_fd_handler} |
3244 | - { |
3245 | - int ret = drm_fd_handler->primeFDToHandle(prime_fd, &handle); |
3246 | - if (ret) |
3247 | - { |
3248 | - std::string msg("Failed to import PRIME fd for DRM buffer"); |
3249 | - BOOST_THROW_EXCEPTION( |
3250 | - boost::enable_error_info( |
3251 | - std::runtime_error(msg)) << boost::errinfo_errno(errno)); |
3252 | - } |
3253 | - } |
3254 | - |
3255 | - ~GEMHandle() |
3256 | - { |
3257 | - struct drm_gem_close arg; |
3258 | - arg.handle = handle; |
3259 | - // TODO (@raof): Error reporting? I do not believe it should be possible for this to fail, |
3260 | - // so if it does we should probably flag it. |
3261 | - drm_fd_handler->ioctl(DRM_IOCTL_GEM_CLOSE, &arg); |
3262 | - } |
3263 | - |
3264 | - std::shared_ptr<mclg::DRMFDHandler> const drm_fd_handler; |
3265 | - uint32_t handle; |
3266 | -}; |
3267 | - |
3268 | struct NullDeleter |
3269 | { |
3270 | void operator()(char *) const {} |
3271 | }; |
3272 | |
3273 | -struct GBMMemoryRegion : mcl::MemoryRegion |
3274 | +struct ShmMemoryRegion : mcl::MemoryRegion |
3275 | { |
3276 | - GBMMemoryRegion(std::shared_ptr<mclg::DRMFDHandler> const& drm_fd_handler, |
3277 | - int prime_fd, geom::Size const& size_param, |
3278 | - geom::Stride stride_param, geom::PixelFormat format_param) |
3279 | - : drm_fd_handler{drm_fd_handler}, |
3280 | - gem_handle{drm_fd_handler, prime_fd}, |
3281 | + ShmMemoryRegion(std::shared_ptr<mclm::BufferFileOps> const& buffer_file_ops, |
3282 | + int buffer_fd, geom::Size const& size_param, |
3283 | + geom::Stride stride_param, MirPixelFormat format_param) |
3284 | + : buffer_file_ops{buffer_file_ops}, |
3285 | size_in_bytes{size_param.height.as_uint32_t() * stride_param.as_uint32_t()} |
3286 | { |
3287 | + static off_t const map_offset = 0; |
3288 | width = size_param.width; |
3289 | height = size_param.height; |
3290 | stride = stride_param; |
3291 | format = format_param; |
3292 | |
3293 | - struct drm_mode_map_dumb map_dumb; |
3294 | - memset(&map_dumb, 0, sizeof(map_dumb)); |
3295 | - map_dumb.handle = gem_handle.handle; |
3296 | - |
3297 | - int ret = drm_fd_handler->ioctl(DRM_IOCTL_MODE_MAP_DUMB, &map_dumb); |
3298 | - if (ret) |
3299 | - { |
3300 | - std::string msg("Failed to map dumb DRM buffer"); |
3301 | - BOOST_THROW_EXCEPTION( |
3302 | - boost::enable_error_info( |
3303 | - std::runtime_error(msg)) << boost::errinfo_errno(errno)); |
3304 | - } |
3305 | - |
3306 | - void* map = drm_fd_handler->map(size_in_bytes, map_dumb.offset); |
3307 | + void* map = buffer_file_ops->map(buffer_fd, map_offset, size_in_bytes); |
3308 | if (map == MAP_FAILED) |
3309 | { |
3310 | - std::string msg("Failed to mmap DRM buffer"); |
3311 | + std::string msg("Failed to mmap buffer"); |
3312 | BOOST_THROW_EXCEPTION( |
3313 | boost::enable_error_info( |
3314 | std::runtime_error(msg)) << boost::errinfo_errno(errno)); |
3315 | @@ -110,63 +66,62 @@ |
3316 | vaddr = std::shared_ptr<char>(static_cast<char*>(map), NullDeleter()); |
3317 | } |
3318 | |
3319 | - ~GBMMemoryRegion() |
3320 | + ~ShmMemoryRegion() |
3321 | { |
3322 | - drm_fd_handler->unmap(vaddr.get(), size_in_bytes); |
3323 | + buffer_file_ops->unmap(vaddr.get(), size_in_bytes); |
3324 | } |
3325 | |
3326 | - std::shared_ptr<mclg::DRMFDHandler> const drm_fd_handler; |
3327 | - GEMHandle const gem_handle; |
3328 | + std::shared_ptr<mclm::BufferFileOps> const buffer_file_ops; |
3329 | size_t const size_in_bytes; |
3330 | }; |
3331 | |
3332 | } |
3333 | |
3334 | -mclg::GBMClientBuffer::GBMClientBuffer( |
3335 | - std::shared_ptr<mclg::DRMFDHandler> const& drm_fd_handler, |
3336 | - std::shared_ptr<MirBufferPackage> const& package, |
3337 | - geom::Size size, geom::PixelFormat pf) |
3338 | - : drm_fd_handler{drm_fd_handler}, |
3339 | - creation_package(std::move(package)), |
3340 | +mclm::ClientBuffer::ClientBuffer( |
3341 | + std::shared_ptr<mclm::BufferFileOps> const& buffer_file_ops, |
3342 | + std::shared_ptr<MirBufferPackage> const& package, |
3343 | + geom::Size size, MirPixelFormat pf) |
3344 | + : buffer_file_ops{buffer_file_ops}, |
3345 | + creation_package{package}, |
3346 | rect({geom::Point{0, 0}, size}), |
3347 | buffer_pf{pf} |
3348 | { |
3349 | } |
3350 | |
3351 | -mclg::GBMClientBuffer::~GBMClientBuffer() noexcept |
3352 | +mclm::ClientBuffer::~ClientBuffer() noexcept |
3353 | { |
3354 | // TODO (@raof): Error reporting? It should not be possible for this to fail; if it does, |
3355 | // something's seriously wrong. |
3356 | - drm_fd_handler->close(creation_package->fd[0]); |
3357 | + buffer_file_ops->close(creation_package->fd[0]); |
3358 | } |
3359 | |
3360 | -std::shared_ptr<mcl::MemoryRegion> mclg::GBMClientBuffer::secure_for_cpu_write() |
3361 | +std::shared_ptr<mcl::MemoryRegion> mclm::ClientBuffer::secure_for_cpu_write() |
3362 | { |
3363 | - const int prime_fd = creation_package->fd[0]; |
3364 | + int const buffer_fd = creation_package->fd[0]; |
3365 | |
3366 | - return std::make_shared<GBMMemoryRegion>(drm_fd_handler, |
3367 | - prime_fd, |
3368 | + return std::make_shared<ShmMemoryRegion>(buffer_file_ops, |
3369 | + buffer_fd, |
3370 | size(), |
3371 | stride(), |
3372 | pixel_format()); |
3373 | } |
3374 | |
3375 | -geom::Size mclg::GBMClientBuffer::size() const |
3376 | +geom::Size mclm::ClientBuffer::size() const |
3377 | { |
3378 | return rect.size; |
3379 | } |
3380 | |
3381 | -geom::Stride mclg::GBMClientBuffer::stride() const |
3382 | +geom::Stride mclm::ClientBuffer::stride() const |
3383 | { |
3384 | return geom::Stride{creation_package->stride}; |
3385 | } |
3386 | |
3387 | -geom::PixelFormat mclg::GBMClientBuffer::pixel_format() const |
3388 | +MirPixelFormat mclm::ClientBuffer::pixel_format() const |
3389 | { |
3390 | return buffer_pf; |
3391 | } |
3392 | |
3393 | -std::shared_ptr<MirNativeBuffer> mclg::GBMClientBuffer::native_buffer_handle() const |
3394 | +std::shared_ptr<MirNativeBuffer> mclm::ClientBuffer::native_buffer_handle() const |
3395 | { |
3396 | creation_package->age = age(); |
3397 | return creation_package; |
3398 | |
3399 | === renamed file 'src/client/gbm/gbm_client_buffer.h' => 'src/client/mesa/client_buffer.h' |
3400 | --- src/client/gbm/gbm_client_buffer.h 2013-11-21 03:16:21 +0000 |
3401 | +++ src/client/mesa/client_buffer.h 2013-12-18 14:40:47 +0000 |
3402 | @@ -17,8 +17,8 @@ |
3403 | * Kevin DuBois <kevin.dubois@canonical.com> |
3404 | */ |
3405 | |
3406 | -#ifndef MIR_CLIENT_GBM_GBM_CLIENT_BUFFER_H_ |
3407 | -#define MIR_CLIENT_GBM_GBM_CLIENT_BUFFER_H_ |
3408 | +#ifndef MIR_CLIENT_MESA_CLIENT_BUFFER_H_ |
3409 | +#define MIR_CLIENT_MESA_CLIENT_BUFFER_H_ |
3410 | |
3411 | #include "../aging_buffer.h" |
3412 | #include "mir_toolkit/mir_client_library.h" |
3413 | @@ -30,37 +30,35 @@ |
3414 | { |
3415 | namespace client |
3416 | { |
3417 | -namespace gbm |
3418 | +namespace mesa |
3419 | { |
3420 | |
3421 | -class DRMFDHandler; |
3422 | +class BufferFileOps; |
3423 | |
3424 | -class GBMClientBuffer : public AgingBuffer |
3425 | +class ClientBuffer : public AgingBuffer |
3426 | { |
3427 | public: |
3428 | - GBMClientBuffer(std::shared_ptr<DRMFDHandler> const& drm_fd_handler, |
3429 | - std::shared_ptr<MirBufferPackage> const& buffer_package, |
3430 | - geometry::Size size, |
3431 | - geometry::PixelFormat pf); |
3432 | + ClientBuffer(std::shared_ptr<BufferFileOps> const& buffer_file_ops, |
3433 | + std::shared_ptr<MirBufferPackage> const& buffer_package, |
3434 | + geometry::Size size, |
3435 | + MirPixelFormat pf); |
3436 | |
3437 | - virtual ~GBMClientBuffer() noexcept; |
3438 | + ~ClientBuffer() noexcept; |
3439 | |
3440 | std::shared_ptr<MemoryRegion> secure_for_cpu_write(); |
3441 | geometry::Size size() const; |
3442 | geometry::Stride stride() const; |
3443 | - geometry::PixelFormat pixel_format() const; |
3444 | + MirPixelFormat pixel_format() const; |
3445 | std::shared_ptr<MirNativeBuffer> native_buffer_handle() const; |
3446 | |
3447 | - GBMClientBuffer(const GBMClientBuffer&) = delete; |
3448 | - GBMClientBuffer& operator=(const GBMClientBuffer&) = delete; |
3449 | private: |
3450 | - const std::shared_ptr<DRMFDHandler> drm_fd_handler; |
3451 | - const std::shared_ptr<MirBufferPackage> creation_package; |
3452 | - const geometry::Rectangle rect; |
3453 | - const geometry::PixelFormat buffer_pf; |
3454 | + std::shared_ptr<BufferFileOps> const buffer_file_ops; |
3455 | + std::shared_ptr<MirBufferPackage> const creation_package; |
3456 | + geometry::Rectangle const rect; |
3457 | + MirPixelFormat const buffer_pf; |
3458 | }; |
3459 | |
3460 | } |
3461 | } |
3462 | } |
3463 | -#endif /* MIR_CLIENT_GBM_GBM_CLIENT_BUFFER_H_ */ |
3464 | +#endif /* MIR_CLIENT_MESA_CLIENT_BUFFER_H_ */ |
3465 | |
3466 | === renamed file 'src/client/gbm/gbm_client_buffer_factory.cpp' => 'src/client/mesa/client_buffer_factory.cpp' |
3467 | --- src/client/gbm/gbm_client_buffer_factory.cpp 2013-11-21 03:16:21 +0000 |
3468 | +++ src/client/mesa/client_buffer_factory.cpp 2013-12-18 14:40:47 +0000 |
3469 | @@ -17,23 +17,27 @@ |
3470 | * Christopher James Halse Rogers <christopher.halse.rogers@canonical.com> |
3471 | */ |
3472 | |
3473 | -#include "gbm_client_buffer_factory.h" |
3474 | -#include "gbm_client_buffer.h" |
3475 | +#include "client_buffer_factory.h" |
3476 | +#include "client_buffer.h" |
3477 | |
3478 | namespace mcl=mir::client; |
3479 | -namespace mclg=mir::client::gbm; |
3480 | +namespace mclm=mir::client::mesa; |
3481 | |
3482 | -mclg::GBMClientBufferFactory::GBMClientBufferFactory( |
3483 | - std::shared_ptr<DRMFDHandler> const& drm_fd_handler) |
3484 | - : drm_fd_handler{drm_fd_handler} |
3485 | +mclm::ClientBufferFactory::ClientBufferFactory( |
3486 | + std::shared_ptr<BufferFileOps> const& buffer_file_ops) |
3487 | + : buffer_file_ops{buffer_file_ops} |
3488 | { |
3489 | } |
3490 | |
3491 | -std::shared_ptr<mcl::ClientBuffer> mclg::GBMClientBufferFactory::create_buffer(std::shared_ptr<MirBufferPackage> const& package, geometry::Size size, geometry::PixelFormat pf) |
3492 | +std::shared_ptr<mcl::ClientBuffer> |
3493 | +mclm::ClientBufferFactory::create_buffer( |
3494 | + std::shared_ptr<MirBufferPackage> const& package, |
3495 | + geometry::Size size, |
3496 | + MirPixelFormat pf) |
3497 | { |
3498 | (void)size; // TODO: remove this unused parameter |
3499 | - return std::make_shared<mclg::GBMClientBuffer>( |
3500 | - drm_fd_handler, |
3501 | + return std::make_shared<mclm::ClientBuffer>( |
3502 | + buffer_file_ops, |
3503 | package, |
3504 | geometry::Size{package->width, package->height}, |
3505 | pf); |
3506 | |
3507 | === renamed file 'src/client/gbm/gbm_client_buffer_factory.h' => 'src/client/mesa/client_buffer_factory.h' |
3508 | --- src/client/gbm/gbm_client_buffer_factory.h 2013-04-24 05:22:20 +0000 |
3509 | +++ src/client/mesa/client_buffer_factory.h 2013-12-18 14:40:47 +0000 |
3510 | @@ -17,35 +17,33 @@ |
3511 | * Christopher James Halse Rogers <christopher.halse.rogers@canonical.com> |
3512 | */ |
3513 | |
3514 | -#ifndef MIR_CLIENT_GBM_GBM_CLIENT_BUFFER_FACTORY_H_ |
3515 | -#define MIR_CLIENT_GBM_GBM_CLIENT_BUFFER_FACTORY_H_ |
3516 | +#ifndef MIR_CLIENT_MESA_CLIENT_BUFFER_FACTORY_H_ |
3517 | +#define MIR_CLIENT_MESA_CLIENT_BUFFER_FACTORY_H_ |
3518 | |
3519 | #include "../client_buffer_factory.h" |
3520 | -#include "gbm_client_buffer.h" |
3521 | |
3522 | namespace mir |
3523 | { |
3524 | namespace client |
3525 | { |
3526 | -class ClientBuffer; |
3527 | - |
3528 | -namespace gbm |
3529 | +namespace mesa |
3530 | { |
3531 | |
3532 | -class DRMFDHandler; |
3533 | +class BufferFileOps; |
3534 | |
3535 | -class GBMClientBufferFactory : public ClientBufferFactory |
3536 | +class ClientBufferFactory : public client::ClientBufferFactory |
3537 | { |
3538 | public: |
3539 | - explicit GBMClientBufferFactory(std::shared_ptr<DRMFDHandler> const& drm_fd_handler); |
3540 | + explicit ClientBufferFactory(std::shared_ptr<BufferFileOps> const& buffer_file_ops); |
3541 | |
3542 | - std::shared_ptr<ClientBuffer> create_buffer(std::shared_ptr<MirBufferPackage> const& package, |
3543 | - geometry::Size size, geometry::PixelFormat pf); |
3544 | + std::shared_ptr<client::ClientBuffer> create_buffer( |
3545 | + std::shared_ptr<MirBufferPackage> const& package, |
3546 | + geometry::Size size, MirPixelFormat pf); |
3547 | private: |
3548 | - std::shared_ptr<DRMFDHandler> drm_fd_handler; |
3549 | + std::shared_ptr<BufferFileOps> const buffer_file_ops; |
3550 | }; |
3551 | |
3552 | } |
3553 | } |
3554 | } |
3555 | -#endif /* MIR_CLIENT_GBM_GBM_CLIENT_BUFFER_FACTORY_H_ */ |
3556 | +#endif /* MIR_CLIENT_MESA_CLIENT_BUFFER_FACTORY_H_ */ |
3557 | |
3558 | === renamed file 'src/client/gbm/gbm_client_platform.cpp' => 'src/client/mesa/client_platform.cpp' |
3559 | --- src/client/gbm/gbm_client_platform.cpp 2013-10-15 08:53:10 +0000 |
3560 | +++ src/client/mesa/client_platform.cpp 2013-12-18 14:40:47 +0000 |
3561 | @@ -17,44 +17,28 @@ |
3562 | */ |
3563 | |
3564 | #include "mir_toolkit/mir_client_library.h" |
3565 | -#include "gbm_client_platform.h" |
3566 | -#include "gbm_client_buffer_factory.h" |
3567 | +#include "client_platform.h" |
3568 | +#include "client_buffer_factory.h" |
3569 | #include "mesa_native_display_container.h" |
3570 | -#include "drm_fd_handler.h" |
3571 | -#include "gbm_native_surface.h" |
3572 | +#include "buffer_file_ops.h" |
3573 | +#include "native_surface.h" |
3574 | #include "../mir_connection.h" |
3575 | #include "../client_buffer_factory.h" |
3576 | #include "../native_client_platform_factory.h" |
3577 | |
3578 | -#include <xf86drm.h> |
3579 | #include <sys/mman.h> |
3580 | #include <unistd.h> |
3581 | |
3582 | namespace mcl=mir::client; |
3583 | -namespace mclg=mir::client::gbm; |
3584 | +namespace mclm=mir::client::mesa; |
3585 | namespace geom=mir::geometry; |
3586 | |
3587 | namespace |
3588 | { |
3589 | |
3590 | -class RealDRMFDHandler : public mclg::DRMFDHandler |
3591 | +struct RealBufferFileOps : public mclm::BufferFileOps |
3592 | { |
3593 | -public: |
3594 | - RealDRMFDHandler(int drm_fd) : drm_fd{drm_fd} |
3595 | - { |
3596 | - } |
3597 | - |
3598 | - int ioctl(unsigned long request, void* arg) |
3599 | - { |
3600 | - return drmIoctl(drm_fd, request, arg); |
3601 | - } |
3602 | - |
3603 | - int primeFDToHandle(int prime_fd, uint32_t *handle) |
3604 | - { |
3605 | - return drmPrimeFDToHandle(drm_fd, prime_fd, handle); |
3606 | - } |
3607 | - |
3608 | - int close(int fd) |
3609 | + int close(int fd) const |
3610 | { |
3611 | while (::close(fd) == -1) |
3612 | { |
3613 | @@ -65,19 +49,16 @@ |
3614 | return 0; |
3615 | } |
3616 | |
3617 | - void* map(size_t size, off_t offset) |
3618 | + void* map(int fd, off_t offset, size_t size) const |
3619 | { |
3620 | - return mmap(0, size, PROT_READ | PROT_WRITE, MAP_SHARED, |
3621 | - drm_fd, offset); |
3622 | + return mmap(nullptr, size, PROT_READ | PROT_WRITE, MAP_SHARED, |
3623 | + fd, offset); |
3624 | } |
3625 | |
3626 | - void unmap(void* addr, size_t size) |
3627 | + void unmap(void* addr, size_t size) const |
3628 | { |
3629 | munmap(addr, size); |
3630 | } |
3631 | - |
3632 | -private: |
3633 | - int drm_fd; |
3634 | }; |
3635 | |
3636 | struct NativeDisplayDeleter |
3637 | @@ -101,40 +82,31 @@ |
3638 | std::shared_ptr<mcl::ClientPlatform> |
3639 | mcl::NativeClientPlatformFactory::create_client_platform(mcl::ClientContext* context) |
3640 | { |
3641 | - MirPlatformPackage platform_package; |
3642 | - |
3643 | - memset(&platform_package, 0, sizeof(platform_package)); |
3644 | - context->populate(platform_package); |
3645 | - |
3646 | - int drm_fd = -1; |
3647 | - |
3648 | - if (platform_package.fd_items > 0) |
3649 | - drm_fd = platform_package.fd[0]; |
3650 | - |
3651 | - auto drm_fd_handler = std::make_shared<RealDRMFDHandler>(drm_fd); |
3652 | - return std::make_shared<mclg::GBMClientPlatform>(context, drm_fd_handler, mcl::EGLNativeDisplayContainer::instance()); |
3653 | + auto buffer_file_ops = std::make_shared<RealBufferFileOps>(); |
3654 | + return std::make_shared<mclm::ClientPlatform>( |
3655 | + context, buffer_file_ops, mcl::EGLNativeDisplayContainer::instance()); |
3656 | } |
3657 | |
3658 | -mclg::GBMClientPlatform::GBMClientPlatform( |
3659 | +mclm::ClientPlatform::ClientPlatform( |
3660 | ClientContext* const context, |
3661 | - std::shared_ptr<DRMFDHandler> const& drm_fd_handler, |
3662 | + std::shared_ptr<BufferFileOps> const& buffer_file_ops, |
3663 | mcl::EGLNativeDisplayContainer& display_container) |
3664 | : context{context}, |
3665 | - drm_fd_handler{drm_fd_handler}, |
3666 | + buffer_file_ops{buffer_file_ops}, |
3667 | display_container(display_container) |
3668 | { |
3669 | } |
3670 | |
3671 | -std::shared_ptr<mcl::ClientBufferFactory> mclg::GBMClientPlatform::create_buffer_factory() |
3672 | +std::shared_ptr<mcl::ClientBufferFactory> mclm::ClientPlatform::create_buffer_factory() |
3673 | { |
3674 | - return std::make_shared<mclg::GBMClientBufferFactory>(drm_fd_handler); |
3675 | + return std::make_shared<mclm::ClientBufferFactory>(buffer_file_ops); |
3676 | } |
3677 | |
3678 | namespace |
3679 | { |
3680 | struct NativeWindowDeleter |
3681 | { |
3682 | - NativeWindowDeleter(mclg::GBMNativeSurface* window) |
3683 | + NativeWindowDeleter(mclm::NativeSurface* window) |
3684 | : window(window) {} |
3685 | |
3686 | void operator()(EGLNativeWindowType* type) |
3687 | @@ -144,21 +116,21 @@ |
3688 | } |
3689 | |
3690 | private: |
3691 | - mclg::GBMNativeSurface* window; |
3692 | + mclm::NativeSurface* window; |
3693 | }; |
3694 | } |
3695 | |
3696 | -std::shared_ptr<EGLNativeWindowType> mclg::GBMClientPlatform::create_egl_native_window(ClientSurface* client_surface) |
3697 | +std::shared_ptr<EGLNativeWindowType> mclm::ClientPlatform::create_egl_native_window(ClientSurface* client_surface) |
3698 | { |
3699 | //TODO: this is awkward on both android and gbm... |
3700 | - auto gbm_window = new GBMNativeSurface(*client_surface); |
3701 | + auto native_window = new NativeSurface(*client_surface); |
3702 | auto egl_native_window = new EGLNativeWindowType; |
3703 | - *egl_native_window = gbm_window; |
3704 | - NativeWindowDeleter deleter(gbm_window); |
3705 | + *egl_native_window = native_window; |
3706 | + NativeWindowDeleter deleter(native_window); |
3707 | return std::shared_ptr<EGLNativeWindowType>(egl_native_window, deleter); |
3708 | } |
3709 | |
3710 | -std::shared_ptr<EGLNativeDisplayType> mclg::GBMClientPlatform::create_egl_native_display() |
3711 | +std::shared_ptr<EGLNativeDisplayType> mclm::ClientPlatform::create_egl_native_display() |
3712 | { |
3713 | MirEGLNativeDisplayType *mir_native_display = new MirEGLNativeDisplayType; |
3714 | *mir_native_display = display_container.create(context->mir_connection()); |
3715 | @@ -167,12 +139,12 @@ |
3716 | return std::shared_ptr<EGLNativeDisplayType>(egl_native_display, NativeDisplayDeleter(display_container)); |
3717 | } |
3718 | |
3719 | -MirPlatformType mclg::GBMClientPlatform::platform_type() const |
3720 | +MirPlatformType mclm::ClientPlatform::platform_type() const |
3721 | { |
3722 | - return mir_platform_type_gbm; |
3723 | -} |
3724 | + return mir_platform_type_gbm; |
3725 | +} |
3726 | |
3727 | -MirNativeBuffer* mclg::GBMClientPlatform::convert_native_buffer(graphics::NativeBuffer* buf) const |
3728 | +MirNativeBuffer* mclm::ClientPlatform::convert_native_buffer(graphics::NativeBuffer* buf) const |
3729 | { |
3730 | //MirNativeBuffer is type-compatible with the MirNativeBuffer |
3731 | return buf; |
3732 | |
3733 | === renamed file 'src/client/gbm/gbm_client_platform.h' => 'src/client/mesa/client_platform.h' |
3734 | --- src/client/gbm/gbm_client_platform.h 2013-10-15 08:53:10 +0000 |
3735 | +++ src/client/mesa/client_platform.h 2013-12-18 14:40:47 +0000 |
3736 | @@ -15,8 +15,8 @@ |
3737 | * |
3738 | * Authored by: Kevin DuBois <kevin.dubois@canonical.com> |
3739 | */ |
3740 | -#ifndef MIR_CLIENT_GBM_GBM_CLIENT_PLATFORM_H_ |
3741 | -#define MIR_CLIENT_GBM_GBM_CLIENT_PLATFORM_H_ |
3742 | +#ifndef MIR_CLIENT_MESA_CLIENT_PLATFORM_H_ |
3743 | +#define MIR_CLIENT_MESA_CLIENT_PLATFORM_H_ |
3744 | |
3745 | #include "../client_platform.h" |
3746 | |
3747 | @@ -27,19 +27,19 @@ |
3748 | class ClientBufferDepository; |
3749 | class EGLNativeDisplayContainer; |
3750 | |
3751 | -namespace gbm |
3752 | +namespace mesa |
3753 | { |
3754 | |
3755 | -class DRMFDHandler; |
3756 | +class BufferFileOps; |
3757 | |
3758 | -class GBMClientPlatform : public ClientPlatform |
3759 | +class ClientPlatform : public client::ClientPlatform |
3760 | { |
3761 | public: |
3762 | - GBMClientPlatform(ClientContext* const context, |
3763 | - std::shared_ptr<DRMFDHandler> const& drm_fd_handler, |
3764 | - EGLNativeDisplayContainer& display_container); |
3765 | + ClientPlatform(ClientContext* const context, |
3766 | + std::shared_ptr<BufferFileOps> const& buffer_file_ops, |
3767 | + EGLNativeDisplayContainer& display_container); |
3768 | |
3769 | - MirPlatformType platform_type() const; |
3770 | + MirPlatformType platform_type() const; |
3771 | std::shared_ptr<ClientBufferFactory> create_buffer_factory(); |
3772 | std::shared_ptr<EGLNativeWindowType> create_egl_native_window(ClientSurface *surface); |
3773 | std::shared_ptr<EGLNativeDisplayType> create_egl_native_display(); |
3774 | @@ -47,7 +47,7 @@ |
3775 | |
3776 | private: |
3777 | ClientContext* const context; |
3778 | - std::shared_ptr<DRMFDHandler> const drm_fd_handler; |
3779 | + std::shared_ptr<BufferFileOps> const buffer_file_ops; |
3780 | EGLNativeDisplayContainer& display_container; |
3781 | }; |
3782 | |
3783 | @@ -55,4 +55,4 @@ |
3784 | } |
3785 | } |
3786 | |
3787 | -#endif /* MIR_CLIENT_GBM_GBM_CLIENT_PLATFORM_H_ */ |
3788 | +#endif /* MIR_CLIENT_MESA_CLIENT_PLATFORM_H_ */ |
3789 | |
3790 | === modified file 'src/client/mesa/mesa_native_display_container.cpp' |
3791 | --- src/client/gbm/mesa_native_display_container.cpp 2013-08-28 03:41:48 +0000 |
3792 | +++ src/client/mesa/mesa_native_display_container.cpp 2013-12-18 14:40:47 +0000 |
3793 | @@ -25,15 +25,15 @@ |
3794 | #include <mutex> |
3795 | |
3796 | namespace mcl = mir::client; |
3797 | -namespace mclg = mcl::gbm; |
3798 | +namespace mclm = mcl::mesa; |
3799 | |
3800 | namespace |
3801 | { |
3802 | extern "C" |
3803 | { |
3804 | |
3805 | -static int gbm_egl_display_get_platform(MirMesaEGLNativeDisplay* display, |
3806 | - MirPlatformPackage* package) |
3807 | +static int egl_display_get_platform(MirMesaEGLNativeDisplay* display, |
3808 | + MirPlatformPackage* package) |
3809 | { |
3810 | auto connection = static_cast<MirConnection*>(display->context); |
3811 | mir_connection_get_platform(connection, package); |
3812 | @@ -50,15 +50,15 @@ |
3813 | |
3814 | mcl::EGLNativeDisplayContainer& mcl::EGLNativeDisplayContainer::instance() |
3815 | { |
3816 | - static mclg::MesaNativeDisplayContainer default_display_container; |
3817 | + static mclm::MesaNativeDisplayContainer default_display_container; |
3818 | return default_display_container; |
3819 | } |
3820 | |
3821 | -mclg::MesaNativeDisplayContainer::MesaNativeDisplayContainer() |
3822 | +mclm::MesaNativeDisplayContainer::MesaNativeDisplayContainer() |
3823 | { |
3824 | } |
3825 | |
3826 | -mclg::MesaNativeDisplayContainer::~MesaNativeDisplayContainer() |
3827 | +mclm::MesaNativeDisplayContainer::~MesaNativeDisplayContainer() |
3828 | { |
3829 | std::lock_guard<std::mutex> lg(guard); |
3830 | |
3831 | @@ -68,17 +68,17 @@ |
3832 | } |
3833 | } |
3834 | |
3835 | -bool mclg::MesaNativeDisplayContainer::validate(MirEGLNativeDisplayType display) const |
3836 | +bool mclm::MesaNativeDisplayContainer::validate(MirEGLNativeDisplayType display) const |
3837 | { |
3838 | std::lock_guard<std::mutex> lg(guard); |
3839 | return (valid_displays.find(display) != valid_displays.end()); |
3840 | } |
3841 | |
3842 | MirEGLNativeDisplayType |
3843 | -mclg::MesaNativeDisplayContainer::create(MirConnection* connection) |
3844 | +mclm::MesaNativeDisplayContainer::create(MirConnection* connection) |
3845 | { |
3846 | MirMesaEGLNativeDisplay* display = new MirMesaEGLNativeDisplay(); |
3847 | - display->display_get_platform = gbm_egl_display_get_platform; |
3848 | + display->display_get_platform = egl_display_get_platform; |
3849 | display->context = connection; |
3850 | |
3851 | std::lock_guard<std::mutex> lg(guard); |
3852 | @@ -88,7 +88,7 @@ |
3853 | return egl_display; |
3854 | } |
3855 | |
3856 | -void mclg::MesaNativeDisplayContainer::release(MirEGLNativeDisplayType display) |
3857 | +void mclm::MesaNativeDisplayContainer::release(MirEGLNativeDisplayType display) |
3858 | { |
3859 | std::lock_guard<std::mutex> lg(guard); |
3860 | |
3861 | |
3862 | === modified file 'src/client/mesa/mesa_native_display_container.h' |
3863 | --- src/client/gbm/mesa_native_display_container.h 2013-08-28 03:41:48 +0000 |
3864 | +++ src/client/mesa/mesa_native_display_container.h 2013-12-18 14:40:47 +0000 |
3865 | @@ -16,8 +16,8 @@ |
3866 | * Authored by: Robert Carr <robert.carr@canonical.com> |
3867 | */ |
3868 | |
3869 | -#ifndef MIR_CLIENT_GBM_MESA_NATIVE_DISPLAY_CONTAINER_H_ |
3870 | -#define MIR_CLIENT_GBM_MESA_NATIVE_DISPLAY_CONTAINER_H_ |
3871 | +#ifndef MIR_CLIENT_MESA_MESA_NATIVE_DISPLAY_CONTAINER_H_ |
3872 | +#define MIR_CLIENT_MESA_MESA_NATIVE_DISPLAY_CONTAINER_H_ |
3873 | |
3874 | #include "../egl_native_display_container.h" |
3875 | |
3876 | @@ -31,7 +31,7 @@ |
3877 | { |
3878 | namespace client |
3879 | { |
3880 | -namespace gbm |
3881 | +namespace mesa |
3882 | { |
3883 | |
3884 | class MesaNativeDisplayContainer : public EGLNativeDisplayContainer |
3885 | @@ -60,4 +60,4 @@ |
3886 | } |
3887 | } // namespace mir |
3888 | |
3889 | -#endif // MIR_CLIENT_GBM_MESA_NATIVE_DISPLAY_CONTAINER_H_ |
3890 | +#endif // MIR_CLIENT_MESA_MESA_NATIVE_DISPLAY_CONTAINER_H_ |
3891 | |
3892 | === renamed file 'src/client/gbm/gbm_native_surface.cpp' => 'src/client/mesa/native_surface.cpp' |
3893 | --- src/client/gbm/gbm_native_surface.cpp 2013-06-28 00:25:30 +0000 |
3894 | +++ src/client/mesa/native_surface.cpp 2013-12-18 14:40:47 +0000 |
3895 | @@ -18,31 +18,31 @@ |
3896 | |
3897 | #include <cstring> |
3898 | #include "../client_buffer.h" |
3899 | -#include "gbm_native_surface.h" |
3900 | +#include "native_surface.h" |
3901 | |
3902 | -namespace mclg=mir::client::gbm; |
3903 | +namespace mclm=mir::client::mesa; |
3904 | |
3905 | namespace |
3906 | { |
3907 | static int advance_buffer_static(MirMesaEGLNativeSurface* surface, |
3908 | MirBufferPackage* buffer_package) |
3909 | { |
3910 | - auto s = static_cast<mclg::GBMNativeSurface*>(surface); |
3911 | + auto s = static_cast<mclm::NativeSurface*>(surface); |
3912 | return s->advance_buffer(buffer_package); |
3913 | } |
3914 | |
3915 | static int get_parameters_static(MirMesaEGLNativeSurface* surface, |
3916 | MirSurfaceParameters* surface_parameters) |
3917 | { |
3918 | - auto s = static_cast<mclg::GBMNativeSurface*>(surface); |
3919 | + auto s = static_cast<mclm::NativeSurface*>(surface); |
3920 | return s->get_parameters(surface_parameters); |
3921 | } |
3922 | |
3923 | static int set_swapinterval_static(MirMesaEGLNativeSurface* surface, int interval) |
3924 | { |
3925 | - auto s = static_cast<mclg::GBMNativeSurface*>(surface); |
3926 | + auto s = static_cast<mclm::NativeSurface*>(surface); |
3927 | return s->set_swapinterval(interval); |
3928 | -} |
3929 | +} |
3930 | |
3931 | static void buffer_advanced_callback(MirSurface* /* surface */, |
3932 | void* /* context */) |
3933 | @@ -50,15 +50,15 @@ |
3934 | } |
3935 | } |
3936 | |
3937 | -mclg::GBMNativeSurface::GBMNativeSurface(ClientSurface& surface) |
3938 | +mclm::NativeSurface::NativeSurface(ClientSurface& surface) |
3939 | : surface(surface) |
3940 | { |
3941 | - surface_advance_buffer = advance_buffer_static; |
3942 | - surface_get_parameters = get_parameters_static; |
3943 | - surface_set_swapinterval = set_swapinterval_static; |
3944 | + surface_advance_buffer = advance_buffer_static; |
3945 | + surface_get_parameters = get_parameters_static; |
3946 | + surface_set_swapinterval = set_swapinterval_static; |
3947 | } |
3948 | |
3949 | -int mclg::GBMNativeSurface::advance_buffer(MirBufferPackage* buffer_package) |
3950 | +int mclm::NativeSurface::advance_buffer(MirBufferPackage* buffer_package) |
3951 | { |
3952 | mir_wait_for(surface.next_buffer(buffer_advanced_callback, NULL)); |
3953 | auto buffer = surface.get_current_buffer(); |
3954 | @@ -68,18 +68,18 @@ |
3955 | return MIR_MESA_TRUE; |
3956 | } |
3957 | |
3958 | -int mclg::GBMNativeSurface::get_parameters(MirSurfaceParameters* surface_parameters) |
3959 | +int mclm::NativeSurface::get_parameters(MirSurfaceParameters* surface_parameters) |
3960 | { |
3961 | auto params = surface.get_parameters(); |
3962 | memcpy(surface_parameters, ¶ms, sizeof(MirSurfaceParameters)); |
3963 | return MIR_MESA_TRUE; |
3964 | } |
3965 | |
3966 | -int mclg::GBMNativeSurface::set_swapinterval(int interval) |
3967 | +int mclm::NativeSurface::set_swapinterval(int interval) |
3968 | { |
3969 | if ((interval < 0) || (interval > 1)) |
3970 | return MIR_MESA_FALSE; |
3971 | |
3972 | - mir_wait_for(surface.configure(mir_surface_attrib_swapinterval, interval)); |
3973 | + mir_wait_for(surface.configure(mir_surface_attrib_swapinterval, interval)); |
3974 | return MIR_MESA_TRUE; |
3975 | } |
3976 | |
3977 | === renamed file 'src/client/gbm/gbm_native_surface.h' => 'src/client/mesa/native_surface.h' |
3978 | --- src/client/gbm/gbm_native_surface.h 2013-06-28 00:05:44 +0000 |
3979 | +++ src/client/mesa/native_surface.h 2013-12-18 14:40:47 +0000 |
3980 | @@ -16,6 +16,9 @@ |
3981 | * Authored by: Kevin DuBois <kevin.dubois@canonical.com> |
3982 | */ |
3983 | |
3984 | +#ifndef MIR_CLIENT_MESA_NATIVE_SURFACES_H_ |
3985 | +#define MIR_CLIENT_MESA_NATIVE_SURFACES_H_ |
3986 | + |
3987 | #include "mir_toolkit/mesa/native_display.h" |
3988 | #include "../mir_client_surface.h" |
3989 | |
3990 | @@ -23,13 +26,13 @@ |
3991 | { |
3992 | namespace client |
3993 | { |
3994 | -namespace gbm |
3995 | +namespace mesa |
3996 | { |
3997 | |
3998 | -class GBMNativeSurface : public MirMesaEGLNativeSurface |
3999 | +class NativeSurface : public MirMesaEGLNativeSurface |
4000 | { |
4001 | public: |
4002 | - explicit GBMNativeSurface(ClientSurface&); |
4003 | + explicit NativeSurface(ClientSurface&); |
4004 | |
4005 | int advance_buffer(MirBufferPackage* buffer_package); |
4006 | int get_parameters(MirSurfaceParameters* surface_parameters); |
4007 | @@ -42,3 +45,5 @@ |
4008 | } |
4009 | } |
4010 | } |
4011 | + |
4012 | +#endif /* MIR_CLIENT_MESA_NATIVE_SURFACE_H_ */ |
4013 | |
4014 | === modified file 'src/client/mir_client_library.cpp' |
4015 | --- src/client/mir_client_library.cpp 2013-11-21 03:16:21 +0000 |
4016 | +++ src/client/mir_client_library.cpp 2013-12-18 14:40:47 +0000 |
4017 | @@ -176,9 +176,9 @@ |
4018 | return conn; |
4019 | } |
4020 | |
4021 | -int mir_connection_is_valid(MirConnection * connection) |
4022 | +MirBool mir_connection_is_valid(MirConnection * connection) |
4023 | { |
4024 | - return MirConnection::is_valid(connection); |
4025 | + return MirConnection::is_valid(connection) ? mir_true : mir_false; |
4026 | } |
4027 | |
4028 | char const * mir_connection_get_error_message(MirConnection * connection) |
4029 | @@ -266,12 +266,12 @@ |
4030 | |
4031 | int mir_debug_surface_id(MirSurface * surface) |
4032 | { |
4033 | - return surface->id(); |
4034 | + return surface->id(); |
4035 | } |
4036 | |
4037 | -int mir_surface_is_valid(MirSurface* surface) |
4038 | +MirBool mir_surface_is_valid(MirSurface* surface) |
4039 | { |
4040 | - return surface->is_valid(); |
4041 | + return surface->is_valid() ? mir_true : mir_false; |
4042 | } |
4043 | |
4044 | char const * mir_surface_get_error_message(MirSurface * surface) |
4045 | |
4046 | === modified file 'src/client/mir_connection.cpp' |
4047 | --- src/client/mir_connection.cpp 2013-11-21 03:16:21 +0000 |
4048 | +++ src/client/mir_connection.cpp 2013-12-18 14:40:47 +0000 |
4049 | @@ -370,7 +370,7 @@ |
4050 | for (auto i = 0u; i < valid_formats; i++) |
4051 | { |
4052 | formats[i] = static_cast<MirPixelFormat>(connect_result.surface_pixel_format(i)); |
4053 | - } |
4054 | + } |
4055 | } |
4056 | } |
4057 | |
4058 | @@ -458,11 +458,11 @@ |
4059 | { |
4060 | auto output = config->outputs[i]; |
4061 | auto display_request = request.add_display_output(); |
4062 | - display_request->set_output_id(output.output_id); |
4063 | - display_request->set_used(output.used); |
4064 | - display_request->set_current_mode(output.current_mode); |
4065 | - display_request->set_position_x(output.position_x); |
4066 | - display_request->set_position_y(output.position_y); |
4067 | + display_request->set_output_id(output.output_id); |
4068 | + display_request->set_used(output.used); |
4069 | + display_request->set_current_mode(output.current_mode); |
4070 | + display_request->set_position_x(output.position_x); |
4071 | + display_request->set_position_y(output.position_y); |
4072 | display_request->set_power_mode(output.power_mode); |
4073 | } |
4074 | |
4075 | |
4076 | === modified file 'src/client/mir_connection.h' |
4077 | --- src/client/mir_connection.h 2013-11-21 03:16:21 +0000 |
4078 | +++ src/client/mir_connection.h 2013-12-18 14:40:47 +0000 |
4079 | @@ -105,7 +105,7 @@ |
4080 | void register_display_change_callback(mir_display_config_callback callback, void* context); |
4081 | |
4082 | void populate(MirPlatformPackage& platform_package); |
4083 | - MirDisplayConfiguration* create_copy_of_display_config(); |
4084 | + MirDisplayConfiguration* create_copy_of_display_config(); |
4085 | void available_surface_formats(MirPixelFormat* formats, |
4086 | unsigned int formats_size, unsigned int& valid_formats); |
4087 | |
4088 | |
4089 | === modified file 'src/client/mir_surface.cpp' |
4090 | --- src/client/mir_surface.cpp 2013-11-21 03:16:21 +0000 |
4091 | +++ src/client/mir_surface.cpp 2013-12-18 14:40:47 +0000 |
4092 | @@ -52,7 +52,7 @@ |
4093 | message.set_pixel_format(params.pixel_format); |
4094 | message.set_buffer_usage(params.buffer_usage); |
4095 | message.set_output_id(params.output_id); |
4096 | - |
4097 | + |
4098 | server.create_surface(0, &message, &surface, gp::NewCallback(this, &MirSurface::created, callback, context)); |
4099 | |
4100 | for (int i = 0; i < mir_surface_attribs; i++) |
4101 | @@ -159,10 +159,10 @@ |
4102 | } |
4103 | |
4104 | /* todo: all these conversion functions are a bit of a kludge, probably |
4105 | - better to have a more developed geometry::PixelFormat that can handle this */ |
4106 | -geom::PixelFormat MirSurface::convert_ipc_pf_to_geometry(gp::int32 pf) |
4107 | + better to have a more developed MirPixelFormat that can handle this */ |
4108 | +MirPixelFormat MirSurface::convert_ipc_pf_to_geometry(gp::int32 pf) |
4109 | { |
4110 | - return static_cast<geom::PixelFormat>(pf); |
4111 | + return static_cast<MirPixelFormat>(pf); |
4112 | } |
4113 | |
4114 | void MirSurface::process_incoming_buffer() |
4115 | @@ -254,7 +254,7 @@ |
4116 | { |
4117 | std::lock_guard<std::recursive_mutex> lock(mutex); |
4118 | |
4119 | - return buffer_depository->current_buffer_id(); |
4120 | + return buffer_depository->current_buffer_id(); |
4121 | } |
4122 | |
4123 | void MirSurface::populate(MirBufferPackage& buffer_package) |
4124 | |
4125 | === modified file 'src/client/mir_surface.h' |
4126 | --- src/client/mir_surface.h 2013-11-21 03:16:21 +0000 |
4127 | +++ src/client/mir_surface.h 2013-12-18 14:40:47 +0000 |
4128 | @@ -20,7 +20,6 @@ |
4129 | |
4130 | #include "mir_protobuf.pb.h" |
4131 | |
4132 | -#include "mir/geometry/pixel_format.h" |
4133 | #include "mir/geometry/dimensions.h" |
4134 | #include "mir_toolkit/mir_client_library.h" |
4135 | #include "mir_toolkit/common.h" |
4136 | @@ -101,7 +100,7 @@ |
4137 | void populate(MirBufferPackage& buffer_package); |
4138 | void created(mir_surface_callback callback, void * context); |
4139 | void new_buffer(mir_surface_callback callback, void * context); |
4140 | - mir::geometry::PixelFormat convert_ipc_pf_to_geometry(google::protobuf::int32 pf); |
4141 | + MirPixelFormat convert_ipc_pf_to_geometry(google::protobuf::int32 pf); |
4142 | |
4143 | /* todo: race condition. protobuf does not guarantee that callbacks will be synchronized. potential |
4144 | race in surface, last_buffer_id */ |
4145 | |
4146 | === modified file 'src/client/rpc/mir_socket_rpc_channel.cpp' |
4147 | --- src/client/rpc/mir_socket_rpc_channel.cpp 2013-11-21 03:16:21 +0000 |
4148 | +++ src/client/rpc/mir_socket_rpc_channel.cpp 2013-12-18 14:40:47 +0000 |
4149 | @@ -415,7 +415,7 @@ |
4150 | { |
4151 | rpc_report->event_parsing_failed(event); |
4152 | } |
4153 | - } |
4154 | + } |
4155 | } |
4156 | } |
4157 | |
4158 | |
4159 | === modified file 'src/client/surface_map.cpp' |
4160 | --- src/client/surface_map.cpp 2013-11-20 17:13:18 +0000 |
4161 | +++ src/client/surface_map.cpp 2013-12-18 14:40:47 +0000 |
4162 | @@ -42,7 +42,7 @@ |
4163 | ss << __PRETTY_FUNCTION__ |
4164 | << "executed with non-existent surface ID " |
4165 | << surface_id << ".\n"; |
4166 | - |
4167 | + |
4168 | BOOST_THROW_EXCEPTION(std::runtime_error(ss.str())); |
4169 | } |
4170 | } |
4171 | @@ -50,11 +50,11 @@ |
4172 | void mcl::ConnectionSurfaceMap::insert(int const& surface_id, MirSurface* surface) |
4173 | { |
4174 | std::unique_lock<std::mutex> lk(guard); |
4175 | - surfaces[surface_id] = surface; |
4176 | + surfaces[surface_id] = surface; |
4177 | } |
4178 | |
4179 | void mcl::ConnectionSurfaceMap::erase(int surface_id) |
4180 | { |
4181 | std::unique_lock<std::mutex> lk(guard); |
4182 | - surfaces.erase(surface_id); |
4183 | + surfaces.erase(surface_id); |
4184 | } |
4185 | |
4186 | === modified file 'src/platform/graphics/CMakeLists.txt' |
4187 | --- src/platform/graphics/CMakeLists.txt 2013-11-21 03:16:21 +0000 |
4188 | +++ src/platform/graphics/CMakeLists.txt 2013-12-18 14:40:47 +0000 |
4189 | @@ -26,3 +26,13 @@ |
4190 | ) |
4191 | |
4192 | install(TARGETS mirplatform LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) |
4193 | + |
4194 | +if (MIR_PLATFORM STREQUAL "android") |
4195 | + include_directories(${LIBHARDWARE_INCLUDE_DIRS}) |
4196 | + add_subdirectory(android/) |
4197 | +endif() |
4198 | + |
4199 | +if (MIR_PLATFORM STREQUAL "mesa") |
4200 | + add_subdirectory(mesa/) |
4201 | +endif() |
4202 | + |
4203 | |
4204 | === renamed directory 'src/server/graphics/android' => 'src/platform/graphics/android' |
4205 | === modified file 'src/platform/graphics/android/android_alloc_adaptor.cpp' |
4206 | --- src/server/graphics/android/android_alloc_adaptor.cpp 2013-11-21 03:16:21 +0000 |
4207 | +++ src/platform/graphics/android/android_alloc_adaptor.cpp 2013-12-18 14:40:47 +0000 |
4208 | @@ -2,15 +2,15 @@ |
4209 | * Copyright © 2012 Canonical Ltd. |
4210 | * |
4211 | * This program is free software: you can redistribute it and/or modify it |
4212 | - * under the terms of the GNU General Public License version 3, |
4213 | + * under the terms of the GNU Lesser General Public License version 3, |
4214 | * as published by the Free Software Foundation. |
4215 | * |
4216 | * This program is distributed in the hope that it will be useful, |
4217 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
4218 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
4219 | - * GNU General Public License for more details. |
4220 | + * GNU Lesser General Public License for more details. |
4221 | * |
4222 | - * You should have received a copy of the GNU General Public License |
4223 | + * You should have received a copy of the GNU Lesser General Public License |
4224 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
4225 | * |
4226 | * Authored by: |
4227 | @@ -52,7 +52,7 @@ |
4228 | } |
4229 | |
4230 | std::shared_ptr<mg::NativeBuffer> mga::AndroidAllocAdaptor::alloc_buffer( |
4231 | - geometry::Size size, geometry::PixelFormat pf, BufferUsage usage) |
4232 | + geometry::Size size, MirPixelFormat pf, BufferUsage usage) |
4233 | { |
4234 | buffer_handle_t buf_handle = NULL; |
4235 | auto stride = 0; |
4236 | |
4237 | === modified file 'src/platform/graphics/android/android_alloc_adaptor.h' |
4238 | --- src/server/graphics/android/android_alloc_adaptor.h 2013-10-15 08:53:10 +0000 |
4239 | +++ src/platform/graphics/android/android_alloc_adaptor.h 2013-12-18 14:40:47 +0000 |
4240 | @@ -2,15 +2,15 @@ |
4241 | * Copyright © 2012 Canonical Ltd. |
4242 | * |
4243 | * This program is free software: you can redistribute it and/or modify it |
4244 | - * under the terms of the GNU General Public License version 3, |
4245 | + * under the terms of the GNU Lesser General Public License version 3, |
4246 | * as published by the Free Software Foundation. |
4247 | * |
4248 | * This program is distributed in the hope that it will be useful, |
4249 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
4250 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
4251 | - * GNU General Public License for more details. |
4252 | + * GNU Lesser General Public License for more details. |
4253 | * |
4254 | - * You should have received a copy of the GNU General Public License |
4255 | + * You should have received a copy of the GNU Lesser General Public License |
4256 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
4257 | * |
4258 | * Authored by: Kevin DuBois <kevin.dubois@canonical.com> |
4259 | @@ -36,7 +36,7 @@ |
4260 | public: |
4261 | explicit AndroidAllocAdaptor(const std::shared_ptr<struct alloc_device_t>& alloc_device); |
4262 | std::shared_ptr<NativeBuffer> alloc_buffer(geometry::Size, |
4263 | - geometry::PixelFormat, BufferUsage usage); |
4264 | + MirPixelFormat, BufferUsage usage); |
4265 | |
4266 | /* note: alloc_device_t has a third method (dump) that isn't needed by us. it can be used to check buffer contents */ |
4267 | |
4268 | |
4269 | === modified file 'src/platform/graphics/android/android_buffer_allocator.cpp' |
4270 | --- src/server/graphics/android/android_buffer_allocator.cpp 2013-11-21 03:16:21 +0000 |
4271 | +++ src/platform/graphics/android/android_buffer_allocator.cpp 2013-12-18 14:40:47 +0000 |
4272 | @@ -2,15 +2,15 @@ |
4273 | * Copyright © 2012 Canonical Ltd. |
4274 | * |
4275 | * This program is free software: you can redistribute it and/or modify it |
4276 | - * under the terms of the GNU General Public License version 3, |
4277 | + * under the terms of the GNU Lesser General Public License version 3, |
4278 | * as published by the Free Software Foundation. |
4279 | * |
4280 | * This program is distributed in the hope that it will be useful, |
4281 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
4282 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
4283 | - * GNU General Public License for more details. |
4284 | + * GNU Lesser General Public License for more details. |
4285 | * |
4286 | - * You should have received a copy of the GNU General Public License |
4287 | + * You should have received a copy of the GNU Lesser General Public License |
4288 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
4289 | * |
4290 | * Authored by: |
4291 | @@ -78,7 +78,7 @@ |
4292 | } |
4293 | |
4294 | std::shared_ptr<mg::Buffer> mga::AndroidGraphicBufferAllocator::alloc_buffer_platform( |
4295 | - geom::Size sz, geom::PixelFormat pf, mga::BufferUsage use) |
4296 | + geom::Size sz, MirPixelFormat pf, mga::BufferUsage use) |
4297 | { |
4298 | auto native_handle = alloc_device->alloc_buffer(sz, pf, use); |
4299 | auto buffer = std::make_shared<Buffer>(native_handle, egl_extensions); |
4300 | @@ -86,12 +86,12 @@ |
4301 | return buffer; |
4302 | } |
4303 | |
4304 | -std::vector<geom::PixelFormat> mga::AndroidGraphicBufferAllocator::supported_pixel_formats() |
4305 | +std::vector<MirPixelFormat> mga::AndroidGraphicBufferAllocator::supported_pixel_formats() |
4306 | { |
4307 | - static std::vector<geom::PixelFormat> const pixel_formats{ |
4308 | - geom::PixelFormat::abgr_8888, |
4309 | - geom::PixelFormat::xbgr_8888, |
4310 | - geom::PixelFormat::bgr_888 |
4311 | + static std::vector<MirPixelFormat> const pixel_formats{ |
4312 | + mir_pixel_format_abgr_8888, |
4313 | + mir_pixel_format_xbgr_8888, |
4314 | + mir_pixel_format_bgr_888 |
4315 | }; |
4316 | |
4317 | return pixel_formats; |
4318 | @@ -106,5 +106,5 @@ |
4319 | case mg::BufferUsage::hardware: |
4320 | default: |
4321 | return mga::BufferUsage::use_hardware; |
4322 | - } |
4323 | + } |
4324 | } |
4325 | |
4326 | === modified file 'src/platform/graphics/android/android_display.cpp' |
4327 | --- src/server/graphics/android/android_display.cpp 2013-11-21 17:20:14 +0000 |
4328 | +++ src/platform/graphics/android/android_display.cpp 2013-12-18 14:40:47 +0000 |
4329 | @@ -2,15 +2,15 @@ |
4330 | * Copyright © 2012 Canonical Ltd. |
4331 | * |
4332 | * This program is free software: you can redistribute it and/or modify it |
4333 | - * under the terms of the GNU General Public License version 3, |
4334 | + * under the terms of the GNU Lesser General Public License version 3, |
4335 | * as published by the Free Software Foundation. |
4336 | * |
4337 | * This program is distributed in the hope that it will be useful, |
4338 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
4339 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
4340 | - * GNU General Public License for more details. |
4341 | + * GNU Lesser General Public License for more details. |
4342 | * |
4343 | - * You should have received a copy of the GNU General Public License |
4344 | + * You should have received a copy of the GNU Lesser General Public License |
4345 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
4346 | * |
4347 | * Authored by: Kevin DuBois <kevin.dubois@canonical.com> |
4348 | |
4349 | === modified file 'src/platform/graphics/android/android_display.h' |
4350 | --- src/server/graphics/android/android_display.h 2013-11-21 17:20:14 +0000 |
4351 | +++ src/platform/graphics/android/android_display.h 2013-12-18 14:40:47 +0000 |
4352 | @@ -2,15 +2,15 @@ |
4353 | * Copyright © 2012 Canonical Ltd. |
4354 | * |
4355 | * This program is free software: you can redistribute it and/or modify it |
4356 | - * under the terms of the GNU General Public License version 3, |
4357 | + * under the terms of the GNU Lesser General Public License version 3, |
4358 | * as published by the Free Software Foundation. |
4359 | * |
4360 | * This program is distributed in the hope that it will be useful, |
4361 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
4362 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
4363 | - * GNU General Public License for more details. |
4364 | + * GNU Lesser General Public License for more details. |
4365 | * |
4366 | - * You should have received a copy of the GNU General Public License |
4367 | + * You should have received a copy of the GNU Lesser General Public License |
4368 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
4369 | * |
4370 | * Authored by: Kevin DuBois <kevin.dubois@canonical.com> |
4371 | @@ -71,7 +71,7 @@ |
4372 | GLContext gl_context; |
4373 | std::shared_ptr<DisplayDevice> const display_device; |
4374 | //we only have a primary display at the moment |
4375 | - std::unique_ptr<graphics::DisplayBuffer> const display_buffer; |
4376 | + std::unique_ptr<graphics::DisplayBuffer> const display_buffer; |
4377 | AndroidDisplayConfiguration current_configuration; |
4378 | }; |
4379 | |
4380 | |
4381 | === modified file 'src/platform/graphics/android/android_display_configuration.cpp' |
4382 | --- src/server/graphics/android/android_display_configuration.cpp 2013-09-12 23:48:21 +0000 |
4383 | +++ src/platform/graphics/android/android_display_configuration.cpp 2013-12-18 14:40:47 +0000 |
4384 | @@ -2,15 +2,15 @@ |
4385 | * Copyright © 2013 Canonical Ltd. |
4386 | * |
4387 | * This program is free software: you can redistribute it and/or modify it |
4388 | - * under the terms of the GNU General Public License version 3, |
4389 | + * under the terms of the GNU Lesser General Public License version 3, |
4390 | * as published by the Free Software Foundation. |
4391 | * |
4392 | * This program is distributed in the hope that it will be useful, |
4393 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
4394 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
4395 | - * GNU General Public License for more details. |
4396 | + * GNU Lesser General Public License for more details. |
4397 | * |
4398 | - * You should have received a copy of the GNU General Public License |
4399 | + * You should have received a copy of the GNU Lesser General Public License |
4400 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
4401 | */ |
4402 | |
4403 | @@ -24,7 +24,7 @@ |
4404 | : configuration{mg::DisplayConfigurationOutputId{1}, |
4405 | mg::DisplayConfigurationCardId{0}, |
4406 | mg::DisplayConfigurationOutputType::lvds, |
4407 | - {geom::PixelFormat::abgr_8888}, |
4408 | + {mir_pixel_format_abgr_8888}, |
4409 | {mg::DisplayConfigurationMode{display_size,0.0f}}, |
4410 | 0, |
4411 | geom::Size{0,0}, |
4412 | |
4413 | === modified file 'src/platform/graphics/android/android_display_configuration.h' |
4414 | --- src/server/graphics/android/android_display_configuration.h 2013-09-12 23:48:21 +0000 |
4415 | +++ src/platform/graphics/android/android_display_configuration.h 2013-12-18 14:40:47 +0000 |
4416 | @@ -2,15 +2,15 @@ |
4417 | * Copyright © 2013 Canonical Ltd. |
4418 | * |
4419 | * This program is free software: you can redistribute it and/or modify it |
4420 | - * under the terms of the GNU General Public License version 3, |
4421 | + * under the terms of the GNU Lesser General Public License version 3, |
4422 | * as published by the Free Software Foundation. |
4423 | * |
4424 | * This program is distributed in the hope that it will be useful, |
4425 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
4426 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
4427 | - * GNU General Public License for more details. |
4428 | + * GNU Lesser General Public License for more details. |
4429 | * |
4430 | - * You should have received a copy of the GNU General Public License |
4431 | + * You should have received a copy of the GNU Lesser General Public License |
4432 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
4433 | */ |
4434 | |
4435 | @@ -32,7 +32,7 @@ |
4436 | AndroidDisplayConfiguration(geometry::Size const& display_size); |
4437 | AndroidDisplayConfiguration(AndroidDisplayConfiguration const& other); |
4438 | AndroidDisplayConfiguration& operator=(AndroidDisplayConfiguration const& other); |
4439 | - |
4440 | + |
4441 | virtual ~AndroidDisplayConfiguration() = default; |
4442 | |
4443 | void for_each_card(std::function<void(DisplayConfigurationCard const&)> f) const; |
4444 | |
4445 | === modified file 'src/platform/graphics/android/android_format_conversion-inl.h' |
4446 | --- src/server/graphics/android/android_format_conversion-inl.h 2013-04-19 15:58:22 +0000 |
4447 | +++ src/platform/graphics/android/android_format_conversion-inl.h 2013-12-18 14:40:47 +0000 |
4448 | @@ -2,15 +2,15 @@ |
4449 | * Copyright © 2013 Canonical Ltd. |
4450 | * |
4451 | * This program is free software: you can redistribute it and/or modify it |
4452 | - * under the terms of the GNU General Public License version 3, |
4453 | + * under the terms of the GNU Lesser General Public License version 3, |
4454 | * as published by the Free Software Foundation. |
4455 | * |
4456 | * This program is distributed in the hope that it will be useful, |
4457 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
4458 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
4459 | - * GNU General Public License for more details. |
4460 | + * GNU Lesser General Public License for more details. |
4461 | * |
4462 | - * You should have received a copy of the GNU General Public License |
4463 | + * You should have received a copy of the GNU Lesser General Public License |
4464 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
4465 | * |
4466 | * Authored by: Kevin DuBois <kevin.dubois@canonical.com> |
4467 | @@ -19,7 +19,7 @@ |
4468 | #ifndef MIR_GRAPHICS_ANDROID_ANDROID_FORMAT_CONVERSION_INL_H_ |
4469 | #define MIR_GRAPHICS_ANDROID_ANDROID_FORMAT_CONVERSION_INL_H_ |
4470 | |
4471 | -#include "mir/geometry/pixel_format.h" |
4472 | +#include "mir_toolkit/common.h" |
4473 | #include <system/graphics.h> |
4474 | |
4475 | namespace mir |
4476 | @@ -29,39 +29,39 @@ |
4477 | namespace android |
4478 | { |
4479 | |
4480 | -inline static int to_android_format(geometry::PixelFormat format) |
4481 | +inline static int to_android_format(MirPixelFormat format) |
4482 | { |
4483 | switch(format) |
4484 | { |
4485 | - case geometry::PixelFormat::abgr_8888: |
4486 | + case mir_pixel_format_abgr_8888: |
4487 | return HAL_PIXEL_FORMAT_RGBA_8888; |
4488 | - case geometry::PixelFormat::xbgr_8888: |
4489 | + case mir_pixel_format_xbgr_8888: |
4490 | return HAL_PIXEL_FORMAT_RGBX_8888; |
4491 | - case geometry::PixelFormat::argb_8888: |
4492 | - return HAL_PIXEL_FORMAT_BGRA_8888; |
4493 | - case geometry::PixelFormat::xrgb_8888: |
4494 | - return HAL_PIXEL_FORMAT_BGRA_8888; |
4495 | - case geometry::PixelFormat::bgr_888: |
4496 | + case mir_pixel_format_argb_8888: |
4497 | + return HAL_PIXEL_FORMAT_BGRA_8888; |
4498 | + case mir_pixel_format_xrgb_8888: |
4499 | + return HAL_PIXEL_FORMAT_BGRA_8888; |
4500 | + case mir_pixel_format_bgr_888: |
4501 | return HAL_PIXEL_FORMAT_RGB_888; |
4502 | default: |
4503 | return 0; |
4504 | } |
4505 | } |
4506 | |
4507 | -inline static mir::geometry::PixelFormat to_mir_format(int format) |
4508 | +inline static MirPixelFormat to_mir_format(int format) |
4509 | { |
4510 | switch(format) |
4511 | { |
4512 | case HAL_PIXEL_FORMAT_RGBA_8888: |
4513 | - return geometry::PixelFormat::abgr_8888; |
4514 | + return mir_pixel_format_abgr_8888; |
4515 | case HAL_PIXEL_FORMAT_RGBX_8888: |
4516 | - return geometry::PixelFormat::xbgr_8888; |
4517 | + return mir_pixel_format_xbgr_8888; |
4518 | case HAL_PIXEL_FORMAT_BGRA_8888: |
4519 | - return geometry::PixelFormat::argb_8888; |
4520 | + return mir_pixel_format_argb_8888; |
4521 | case HAL_PIXEL_FORMAT_RGB_888: |
4522 | - return geometry::PixelFormat::bgr_888; |
4523 | + return mir_pixel_format_bgr_888; |
4524 | default: |
4525 | - return geometry::PixelFormat::invalid; |
4526 | + return mir_pixel_format_invalid; |
4527 | } |
4528 | } |
4529 | |
4530 | |
4531 | === modified file 'src/platform/graphics/android/android_graphic_buffer_allocator.h' |
4532 | --- src/server/graphics/android/android_graphic_buffer_allocator.h 2013-11-21 03:16:21 +0000 |
4533 | +++ src/platform/graphics/android/android_graphic_buffer_allocator.h 2013-12-18 14:40:47 +0000 |
4534 | @@ -2,15 +2,15 @@ |
4535 | * Copyright © 2012 Canonical Ltd. |
4536 | * |
4537 | * This program is free software: you can redistribute it and/or modify it |
4538 | - * under the terms of the GNU General Public License version 3, |
4539 | + * under the terms of the GNU Lesser General Public License version 3, |
4540 | * as published by the Free Software Foundation. |
4541 | * |
4542 | * This program is distributed in the hope that it will be useful, |
4543 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
4544 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
4545 | - * GNU General Public License for more details. |
4546 | + * GNU Lesser General Public License for more details. |
4547 | * |
4548 | - * You should have received a copy of the GNU General Public License |
4549 | + * You should have received a copy of the GNU Lesser General Public License |
4550 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
4551 | * |
4552 | * Authored by: |
4553 | @@ -49,9 +49,9 @@ |
4554 | graphics::BufferProperties const& buffer_properties); |
4555 | |
4556 | std::shared_ptr<graphics::Buffer> alloc_buffer_platform( |
4557 | - geometry::Size sz, geometry::PixelFormat pf, BufferUsage use); |
4558 | + geometry::Size sz, MirPixelFormat pf, BufferUsage use); |
4559 | |
4560 | - std::vector<geometry::PixelFormat> supported_pixel_formats(); |
4561 | + std::vector<MirPixelFormat> supported_pixel_formats(); |
4562 | |
4563 | static BufferUsage convert_from_compositor_usage(graphics::BufferUsage usage); |
4564 | |
4565 | |
4566 | === modified file 'src/platform/graphics/android/android_platform.cpp' |
4567 | --- src/server/graphics/android/android_platform.cpp 2013-11-21 17:20:14 +0000 |
4568 | +++ src/platform/graphics/android/android_platform.cpp 2013-12-18 14:40:47 +0000 |
4569 | @@ -2,15 +2,15 @@ |
4570 | * Copyright © 2012 Canonical Ltd. |
4571 | * |
4572 | * This program is free software: you can redistribute it and/or modify it |
4573 | - * under the terms of the GNU General Public License version 3, |
4574 | + * under the terms of the GNU Lesser General Public License version 3, |
4575 | * as published by the Free Software Foundation. |
4576 | * |
4577 | * This program is distributed in the hope that it will be useful, |
4578 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
4579 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
4580 | - * GNU General Public License for more details. |
4581 | + * GNU Lesser General Public License for more details. |
4582 | * |
4583 | - * You should have received a copy of the GNU General Public License |
4584 | + * You should have received a copy of the GNU Lesser General Public License |
4585 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
4586 | * |
4587 | * Authored by: |
4588 | @@ -77,7 +77,7 @@ |
4589 | auto buffer_handle = native_buffer->handle(); |
4590 | |
4591 | int offset = 0; |
4592 | - |
4593 | + |
4594 | for(auto i=0; i<buffer_handle->numFds; i++) |
4595 | { |
4596 | packer->pack_fd(buffer_handle->data[offset++]); |
4597 | @@ -119,11 +119,7 @@ |
4598 | |
4599 | extern "C" std::shared_ptr<mg::NativePlatform> create_native_platform(std::shared_ptr<mg::DisplayReport> const& display_report) |
4600 | { |
4601 | - auto should_use_fb_fallback = false; |
4602 | - auto buffer_initializer = std::make_shared<mg::NullBufferInitializer>(); |
4603 | - auto fb_allocator = std::make_shared<mga::AndroidGraphicBufferAllocator>(buffer_initializer); |
4604 | - auto display_resource_factory = std::make_shared<mga::ResourceFactory>(); |
4605 | - auto display_builder = std::make_shared<mga::OutputBuilder>( |
4606 | - fb_allocator, display_resource_factory, display_report, should_use_fb_fallback); |
4607 | - return std::make_shared<mga::AndroidPlatform>(display_builder, display_report); |
4608 | + //TODO: remove nullptr parameter once platform classes are sorted. |
4609 | + // mg::NativePlatform cannot create a display anyways, so it doesnt need a display builder |
4610 | + return std::make_shared<mga::AndroidPlatform>(nullptr, display_report); |
4611 | } |
4612 | |
4613 | === modified file 'src/platform/graphics/android/android_platform.h' |
4614 | --- src/server/graphics/android/android_platform.h 2013-11-21 17:20:14 +0000 |
4615 | +++ src/platform/graphics/android/android_platform.h 2013-12-18 14:40:47 +0000 |
4616 | @@ -2,15 +2,15 @@ |
4617 | * Copyright © 2012 Canonical Ltd. |
4618 | * |
4619 | * This program is free software: you can redistribute it and/or modify it |
4620 | - * under the terms of the GNU General Public License version 3, |
4621 | + * under the terms of the GNU Lesser General Public License version 3, |
4622 | * as published by the Free Software Foundation. |
4623 | * |
4624 | * This program is distributed in the hope that it will be useful, |
4625 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
4626 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
4627 | - * GNU General Public License for more details. |
4628 | + * GNU Lesser General Public License for more details. |
4629 | * |
4630 | - * You should have received a copy of the GNU General Public License |
4631 | + * You should have received a copy of the GNU Lesser General Public License |
4632 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
4633 | * |
4634 | * Authored by: Alexandros Frantzis <alexandros.frantzis@canonical.com> |
4635 | |
4636 | === modified file 'src/platform/graphics/android/buffer.cpp' |
4637 | --- src/server/graphics/android/buffer.cpp 2013-10-15 08:53:10 +0000 |
4638 | +++ src/platform/graphics/android/buffer.cpp 2013-12-18 14:40:47 +0000 |
4639 | @@ -2,15 +2,15 @@ |
4640 | * Copyright © 2012 Canonical Ltd. |
4641 | * |
4642 | * This program is free software: you can redistribute it and/or modify it |
4643 | - * under the terms of the GNU General Public License version 3, |
4644 | + * under the terms of the GNU Lesser General Public License version 3, |
4645 | * as published by the Free Software Foundation. |
4646 | * |
4647 | * This program is distributed in the hope that it will be useful, |
4648 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
4649 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
4650 | - * GNU General Public License for more details. |
4651 | + * GNU Lesser General Public License for more details. |
4652 | * |
4653 | - * You should have received a copy of the GNU General Public License |
4654 | + * You should have received a copy of the GNU Lesser General Public License |
4655 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
4656 | * |
4657 | * Authored by: |
4658 | @@ -60,10 +60,10 @@ |
4659 | { |
4660 | ANativeWindowBuffer *anwb = native_buffer->anwb(); |
4661 | return geom::Stride{anwb->stride * |
4662 | - geom::bytes_per_pixel(pixel_format())}; |
4663 | + MIR_BYTES_PER_PIXEL(pixel_format())}; |
4664 | } |
4665 | |
4666 | -geom::PixelFormat mga::Buffer::pixel_format() const |
4667 | +MirPixelFormat mga::Buffer::pixel_format() const |
4668 | { |
4669 | ANativeWindowBuffer *anwb = native_buffer->anwb(); |
4670 | return mga::to_mir_format(anwb->format); |
4671 | @@ -123,7 +123,7 @@ |
4672 | content_lock.unlock(); |
4673 | }); |
4674 | |
4675 | - //lock remains in effect until the native handle is released |
4676 | + //lock remains in effect until the native handle is released |
4677 | lk.release(); |
4678 | return native_resource; |
4679 | } |
4680 | |
4681 | === modified file 'src/platform/graphics/android/buffer.h' |
4682 | --- src/server/graphics/android/buffer.h 2013-10-15 08:53:10 +0000 |
4683 | +++ src/platform/graphics/android/buffer.h 2013-12-18 14:40:47 +0000 |
4684 | @@ -2,15 +2,15 @@ |
4685 | * Copyright © 2012,2013 Canonical Ltd. |
4686 | * |
4687 | * This program is free software: you can redistribute it and/or modify it |
4688 | - * under the terms of the GNU General Public License version 3, |
4689 | + * under the terms of the GNU Lesser General Public License version 3, |
4690 | * as published by the Free Software Foundation. |
4691 | * |
4692 | * This program is distributed in the hope that it will be useful, |
4693 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
4694 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
4695 | - * GNU General Public License for more details. |
4696 | + * GNU Lesser General Public License for more details. |
4697 | * |
4698 | - * You should have received a copy of the GNU General Public License |
4699 | + * You should have received a copy of the GNU Lesser General Public License |
4700 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
4701 | * |
4702 | * Authored by: |
4703 | @@ -49,7 +49,7 @@ |
4704 | |
4705 | geometry::Size size() const; |
4706 | geometry::Stride stride() const; |
4707 | - geometry::PixelFormat pixel_format() const; |
4708 | + MirPixelFormat pixel_format() const; |
4709 | void bind_to_texture(); |
4710 | bool can_bypass() const override; |
4711 | |
4712 | |
4713 | === modified file 'src/platform/graphics/android/buffer_usage.h' |
4714 | --- src/server/graphics/android/buffer_usage.h 2013-05-21 21:51:13 +0000 |
4715 | +++ src/platform/graphics/android/buffer_usage.h 2013-12-18 14:40:47 +0000 |
4716 | @@ -2,15 +2,15 @@ |
4717 | * Copyright © 2013 Canonical Ltd. |
4718 | * |
4719 | * This program is free software: you can redistribute it and/or modify it |
4720 | - * under the terms of the GNU General Public License version 3, |
4721 | + * under the terms of the GNU Lesser General Public License version 3, |
4722 | * as published by the Free Software Foundation. |
4723 | * |
4724 | * This program is distributed in the hope that it will be useful, |
4725 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
4726 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
4727 | - * GNU General Public License for more details. |
4728 | + * GNU Lesser General Public License for more details. |
4729 | * |
4730 | - * You should have received a copy of the GNU General Public License |
4731 | + * You should have received a copy of the GNU Lesser General Public License |
4732 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
4733 | * |
4734 | * Authored by: Kevin DuBois <kevin.dubois@canonical.com> |
4735 | |
4736 | === modified file 'src/platform/graphics/android/display_buffer.cpp' |
4737 | --- src/server/graphics/android/display_buffer.cpp 2013-11-19 19:59:27 +0000 |
4738 | +++ src/platform/graphics/android/display_buffer.cpp 2013-12-18 14:40:47 +0000 |
4739 | @@ -2,15 +2,15 @@ |
4740 | * Copyright © 2013 Canonical Ltd. |
4741 | * |
4742 | * This program is free software: you can redistribute it and/or modify it |
4743 | - * under the terms of the GNU General Public License version 3, |
4744 | + * under the terms of the GNU Lesser General Public License version 3, |
4745 | * as published by the Free Software Foundation. |
4746 | * |
4747 | * This program is distributed in the hope that it will be useful, |
4748 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
4749 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
4750 | - * GNU General Public License for more details. |
4751 | + * GNU Lesser General Public License for more details. |
4752 | * |
4753 | - * You should have received a copy of the GNU General Public License |
4754 | + * You should have received a copy of the GNU Lesser General Public License |
4755 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
4756 | * |
4757 | * Authored by: Kevin DuBois <kevin.dubois@canonical.com> |
4758 | |
4759 | === modified file 'src/platform/graphics/android/display_buffer.h' |
4760 | --- src/server/graphics/android/display_buffer.h 2013-11-18 22:44:06 +0000 |
4761 | +++ src/platform/graphics/android/display_buffer.h 2013-12-18 14:40:47 +0000 |
4762 | @@ -2,15 +2,15 @@ |
4763 | * Copyright © 2013 Canonical Ltd. |
4764 | * |
4765 | * This program is free software: you can redistribute it and/or modify it |
4766 | - * under the terms of the GNU General Public License version 3, |
4767 | + * under the terms of the GNU Lesser General Public License version 3, |
4768 | * as published by the Free Software Foundation. |
4769 | * |
4770 | * This program is distributed in the hope that it will be useful, |
4771 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
4772 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
4773 | - * GNU General Public License for more details. |
4774 | + * GNU Lesser General Public License for more details. |
4775 | * |
4776 | - * You should have received a copy of the GNU General Public License |
4777 | + * You should have received a copy of the GNU Lesser General Public License |
4778 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
4779 | * |
4780 | * Authored by: Kevin DuBois <kevin.dubois@canonical.com> |
4781 | @@ -46,7 +46,7 @@ |
4782 | void release_current(); |
4783 | void post_update(); |
4784 | bool can_bypass() const override; |
4785 | - |
4786 | + |
4787 | private: |
4788 | std::shared_ptr<FramebufferBundle> const fb_bundle; |
4789 | std::shared_ptr<DisplayDevice> const display_device; |
4790 | |
4791 | === modified file 'src/platform/graphics/android/display_builder.h' |
4792 | --- src/server/graphics/android/display_builder.h 2013-11-21 17:20:14 +0000 |
4793 | +++ src/platform/graphics/android/display_builder.h 2013-12-18 14:40:47 +0000 |
4794 | @@ -2,15 +2,15 @@ |
4795 | * Copyright © 2013 Canonical Ltd. |
4796 | * |
4797 | * This program is free software: you can redistribute it and/or modify it |
4798 | - * under the terms of the GNU General Public License version 3, |
4799 | + * under the terms of the GNU Lesser General Public License version 3, |
4800 | * as published by the Free Software Foundation. |
4801 | * |
4802 | * This program is distributed in the hope that it will be useful, |
4803 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
4804 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
4805 | - * GNU General Public License for more details. |
4806 | + * GNU Lesser General Public License for more details. |
4807 | * |
4808 | - * You should have received a copy of the GNU General Public License |
4809 | + * You should have received a copy of the GNU Lesser General Public License |
4810 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
4811 | * |
4812 | * Authored by: Alexandros Frantzis <alexandros.frantzis@canonical.com> |
4813 | @@ -20,7 +20,7 @@ |
4814 | #define MIR_GRAPHICS_ANDROID_DISPLAY_BUILDER_H_ |
4815 | |
4816 | #include "mir/graphics/display_buffer.h" |
4817 | -#include "mir/geometry/pixel_format.h" |
4818 | +#include "mir_toolkit/common.h" |
4819 | #include <memory> |
4820 | |
4821 | namespace mir |
4822 | @@ -37,7 +37,7 @@ |
4823 | public: |
4824 | virtual ~DisplayBuilder() = default; |
4825 | |
4826 | - virtual geometry::PixelFormat display_format() = 0; |
4827 | + virtual MirPixelFormat display_format() = 0; |
4828 | virtual std::shared_ptr<DisplayDevice> create_display_device() = 0; |
4829 | virtual std::unique_ptr<graphics::DisplayBuffer> create_display_buffer( |
4830 | std::shared_ptr<DisplayDevice> const& display_device, |
4831 | |
4832 | === modified file 'src/platform/graphics/android/display_device.h' |
4833 | --- src/server/graphics/android/display_device.h 2013-11-21 17:20:14 +0000 |
4834 | +++ src/platform/graphics/android/display_device.h 2013-12-18 14:40:47 +0000 |
4835 | @@ -2,15 +2,15 @@ |
4836 | * Copyright © 2013 Canonical Ltd. |
4837 | * |
4838 | * This program is free software: you can redistribute it and/or modify |
4839 | - * it under the terms of the GNU General Public License version 3 as |
4840 | + * it under the terms of the GNU Lesser General Public License version 3 as |
4841 | * published by the Free Software Foundation. |
4842 | * |
4843 | * This program is distributed in the hope that it will be useful, |
4844 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
4845 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
4846 | - * GNU General Public License for more details. |
4847 | + * GNU Lesser General Public License for more details. |
4848 | * |
4849 | - * You should have received a copy of the GNU General Public License |
4850 | + * You should have received a copy of the GNU Lesser General Public License |
4851 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
4852 | * |
4853 | * Authored by: Kevin DuBois <kevin.dubois@canonical.com> |
4854 | @@ -38,7 +38,7 @@ |
4855 | |
4856 | virtual void mode(MirPowerMode mode) = 0; |
4857 | virtual void prepare_composition() = 0; |
4858 | - virtual void gpu_render(EGLDisplay dpy, EGLSurface sur) = 0; |
4859 | + virtual void gpu_render(EGLDisplay dpy, EGLSurface sur) = 0; |
4860 | virtual void post(Buffer const& buffer) = 0; |
4861 | |
4862 | protected: |
4863 | |
4864 | === modified file 'src/platform/graphics/android/display_resource_factory.h' |
4865 | --- src/server/graphics/android/display_resource_factory.h 2013-11-21 17:20:14 +0000 |
4866 | +++ src/platform/graphics/android/display_resource_factory.h 2013-12-18 14:40:47 +0000 |
4867 | @@ -2,15 +2,15 @@ |
4868 | * Copyright © 2013 Canonical Ltd. |
4869 | * |
4870 | * This program is free software: you can redistribute it and/or modify |
4871 | - * it under the terms of the GNU General Public License version 3 as |
4872 | + * it under the terms of the GNU Lesser General Public License version 3 as |
4873 | * published by the Free Software Foundation. |
4874 | * |
4875 | * This program is distributed in the hope that it will be useful, |
4876 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
4877 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
4878 | - * GNU General Public License for more details. |
4879 | + * GNU Lesser General Public License for more details. |
4880 | * |
4881 | - * You should have received a copy of the GNU General Public License |
4882 | + * You should have received a copy of the GNU Lesser General Public License |
4883 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
4884 | * |
4885 | * Authored by: Kevin DuBois <kevin.dubois@canonical.com> |
4886 | |
4887 | === modified file 'src/platform/graphics/android/fb_device.cpp' |
4888 | --- src/server/graphics/android/fb_device.cpp 2013-11-21 17:20:14 +0000 |
4889 | +++ src/platform/graphics/android/fb_device.cpp 2013-12-18 14:40:47 +0000 |
4890 | @@ -2,15 +2,15 @@ |
4891 | * Copyright © 2013 Canonical Ltd. |
4892 | * |
4893 | * This program is free software: you can redistribute it and/or modify it |
4894 | - * under the terms of the GNU General Public License version 3, |
4895 | + * under the terms of the GNU Lesser General Public License version 3, |
4896 | * as published by the Free Software Foundation. |
4897 | * |
4898 | * This program is distributed in the hope that it will be useful, |
4899 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
4900 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
4901 | - * GNU General Public License for more details. |
4902 | + * GNU Lesser General Public License for more details. |
4903 | * |
4904 | - * You should have received a copy of the GNU General Public License |
4905 | + * You should have received a copy of the GNU Lesser General Public License |
4906 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
4907 | * |
4908 | * Authored by: Kevin DuBois <kevin.dubois@canonical.com> |
4909 | @@ -39,6 +39,8 @@ |
4910 | { |
4911 | fb_device->setSwapInterval(fb_device.get(), 1); |
4912 | } |
4913 | + |
4914 | + mode(mir_power_mode_on); |
4915 | } |
4916 | |
4917 | void mga::FBDevice::prepare_composition() |
4918 | @@ -65,6 +67,14 @@ |
4919 | |
4920 | void mga::FBDevice::mode(MirPowerMode mode) |
4921 | { |
4922 | - // TODO: Implement |
4923 | - (void) mode; |
4924 | + int enable = 0; |
4925 | + if (mode == mir_power_mode_on) |
4926 | + { |
4927 | + enable = 1; |
4928 | + } |
4929 | + |
4930 | + if (fb_device->enableScreen) |
4931 | + { |
4932 | + fb_device->enableScreen(fb_device.get(), enable); |
4933 | + } |
4934 | } |
4935 | |
4936 | === modified file 'src/platform/graphics/android/fb_device.h' |
4937 | --- src/server/graphics/android/fb_device.h 2013-11-21 17:20:14 +0000 |
4938 | +++ src/platform/graphics/android/fb_device.h 2013-12-18 14:40:47 +0000 |
4939 | @@ -2,15 +2,15 @@ |
4940 | * Copyright © 2013 Canonical Ltd. |
4941 | * |
4942 | * This program is free software: you can redistribute it and/or modify it |
4943 | - * under the terms of the GNU General Public License version 3, |
4944 | + * under the terms of the GNU Lesser General Public License version 3, |
4945 | * as published by the Free Software Foundation. |
4946 | * |
4947 | * This program is distributed in the hope that it will be useful, |
4948 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
4949 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
4950 | - * GNU General Public License for more details. |
4951 | + * GNU Lesser General Public License for more details. |
4952 | * |
4953 | - * You should have received a copy of the GNU General Public License |
4954 | + * You should have received a copy of the GNU Lesser General Public License |
4955 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
4956 | * |
4957 | * Authored by: Kevin DuBois <kevin.dubois@canonical.com> |
4958 | @@ -22,7 +22,7 @@ |
4959 | #include "display_device.h" |
4960 | #include <hardware/gralloc.h> |
4961 | #include <hardware/fb.h> |
4962 | - |
4963 | + |
4964 | namespace mir |
4965 | { |
4966 | namespace graphics |
4967 | @@ -30,14 +30,14 @@ |
4968 | namespace android |
4969 | { |
4970 | |
4971 | -class FBDevice : public DisplayDevice |
4972 | +class FBDevice : public DisplayDevice |
4973 | { |
4974 | public: |
4975 | FBDevice(std::shared_ptr<framebuffer_device_t> const& fbdev); |
4976 | |
4977 | void mode(MirPowerMode mode); |
4978 | void prepare_composition(); |
4979 | - void gpu_render(EGLDisplay dpy, EGLSurface sur); |
4980 | + void gpu_render(EGLDisplay dpy, EGLSurface sur); |
4981 | void post(Buffer const& buffer); |
4982 | |
4983 | private: |
4984 | |
4985 | === modified file 'src/platform/graphics/android/framebuffer_bundle.h' |
4986 | --- src/server/graphics/android/framebuffer_bundle.h 2013-11-21 17:20:14 +0000 |
4987 | +++ src/platform/graphics/android/framebuffer_bundle.h 2013-12-18 14:40:47 +0000 |
4988 | @@ -2,15 +2,15 @@ |
4989 | * Copyright © 2013 Canonical Ltd. |
4990 | * |
4991 | * This program is free software: you can redistribute it and/or modify it |
4992 | - * under the terms of the GNU General Public License version 3, |
4993 | + * under the terms of the GNU Lesser General Public License version 3, |
4994 | * as published by the Free Software Foundation. |
4995 | * |
4996 | * This program is distributed in the hope that it will be useful, |
4997 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
4998 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
4999 | - * GNU General Public License for more details. |
5000 | + * GNU Lesser General Public License for more details. |
target mir/devel