Mir

Merge lp:~raof/mir/check-for-surfaceless into lp:mir/0.1

Proposed by Chris Halse Rogers
Status: Superseded
Proposed branch: lp:~raof/mir/check-for-surfaceless
Merge into: lp:mir/0.1
Diff against target: 23061 lines (+4291/-3934)
464 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)
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/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_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/-4)
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/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 (+3/-3)
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/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)
native-compile.sh (+3/-3)
src/client/CMakeLists.txt (+6/-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 (+1/-1)
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 (+1/-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 (+9/-3)
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/display_report.cpp (+1/-1)
src/server/logging/input_report.cpp (+5/-5)
src/server/scene/CMakeLists.txt (+1/-1)
src/server/scene/application_session.cpp (+3/-3)
src/server/scene/basic_surface.cpp (+32/-43)
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/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_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/-2)
src/server/scene/surface_stack.h (+6/-6)
src/server/scene/surface_state.h (+2/-2)
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/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)
tests/CMakeLists.txt (+3/-6)
tests/acceptance-tests/CMakeLists.txt (+15/-4)
tests/acceptance-tests/test_client_authorization.cpp (+12/-9)
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 (+2/-2)
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 (+6/-6)
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 (+10/-10)
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 (+1/-1)
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/input_testing_client_configuration.cpp (+89/-0)
tests/mir_test_framework/input_testing_server_options.cpp (+1/-1)
tests/mir_test_framework/testing_client_options.cpp (+4/-4)
tests/mir_test_framework/testing_server_options.cpp (+6/-7)
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_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 (+5/-6)
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 (+58/-59)
tests/unit-tests/scene/test_surface_controller.cpp (+1/-1)
tests/unit-tests/scene/test_surface_data.cpp (+4/-4)
tests/unit-tests/scene/test_surface_impl.cpp (+66/-37)
tests/unit-tests/scene/test_surface_stack.cpp (+15/-16)
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 (+31/-72)
To merge this branch: bzr merge lp:~raof/mir/check-for-surfaceless
Reviewer Review Type Date Requested Status
Mir development team Pending
Review via email: mp+198509@code.launchpad.net

Commit message

nested: Check for, and prefer, EGL_KHR_surfaceless_context over dummy pbuffer surfaces

It seems that at least one of our Android stacks doesn't support EGL_KHR_surfaceless_context,
and Mesa doesn't support pbuffer surfaces.

Fixes nested on Mesa

Description of the change

nested: Check for, and prefer, EGL_KHR_surfaceless_context over dummy pbuffer surfaces

It seems that at least one of our Android stacks doesn't support EGL_KHR_surfaceless_context,
and Mesa doesn't support pbuffer surfaces.

Fixes nested on Mesa

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'CMakeLists.txt'
--- CMakeLists.txt 2013-11-21 03:23:50 +0000
+++ CMakeLists.txt 2013-12-11 07:33:52 +0000
@@ -87,13 +87,13 @@
87)87)
88endif(MIR_DISABLE_EPOLL_REACTOR)88endif(MIR_DISABLE_EPOLL_REACTOR)
8989
90# Default to gbm backend90# Default to mesa backend
91set(91set(
92 MIR_PLATFORM92 MIR_PLATFORM
93 gbm93 mesa
94 CACHE94 CACHE
95 STRING95 STRING
96 "graphics backend to build (options are 'gbm' or 'android')"96 "graphics backend to build (options are 'mesa' or 'android')"
97)97)
9898
99find_package(EGL REQUIRED)99find_package(EGL REQUIRED)
@@ -124,14 +124,14 @@
124124
125 #ctest does not work for android, so turn test discovery off125 #ctest does not work for android, so turn test discovery off
126 set(DISABLE_GTEST_TEST_DISCOVERY ON)126 set(DISABLE_GTEST_TEST_DISCOVERY ON)
127elseif (MIR_PLATFORM STREQUAL "gbm")127elseif (MIR_PLATFORM STREQUAL "mesa")
128 find_package( PkgConfig )128 find_package( PkgConfig )
129 pkg_check_modules( GBM REQUIRED gbm>=9.0.0)129 pkg_check_modules( GBM REQUIRED gbm>=9.0.0)
130 pkg_check_modules( DRM REQUIRED libdrm )130 pkg_check_modules( DRM REQUIRED libdrm )
131 pkg_check_modules( UDEV REQUIRED libudev )131 pkg_check_modules( UDEV REQUIRED libudev )
132 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__GBM__")132 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__GBM__")
133else ()133else ()
134 message (FATAL_ERROR "MIR_BACKEND must be either 'android' or 'gbm'")134 message (FATAL_ERROR "MIR_BACKEND must be either 'android' or 'mesa'")
135endif()135endif()
136136
137set(MIR_ANDROID_INCLUDE_DIRECTORIES) # to be filled by android-input137set(MIR_ANDROID_INCLUDE_DIRECTORIES) # to be filled by android-input
138138
=== modified file 'cmake/MirCommon.cmake'
--- cmake/MirCommon.cmake 2013-08-28 03:41:48 +0000
+++ cmake/MirCommon.cmake 2013-12-11 07:33:52 +0000
@@ -19,8 +19,15 @@
19 valgrind)19 valgrind)
2020
21 if(VALGRIND_EXECUTABLE)21 if(VALGRIND_EXECUTABLE)
22 set(VALGRIND_ARGS "--error-exitcode=1 --trace-children=yes")22 if(MIR_PLATFORM STREQUAL "android")
23 # don't exit with an error when valgrind find errors
24 #set(VALGRIND_ARGS "--error-exitcode=1")
25 else()
26 set(VALGRIND_ARGS "--error-exitcode=1 --trace-children=yes")
27 endif()
28
23 set(ENABLE_MEMCHECK_FLAG "--enable-memcheck")29 set(ENABLE_MEMCHECK_FLAG "--enable-memcheck")
30
24 else(VALGRIND_EXECUTABLE)31 else(VALGRIND_EXECUTABLE)
25 message("Not enabling memcheck as valgrind is missing on your system")32 message("Not enabling memcheck as valgrind is missing on your system")
26 endif(VALGRIND_EXECUTABLE)33 endif(VALGRIND_EXECUTABLE)
2734
=== modified file 'debian/control'
--- debian/control 2013-11-21 03:16:21 +0000
+++ debian/control 2013-12-11 07:33:52 +0000
@@ -69,7 +69,7 @@
69 .69 .
70 Contains the protocol's definition files.70 Contains the protocol's definition files.
7171
72Package: libmirserver1172Package: libmirserver12
73Section: libs73Section: libs
74Architecture: i386 amd64 armhf arm6474Architecture: i386 amd64 armhf arm64
75Multi-Arch: same75Multi-Arch: same
@@ -115,7 +115,7 @@
115Architecture: i386 amd64 armhf arm64115Architecture: i386 amd64 armhf arm64
116Multi-Arch: same116Multi-Arch: same
117Pre-Depends: ${misc:Pre-Depends}117Pre-Depends: ${misc:Pre-Depends}
118Depends: libmirserver11 (= ${binary:Version}),118Depends: libmirserver12 (= ${binary:Version}),
119 libmirprotobuf-dev (= ${binary:Version}),119 libmirprotobuf-dev (= ${binary:Version}),
120 mircommon-dev (= ${binary:Version}),120 mircommon-dev (= ${binary:Version}),
121 libglm-dev,121 libglm-dev,
122122
=== renamed file 'debian/libmirserver11.install' => 'debian/libmirserver12.install'
--- debian/libmirserver11.install 2013-11-21 03:16:21 +0000
+++ debian/libmirserver12.install 2013-12-11 07:33:52 +0000
@@ -1,1 +1,1 @@
1usr/lib/*/libmirserver.so.111usr/lib/*/libmirserver.so.12
22
=== modified file 'debian/mir-test-tools.install'
--- debian/mir-test-tools.install 2013-08-28 03:41:48 +0000
+++ debian/mir-test-tools.install 2013-12-11 07:33:52 +0000
@@ -1,3 +1,6 @@
1usr/bin/mir_stress1usr/bin/mir_stress
2usr/bin/mir_unit_tests
3usr/bin/mir_acceptance_tests
4usr/bin/mir_integration_tests
2usr/lib/*/mir/tools/libmirclientlttng.so5usr/lib/*/mir/tools/libmirclientlttng.so
3usr/lib/*/mir/tools/libmirserverlttng.so6usr/lib/*/mir/tools/libmirserverlttng.so
47
=== modified file 'debian/rules'
--- debian/rules 2013-11-21 03:16:21 +0000
+++ debian/rules 2013-12-11 07:33:52 +0000
@@ -21,10 +21,7 @@
21ifeq ($(DEB_HOST_ARCH),armhf)21ifeq ($(DEB_HOST_ARCH),armhf)
22 dh_auto_configure -- \22 dh_auto_configure -- \
23 $(COMMON_CONFIGURE_OPTIONS) \23 $(COMMON_CONFIGURE_OPTIONS) \
24 -DMIR_PLATFORM=android \24 -DMIR_PLATFORM=android
25 -DMIR_ENABLE_UNIT_TESTS=NO \
26 -DMIR_ENABLE_ACCEPTANCE_TESTS=NO \
27 -DMIR_ENABLE_INTEGRATION_TESTS=NO
28else25else
29ifeq ($(DEB_HOST_ARCH),powerpc)26ifeq ($(DEB_HOST_ARCH),powerpc)
30 dh_auto_configure -- \27 dh_auto_configure -- \
3128
=== modified file 'examples/demo-inprocess-surface-client/inprocess_egl_client.cpp'
--- examples/demo-inprocess-surface-client/inprocess_egl_client.cpp 2013-11-21 03:16:21 +0000
+++ examples/demo-inprocess-surface-client/inprocess_egl_client.cpp 2013-12-11 07:33:52 +0000
@@ -92,7 +92,7 @@
92 auto params = msh::a_surface().of_name("Inprocess EGL Demo")92 auto params = msh::a_surface().of_name("Inprocess EGL Demo")
93 .of_size(surface_size)93 .of_size(surface_size)
94 .of_buffer_usage(mg::BufferUsage::hardware)94 .of_buffer_usage(mg::BufferUsage::hardware)
95 .of_pixel_format(geom::PixelFormat::argb_8888);95 .of_pixel_format(mir_pixel_format_argb_8888);
96 auto session = shell->open_session("Inprocess client", std::make_shared<NullEventSink>());96 auto session = shell->open_session("Inprocess client", std::make_shared<NullEventSink>());
97 // TODO: Why do we get an ID? ~racarr97 // TODO: Why do we get an ID? ~racarr
98 auto surface = session->get_surface(shell->create_surface_for(session, params));98 auto surface = session->get_surface(shell->create_surface_for(session, params));
9999
=== modified file 'examples/demo-shell/window_manager.cpp'
--- examples/demo-shell/window_manager.cpp 2013-11-21 12:34:49 +0000
+++ examples/demo-shell/window_manager.cpp 2013-12-11 07:33:52 +0000
@@ -27,6 +27,7 @@
27#include "mir/compositor/compositor.h"27#include "mir/compositor/compositor.h"
2828
29#include <linux/input.h>29#include <linux/input.h>
30#include <android/keycodes.h> // TODO remove this dependency
3031
31#include <cassert>32#include <cassert>
32#include <cstdlib>33#include <cstdlib>
@@ -133,7 +134,9 @@
133 focus_controller->focus_next();134 focus_controller->focus_next();
134 return true;135 return true;
135 }136 }
136 if (event.key.modifiers & mir_key_modifier_alt && event.key.scan_code == KEY_P)137 else if ((event.key.modifiers & mir_key_modifier_alt &&
138 event.key.scan_code == KEY_P) ||
139 (event.key.key_code == AKEYCODE_POWER))
137 {140 {
138 compositor->stop();141 compositor->stop();
139 auto conf = display->configuration();142 auto conf = display->configuration();
@@ -155,7 +158,8 @@
155 display_off = !display_off;158 display_off = !display_off;
156159
157 display->configure(*conf.get());160 display->configure(*conf.get());
158 compositor->start();161 if (!display_off)
162 compositor->start();
159 return true;163 return true;
160 }164 }
161 }165 }
162166
=== modified file 'examples/eglapp.c'
--- examples/eglapp.c 2013-11-21 03:16:21 +0000
+++ examples/eglapp.c 2013-12-11 07:33:52 +0000
@@ -93,8 +93,12 @@
93 lastcount = count;93 lastcount = count;
94 }94 }
9595
96 /* This is one way to handle window resizing. But in future it would be96 /*
97 better to have resize events coming from the server */97 * Querying the surface (actually the current buffer) dimensions here is
98 * the only truly safe way to be sure that the dimensions we think we
99 * have are those of the buffer being rendered to. But this should be
100 * improved in future; https://bugs.launchpad.net/mir/+bug/1194384
101 */
98 if (eglQuerySurface(egldisplay, eglsurface, EGL_WIDTH, &width) &&102 if (eglQuerySurface(egldisplay, eglsurface, EGL_WIDTH, &width) &&
99 eglQuerySurface(egldisplay, eglsurface, EGL_HEIGHT, &height))103 eglQuerySurface(egldisplay, eglsurface, EGL_HEIGHT, &height))
100 {104 {
@@ -102,7 +106,7 @@
102 }106 }
103}107}
104108
105static void mir_eglapp_handle_input(MirSurface* surface, MirEvent const* ev, void* context)109static void mir_eglapp_handle_event(MirSurface* surface, MirEvent const* ev, void* context)
106{110{
107 (void) surface;111 (void) surface;
108 (void) context;112 (void) context;
@@ -112,22 +116,16 @@
112 {116 {
113 running = 0;117 running = 0;
114 }118 }
115}119 else if (ev->type == mir_event_type_resize)
116
117static unsigned int get_bpp(MirPixelFormat pf)
118{
119 switch (pf)
120 {120 {
121 case mir_pixel_format_abgr_8888:121 /*
122 case mir_pixel_format_xbgr_8888:122 * FIXME: https://bugs.launchpad.net/mir/+bug/1194384
123 case mir_pixel_format_argb_8888:123 * It is unsafe to set the width and height here because we're in a
124 case mir_pixel_format_xrgb_8888:124 * different thread to that doing the rendering. So we either need
125 return 32;125 * support for event queuing (directing them to another thread) or
126 case mir_pixel_format_bgr_888:126 * full single-threaded callbacks. (LP: #1194384).
127 return 24;127 */
128 case mir_pixel_format_invalid:128 printf("Resized to %dx%d\n", ev->resize.width, ev->resize.height);
129 default:
130 return 0;
131 }129 }
132}130}
133131
@@ -172,7 +170,7 @@
172 };170 };
173 MirEventDelegate delegate = 171 MirEventDelegate delegate =
174 {172 {
175 mir_eglapp_handle_input,173 mir_eglapp_handle_event,
176 NULL174 NULL
177 };175 };
178 EGLConfig eglconfig;176 EGLConfig eglconfig;
@@ -342,7 +340,7 @@
342340
343 printf("Server supports %d of %d surface pixel formats. Using format: %d\n",341 printf("Server supports %d of %d surface pixel formats. Using format: %d\n",
344 nformats, mir_pixel_formats, surfaceparm.pixel_format);342 nformats, mir_pixel_formats, surfaceparm.pixel_format);
345 unsigned int bpp = get_bpp(surfaceparm.pixel_format);343 unsigned int bpp = 8 * MIR_BYTES_PER_PIXEL(surfaceparm.pixel_format);
346 EGLint attribs[] =344 EGLint attribs[] =
347 {345 {
348 EGL_SURFACE_TYPE, EGL_WINDOW_BIT,346 EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
349347
=== modified file 'examples/fingerpaint.c'
--- examples/fingerpaint.c 2013-09-19 13:24:22 +0000
+++ examples/fingerpaint.c 2013-12-11 07:33:52 +0000
@@ -247,6 +247,18 @@
247 redraw(surface, canvas);247 redraw(surface, canvas);
248 }248 }
249 }249 }
250 else if (event->type == mir_event_type_resize)
251 {
252 /* FIXME: https://bugs.launchpad.net/mir/+bug/1194384
253 * mir_event_type_resize will arrive in a different thread to that of
254 * mir_event_type_motion, so we cannot safely redraw from this thread.
255 * Either the callbacks will need to become thread-safe, or we'd have
256 * to employ some non-trivial event queuing and inter-thread signals,
257 * which I think is beyond the scope of this example code.
258 *
259 * redraw(surface, canvas);
260 */
261 }
250}262}
251263
252static const MirDisplayOutput *find_active_output(264static const MirDisplayOutput *find_active_output(
253265
=== modified file 'examples/render_surfaces.cpp'
--- examples/render_surfaces.cpp 2013-11-21 12:34:49 +0000
+++ examples/render_surfaces.cpp 2013-12-11 07:33:52 +0000
@@ -414,12 +414,15 @@
414 mf::SurfaceId(), {});414 mf::SurfaceId(), {});
415415
416 /*416 /*
417 * We call advance_client_buffer() twice so that the surface is417 * We call swap_buffers() twice so that the surface is
418 * considers the first buffer to be posted.418 * considers the first buffer to be posted.
419 * (TODO There must be a better way!)419 * (TODO There must be a better way!)
420 */420 */
421 s->advance_client_buffer();421 {
422 s->advance_client_buffer();422 mg::Buffer* buffer{nullptr};
423 s->swap_buffers(buffer);
424 s->swap_buffers(buffer);
425 }
423426
424 /*427 /*
425 * Place each surface at a different starting location and give it a428 * Place each surface at a different starting location and give it a
426429
=== modified file 'include/client/mir_toolkit/mir_client_library.h'
--- include/client/mir_toolkit/mir_client_library.h 2013-11-21 12:34:49 +0000
+++ include/client/mir_toolkit/mir_client_library.h 2013-12-11 07:33:52 +0000
@@ -66,10 +66,10 @@
66/**66/**
67 * Test for a valid connection67 * Test for a valid connection
68 * \param [in] connection The connection68 * \param [in] connection The connection
69 * \return A non-zero value if the supplied connection is69 * \return True if the supplied connection is valid, or
70 * valid, 0 otherwise70 * false otherwise.
71 */71 */
72int mir_connection_is_valid(MirConnection *connection);72MirBool mir_connection_is_valid(MirConnection *connection);
7373
74/**74/**
75 * Retrieve a text description of the last error. The returned string is owned75 * Retrieve a text description of the last error. The returned string is owned
@@ -104,7 +104,7 @@
104void mir_connection_set_lifecycle_event_callback(MirConnection* connection,104void mir_connection_set_lifecycle_event_callback(MirConnection* connection,
105 mir_lifecycle_event_callback callback, void* context);105 mir_lifecycle_event_callback callback, void* context);
106106
107/** 107/**
108 * \deprecated Use mir_connection_create_display_config108 * \deprecated Use mir_connection_create_display_config
109 */109 */
110__attribute__((__deprecated__("Use mir_connection_create_display_config()")))110__attribute__((__deprecated__("Use mir_connection_create_display_config()")))
@@ -112,8 +112,8 @@
112112
113/**113/**
114 * Query the display114 * Query the display
115 * \warning return value must be destroyed via mir_display_config_destroy() 115 * \warning return value must be destroyed via mir_display_config_destroy()
116 * \warning may return null if connection is invalid 116 * \warning may return null if connection is invalid
117 * \param [in] connection The connection117 * \param [in] connection The connection
118 * \return structure that describes the display configuration118 * \return structure that describes the display configuration
119 */119 */
@@ -135,7 +135,7 @@
135135
136/**136/**
137 * Destroy the DisplayConfiguration resource acquired from mir_connection_create_display_config137 * Destroy the DisplayConfiguration resource acquired from mir_connection_create_display_config
138 * \param [in] display_configuration The display_configuration information resource to be destroyed 138 * \param [in] display_configuration The display_configuration information resource to be destroyed
139 */139 */
140void mir_display_config_destroy(MirDisplayConfiguration* display_configuration);140void mir_display_config_destroy(MirDisplayConfiguration* display_configuration);
141141
@@ -149,7 +149,7 @@
149 *149 *
150 * \warning This request may be denied. Check that the request succeeded with mir_connection_get_error_message.150 * \warning This request may be denied. Check that the request succeeded with mir_connection_get_error_message.
151 * \param [in] connection The connection151 * \param [in] connection The connection
152 * \param [in] display_configuration The display_configuration to apply 152 * \param [in] display_configuration The display_configuration to apply
153 * \return A handle that can be passed to mir_wait_for153 * \return A handle that can be passed to mir_wait_for
154 */154 */
155MirWaitHandle* mir_connection_apply_display_config(MirConnection *connection, MirDisplayConfiguration* display_configuration);155MirWaitHandle* mir_connection_apply_display_config(MirConnection *connection, MirDisplayConfiguration* display_configuration);
@@ -164,10 +164,10 @@
164/**164/**
165 * Get the list of possible formats that a surface can be created with.165 * Get the list of possible formats that a surface can be created with.
166 * \param [in] connection The connection166 * \param [in] connection The connection
167 * \param [out] formats List of valid formats to create surfaces with 167 * \param [out] formats List of valid formats to create surfaces with
168 * \param [in] formats_size size of formats list168 * \param [in] formats_size size of formats list
169 * \param [out] num_valid_formats number of valid formats returned in formats169 * \param [out] num_valid_formats number of valid formats returned in formats
170 */ 170 */
171void mir_connection_get_available_surface_formats(171void mir_connection_get_available_surface_formats(
172 MirConnection* connection, MirPixelFormat* formats,172 MirConnection* connection, MirPixelFormat* formats,
173 unsigned const int format_size, unsigned int *num_valid_formats);173 unsigned const int format_size, unsigned int *num_valid_formats);
@@ -227,10 +227,10 @@
227/**227/**
228 * Test for a valid surface228 * Test for a valid surface
229 * \param [in] surface The surface229 * \param [in] surface The surface
230 * \return A non-zero value if the supplied surface is valid,230 * \return True if the supplied surface is valid, or
231 * 0 otherwise231 * false otherwise.
232 */232 */
233int mir_surface_is_valid(MirSurface *surface);233MirBool mir_surface_is_valid(MirSurface *surface);
234234
235/**235/**
236 * Retrieve a text description of the error. The returned string is owned by236 * Retrieve a text description of the error. The returned string is owned by
@@ -253,7 +253,7 @@
253253
254/**254/**
255 * Get the underlying platform type so the buffer obtained in "raw" representation255 * Get the underlying platform type so the buffer obtained in "raw" representation
256 * in mir_surface_get_current_buffer() can be understood 256 * in mir_surface_get_current_buffer() can be understood
257 * \pre The surface is valid257 * \pre The surface is valid
258 * \param [in] surface The surface258 * \param [in] surface The surface
259 * \return One of mir_platform_type_android or mir_platform_type_gbm259 * \return One of mir_platform_type_android or mir_platform_type_gbm
@@ -386,12 +386,12 @@
386/**386/**
387 * Set the swapinterval for mir_surface_swap_buffers. EGL users should use387 * Set the swapinterval for mir_surface_swap_buffers. EGL users should use
388 * eglSwapInterval directly.388 * eglSwapInterval directly.
389 * At the time being, only swapinterval of 0 or 1 is supported. 389 * At the time being, only swapinterval of 0 or 1 is supported.
390 * \param [in] surface The surface to operate on390 * \param [in] surface The surface to operate on
391 * \param [in] interval The number of vblank signals that391 * \param [in] interval The number of vblank signals that
392 * mir_surface_swap_buffers will wait for 392 * mir_surface_swap_buffers will wait for
393 * \return A wait handle that can be passed to mir_wait_for,393 * \return A wait handle that can be passed to mir_wait_for,
394 * or NULL if the interval could not be supported 394 * or NULL if the interval could not be supported
395 */395 */
396MirWaitHandle* mir_surface_set_swapinterval(MirSurface* surface, int interval);396MirWaitHandle* mir_surface_set_swapinterval(MirSurface* surface, int interval);
397397
398398
=== modified file 'include/client/mir_toolkit/mir_client_library_debug.h'
--- include/client/mir_toolkit/mir_client_library_debug.h 2013-09-11 20:57:29 +0000
+++ include/client/mir_toolkit/mir_client_library_debug.h 2013-12-11 07:33:52 +0000
@@ -38,6 +38,6 @@
38 * This is the buffer that is currently being drawn to,38 * This is the buffer that is currently being drawn to,
39 * and would be returned by mir_surface_get_current_buffer.39 * and would be returned by mir_surface_get_current_buffer.
40 */40 */
41uint32_t mir_debug_surface_current_buffer_id(MirSurface *surface); 41uint32_t mir_debug_surface_current_buffer_id(MirSurface *surface);
4242
43#endif /* MIR_CLIENT_LIBRARY_DEBUG_H */43#endif /* MIR_CLIENT_LIBRARY_DEBUG_H */
4444
=== modified file 'include/platform/mir/graphics/buffer.h'
--- include/platform/mir/graphics/buffer.h 2013-10-15 08:53:10 +0000
+++ include/platform/mir/graphics/buffer.h 2013-12-11 07:33:52 +0000
@@ -21,7 +21,7 @@
2121
22#include "mir/graphics/native_buffer.h"22#include "mir/graphics/native_buffer.h"
23#include "mir/geometry/size.h"23#include "mir/geometry/size.h"
24#include "mir/geometry/pixel_format.h"24#include "mir_toolkit/common.h"
2525
26#include <memory>26#include <memory>
2727
@@ -40,7 +40,7 @@
40 virtual BufferID id() const = 0;40 virtual BufferID id() const = 0;
41 virtual geometry::Size size() const = 0;41 virtual geometry::Size size() const = 0;
42 virtual geometry::Stride stride() const = 0;42 virtual geometry::Stride stride() const = 0;
43 virtual geometry::PixelFormat pixel_format() const = 0;43 virtual MirPixelFormat pixel_format() const = 0;
44 virtual void bind_to_texture() = 0;44 virtual void bind_to_texture() = 0;
45 virtual bool can_bypass() const = 0;45 virtual bool can_bypass() const = 0;
4646
4747
=== modified file 'include/platform/mir/graphics/buffer_properties.h'
--- include/platform/mir/graphics/buffer_properties.h 2013-08-28 03:41:48 +0000
+++ include/platform/mir/graphics/buffer_properties.h 2013-12-11 07:33:52 +0000
@@ -20,7 +20,7 @@
20#define MIR_GRAPHICS_BUFFER_PROPERTIES_H_20#define MIR_GRAPHICS_BUFFER_PROPERTIES_H_
2121
22#include "mir/geometry/size.h"22#include "mir/geometry/size.h"
23#include "mir/geometry/pixel_format.h"23#include "mir_toolkit/common.h"
2424
25namespace mir25namespace mir
26{26{
@@ -49,13 +49,13 @@
49{49{
50 BufferProperties() :50 BufferProperties() :
51 size(),51 size(),
52 format(geometry::PixelFormat::invalid),52 format(mir_pixel_format_invalid),
53 usage(BufferUsage::undefined)53 usage(BufferUsage::undefined)
54 {54 {
55 }55 }
5656
57 BufferProperties(const geometry::Size& size,57 BufferProperties(const geometry::Size& size,
58 const geometry::PixelFormat& format,58 const MirPixelFormat& format,
59 BufferUsage usage) :59 BufferUsage usage) :
60 size{size},60 size{size},
61 format{format},61 format{format},
@@ -64,7 +64,7 @@
64 }64 }
6565
66 geometry::Size size;66 geometry::Size size;
67 geometry::PixelFormat format;67 MirPixelFormat format;
68 BufferUsage usage;68 BufferUsage usage;
69};69};
7070
7171
=== modified file 'include/platform/mir/graphics/display_configuration.h'
--- include/platform/mir/graphics/display_configuration.h 2013-09-12 21:36:55 +0000
+++ include/platform/mir/graphics/display_configuration.h 2013-12-11 07:33:52 +0000
@@ -22,7 +22,6 @@
22#include "mir/int_wrapper.h"22#include "mir/int_wrapper.h"
23#include "mir/geometry/size.h"23#include "mir/geometry/size.h"
24#include "mir/geometry/point.h"24#include "mir/geometry/point.h"
25#include "mir/geometry/pixel_format.h"
26#include "mir_toolkit/common.h"25#include "mir_toolkit/common.h"
2726
28#include <functional>27#include <functional>
@@ -89,7 +88,7 @@
89 /** The type of the output. */88 /** The type of the output. */
90 DisplayConfigurationOutputType type;89 DisplayConfigurationOutputType type;
91 /** The pixel formats supported by the output */90 /** The pixel formats supported by the output */
92 std::vector<geometry::PixelFormat> pixel_formats;91 std::vector<MirPixelFormat> pixel_formats;
93 /** The modes supported by the output. */92 /** The modes supported by the output. */
94 std::vector<DisplayConfigurationMode> modes;93 std::vector<DisplayConfigurationMode> modes;
95 /** The index in the 'modes' vector of the preferred output mode. */94 /** The index in the 'modes' vector of the preferred output mode. */
9695
=== modified file 'include/platform/mir/graphics/graphic_buffer_allocator.h'
--- include/platform/mir/graphics/graphic_buffer_allocator.h 2013-08-28 03:41:48 +0000
+++ include/platform/mir/graphics/graphic_buffer_allocator.h 2013-12-11 07:33:52 +0000
@@ -50,7 +50,7 @@
50 /**50 /**
51 * The supported buffer pixel formats.51 * The supported buffer pixel formats.
52 */52 */
53 virtual std::vector<geometry::PixelFormat> supported_pixel_formats() = 0;53 virtual std::vector<MirPixelFormat> supported_pixel_formats() = 0;
5454
55protected:55protected:
56 GraphicBufferAllocator() = default;56 GraphicBufferAllocator() = default;
5757
=== modified file 'include/platform/mir/graphics/internal_surface.h'
--- include/platform/mir/graphics/internal_surface.h 2013-08-28 03:41:48 +0000
+++ include/platform/mir/graphics/internal_surface.h 2013-12-11 07:33:52 +0000
@@ -35,7 +35,7 @@
35public:35public:
36 virtual ~InternalSurface() = default;36 virtual ~InternalSurface() = default;
3737
38 virtual std::shared_ptr<Buffer> advance_client_buffer() = 0;38 virtual void swap_buffers(graphics::Buffer*&) = 0;
39 virtual geometry::Size size() const = 0;39 virtual geometry::Size size() const = 0;
40 virtual MirPixelFormat pixel_format() const = 0;40 virtual MirPixelFormat pixel_format() const = 0;
4141
4242
=== modified file 'include/server/mir/compositor/buffer_stream.h'
--- include/server/mir/compositor/buffer_stream.h 2013-11-21 03:16:21 +0000
+++ include/server/mir/compositor/buffer_stream.h 2013-12-11 07:33:52 +0000
@@ -21,7 +21,7 @@
21#define MIR_COMPOSITOR_BUFFER_STREAM_H_21#define MIR_COMPOSITOR_BUFFER_STREAM_H_
2222
23#include "mir/geometry/size.h"23#include "mir/geometry/size.h"
24#include "mir/geometry/pixel_format.h"24#include "mir_toolkit/common.h"
25#include "mir/graphics/buffer_id.h"25#include "mir/graphics/buffer_id.h"
2626
27#include <memory>27#include <memory>
@@ -41,11 +41,11 @@
41public:41public:
42 virtual ~BufferStream() = default;42 virtual ~BufferStream() = default;
4343
44 virtual std::shared_ptr<graphics::Buffer> secure_client_buffer() = 0;44 virtual void swap_client_buffers(graphics::Buffer*& buffer) = 0;
45 virtual std::shared_ptr<graphics::Buffer>45 virtual std::shared_ptr<graphics::Buffer>
46 lock_compositor_buffer(unsigned long frameno) = 0;46 lock_compositor_buffer(unsigned long frameno) = 0;
47 virtual std::shared_ptr<graphics::Buffer> lock_snapshot_buffer() = 0;47 virtual std::shared_ptr<graphics::Buffer> lock_snapshot_buffer() = 0;
48 virtual geometry::PixelFormat get_stream_pixel_format() = 0;48 virtual MirPixelFormat get_stream_pixel_format() = 0;
49 virtual geometry::Size stream_size() = 0;49 virtual geometry::Size stream_size() = 0;
50 virtual void resize(geometry::Size const& size) = 0;50 virtual void resize(geometry::Size const& size) = 0;
51 virtual void allow_framedropping(bool) = 0;51 virtual void allow_framedropping(bool) = 0;
5252
=== modified file 'include/server/mir/compositor/compositing_criteria.h'
--- include/server/mir/compositor/compositing_criteria.h 2013-10-07 07:56:05 +0000
+++ include/server/mir/compositor/compositing_criteria.h 2013-12-11 07:33:52 +0000
@@ -30,7 +30,7 @@
30namespace compositor30namespace compositor
31{31{
3232
33class CompositingCriteria 33class CompositingCriteria
34{34{
35public:35public:
36 virtual float alpha() const = 0;36 virtual float alpha() const = 0;
3737
=== modified file 'include/server/mir/default_server_configuration.h'
--- include/server/mir/default_server_configuration.h 2013-11-21 12:34:49 +0000
+++ include/server/mir/default_server_configuration.h 2013-12-11 07:33:52 +0000
@@ -35,7 +35,6 @@
35class Drawer;35class Drawer;
36class DisplayBufferCompositorFactory;36class DisplayBufferCompositorFactory;
37class Compositor;37class Compositor;
38class OverlayRenderer;
39class RendererFactory;38class RendererFactory;
40}39}
41namespace frontend40namespace frontend
@@ -55,7 +54,6 @@
55namespace shell54namespace shell
56{55{
57class SurfaceFactory;56class SurfaceFactory;
58class SurfaceController;
59class InputTargeter;57class InputTargeter;
60class FocusSetter;58class FocusSetter;
61class PlacementStrategy;59class PlacementStrategy;
@@ -82,6 +80,7 @@
82class SurfaceBuilder;80class SurfaceBuilder;
83class SurfaceStackModel;81class SurfaceStackModel;
84class SurfaceStack;82class SurfaceStack;
83class SurfaceRanker;
85class SurfaceController;84class SurfaceController;
86class InputRegistrar;85class InputRegistrar;
87class SceneReport;86class SceneReport;
@@ -152,7 +151,6 @@
152 * configurable interfaces for modifying compositor151 * configurable interfaces for modifying compositor
153 * @{ */152 * @{ */
154 virtual std::shared_ptr<compositor::DisplayBufferCompositorFactory> the_display_buffer_compositor_factory();153 virtual std::shared_ptr<compositor::DisplayBufferCompositorFactory> the_display_buffer_compositor_factory();
155 virtual std::shared_ptr<compositor::OverlayRenderer> the_overlay_renderer();
156 /** @} */154 /** @} */
157155
158 /** @name compositor configuration - dependencies156 /** @name compositor configuration - dependencies
@@ -191,7 +189,6 @@
191 virtual std::shared_ptr<shell::SessionListener> the_shell_session_listener();189 virtual std::shared_ptr<shell::SessionListener> the_shell_session_listener();
192 virtual std::shared_ptr<shell::DisplayLayout> the_shell_display_layout();190 virtual std::shared_ptr<shell::DisplayLayout> the_shell_display_layout();
193 virtual std::shared_ptr<shell::SurfaceConfigurator> the_shell_surface_configurator();191 virtual std::shared_ptr<shell::SurfaceConfigurator> the_shell_surface_configurator();
194 virtual std::shared_ptr<shell::SurfaceController> the_shell_surface_controller();
195 /** @} */192 /** @} */
196193
197 /** @name internal scene configuration194 /** @name internal scene configuration
@@ -204,6 +201,7 @@
204 virtual std::shared_ptr<scene::SessionEventSink> the_session_event_sink();201 virtual std::shared_ptr<scene::SessionEventSink> the_session_event_sink();
205 virtual std::shared_ptr<scene::SessionEventHandlerRegister> the_session_event_handler_register();202 virtual std::shared_ptr<scene::SessionEventHandlerRegister> the_session_event_handler_register();
206 virtual std::shared_ptr<scene::SurfaceStackModel> the_surface_stack_model();203 virtual std::shared_ptr<scene::SurfaceStackModel> the_surface_stack_model();
204 virtual std::shared_ptr<scene::SurfaceRanker> the_surface_ranker();
207 /** @} */205 /** @} */
208206
209 /** @name scene configuration - dependencies207 /** @name scene configuration - dependencies
@@ -279,7 +277,6 @@
279 CachedPtr<shell::DisplayLayout> shell_display_layout;277 CachedPtr<shell::DisplayLayout> shell_display_layout;
280 CachedPtr<shell::SurfaceConfigurator> shell_surface_configurator;278 CachedPtr<shell::SurfaceConfigurator> shell_surface_configurator;
281 CachedPtr<compositor::DisplayBufferCompositorFactory> display_buffer_compositor_factory;279 CachedPtr<compositor::DisplayBufferCompositorFactory> display_buffer_compositor_factory;
282 CachedPtr<compositor::OverlayRenderer> overlay_renderer;
283 CachedPtr<compositor::Compositor> compositor;280 CachedPtr<compositor::Compositor> compositor;
284 CachedPtr<logging::Logger> logger;281 CachedPtr<logging::Logger> logger;
285 CachedPtr<graphics::DisplayReport> display_report;282 CachedPtr<graphics::DisplayReport> display_report;
286283
=== modified file 'include/server/mir/frontend/message_processor_report.h'
--- include/server/mir/frontend/message_processor_report.h 2013-08-28 03:41:48 +0000
+++ include/server/mir/frontend/message_processor_report.h 2013-12-11 07:33:52 +0000
@@ -44,7 +44,7 @@
44 virtual void exception_handled(void const* mediator, int id, std::exception const& error) = 0;44 virtual void exception_handled(void const* mediator, int id, std::exception const& error) = 0;
4545
46 virtual void exception_handled(void const* mediator, std::exception const& error) = 0;46 virtual void exception_handled(void const* mediator, std::exception const& error) = 0;
47 47
48 virtual void sent_event(void const* mediator, MirSurfaceEvent const& ev) = 0;48 virtual void sent_event(void const* mediator, MirSurfaceEvent const& ev) = 0;
4949
50private:50private:
5151
=== modified file 'include/server/mir/frontend/null_message_processor_report.h'
--- include/server/mir/frontend/null_message_processor_report.h 2013-08-28 03:41:48 +0000
+++ include/server/mir/frontend/null_message_processor_report.h 2013-12-11 07:33:52 +0000
@@ -36,7 +36,7 @@
36 void exception_handled(void const*, int, std::exception const&);36 void exception_handled(void const*, int, std::exception const&);
3737
38 void exception_handled(void const*, std::exception const&);38 void exception_handled(void const*, std::exception const&);
39 39
40 void sent_event(void const*, MirSurfaceEvent const& e);40 void sent_event(void const*, MirSurfaceEvent const& e);
41};41};
42}42}
4343
=== modified file 'include/server/mir/frontend/session_authorizer.h'
--- include/server/mir/frontend/session_authorizer.h 2013-08-28 03:41:48 +0000
+++ include/server/mir/frontend/session_authorizer.h 2013-12-11 07:33:52 +0000
@@ -30,7 +30,7 @@
30{30{
31public:31public:
32 virtual ~SessionAuthorizer() {}32 virtual ~SessionAuthorizer() {}
33 33
34 virtual bool connection_is_allowed(pid_t pid) = 0;34 virtual bool connection_is_allowed(pid_t pid) = 0;
35 virtual bool configure_display_is_allowed(pid_t pid) = 0;35 virtual bool configure_display_is_allowed(pid_t pid) = 0;
36protected:36protected:
3737
=== modified file 'include/server/mir/frontend/surface.h'
--- include/server/mir/frontend/surface.h 2013-11-21 03:16:21 +0000
+++ include/server/mir/frontend/surface.h 2013-12-11 07:33:52 +0000
@@ -20,7 +20,6 @@
20#ifndef MIR_FRONTEND_SURFACE_H_20#ifndef MIR_FRONTEND_SURFACE_H_
21#define MIR_FRONTEND_SURFACE_H_21#define MIR_FRONTEND_SURFACE_H_
2222
23#include "mir/geometry/pixel_format.h"
24#include "mir/geometry/point.h"23#include "mir/geometry/point.h"
25#include "mir/geometry/size.h"24#include "mir/geometry/size.h"
26#include "mir_toolkit/common.h"25#include "mir_toolkit/common.h"
@@ -55,9 +54,9 @@
55 virtual void force_requests_to_complete() = 0;54 virtual void force_requests_to_complete() = 0;
5655
57 virtual geometry::Size size() const = 0;56 virtual geometry::Size size() const = 0;
58 virtual geometry::PixelFormat pixel_format() const = 0;57 virtual MirPixelFormat pixel_format() const = 0;
5958
60 virtual std::shared_ptr<graphics::Buffer> advance_client_buffer() = 0;59 virtual void swap_buffers(graphics::Buffer*&) = 0;
6160
62 virtual bool supports_input() const = 0;61 virtual bool supports_input() const = 0;
63 virtual int client_input_fd() const = 0;62 virtual int client_input_fd() const = 0;
6463
=== modified file 'include/server/mir/input/input_configuration.h'
--- include/server/mir/input/input_configuration.h 2013-11-20 15:56:58 +0000
+++ include/server/mir/input/input_configuration.h 2013-12-11 07:33:52 +0000
@@ -44,7 +44,7 @@
44 virtual std::shared_ptr<scene::InputRegistrar> the_input_registrar() = 0;44 virtual std::shared_ptr<scene::InputRegistrar> the_input_registrar() = 0;
45 virtual std::shared_ptr<shell::InputTargeter> the_input_targeter() = 0;45 virtual std::shared_ptr<shell::InputTargeter> the_input_targeter() = 0;
46 virtual std::shared_ptr<input::InputManager> the_input_manager() = 0;46 virtual std::shared_ptr<input::InputManager> the_input_manager() = 0;
47 47
48 virtual void set_input_targets(std::shared_ptr<input::InputTargets> const& targets) = 0;48 virtual void set_input_targets(std::shared_ptr<input::InputTargets> const& targets) = 0;
4949
50protected:50protected:
5151
=== modified file 'include/server/mir/input/input_report.h'
--- include/server/mir/input/input_report.h 2013-05-29 14:11:56 +0000
+++ include/server/mir/input/input_report.h 2013-12-11 07:33:52 +0000
@@ -31,7 +31,7 @@
31{31{
32public:32public:
33 virtual ~InputReport() = default;33 virtual ~InputReport() = default;
34 34
35 virtual void received_event_from_kernel(int64_t when, int type, int code, int value) = 0;35 virtual void received_event_from_kernel(int64_t when, int type, int code, int value) = 0;
3636
37 virtual void published_key_event(int dest_fd, uint32_t seq_id, int64_t event_time) = 0;37 virtual void published_key_event(int dest_fd, uint32_t seq_id, int64_t event_time) = 0;
@@ -39,7 +39,7 @@
39 virtual void published_motion_event(int dest_fd, uint32_t seq_id, int64_t event_time) = 0;39 virtual void published_motion_event(int dest_fd, uint32_t seq_id, int64_t event_time) = 0;
4040
41 virtual void received_event_finished_signal(int src_fd, uint32_t seq_id) = 0;41 virtual void received_event_finished_signal(int src_fd, uint32_t seq_id) = 0;
42 42
43protected:43protected:
44 InputReport() = default;44 InputReport() = default;
45 InputReport(InputReport const&) = delete;45 InputReport(InputReport const&) = delete;
4646
=== modified file 'include/server/mir/input/null_input_report.h'
--- include/server/mir/input/null_input_report.h 2013-05-29 14:11:56 +0000
+++ include/server/mir/input/null_input_report.h 2013-12-11 07:33:52 +0000
@@ -32,7 +32,7 @@
32public:32public:
33 NullInputReport() = default;33 NullInputReport() = default;
34 virtual ~NullInputReport() noexcept(true) = default;34 virtual ~NullInputReport() noexcept(true) = default;
35 35
36 void received_event_from_kernel(int64_t when, int type, int code, int value);36 void received_event_from_kernel(int64_t when, int type, int code, int value);
3737
38 void published_key_event(int dest_fd, uint32_t seq_id, int64_t event_time);38 void published_key_event(int dest_fd, uint32_t seq_id, int64_t event_time);
3939
=== modified file 'include/server/mir/input/surface.h'
--- include/server/mir/input/surface.h 2013-07-16 15:49:19 +0000
+++ include/server/mir/input/surface.h 2013-12-11 07:33:52 +0000
@@ -27,7 +27,7 @@
27{27{
28namespace input28namespace input
29{29{
30class Surface 30class Surface
31{31{
32public:32public:
33 virtual std::string const& name() const = 0;33 virtual std::string const& name() const = 0;
@@ -36,7 +36,7 @@
36 virtual bool contains(geometry::Point const& point) const = 0;36 virtual bool contains(geometry::Point const& point) const = 0;
3737
38protected:38protected:
39 Surface() = default; 39 Surface() = default;
40 virtual ~Surface() = default;40 virtual ~Surface() = default;
41 Surface(const Surface&) = delete;41 Surface(const Surface&) = delete;
42 Surface& operator=(const Surface& ) = delete;42 Surface& operator=(const Surface& ) = delete;
4343
=== modified file 'include/server/mir/logging/input_report.h'
--- include/server/mir/logging/input_report.h 2013-05-29 14:11:56 +0000
+++ include/server/mir/logging/input_report.h 2013-12-11 07:33:52 +0000
@@ -39,14 +39,14 @@
39public:39public:
40 InputReport(std::shared_ptr<Logger> const& logger);40 InputReport(std::shared_ptr<Logger> const& logger);
41 virtual ~InputReport() noexcept(true) = default;41 virtual ~InputReport() noexcept(true) = default;
42 42
43 void received_event_from_kernel(int64_t when, int type, int code, int value);43 void received_event_from_kernel(int64_t when, int type, int code, int value);
4444
45 void published_key_event(int dest_fd, uint32_t seq_id, int64_t event_time);45 void published_key_event(int dest_fd, uint32_t seq_id, int64_t event_time);
46 void published_motion_event(int dest_fd, uint32_t seq_id, int64_t event_time);46 void published_motion_event(int dest_fd, uint32_t seq_id, int64_t event_time);
4747
48 void received_event_finished_signal(int src_fd, uint32_t seq_id);48 void received_event_finished_signal(int src_fd, uint32_t seq_id);
49 49
50private:50private:
51 char const* component();51 char const* component();
52 std::shared_ptr<Logger> const logger;52 std::shared_ptr<Logger> const logger;
5353
=== modified file 'include/server/mir/lttng/input_report.h'
--- include/server/mir/lttng/input_report.h 2013-06-03 12:15:44 +0000
+++ include/server/mir/lttng/input_report.h 2013-12-11 07:33:52 +0000
@@ -32,14 +32,14 @@
32public:32public:
33 InputReport() = default;33 InputReport() = default;
34 virtual ~InputReport() noexcept(true) = default;34 virtual ~InputReport() noexcept(true) = default;
35 35
36 void received_event_from_kernel(int64_t when, int type, int code, int value);36 void received_event_from_kernel(int64_t when, int type, int code, int value);
3737
38 void published_key_event(int dest_fd, uint32_t seq_id, int64_t event_time);38 void published_key_event(int dest_fd, uint32_t seq_id, int64_t event_time);
39 void published_motion_event(int dest_fd, uint32_t seq_id, int64_t event_time);39 void published_motion_event(int dest_fd, uint32_t seq_id, int64_t event_time);
4040
41 void received_event_finished_signal(int src_fd, uint32_t seq_id);41 void received_event_finished_signal(int src_fd, uint32_t seq_id);
42 42
43private:43private:
44 ServerTracepointProvider tp_provider;44 ServerTracepointProvider tp_provider;
45};45};
4646
=== modified file 'include/server/mir/scene/input_registrar.h'
--- include/server/mir/scene/input_registrar.h 2013-11-20 16:22:32 +0000
+++ include/server/mir/scene/input_registrar.h 2013-12-11 07:33:52 +0000
@@ -41,7 +41,7 @@
41{41{
42public:42public:
43 virtual ~InputRegistrar() = default;43 virtual ~InputRegistrar() = default;
44 44
45 virtual void input_channel_opened(std::shared_ptr<input::InputChannel> const& opened_channel,45 virtual void input_channel_opened(std::shared_ptr<input::InputChannel> const& opened_channel,
46 std::shared_ptr<input::Surface> const& info,46 std::shared_ptr<input::Surface> const& info,
47 input::InputReceptionMode input_mode) = 0;47 input::InputReceptionMode input_mode) = 0;
4848
=== modified file 'include/server/mir/shell/input_targeter.h'
--- include/server/mir/shell/input_targeter.h 2013-08-28 03:41:48 +0000
+++ include/server/mir/shell/input_targeter.h 2013-12-11 07:33:52 +0000
@@ -36,7 +36,7 @@
36{36{
37public:37public:
38 virtual ~InputTargeter() = default;38 virtual ~InputTargeter() = default;
39 39
40 virtual void focus_changed(std::shared_ptr<input::InputChannel const> const& focus_channel) = 0;40 virtual void focus_changed(std::shared_ptr<input::InputChannel const> const& focus_channel) = 0;
41 virtual void focus_cleared() = 0;41 virtual void focus_cleared() = 0;
4242
4343
=== modified file 'include/server/mir/shell/session_listener.h'
--- include/server/mir/shell/session_listener.h 2013-08-28 03:41:48 +0000
+++ include/server/mir/shell/session_listener.h 2013-12-11 07:33:52 +0000
@@ -35,7 +35,7 @@
35 virtual void stopping(std::shared_ptr<Session> const& session) = 0;35 virtual void stopping(std::shared_ptr<Session> const& session) = 0;
36 virtual void focused(std::shared_ptr<Session> const& session) = 0;36 virtual void focused(std::shared_ptr<Session> const& session) = 0;
37 virtual void unfocused() = 0;37 virtual void unfocused() = 0;
38 38
39 virtual void surface_created(Session& session, std::shared_ptr<Surface> const& surface) = 0;39 virtual void surface_created(Session& session, std::shared_ptr<Surface> const& surface) = 0;
40 virtual void destroying_surface(Session& session, std::shared_ptr<Surface> const& surface) = 0;40 virtual void destroying_surface(Session& session, std::shared_ptr<Surface> const& surface) = 0;
4141
4242
=== modified file 'include/server/mir/shell/surface.h'
--- include/server/mir/shell/surface.h 2013-11-21 03:16:21 +0000
+++ include/server/mir/shell/surface.h 2013-12-11 07:33:52 +0000
@@ -29,10 +29,10 @@
2929
30namespace mir30namespace mir
31{31{
32namespace scene { class SurfaceRanker; }
32namespace shell33namespace shell
33{34{
34class InputTargeter;35class InputTargeter;
35class SurfaceController;
3636
37class Surface : public frontend::Surface, public shell::SurfaceBufferAccess37class Surface : public frontend::Surface, public shell::SurfaceBufferAccess
38{38{
@@ -50,7 +50,7 @@
5050
51 virtual void allow_framedropping(bool) = 0;51 virtual void allow_framedropping(bool) = 0;
5252
53 virtual void raise(std::shared_ptr<SurfaceController> const& controller) = 0;53 virtual void raise(std::shared_ptr<scene::SurfaceRanker> const& controller) = 0;
5454
55 virtual void resize(geometry::Size const& size) = 0;55 virtual void resize(geometry::Size const& size) = 0;
56 virtual void set_rotation(float degrees, glm::vec3 const& axis) = 0;56 virtual void set_rotation(float degrees, glm::vec3 const& axis) = 0;
5757
=== modified file 'include/server/mir/shell/surface_configurator.h'
--- include/server/mir/shell/surface_configurator.h 2013-07-29 22:55:20 +0000
+++ include/server/mir/shell/surface_configurator.h 2013-12-11 07:33:52 +0000
@@ -34,7 +34,7 @@
34{34{
35public:35public:
36 virtual ~SurfaceConfigurator() = default;36 virtual ~SurfaceConfigurator() = default;
37 37
38 /// Returns the selected value.38 /// Returns the selected value.
39 virtual int select_attribute_value(Surface const& surface, MirSurfaceAttrib attrib,39 virtual int select_attribute_value(Surface const& surface, MirSurfaceAttrib attrib,
40 int requested_value) = 0;40 int requested_value) = 0;
4141
=== modified file 'include/server/mir/shell/surface_creation_parameters.h'
--- include/server/mir/shell/surface_creation_parameters.h 2013-11-20 15:56:58 +0000
+++ include/server/mir/shell/surface_creation_parameters.h 2013-12-11 07:33:52 +0000
@@ -19,7 +19,7 @@
19#ifndef MIR_SHELL_SURFACE_CREATION_PARAMETERS_H_19#ifndef MIR_SHELL_SURFACE_CREATION_PARAMETERS_H_
20#define MIR_SHELL_SURFACE_CREATION_PARAMETERS_H_20#define MIR_SHELL_SURFACE_CREATION_PARAMETERS_H_
2121
22#include "mir/geometry/pixel_format.h"22#include "mir_toolkit/common.h"
23#include "mir/geometry/point.h"23#include "mir/geometry/point.h"
24#include "mir/geometry/size.h"24#include "mir/geometry/size.h"
25#include "mir/graphics/buffer_properties.h"25#include "mir/graphics/buffer_properties.h"
@@ -44,15 +44,15 @@
44 SurfaceCreationParameters& of_size(geometry::Size new_size);44 SurfaceCreationParameters& of_size(geometry::Size new_size);
4545
46 SurfaceCreationParameters& of_size(geometry::Width::ValueType width, geometry::Height::ValueType height);46 SurfaceCreationParameters& of_size(geometry::Width::ValueType width, geometry::Height::ValueType height);
47 47
48 SurfaceCreationParameters& of_position(geometry::Point const& top_left);48 SurfaceCreationParameters& of_position(geometry::Point const& top_left);
4949
50 SurfaceCreationParameters& of_buffer_usage(graphics::BufferUsage new_buffer_usage);50 SurfaceCreationParameters& of_buffer_usage(graphics::BufferUsage new_buffer_usage);
5151
52 SurfaceCreationParameters& of_pixel_format(geometry::PixelFormat new_pixel_format);52 SurfaceCreationParameters& of_pixel_format(MirPixelFormat new_pixel_format);
53 53
54 SurfaceCreationParameters& of_depth(scene::DepthId const& new_depth);54 SurfaceCreationParameters& of_depth(scene::DepthId const& new_depth);
55 55
56 SurfaceCreationParameters& with_input_mode(input::InputReceptionMode const& new_mode);56 SurfaceCreationParameters& with_input_mode(input::InputReceptionMode const& new_mode);
5757
58 SurfaceCreationParameters& with_output_id(graphics::DisplayConfigurationOutputId const& output_id);58 SurfaceCreationParameters& with_output_id(graphics::DisplayConfigurationOutputId const& output_id);
@@ -61,7 +61,7 @@
61 geometry::Size size;61 geometry::Size size;
62 geometry::Point top_left;62 geometry::Point top_left;
63 graphics::BufferUsage buffer_usage;63 graphics::BufferUsage buffer_usage;
64 geometry::PixelFormat pixel_format;64 MirPixelFormat pixel_format;
65 scene::DepthId depth;65 scene::DepthId depth;
66 input::InputReceptionMode input_mode;66 input::InputReceptionMode input_mode;
67 graphics::DisplayConfigurationOutputId output_id;67 graphics::DisplayConfigurationOutputId output_id;
6868
=== removed file 'include/shared/mir/geometry/pixel_format.h'
--- include/shared/mir/geometry/pixel_format.h 2013-10-07 08:25:04 +0000
+++ include/shared/mir/geometry/pixel_format.h 1970-01-01 00:00:00 +0000
@@ -1,54 +0,0 @@
1/*
2 * Copyright © 2012 Canonical Ltd.
3 *
4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU Lesser General Public License version 3,
6 * as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authored by: Alan Griffiths <alan@octopull.co.uk>
17 */
18
19
20#ifndef MIR_COMPOSITOR_PIXEL_FORMAT_H_
21#define MIR_COMPOSITOR_PIXEL_FORMAT_H_
22
23#include <cstdint>
24#include <cstddef>
25
26namespace mir
27{
28namespace geometry
29{
30enum class PixelFormat : uint32_t
31{
32 invalid,
33 abgr_8888,
34 xbgr_8888,
35 argb_8888,
36 xrgb_8888,
37 bgr_888
38};
39
40static inline size_t bytes_per_pixel(PixelFormat fmt)
41{
42 return (fmt == PixelFormat::bgr_888) ? 3 : 4;
43}
44
45static inline bool has_alpha(PixelFormat fmt)
46{
47 return (fmt == PixelFormat::abgr_8888) ||
48 (fmt == PixelFormat::argb_8888);
49}
50
51}
52}
53
54#endif /* MIR_COMPOSITOR_PIXEL_FORMAT_H_ */
550
=== modified file 'include/shared/mir/geometry/rectangle.h'
--- include/shared/mir/geometry/rectangle.h 2013-11-21 03:16:21 +0000
+++ include/shared/mir/geometry/rectangle.h 2013-12-11 07:33:52 +0000
@@ -35,7 +35,7 @@
35 Point top_left;35 Point top_left;
36 Size size;36 Size size;
3737
38 /** 38 /**
39 * The bottom right boundary point of the rectangle.39 * The bottom right boundary point of the rectangle.
40 *40 *
41 * Note that the returned point is *not* included in the rectangle41 * Note that the returned point is *not* included in the rectangle
4242
=== modified file 'include/shared/mir/graphics/android/android_driver_interpreter.h'
--- include/shared/mir/graphics/android/android_driver_interpreter.h 2013-10-15 08:53:10 +0000
+++ include/shared/mir/graphics/android/android_driver_interpreter.h 2013-12-11 07:33:52 +0000
@@ -36,7 +36,7 @@
36 virtual void driver_returns_buffer(ANativeWindowBuffer*, int fence) = 0;36 virtual void driver_returns_buffer(ANativeWindowBuffer*, int fence) = 0;
37 virtual void dispatch_driver_request_format(int format) = 0;37 virtual void dispatch_driver_request_format(int format) = 0;
38 virtual int driver_requests_info(int key) const = 0;38 virtual int driver_requests_info(int key) const = 0;
39 virtual void sync_to_display(bool sync) = 0; 39 virtual void sync_to_display(bool sync) = 0;
40protected:40protected:
41 AndroidDriverInterpreter() {};41 AndroidDriverInterpreter() {};
42 virtual ~AndroidDriverInterpreter() {};42 virtual ~AndroidDriverInterpreter() {};
4343
=== modified file 'include/shared/mir/graphics/android/mir_native_window.h'
--- include/shared/mir/graphics/android/mir_native_window.h 2013-11-21 03:16:21 +0000
+++ include/shared/mir/graphics/android/mir_native_window.h 2013-12-11 07:33:52 +0000
@@ -25,7 +25,7 @@
2525
26namespace mir26namespace mir
27{27{
28namespace graphics 28namespace graphics
29{29{
30namespace android30namespace android
31{31{
3232
=== modified file 'include/shared/mir/graphics/android/native_buffer.h'
--- include/shared/mir/graphics/android/native_buffer.h 2013-10-15 08:53:10 +0000
+++ include/shared/mir/graphics/android/native_buffer.h 2013-12-11 07:33:52 +0000
@@ -27,7 +27,7 @@
27namespace graphics27namespace graphics
28{28{
2929
30class NativeBuffer 30class NativeBuffer
31{31{
32public:32public:
33 virtual ~NativeBuffer() = default;33 virtual ~NativeBuffer() = default;
@@ -37,7 +37,7 @@
37 virtual android::NativeFence copy_fence() const = 0;37 virtual android::NativeFence copy_fence() const = 0;
3838
39 virtual void wait_for_content() = 0;39 virtual void wait_for_content() = 0;
40 virtual void update_fence(android::NativeFence& fence) = 0; 40 virtual void update_fence(android::NativeFence& fence) = 0;
4141
42protected:42protected:
43 NativeBuffer() = default;43 NativeBuffer() = default;
4444
=== modified file 'include/shared/mir/input/android/android_input_lexicon.h'
--- include/shared/mir/input/android/android_input_lexicon.h 2013-04-24 05:22:20 +0000
+++ include/shared/mir/input/android/android_input_lexicon.h 2013-12-11 07:33:52 +0000
@@ -36,7 +36,7 @@
36namespace android36namespace android
37{37{
3838
39/// The Lexicon translates droidinput event types to MirEvent types prior to 39/// The Lexicon translates droidinput event types to MirEvent types prior to
40/// shell or client handling.40/// shell or client handling.
41class Lexicon41class Lexicon
42{42{
4343
=== modified file 'include/shared/mir/input/input_platform.h'
--- include/shared/mir/input/input_platform.h 2013-11-21 03:16:21 +0000
+++ include/shared/mir/input/input_platform.h 2013-12-11 07:33:52 +0000
@@ -37,7 +37,7 @@
37class InputPlatform37class InputPlatform
38{38{
39public:39public:
40 virtual ~InputPlatform() {}; 40 virtual ~InputPlatform() {};
4141
42 virtual std::shared_ptr<InputReceiverThread> create_input_thread(int fd, std::function<void(MirEvent *)> const& callback) = 0;42 virtual std::shared_ptr<InputReceiverThread> create_input_thread(int fd, std::function<void(MirEvent *)> const& callback) = 0;
4343
4444
=== modified file 'include/shared/mir/input/xkb_mapper.h'
--- include/shared/mir/input/xkb_mapper.h 2013-05-17 19:42:09 +0000
+++ include/shared/mir/input/xkb_mapper.h 2013-12-11 07:33:52 +0000
@@ -37,7 +37,7 @@
37public:37public:
38 XKBMapper();38 XKBMapper();
39 virtual ~XKBMapper() = default;39 virtual ~XKBMapper() = default;
40 40
41 void update_state_and_map_event(MirKeyEvent& key_ev);41 void update_state_and_map_event(MirKeyEvent& key_ev);
4242
43protected:43protected:
4444
=== modified file 'include/shared/mir_toolkit/client_types.h'
--- include/shared/mir_toolkit/client_types.h 2013-11-21 03:16:21 +0000
+++ include/shared/mir_toolkit/client_types.h 2013-12-11 07:33:52 +0000
@@ -34,6 +34,12 @@
34extern "C" {34extern "C" {
35#endif35#endif
3636
37typedef enum MirBool
38{
39 mir_false = 0,
40 mir_true = 1
41} MirBool;
42
37/* Display server connection API */43/* Display server connection API */
38typedef void* MirEGLNativeWindowType;44typedef void* MirEGLNativeWindowType;
39typedef void* MirEGLNativeDisplayType;45typedef void* MirEGLNativeDisplayType;
@@ -97,26 +103,6 @@
97 MirConnection* connection, void* context);103 MirConnection* connection, void* context);
98104
99/**105/**
100 * The order of components in a format enum matches the
101 * order of the components as they would be written in an
102 * integer representing a pixel value of that format.
103 *
104 * For example, abgr_8888 corresponds to 0xAABBGGRR, which will
105 * end up as R,G,B,A in memory in a little endian system, and
106 * as A,B,G,R in memory in a big endian system.
107 */
108typedef enum MirPixelFormat
109{
110 mir_pixel_format_invalid,
111 mir_pixel_format_abgr_8888,
112 mir_pixel_format_xbgr_8888,
113 mir_pixel_format_argb_8888,
114 mir_pixel_format_xrgb_8888,
115 mir_pixel_format_bgr_888,
116 mir_pixel_formats
117} MirPixelFormat;
118
119/**
120 * MirBufferUsage specifies how a surface can and will be used. A "hardware"106 * MirBufferUsage specifies how a surface can and will be used. A "hardware"
121 * surface can be used for OpenGL accelerated rendering. A "software" surface107 * surface can be used for OpenGL accelerated rendering. A "software" surface
122 * is one that can be addressed in main memory and blitted to directly.108 * is one that can be addressed in main memory and blitted to directly.
@@ -157,7 +143,7 @@
157typedef enum MirPlatformType143typedef enum MirPlatformType
158{144{
159 mir_platform_type_gbm,145 mir_platform_type_gbm,
160 mir_platform_type_android 146 mir_platform_type_android
161} MirPlatformType;147} MirPlatformType;
162148
163typedef struct MirPlatformPackage149typedef struct MirPlatformPackage
@@ -184,7 +170,7 @@
184170
185} MirGraphicsRegion;171} MirGraphicsRegion;
186172
187/** 173/**
188 * DEPRECATED. use MirDisplayConfiguration174 * DEPRECATED. use MirDisplayConfiguration
189 */175 */
190enum { mir_supported_pixel_format_max = 32 };176enum { mir_supported_pixel_format_max = 32 };
@@ -192,7 +178,7 @@
192{178{
193 uint32_t width;179 uint32_t width;
194 uint32_t height;180 uint32_t height;
195 181
196 int supported_pixel_format_items;182 int supported_pixel_format_items;
197 MirPixelFormat supported_pixel_format[mir_supported_pixel_format_max];183 MirPixelFormat supported_pixel_format[mir_supported_pixel_format_max];
198} MirDisplayInfo;184} MirDisplayInfo;
@@ -240,7 +226,7 @@
240 uint32_t num_modes;226 uint32_t num_modes;
241 MirDisplayMode* modes;227 MirDisplayMode* modes;
242 uint32_t preferred_mode;228 uint32_t preferred_mode;
243 uint32_t current_mode; 229 uint32_t current_mode;
244230
245 uint32_t num_output_formats;231 uint32_t num_output_formats;
246 MirPixelFormat* output_formats;232 MirPixelFormat* output_formats;
@@ -257,7 +243,7 @@
257243
258 uint32_t physical_width_mm;244 uint32_t physical_width_mm;
259 uint32_t physical_height_mm;245 uint32_t physical_height_mm;
260 246
261 MirPowerMode power_mode;247 MirPowerMode power_mode;
262} MirDisplayOutput;248} MirDisplayOutput;
263249
264250
=== modified file 'include/shared/mir_toolkit/common.h'
--- include/shared/mir_toolkit/common.h 2013-11-21 03:16:21 +0000
+++ include/shared/mir_toolkit/common.h 2013-12-11 07:33:52 +0000
@@ -86,6 +86,30 @@
86 mir_power_mode_suspend, /* Blanked, lowest power. */86 mir_power_mode_suspend, /* Blanked, lowest power. */
87 mir_power_mode_off /* Powered down. */87 mir_power_mode_off /* Powered down. */
88} MirPowerMode;88} MirPowerMode;
89
90/**
91 * The order of components in a format enum matches the
92 * order of the components as they would be written in an
93 * integer representing a pixel value of that format.
94 *
95 * For example, abgr_8888 corresponds to 0xAABBGGRR, which will
96 * end up as R,G,B,A in memory in a little endian system, and
97 * as A,B,G,R in memory in a big endian system.
98 */
99typedef enum MirPixelFormat
100{
101 mir_pixel_format_invalid,
102 mir_pixel_format_abgr_8888,
103 mir_pixel_format_xbgr_8888,
104 mir_pixel_format_argb_8888,
105 mir_pixel_format_xrgb_8888,
106 mir_pixel_format_bgr_888,
107 mir_pixel_formats
108} MirPixelFormat;
109
110/* This could be improved... https://bugs.launchpad.net/mir/+bug/1236254 */
111#define MIR_BYTES_PER_PIXEL(f) (((f) == mir_pixel_format_bgr_888) ? 3 : 4)
112
89/**@}*/113/**@}*/
90114
91#endif115#endif
92116
=== modified file 'include/shared/mir_toolkit/event.h'
--- include/shared/mir_toolkit/event.h 2013-11-21 03:16:21 +0000
+++ include/shared/mir_toolkit/event.h 2013-12-11 07:33:52 +0000
@@ -39,7 +39,8 @@
39{39{
40 mir_event_type_key,40 mir_event_type_key,
41 mir_event_type_motion,41 mir_event_type_motion,
42 mir_event_type_surface42 mir_event_type_surface,
43 mir_event_type_resize
43} MirEventType;44} MirEventType;
4445
45typedef enum {46typedef enum {
@@ -141,7 +142,7 @@
141142
142 int32_t device_id;143 int32_t device_id;
143 int32_t source_id;144 int32_t source_id;
144 /* 145 /*
145 * TODO(racarr): We would like to store this as a MirMotionAction but the android input stack146 * TODO(racarr): We would like to store this as a MirMotionAction but the android input stack
146 * encodes some non enumerable values in it. It's convenient to keep things147 * encodes some non enumerable values in it. It's convenient to keep things
147 * this way for now until we can drop SF/Hybris support in QtUbuntu.148 * this way for now until we can drop SF/Hybris support in QtUbuntu.
@@ -194,12 +195,22 @@
194 int value;195 int value;
195} MirSurfaceEvent;196} MirSurfaceEvent;
196197
198typedef struct
199{
200 MirEventType type;
201
202 int surface_id;
203 int width;
204 int height;
205} MirResizeEvent;
206
197typedef union207typedef union
198{208{
199 MirEventType type;209 MirEventType type;
200 MirKeyEvent key;210 MirKeyEvent key;
201 MirMotionEvent motion;211 MirMotionEvent motion;
202 MirSurfaceEvent surface;212 MirSurfaceEvent surface;
213 MirResizeEvent resize;
203} MirEvent;214} MirEvent;
204215
205#ifdef __cplusplus216#ifdef __cplusplus
206217
=== modified file 'include/shared/mir_toolkit/mir_native_buffer.h'
--- include/shared/mir_toolkit/mir_native_buffer.h 2013-11-21 03:16:21 +0000
+++ include/shared/mir_toolkit/mir_native_buffer.h 2013-12-11 07:33:52 +0000
@@ -52,6 +52,6 @@
52struct ANativeWindowBuffer;52struct ANativeWindowBuffer;
53typedef struct ANativeWindowBuffer MirNativeBuffer;53typedef struct ANativeWindowBuffer MirNativeBuffer;
54#else54#else
55typedef struct MirBufferPackage MirNativeBuffer; 55typedef struct MirBufferPackage MirNativeBuffer;
56#endif56#endif
57#endif /* MIR_CLIENT_MIR_NATIVE_BUFFER_H_ */57#endif /* MIR_CLIENT_MIR_NATIVE_BUFFER_H_ */
5858
=== added file 'include/test/gmock_set_arg.h'
--- include/test/gmock_set_arg.h 1970-01-01 00:00:00 +0000
+++ include/test/gmock_set_arg.h 2013-12-11 07:33:52 +0000
@@ -0,0 +1,57 @@
1/*
2 * Copyright © 2013 Canonical Ltd.
3 *
4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License version 3,
6 * as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authored by: Alan Griffiths <alan@octopull.co.uk>
17 */
18
19#ifndef GMOCK_SET_ARG_H_
20#define GMOCK_SET_ARG_H_
21
22#include <gmock/gmock.h>
23
24namespace testing
25{
26namespace internal
27{
28template <size_t N, typename A, bool kIsProto>
29class SetArgumentAction {
30 public:
31 // Constructs an action that sets the variable pointed to by the
32 // N-th function argument to 'value'.
33 explicit SetArgumentAction(const A& value) : value_(value) {}
34
35 template <typename Result, typename ArgumentTuple>
36 void Perform(const ArgumentTuple& args) const {
37 CompileAssertTypesEqual<void, Result>();
38 ::std::tr1::get<N>(args) = value_;
39 }
40
41 private:
42 const A value_;
43
44 GTEST_DISALLOW_ASSIGN_(SetArgumentAction);
45};
46}
47template <size_t N, typename T>
48PolymorphicAction<
49 internal::SetArgumentAction<
50 N, T, internal::IsAProtocolMessage<T>::value> >
51SetArg(const T& x) {
52 return MakePolymorphicAction(internal::SetArgumentAction<
53 N, T, internal::IsAProtocolMessage<T>::value>(x));
54}
55}
56
57#endif /* GMOCK_SET_ARG_H_ */
058
=== modified file 'include/test/mir_test/draw/draw_pattern_checkered-inl.h'
--- include/test/mir_test/draw/draw_pattern_checkered-inl.h 2013-11-21 03:16:21 +0000
+++ include/test/mir_test/draw/draw_pattern_checkered-inl.h 2013-12-11 07:33:52 +0000
@@ -16,8 +16,7 @@
16 * Authored by: Kevin DuBois <kevin.dubois@canonical.com>16 * Authored by: Kevin DuBois <kevin.dubois@canonical.com>
17 */17 */
1818
19#include "mir/geometry/pixel_format.h"19#include "mir_toolkit/common.h"
20namespace geom = mir::geometry;
2120
22template<size_t Rows, size_t Cols>21template<size_t Rows, size_t Cols>
23DrawPatternCheckered<Rows,Cols>::DrawPatternCheckered(uint32_t (&pattern) [Rows][Cols])22DrawPatternCheckered<Rows,Cols>::DrawPatternCheckered(uint32_t (&pattern) [Rows][Cols])
@@ -32,14 +31,14 @@
32 if (region.pixel_format != mir_pixel_format_abgr_8888)31 if (region.pixel_format != mir_pixel_format_abgr_8888)
33 throw(std::runtime_error("cannot draw region, incorrect format"));32 throw(std::runtime_error("cannot draw region, incorrect format"));
3433
35 auto bpp = geom::bytes_per_pixel(geom::PixelFormat::abgr_8888);34 auto bpp = MIR_BYTES_PER_PIXEL(mir_pixel_format_abgr_8888);
36 for(int i=0; i < region.width; i++)35 for(int i=0; i < region.width; i++)
37 {36 {
38 for(int j=0; j<region.height; j++)37 for(int j=0; j<region.height; j++)
39 {38 {
40 int key_row = i % Rows;39 int key_row = i % Rows;
41 int key_col = j % Cols;40 int key_col = j % Cols;
42 uint32_t *pixel = reinterpret_cast<uint32_t*>(&region.vaddr[j*region.stride + (i * bpp)]); 41 uint32_t *pixel = reinterpret_cast<uint32_t*>(&region.vaddr[j*region.stride + (i * bpp)]);
43 *pixel = color_pattern[key_row][key_col];42 *pixel = color_pattern[key_row][key_col];
44 }43 }
45 }44 }
@@ -51,14 +50,14 @@
51 if (region.pixel_format != mir_pixel_format_abgr_8888)50 if (region.pixel_format != mir_pixel_format_abgr_8888)
52 throw(std::runtime_error("cannot check region, incorrect format"));51 throw(std::runtime_error("cannot check region, incorrect format"));
5352
54 auto bpp = geom::bytes_per_pixel(geom::PixelFormat::abgr_8888);53 auto bpp = MIR_BYTES_PER_PIXEL(mir_pixel_format_abgr_8888);
55 for(int i=0; i< region.width; i++)54 for(int i=0; i< region.width; i++)
56 {55 {
57 for(int j=0; j<region.height; j++)56 for(int j=0; j<region.height; j++)
58 {57 {
59 int key_row = i % Rows;58 int key_row = i % Rows;
60 int key_col = j % Cols;59 int key_col = j % Cols;
61 uint32_t *pixel = reinterpret_cast<uint32_t*>(&region.vaddr[j*region.stride + (i * bpp)]); 60 uint32_t *pixel = reinterpret_cast<uint32_t*>(&region.vaddr[j*region.stride + (i * bpp)]);
62 if ( *pixel != color_pattern[key_row][key_col] )61 if ( *pixel != color_pattern[key_row][key_col] )
63 {62 {
64 return false;63 return false;
6564
=== modified file 'include/test/mir_test/fake_event_hub_input_configuration.h'
--- include/test/mir_test/fake_event_hub_input_configuration.h 2013-08-30 07:47:16 +0000
+++ include/test/mir_test/fake_event_hub_input_configuration.h 2013-12-11 07:33:52 +0000
@@ -59,7 +59,7 @@
5959
60 droidinput::sp<droidinput::EventHubInterface> the_event_hub();60 droidinput::sp<droidinput::EventHubInterface> the_event_hub();
61 input::android::FakeEventHub* the_fake_event_hub();61 input::android::FakeEventHub* the_fake_event_hub();
62 62
63 bool is_key_repeat_enabled() override { return false; }63 bool is_key_repeat_enabled() override { return false; }
6464
6565
6666
=== modified file 'include/test/mir_test_doubles/mock_alloc_adaptor.h'
--- include/test/mir_test_doubles/mock_alloc_adaptor.h 2013-10-15 08:53:10 +0000
+++ include/test/mir_test_doubles/mock_alloc_adaptor.h 2013-12-11 07:33:52 +0000
@@ -19,7 +19,7 @@
19#ifndef MIR_TEST_DOUBLES_MOCK_ALLOC_ADAPTOR_H_19#ifndef MIR_TEST_DOUBLES_MOCK_ALLOC_ADAPTOR_H_
20#define MIR_TEST_DOUBLES_MOCK_ALLOC_ADAPTOR_H_20#define MIR_TEST_DOUBLES_MOCK_ALLOC_ADAPTOR_H_
2121
22#include "src/server/graphics/android/graphic_alloc_adaptor.h"22#include "src/platform/graphics/android/graphic_alloc_adaptor.h"
2323
24#include <system/window.h>24#include <system/window.h>
25#include <gmock/gmock.h>25#include <gmock/gmock.h>
@@ -34,8 +34,8 @@
34class MockAllocAdaptor : public graphics::android::GraphicAllocAdaptor34class MockAllocAdaptor : public graphics::android::GraphicAllocAdaptor
35{35{
36public:36public:
37 MOCK_METHOD3(alloc_buffer, 37 MOCK_METHOD3(alloc_buffer,
38 std::shared_ptr<graphics::NativeBuffer>(geometry::Size, geometry::PixelFormat, graphics::android::BufferUsage));38 std::shared_ptr<graphics::NativeBuffer>(geometry::Size, MirPixelFormat, graphics::android::BufferUsage));
39};39};
4040
41}41}
4242
=== modified file 'include/test/mir_test_doubles/mock_android_native_buffer.h'
--- include/test/mir_test_doubles/mock_android_native_buffer.h 2013-10-11 21:30:50 +0000
+++ include/test/mir_test_doubles/mock_android_native_buffer.h 2013-12-11 07:33:52 +0000
@@ -20,7 +20,7 @@
20#define MIR_TEST_DOUBLES_MOCK_ANDROID_NATIVE_BUFFER_H_20#define MIR_TEST_DOUBLES_MOCK_ANDROID_NATIVE_BUFFER_H_
2121
22#include "mir/graphics/android/native_buffer.h"22#include "mir/graphics/android/native_buffer.h"
23#include <gmock/gmock.h> 23#include <gmock/gmock.h>
2424
25namespace mir25namespace mir
26{26{
2727
=== modified file 'include/test/mir_test_doubles/mock_android_registrar.h'
--- include/test/mir_test_doubles/mock_android_registrar.h 2013-06-21 22:14:10 +0000
+++ include/test/mir_test_doubles/mock_android_registrar.h 2013-12-11 07:33:52 +0000
@@ -36,7 +36,7 @@
36struct MockAndroidRegistrar : public client::android::AndroidRegistrar36struct MockAndroidRegistrar : public client::android::AndroidRegistrar
37{37{
38 ~MockAndroidRegistrar() noexcept {}38 ~MockAndroidRegistrar() noexcept {}
39 MOCK_CONST_METHOD1(register_buffer, 39 MOCK_CONST_METHOD1(register_buffer,
40 std::shared_ptr<const native_handle_t>(std::shared_ptr<MirBufferPackage> const&));40 std::shared_ptr<const native_handle_t>(std::shared_ptr<MirBufferPackage> const&));
41 MOCK_METHOD2(secure_for_cpu, std::shared_ptr<char>(std::shared_ptr<const native_handle_t>, geometry::Rectangle));41 MOCK_METHOD2(secure_for_cpu, std::shared_ptr<char>(std::shared_ptr<const native_handle_t>, geometry::Rectangle));
42};42};
4343
=== modified file 'include/test/mir_test_doubles/mock_buffer.h'
--- include/test/mir_test_doubles/mock_buffer.h 2013-10-15 08:53:10 +0000
+++ include/test/mir_test_doubles/mock_buffer.h 2013-12-11 07:33:52 +0000
@@ -42,7 +42,7 @@
4242
43 MockBuffer(geometry::Size size,43 MockBuffer(geometry::Size size,
44 geometry::Stride s,44 geometry::Stride s,
45 geometry::PixelFormat pf)45 MirPixelFormat pf)
46 {46 {
47 using namespace testing;47 using namespace testing;
48 ON_CALL(*this, size())48 ON_CALL(*this, size())
@@ -60,7 +60,7 @@
6060
61 MOCK_CONST_METHOD0(size, geometry::Size());61 MOCK_CONST_METHOD0(size, geometry::Size());
62 MOCK_CONST_METHOD0(stride, geometry::Stride());62 MOCK_CONST_METHOD0(stride, geometry::Stride());
63 MOCK_CONST_METHOD0(pixel_format, geometry::PixelFormat());63 MOCK_CONST_METHOD0(pixel_format, MirPixelFormat());
64 MOCK_CONST_METHOD0(native_buffer_handle, std::shared_ptr<graphics::NativeBuffer>());64 MOCK_CONST_METHOD0(native_buffer_handle, std::shared_ptr<graphics::NativeBuffer>());
6565
66 MOCK_METHOD0(bind_to_texture, void());66 MOCK_METHOD0(bind_to_texture, void());
6767
=== modified file 'include/test/mir_test_doubles/mock_buffer_bundle.h'
--- include/test/mir_test_doubles/mock_buffer_bundle.h 2013-11-21 03:16:21 +0000
+++ include/test/mir_test_doubles/mock_buffer_bundle.h 2013-12-11 07:33:52 +0000
@@ -37,8 +37,8 @@
37 ~MockBufferBundle() noexcept37 ~MockBufferBundle() noexcept
38 {}38 {}
3939
40 MOCK_METHOD0(client_acquire, std::shared_ptr<graphics::Buffer>());40 MOCK_METHOD0(client_acquire, graphics::Buffer*());
41 MOCK_METHOD1(client_release, void(std::shared_ptr<graphics::Buffer> const&));41 MOCK_METHOD1(client_release, void(graphics::Buffer*));
42 MOCK_METHOD1(compositor_acquire, std::shared_ptr<graphics::Buffer>(unsigned long));42 MOCK_METHOD1(compositor_acquire, std::shared_ptr<graphics::Buffer>(unsigned long));
43 MOCK_METHOD1(compositor_release, void(std::shared_ptr<graphics::Buffer> const&));43 MOCK_METHOD1(compositor_release, void(std::shared_ptr<graphics::Buffer> const&));
44 MOCK_METHOD0(snapshot_acquire, std::shared_ptr<graphics::Buffer>());44 MOCK_METHOD0(snapshot_acquire, std::shared_ptr<graphics::Buffer>());
4545
=== modified file 'include/test/mir_test_doubles/mock_buffer_stream.h'
--- include/test/mir_test_doubles/mock_buffer_stream.h 2013-11-21 03:16:21 +0000
+++ include/test/mir_test_doubles/mock_buffer_stream.h 2013-12-11 07:33:52 +0000
@@ -31,12 +31,12 @@
31{31{
32struct MockBufferStream : public compositor::BufferStream32struct MockBufferStream : public compositor::BufferStream
33{33{
34 MOCK_METHOD0(secure_client_buffer, std::shared_ptr<graphics::Buffer>());34 MOCK_METHOD1(swap_client_buffers, void(graphics::Buffer*&));
35 MOCK_METHOD1(lock_compositor_buffer,35 MOCK_METHOD1(lock_compositor_buffer,
36 std::shared_ptr<graphics::Buffer>(unsigned long));36 std::shared_ptr<graphics::Buffer>(unsigned long));
37 MOCK_METHOD0(lock_snapshot_buffer, std::shared_ptr<graphics::Buffer>());37 MOCK_METHOD0(lock_snapshot_buffer, std::shared_ptr<graphics::Buffer>());
3838
39 MOCK_METHOD0(get_stream_pixel_format, geometry::PixelFormat());39 MOCK_METHOD0(get_stream_pixel_format, MirPixelFormat());
40 MOCK_METHOD0(stream_size, geometry::Size());40 MOCK_METHOD0(stream_size, geometry::Size());
41 MOCK_METHOD1(resize, void(geometry::Size const&));41 MOCK_METHOD1(resize, void(geometry::Size const&));
42 MOCK_METHOD0(force_client_completion, void());42 MOCK_METHOD0(force_client_completion, void());
4343
=== modified file 'include/test/mir_test_doubles/mock_display_device.h'
--- include/test/mir_test_doubles/mock_display_device.h 2013-11-21 17:20:14 +0000
+++ include/test/mir_test_doubles/mock_display_device.h 2013-12-11 07:33:52 +0000
@@ -20,9 +20,9 @@
20#define MIR_TEST_DOUBLES_MOCK_DISPLAY_DEVICE_H_20#define MIR_TEST_DOUBLES_MOCK_DISPLAY_DEVICE_H_
2121
22#include "mir/graphics/buffer.h"22#include "mir/graphics/buffer.h"
23#include "src/server/graphics/android/display_device.h"23#include "src/platform/graphics/android/display_device.h"
24#include <gmock/gmock.h>24#include <gmock/gmock.h>
25 25
26namespace mir26namespace mir
27{27{
28namespace test28namespace test
2929
=== modified file 'include/test/mir_test_doubles/mock_egl.h'
--- include/test/mir_test_doubles/mock_egl.h 2013-11-21 03:16:21 +0000
+++ include/test/mir_test_doubles/mock_egl.h 2013-12-11 07:33:52 +0000
@@ -58,7 +58,6 @@
58public:58public:
59 MockEGL();59 MockEGL();
60 ~MockEGL();60 ~MockEGL();
61 void silence_uninteresting();
6261
63 typedef void (*generic_function_pointer_t)(void);62 typedef void (*generic_function_pointer_t)(void);
6463
6564
=== modified file 'include/test/mir_test_doubles/mock_fb_hal_device.h'
--- include/test/mir_test_doubles/mock_fb_hal_device.h 2013-11-19 22:02:08 +0000
+++ include/test/mir_test_doubles/mock_fb_hal_device.h 2013-12-11 07:33:52 +0000
@@ -52,10 +52,11 @@
52 {0,0,0,0,0,0,0},52 {0,0,0,0,0,0,0},
53 nullptr, nullptr,nullptr,nullptr, nullptr,nullptr,53 nullptr, nullptr,nullptr,nullptr, nullptr,nullptr,
54 {0,0,0,0,0,0}54 {0,0,0,0,0,0}
55 }) 55 })
56 {56 {
57 post = hook_post;57 post = hook_post;
58 setSwapInterval = hook_setSwapInterval; 58 setSwapInterval = hook_setSwapInterval;
59 enableScreen = hook_enableScreen;
59 }60 }
6061
61 MockFBHalDevice()62 MockFBHalDevice()
@@ -72,12 +73,20 @@
72 static int hook_setSwapInterval(struct framebuffer_device_t* mock_fb, int interval)73 static int hook_setSwapInterval(struct framebuffer_device_t* mock_fb, int interval)
73 {74 {
74 MockFBHalDevice* mocker = static_cast<MockFBHalDevice*>(mock_fb);75 MockFBHalDevice* mocker = static_cast<MockFBHalDevice*>(mock_fb);
75 return mocker->setSwapInterval_interface(mock_fb, interval); 76 return mocker->setSwapInterval_interface(mock_fb, interval);
76 }77 }
7778
79 static int hook_enableScreen(struct framebuffer_device_t* mock_fb, int enable)
80 {
81 MockFBHalDevice* mocker = static_cast<MockFBHalDevice*>(mock_fb);
82 return mocker->enableScreen_interface(mock_fb, enable);
83 }
84
85
86 MOCK_METHOD2(enableScreen_interface, int(struct framebuffer_device_t*, int));
78 MOCK_METHOD2(post_interface, int(struct framebuffer_device_t*, buffer_handle_t));87 MOCK_METHOD2(post_interface, int(struct framebuffer_device_t*, buffer_handle_t));
79 MOCK_METHOD2(setSwapInterval_interface, int(struct framebuffer_device_t*, int));88 MOCK_METHOD2(setSwapInterval_interface, int(struct framebuffer_device_t*, int));
80 89
81 hw_device_t empty_module;90 hw_device_t empty_module;
82};91};
8392
8493
=== modified file 'include/test/mir_test_doubles/mock_framebuffer_bundle.h'
--- include/test/mir_test_doubles/mock_framebuffer_bundle.h 2013-11-19 22:41:51 +0000
+++ include/test/mir_test_doubles/mock_framebuffer_bundle.h 2013-12-11 07:33:52 +0000
@@ -19,7 +19,7 @@
19#ifndef MIR_TEST_DOUBLES_MOCK_FRAMEBUFFER_BUNDLE_H_19#ifndef MIR_TEST_DOUBLES_MOCK_FRAMEBUFFER_BUNDLE_H_
20#define MIR_TEST_DOUBLES_MOCK_FRAMEBUFFER_BUNDLE_H_20#define MIR_TEST_DOUBLES_MOCK_FRAMEBUFFER_BUNDLE_H_
2121
22#include "src/server/graphics/android/framebuffer_bundle.h"22#include "src/platform/graphics/android/framebuffer_bundle.h"
23#include "stub_buffer.h"23#include "stub_buffer.h"
24#include <gmock/gmock.h>24#include <gmock/gmock.h>
2525
@@ -38,7 +38,7 @@
38 ON_CALL(*this, last_rendered_buffer())38 ON_CALL(*this, last_rendered_buffer())
39 .WillByDefault(Return(std::make_shared<StubBuffer>()));39 .WillByDefault(Return(std::make_shared<StubBuffer>()));
40 }40 }
41 MOCK_METHOD0(fb_format, geometry::PixelFormat());41 MOCK_METHOD0(fb_format, MirPixelFormat());
42 MOCK_METHOD0(fb_size, geometry::Size());42 MOCK_METHOD0(fb_size, geometry::Size());
43 MOCK_METHOD0(buffer_for_render, std::shared_ptr<graphics::Buffer>());43 MOCK_METHOD0(buffer_for_render, std::shared_ptr<graphics::Buffer>());
44 MOCK_METHOD0(last_rendered_buffer, std::shared_ptr<graphics::Buffer>());44 MOCK_METHOD0(last_rendered_buffer, std::shared_ptr<graphics::Buffer>());
4545
=== modified file 'include/test/mir_test_doubles/mock_frontend_surface.h'
--- include/test/mir_test_doubles/mock_frontend_surface.h 2013-11-21 03:16:21 +0000
+++ include/test/mir_test_doubles/mock_frontend_surface.h 2013-12-11 07:33:52 +0000
@@ -39,10 +39,10 @@
3939
40 MOCK_METHOD0(destroy, void());40 MOCK_METHOD0(destroy, void());
41 MOCK_METHOD0(force_requests_to_complete, void());41 MOCK_METHOD0(force_requests_to_complete, void());
42 MOCK_METHOD0(advance_client_buffer, std::shared_ptr<graphics::Buffer>());42 MOCK_METHOD1(swap_buffers, void(graphics::Buffer*&));
4343
44 MOCK_CONST_METHOD0(size, geometry::Size());44 MOCK_CONST_METHOD0(size, geometry::Size());
45 MOCK_CONST_METHOD0(pixel_format, geometry::PixelFormat());45 MOCK_CONST_METHOD0(pixel_format, MirPixelFormat());
4646
47 MOCK_CONST_METHOD0(supports_input, bool());47 MOCK_CONST_METHOD0(supports_input, bool());
48 MOCK_CONST_METHOD0(client_input_fd, int());48 MOCK_CONST_METHOD0(client_input_fd, int());
4949
=== modified file 'include/test/mir_test_doubles/mock_hwc_composer_device_1.h'
--- include/test/mir_test_doubles/mock_hwc_composer_device_1.h 2013-11-21 03:16:21 +0000
+++ include/test/mir_test_doubles/mock_hwc_composer_device_1.h 2013-12-11 07:33:52 +0000
@@ -66,7 +66,7 @@
6666
67 void hwc_set_return_fence(int fence)67 void hwc_set_return_fence(int fence)
68 {68 {
69 fb_fence = fence; 69 fb_fence = fence;
70 }70 }
7171
72 int save_last_prepare_arguments(struct hwc_composer_device_1 *, size_t, hwc_display_contents_1_t** displays)72 int save_last_prepare_arguments(struct hwc_composer_device_1 *, size_t, hwc_display_contents_1_t** displays)
@@ -87,7 +87,7 @@
87 set_layerlist.back().visibleRegionScreen = {0, nullptr};87 set_layerlist.back().visibleRegionScreen = {0, nullptr};
88 }88 }
8989
90 if (primary_display->hwLayers)90 if (primary_display->numHwLayers >= 2)
91 {91 {
92 primary_display->hwLayers[1].releaseFenceFd = fb_fence;92 primary_display->hwLayers[1].releaseFenceFd = fb_fence;
93 }93 }
9494
=== modified file 'include/test/mir_test_doubles/mock_hwc_layerlist.h'
--- include/test/mir_test_doubles/mock_hwc_layerlist.h 2013-09-25 15:46:05 +0000
+++ include/test/mir_test_doubles/mock_hwc_layerlist.h 2013-12-11 07:33:52 +0000
@@ -19,7 +19,7 @@
19#ifndef MIR_TEST_DOUBLES_MOCK_HWC_LAYERLIST_H_19#ifndef MIR_TEST_DOUBLES_MOCK_HWC_LAYERLIST_H_
20#define MIR_TEST_DOUBLES_MOCK_HWC_LAYERLIST_H_20#define MIR_TEST_DOUBLES_MOCK_HWC_LAYERLIST_H_
2121
22#include "src/server/graphics/android/hwc_layerlist.h"22#include "src/platform/graphics/android/hwc_layerlist.h"
2323
24#include <gmock/gmock.h>24#include <gmock/gmock.h>
2525
2626
=== modified file 'include/test/mir_test_doubles/mock_hwc_vsync_coordinator.h'
--- include/test/mir_test_doubles/mock_hwc_vsync_coordinator.h 2013-05-20 15:29:28 +0000
+++ include/test/mir_test_doubles/mock_hwc_vsync_coordinator.h 2013-12-11 07:33:52 +0000
@@ -19,7 +19,7 @@
19#ifndef MIR_TEST_DOUBLES_MOCK_HWC_VSYNC_COORDINATOR_H_19#ifndef MIR_TEST_DOUBLES_MOCK_HWC_VSYNC_COORDINATOR_H_
20#define MIR_TEST_DOUBLES_MOCK_HWC_VSYNC_COORDINATOR_H_20#define MIR_TEST_DOUBLES_MOCK_HWC_VSYNC_COORDINATOR_H_
2121
22#include "src/server/graphics/android/hwc_vsync_coordinator.h"22#include "src/platform/graphics/android/hwc_vsync_coordinator.h"
2323
24#include <gmock/gmock.h>24#include <gmock/gmock.h>
2525
2626
=== modified file 'include/test/mir_test_doubles/mock_input_dispatcher.h'
--- include/test/mir_test_doubles/mock_input_dispatcher.h 2013-05-24 18:23:48 +0000
+++ include/test/mir_test_doubles/mock_input_dispatcher.h 2013-12-11 07:33:52 +0000
@@ -45,7 +45,7 @@
45 MOCK_METHOD2(transferTouchFocus, bool(droidinput::sp<droidinput::InputChannel> const&, droidinput::sp<droidinput::InputChannel> const&));45 MOCK_METHOD2(transferTouchFocus, bool(droidinput::sp<droidinput::InputChannel> const&, droidinput::sp<droidinput::InputChannel> const&));
46 MOCK_METHOD3(registerInputChannel, droidinput::status_t(droidinput::sp<droidinput::InputChannel> const&, droidinput::sp<droidinput::InputWindowHandle> const&, bool));46 MOCK_METHOD3(registerInputChannel, droidinput::status_t(droidinput::sp<droidinput::InputChannel> const&, droidinput::sp<droidinput::InputWindowHandle> const&, bool));
47 MOCK_METHOD1(unregisterInputChannel, droidinput::status_t(droidinput::sp<droidinput::InputChannel> const&));47 MOCK_METHOD1(unregisterInputChannel, droidinput::status_t(droidinput::sp<droidinput::InputChannel> const&));
48 48
49 MOCK_METHOD1(setKeyboardFocus, void(droidinput::sp<droidinput::InputWindowHandle> const&));49 MOCK_METHOD1(setKeyboardFocus, void(droidinput::sp<droidinput::InputWindowHandle> const&));
50 MOCK_METHOD1(notifyWindowRemoved, void(droidinput::sp<droidinput::InputWindowHandle> const&));50 MOCK_METHOD1(notifyWindowRemoved, void(droidinput::sp<droidinput::InputWindowHandle> const&));
5151
5252
=== modified file 'include/test/mir_test_doubles/mock_input_surface.h'
--- include/test/mir_test_doubles/mock_input_surface.h 2013-08-28 03:41:48 +0000
+++ include/test/mir_test_doubles/mock_input_surface.h 2013-12-11 07:33:52 +0000
@@ -29,7 +29,7 @@
29namespace doubles29namespace doubles
30{30{
3131
32class MockInputSurface : public input::Surface 32class MockInputSurface : public input::Surface
33{33{
34public:34public:
35 MockInputSurface()35 MockInputSurface()
3636
=== modified file 'include/test/mir_test_doubles/mock_interpreter_resource_cache.h'
--- include/test/mir_test_doubles/mock_interpreter_resource_cache.h 2013-10-15 08:53:10 +0000
+++ include/test/mir_test_doubles/mock_interpreter_resource_cache.h 2013-12-11 07:33:52 +0000
@@ -18,7 +18,7 @@
18#ifndef MIR_TEST_DOUBLES_MOCK_INTERPRETER_RESOURCE_CACHE_H_18#ifndef MIR_TEST_DOUBLES_MOCK_INTERPRETER_RESOURCE_CACHE_H_
19#define MIR_TEST_DOUBLES_MOCK_INTERPRETER_RESOURCE_CACHE_H_19#define MIR_TEST_DOUBLES_MOCK_INTERPRETER_RESOURCE_CACHE_H_
2020
21#include "src/server/graphics/android/interpreter_resource_cache.h"21#include "src/platform/graphics/android/interpreter_resource_cache.h"
2222
23namespace mir23namespace mir
24{24{
2525
=== modified file 'include/test/mir_test_doubles/mock_session_listener.h'
--- include/test/mir_test_doubles/mock_session_listener.h 2013-07-18 22:51:42 +0000
+++ include/test/mir_test_doubles/mock_session_listener.h 2013-12-11 07:33:52 +0000
@@ -38,7 +38,7 @@
38 MOCK_METHOD1(stopping, void(std::shared_ptr<shell::Session> const&));38 MOCK_METHOD1(stopping, void(std::shared_ptr<shell::Session> const&));
39 MOCK_METHOD1(focused, void(std::shared_ptr<shell::Session> const&));39 MOCK_METHOD1(focused, void(std::shared_ptr<shell::Session> const&));
40 MOCK_METHOD0(unfocused, void());40 MOCK_METHOD0(unfocused, void());
41 41
42 MOCK_METHOD2(surface_created, void(shell::Session&, std::shared_ptr<shell::Surface> const&));42 MOCK_METHOD2(surface_created, void(shell::Session&, std::shared_ptr<shell::Surface> const&));
43 MOCK_METHOD2(destroying_surface, void(shell::Session&, std::shared_ptr<shell::Surface> const&));43 MOCK_METHOD2(destroying_surface, void(shell::Session&, std::shared_ptr<shell::Surface> const&));
44};44};
4545
=== modified file 'include/test/mir_test_doubles/mock_shell_session.h'
--- include/test/mir_test_doubles/mock_shell_session.h 2013-11-21 03:16:21 +0000
+++ include/test/mir_test_doubles/mock_shell_session.h 2013-12-11 07:33:52 +0000
@@ -46,7 +46,7 @@
4646
47 MOCK_METHOD0(hide, void());47 MOCK_METHOD0(hide, void());
48 MOCK_METHOD0(show, void());48 MOCK_METHOD0(show, void());
49 49
50 MOCK_METHOD1(send_display_config, void(graphics::DisplayConfiguration const&));50 MOCK_METHOD1(send_display_config, void(graphics::DisplayConfiguration const&));
51 MOCK_METHOD3(configure_surface, int(frontend::SurfaceId, MirSurfaceAttrib, int));51 MOCK_METHOD3(configure_surface, int(frontend::SurfaceId, MirSurfaceAttrib, int));
5252
5353
=== modified file 'include/test/mir_test_doubles/mock_surface.h'
--- include/test/mir_test_doubles/mock_surface.h 2013-11-21 12:34:49 +0000
+++ include/test/mir_test_doubles/mock_surface.h 2013-12-11 07:33:52 +0000
@@ -38,8 +38,8 @@
3838
39struct MockSurface : public scene::SurfaceImpl39struct MockSurface : public scene::SurfaceImpl
40{40{
41 MockSurface(shell::Session* session, std::shared_ptr<scene::SurfaceBuilder> const& builder) :41 MockSurface(std::shared_ptr<scene::SurfaceBuilder> const& builder) :
42 scene::SurfaceImpl(session, builder, std::make_shared<NullSurfaceConfigurator>(), shell::a_surface(),42 scene::SurfaceImpl(builder, std::make_shared<NullSurfaceConfigurator>(), shell::a_surface(),
43 frontend::SurfaceId{}, std::make_shared<NullEventSink>())43 frontend::SurfaceId{}, std::make_shared<NullEventSink>())
44 {44 {
45 }45 }
@@ -49,14 +49,14 @@
49 MOCK_METHOD0(hide, void());49 MOCK_METHOD0(hide, void());
50 MOCK_METHOD0(show, void());50 MOCK_METHOD0(show, void());
51 MOCK_METHOD0(visible, bool());51 MOCK_METHOD0(visible, bool());
52 MOCK_METHOD1(raise, void(std::shared_ptr<shell::SurfaceController> const&));52 MOCK_METHOD1(raise, void(std::shared_ptr<scene::SurfaceRanker> const&));
5353
54 MOCK_METHOD0(force_requests_to_complete, void());54 MOCK_METHOD0(force_requests_to_complete, void());
55 MOCK_METHOD0(advance_client_buffer, std::shared_ptr<graphics::Buffer>());55 MOCK_METHOD0(advance_client_buffer, std::shared_ptr<graphics::Buffer>());
5656
57 MOCK_CONST_METHOD0(name, std::string());57 MOCK_CONST_METHOD0(name, std::string());
58 MOCK_CONST_METHOD0(size, geometry::Size());58 MOCK_CONST_METHOD0(size, geometry::Size());
59 MOCK_CONST_METHOD0(pixel_format, geometry::PixelFormat());59 MOCK_CONST_METHOD0(pixel_format, MirPixelFormat());
6060
61 MOCK_CONST_METHOD0(supports_input, bool());61 MOCK_CONST_METHOD0(supports_input, bool());
62 MOCK_CONST_METHOD0(client_input_fd, int());62 MOCK_CONST_METHOD0(client_input_fd, int());
6363
=== renamed file 'include/test/mir_test_doubles/mock_surface_controller.h' => 'include/test/mir_test_doubles/mock_surface_ranker.h'
--- include/test/mir_test_doubles/mock_surface_controller.h 2013-11-21 12:34:49 +0000
+++ include/test/mir_test_doubles/mock_surface_ranker.h 2013-12-11 07:33:52 +0000
@@ -17,10 +17,10 @@
17 */17 */
1818
1919
20#ifndef MIR_TEST_DOUBLES_MOCK_SURFACE_CONTROLLER_H_20#ifndef MIR_TEST_DOUBLES_MOCK_SURFACE_RANKER_H_
21#define MIR_TEST_DOUBLES_MOCK_SURFACE_CONTROLLER_H_21#define MIR_TEST_DOUBLES_MOCK_SURFACE_RANKER_H_
2222
23#include "mir/shell/surface_controller.h"23#include "src/server/scene/surface_ranker.h"
2424
25#include <gmock/gmock.h>25#include <gmock/gmock.h>
2626
@@ -31,7 +31,7 @@
31namespace doubles31namespace doubles
32{32{
3333
34struct MockSurfaceController : public shell::SurfaceController34struct MockSurfaceRanker : public scene::SurfaceRanker
35{35{
36 MOCK_METHOD1(raise, void(std::weak_ptr<scene::BasicSurface> const&));36 MOCK_METHOD1(raise, void(std::weak_ptr<scene::BasicSurface> const&));
37};37};
@@ -41,4 +41,4 @@
41}41}
4242
4343
44#endif /* MIR_TEST_DOUBLES_MOCK_SURFACE_CONTROLLER_H_ */44#endif /* MIR_TEST_DOUBLES_MOCK_SURFACE_RANKER_H_ */
4545
=== modified file 'include/test/mir_test_doubles/mock_surface_renderer.h'
--- include/test/mir_test_doubles/mock_surface_renderer.h 2013-11-21 03:16:21 +0000
+++ include/test/mir_test_doubles/mock_surface_renderer.h 2013-12-11 07:33:52 +0000
@@ -18,7 +18,6 @@
18#ifndef MIR_TEST_DOUBLES_MOCK_SURFACE_RENDERER_H_18#ifndef MIR_TEST_DOUBLES_MOCK_SURFACE_RENDERER_H_
19#define MIR_TEST_DOUBLES_MOCK_SURFACE_RENDERER_H_19#define MIR_TEST_DOUBLES_MOCK_SURFACE_RENDERER_H_
2020
21#include "mir/compositor/buffer_stream.h"
22#include "src/server/compositor/renderer.h"21#include "src/server/compositor/renderer.h"
2322
24#include <gmock/gmock.h>23#include <gmock/gmock.h>
@@ -32,9 +31,8 @@
3231
33struct MockSurfaceRenderer : public compositor::Renderer32struct MockSurfaceRenderer : public compositor::Renderer
34{33{
35 MOCK_METHOD3(render, void(34 MOCK_CONST_METHOD2(render, void(compositor::CompositingCriteria const&, graphics::Buffer&));
36 std::function<void(std::shared_ptr<void> const&)>, compositor::CompositingCriteria const&, compositor::BufferStream&));35 MOCK_CONST_METHOD0(clear, void());
37 MOCK_METHOD1(clear, void(unsigned long));
3836
39 ~MockSurfaceRenderer() noexcept {}37 ~MockSurfaceRenderer() noexcept {}
40};38};
4139
=== modified file 'include/test/mir_test_doubles/null_video_devices.h'
--- include/test/mir_test_doubles/null_video_devices.h 2013-08-28 03:41:48 +0000
+++ include/test/mir_test_doubles/null_video_devices.h 2013-12-11 07:33:52 +0000
@@ -19,7 +19,7 @@
19#ifndef MIR_TEST_DOUBLES_NULL_VIDEO_DEVICES_H_19#ifndef MIR_TEST_DOUBLES_NULL_VIDEO_DEVICES_H_
20#define MIR_TEST_DOUBLES_NULL_VIDEO_DEVICES_H_20#define MIR_TEST_DOUBLES_NULL_VIDEO_DEVICES_H_
2121
22#include "src/server/graphics/gbm/video_devices.h"22#include "src/platform/graphics/mesa/video_devices.h"
2323
24namespace mir24namespace mir
25{25{
@@ -28,7 +28,7 @@
28namespace doubles28namespace doubles
29{29{
3030
31class NullVideoDevices : public graphics::gbm::VideoDevices31class NullVideoDevices : public graphics::mesa::VideoDevices
32{32{
33public:33public:
34 void register_change_handler(34 void register_change_handler(
3535
=== modified file 'include/test/mir_test_doubles/null_virtual_terminal.h'
--- include/test/mir_test_doubles/null_virtual_terminal.h 2013-08-28 03:41:48 +0000
+++ include/test/mir_test_doubles/null_virtual_terminal.h 2013-12-11 07:33:52 +0000
@@ -19,7 +19,7 @@
19#ifndef MIR_TEST_DOUBLES_NULL_VIRTUAL_TERMINAL_H_19#ifndef MIR_TEST_DOUBLES_NULL_VIRTUAL_TERMINAL_H_
20#define MIR_TEST_DOUBLES_NULL_VIRTUAL_TERMINAL_H_20#define MIR_TEST_DOUBLES_NULL_VIRTUAL_TERMINAL_H_
2121
22#include "src/server/graphics/gbm/virtual_terminal.h"22#include "src/platform/graphics/mesa/virtual_terminal.h"
2323
24namespace mir24namespace mir
25{25{
@@ -28,7 +28,7 @@
28namespace doubles28namespace doubles
29{29{
3030
31class NullVirtualTerminal : public graphics::gbm::VirtualTerminal31class NullVirtualTerminal : public graphics::mesa::VirtualTerminal
32{32{
33public:33public:
34 void set_graphics_mode() {}34 void set_graphics_mode() {}
3535
=== modified file 'include/test/mir_test_doubles/stub_buffer.h'
--- include/test/mir_test_doubles/stub_buffer.h 2013-10-15 08:53:10 +0000
+++ include/test/mir_test_doubles/stub_buffer.h 2013-12-11 07:33:52 +0000
@@ -40,7 +40,7 @@
40public:40public:
41 StubBuffer()41 StubBuffer()
42 : buf_size{0, 0},42 : buf_size{0, 0},
43 buf_pixel_format{geometry::PixelFormat::abgr_8888}43 buf_pixel_format{mir_pixel_format_abgr_8888}
44 {44 {
45 }45 }
4646
@@ -54,7 +54,7 @@
5454
55 virtual geometry::Stride stride() const { return geometry::Stride(); }55 virtual geometry::Stride stride() const { return geometry::Stride(); }
5656
57 virtual geometry::PixelFormat pixel_format() const { return buf_pixel_format; }57 virtual MirPixelFormat pixel_format() const { return buf_pixel_format; }
5858
59 virtual std::shared_ptr<graphics::NativeBuffer> native_buffer_handle() const59 virtual std::shared_ptr<graphics::NativeBuffer> native_buffer_handle() const
60 {60 {
@@ -69,7 +69,7 @@
69 virtual bool can_bypass() const override { return false; }69 virtual bool can_bypass() const override { return false; }
7070
71 geometry::Size const buf_size;71 geometry::Size const buf_size;
72 geometry::PixelFormat const buf_pixel_format;72 MirPixelFormat const buf_pixel_format;
73};73};
74}74}
75}75}
7676
=== modified file 'include/test/mir_test_doubles/stub_buffer_allocator.h'
--- include/test/mir_test_doubles/stub_buffer_allocator.h 2013-11-21 03:16:21 +0000
+++ include/test/mir_test_doubles/stub_buffer_allocator.h 2013-12-11 07:33:52 +0000
@@ -43,7 +43,7 @@
43 return std::make_shared<StubBuffer>(properties);43 return std::make_shared<StubBuffer>(properties);
44 }44 }
4545
46 std::vector<geometry::PixelFormat> supported_pixel_formats()46 std::vector<MirPixelFormat> supported_pixel_formats()
47 {47 {
48 return {};48 return {};
49 }49 }
5050
=== modified file 'include/test/mir_test_doubles/stub_buffer_stream.h'
--- include/test/mir_test_doubles/stub_buffer_stream.h 2013-11-21 03:16:21 +0000
+++ include/test/mir_test_doubles/stub_buffer_stream.h 2013-12-11 07:33:52 +0000
@@ -34,30 +34,28 @@
34public:34public:
35 StubBufferStream()35 StubBufferStream()
36 {36 {
37 stub_client_buffer = std::make_shared<StubBuffer>();
38 stub_compositor_buffer = std::make_shared<StubBuffer>();37 stub_compositor_buffer = std::make_shared<StubBuffer>();
39 }38 }
40 std::shared_ptr<graphics::Buffer> secure_client_buffer()39 void swap_client_buffers(graphics::Buffer*& buffer) override
41 {40 {
42 return stub_client_buffer;41 buffer = &stub_client_buffer;
43 }42 }
4443 std::shared_ptr<graphics::Buffer> lock_compositor_buffer(unsigned long) override
45 std::shared_ptr<graphics::Buffer> lock_compositor_buffer(unsigned long)44 {
46 {45 return stub_compositor_buffer;
47 return stub_compositor_buffer;46 }
48 }47
4948 std::shared_ptr<graphics::Buffer> lock_snapshot_buffer() override
50 std::shared_ptr<graphics::Buffer> lock_snapshot_buffer()49 {
51 {50 return stub_compositor_buffer;
52 return stub_compositor_buffer;51 }
53 }52
5453 MirPixelFormat get_stream_pixel_format() override
55 geometry::PixelFormat get_stream_pixel_format()54 {
56 {55 return MirPixelFormat();
57 return geometry::PixelFormat();56 }
58 }57
5958 geometry::Size stream_size() override
60 geometry::Size stream_size()
61 {59 {
62 return geometry::Size();60 return geometry::Size();
63 }61 }
@@ -66,15 +64,15 @@
66 {64 {
67 }65 }
6866
69 void force_requests_to_complete()67 void force_requests_to_complete() override
70 {68 {
71 }69 }
7270
73 void allow_framedropping(bool)71 void allow_framedropping(bool) override
74 {72 {
75 }73 }
7674
77 std::shared_ptr<graphics::Buffer> stub_client_buffer;75 StubBuffer stub_client_buffer;
78 std::shared_ptr<graphics::Buffer> stub_compositor_buffer;76 std::shared_ptr<graphics::Buffer> stub_compositor_buffer;
79};77};
8078
8179
=== modified file 'include/test/mir_test_doubles/stub_display_builder.h'
--- include/test/mir_test_doubles/stub_display_builder.h 2013-11-19 19:11:49 +0000
+++ include/test/mir_test_doubles/stub_display_builder.h 2013-12-11 07:33:52 +0000
@@ -19,7 +19,7 @@
19#ifndef MIR_TEST_DOUBLES_STUB_DISPLAY_BUILDER_H_19#ifndef MIR_TEST_DOUBLES_STUB_DISPLAY_BUILDER_H_
20#define MIR_TEST_DOUBLES_STUB_DISPLAY_BUILDER_H_20#define MIR_TEST_DOUBLES_STUB_DISPLAY_BUILDER_H_
2121
22#include "src/server/graphics/android/display_builder.h"22#include "src/platform/graphics/android/display_builder.h"
23#include "stub_display_buffer.h"23#include "stub_display_buffer.h"
24#include "stub_display_device.h"24#include "stub_display_device.h"
25#include <gmock/gmock.h>25#include <gmock/gmock.h>
@@ -52,9 +52,9 @@
52 {52 {
53 }53 }
5454
55 geometry::PixelFormat display_format()55 MirPixelFormat display_format()
56 {56 {
57 return geometry::PixelFormat::abgr_8888;57 return mir_pixel_format_abgr_8888;
58 }58 }
5959
60 std::unique_ptr<graphics::DisplayBuffer> create_display_buffer(60 std::unique_ptr<graphics::DisplayBuffer> create_display_buffer(
@@ -64,7 +64,7 @@
64 return std::unique_ptr<graphics::DisplayBuffer>(64 return std::unique_ptr<graphics::DisplayBuffer>(
65 new StubDisplayBuffer(geometry::Rectangle{{0,0},sz}));65 new StubDisplayBuffer(geometry::Rectangle{{0,0},sz}));
66 }66 }
67 67
68 std::shared_ptr<graphics::android::DisplayDevice> create_display_device()68 std::shared_ptr<graphics::android::DisplayDevice> create_display_device()
69 {69 {
70 return stub_dev;70 return stub_dev;
7171
=== modified file 'include/test/mir_test_doubles/stub_display_configuration.h'
--- include/test/mir_test_doubles/stub_display_configuration.h 2013-11-21 03:16:21 +0000
+++ include/test/mir_test_doubles/stub_display_configuration.h 2013-12-11 07:33:52 +0000
@@ -21,7 +21,7 @@
2121
22#include "mir/graphics/display_configuration.h"22#include "mir/graphics/display_configuration.h"
23#include "mir/geometry/rectangle.h"23#include "mir/geometry/rectangle.h"
24#include "mir/geometry/pixel_format.h"24#include "mir_toolkit/common.h"
2525
26#include <vector>26#include <vector>
2727
@@ -43,15 +43,15 @@
43 StubDisplayConfig(unsigned int num_displays)43 StubDisplayConfig(unsigned int num_displays)
44 : StubDisplayConfig(num_displays,44 : StubDisplayConfig(num_displays,
45 {45 {
46 geometry::PixelFormat::bgr_888,46 mir_pixel_format_bgr_888,
47 geometry::PixelFormat::abgr_8888,47 mir_pixel_format_abgr_8888,
48 geometry::PixelFormat::xbgr_888848 mir_pixel_format_xbgr_8888
49 })49 })
50 {50 {
51 }51 }
5252
53 StubDisplayConfig(unsigned int num_displays,53 StubDisplayConfig(unsigned int num_displays,
54 std::vector<geometry::PixelFormat> const& pfs)54 std::vector<MirPixelFormat> const& pfs)
55 {55 {
56 /* construct a non-trivial dummy display config to send */56 /* construct a non-trivial dummy display config to send */
57 int mode_index = 0;57 int mode_index = 0;
@@ -67,7 +67,7 @@
67 modes.push_back(mode);67 modes.push_back(mode);
68 }68 }
6969
70 size_t mode_index = modes.size() - 1; 70 size_t mode_index = modes.size() - 1;
71 geometry::Size physical_size{};71 geometry::Size physical_size{};
72 geometry::Point top_left{};72 geometry::Point top_left{};
73 graphics::DisplayConfigurationOutput output{73 graphics::DisplayConfigurationOutput output{
@@ -105,7 +105,7 @@
105 graphics::DisplayConfigurationOutputId{id},105 graphics::DisplayConfigurationOutputId{id},
106 graphics::DisplayConfigurationCardId{0},106 graphics::DisplayConfigurationCardId{0},
107 graphics::DisplayConfigurationOutputType::vga,107 graphics::DisplayConfigurationOutputType::vga,
108 std::vector<geometry::PixelFormat>{geometry::PixelFormat::abgr_8888},108 std::vector<MirPixelFormat>{mir_pixel_format_abgr_8888},
109 {{rect.size, 60.0}},109 {{rect.size, 60.0}},
110 0, geometry::Size{}, true, true, rect.top_left, 0, 0, mir_power_mode_on110 0, geometry::Size{}, true, true, rect.top_left, 0, 0, mir_power_mode_on
111 };111 };
112112
=== modified file 'include/test/mir_test_doubles/stub_display_device.h'
--- include/test/mir_test_doubles/stub_display_device.h 2013-11-21 17:20:14 +0000
+++ include/test/mir_test_doubles/stub_display_device.h 2013-12-11 07:33:52 +0000
@@ -18,8 +18,8 @@
18#ifndef MIR_TEST_DOUBLES_STUB_DISPLAY_DEVICE_H_18#ifndef MIR_TEST_DOUBLES_STUB_DISPLAY_DEVICE_H_
19#define MIR_TEST_DOUBLES_STUB_DISPLAY_DEVICE_H_19#define MIR_TEST_DOUBLES_STUB_DISPLAY_DEVICE_H_
2020
21#include "src/server/graphics/android/display_device.h"21#include "src/platform/graphics/android/display_device.h"
22 22
23namespace mir23namespace mir
24{24{
25namespace test25namespace test
@@ -41,7 +41,7 @@
41 void prepare_composition()41 void prepare_composition()
42 {42 {
43 }43 }
44 void gpu_render(EGLDisplay, EGLSurface) 44 void gpu_render(EGLDisplay, EGLSurface)
45 {45 {
46 }46 }
47 void post(graphics::Buffer const&)47 void post(graphics::Buffer const&)
4848
=== modified file 'include/test/mir_test_doubles/stub_driver_interpreter.h'
--- include/test/mir_test_doubles/stub_driver_interpreter.h 2013-10-17 22:15:46 +0000
+++ include/test/mir_test_doubles/stub_driver_interpreter.h 2013-12-11 07:33:52 +0000
@@ -49,7 +49,7 @@
49 void driver_returns_buffer(ANativeWindowBuffer*, int)49 void driver_returns_buffer(ANativeWindowBuffer*, int)
50 {50 {
51 }51 }
52 void dispatch_driver_request_format(int) 52 void dispatch_driver_request_format(int)
53 {53 {
54 }54 }
55 int driver_requests_info(int index) const55 int driver_requests_info(int index) const
5656
=== modified file 'include/test/mir_test_doubles/stub_shell_session.h'
--- include/test/mir_test_doubles/stub_shell_session.h 2013-11-21 03:16:21 +0000
+++ include/test/mir_test_doubles/stub_shell_session.h 2013-12-11 07:33:52 +0000
@@ -66,7 +66,7 @@
66 void take_snapshot(shell::SnapshotCallback const&) override66 void take_snapshot(shell::SnapshotCallback const&) override
67 {67 {
68 }68 }
69 69
70 std::shared_ptr<shell::Surface> default_surface() const override70 std::shared_ptr<shell::Surface> default_surface() const override
71 {71 {
72 return std::shared_ptr<shell::Surface>();72 return std::shared_ptr<shell::Surface>();
7373
=== removed file 'include/test/mir_test_doubles/stub_surface.h'
--- include/test/mir_test_doubles/stub_surface.h 2013-11-21 03:16:21 +0000
+++ include/test/mir_test_doubles/stub_surface.h 1970-01-01 00:00:00 +0000
@@ -1,74 +0,0 @@
1/*
2 * Copyright © 2013 Canonical Ltd.
3 *
4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License version 3,
6 * as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authored by: Robert Carr <robert.carr@canonical.com>
17 */
18
19#ifndef MIR_TEST_DOUBLES_STUB_SURFACE_H_
20#define MIR_TEST_DOUBLES_STUB_SURFACE_H_
21
22#include "mir/frontend/surface.h"
23
24namespace mir
25{
26namespace test
27{
28namespace doubles
29{
30
31class StubSurface : public frontend::Surface
32{
33public:
34 virtual ~StubSurface() = default;
35
36 void hide() {}
37 void show() {}
38 void force_requests_to_complete() {}
39
40 geometry::Size size() const
41 {
42 return geometry::Size();
43 }
44 geometry::PixelFormat pixel_format() const
45 {
46 return geometry::PixelFormat();
47 }
48
49 std::shared_ptr<graphics::Buffer> advance_client_buffer()
50 {
51 return std::shared_ptr<graphics::Buffer>();
52 }
53
54 virtual int configure(MirSurfaceAttrib, int)
55 {
56 return 0;
57 }
58
59 virtual bool supports_input() const
60 {
61 return false;
62 }
63
64 virtual int client_input_fd() const
65 {
66 return 0;
67 }
68};
69
70}
71}
72} // namespace mir
73
74#endif // MIR_TEST_DOUBLES_STUB_SURFACE_H_
750
=== modified file 'include/test/mir_test_doubles/stub_surface_builder.h'
--- include/test/mir_test_doubles/stub_surface_builder.h 2013-11-21 12:34:49 +0000
+++ include/test/mir_test_doubles/stub_surface_builder.h 2013-12-11 07:33:52 +0000
@@ -21,7 +21,7 @@
21#define MIR_TEST_DOUBLES_STUB_SURFACE_BUILDER_H_21#define MIR_TEST_DOUBLES_STUB_SURFACE_BUILDER_H_
2222
23#include "src/server/scene/surface_builder.h"23#include "src/server/scene/surface_builder.h"
24#include "src/server/scene/surface.h"24#include "src/server/scene/basic_surface.h"
25#include "mir/scene/scene_report.h"25#include "mir/scene/scene_report.h"
26#include "mir/shell/surface_creation_parameters.h"26#include "mir/shell/surface_creation_parameters.h"
2727
@@ -44,10 +44,10 @@
44 {44 {
45 }45 }
4646
47 std::weak_ptr<scene::BasicSurface> create_surface(shell::Session*, shell::SurfaceCreationParameters const&)47 std::weak_ptr<scene::BasicSurface> create_surface(shell::SurfaceCreationParameters const&)
48 {48 {
49 auto state = std::make_shared<MockSurfaceState>();49 auto state = std::make_shared<MockSurfaceState>();
50 dummy_surface = std::make_shared<scene::Surface>(50 dummy_surface = std::make_shared<scene::BasicSurface>(
51 state, buffer_stream,51 state, buffer_stream,
52 std::shared_ptr<input::InputChannel>(),52 std::shared_ptr<input::InputChannel>(),
53 report);53 report);
5454
=== renamed file 'include/test/mir_test_doubles/stub_surface_controller.h' => 'include/test/mir_test_doubles/stub_surface_ranker.h'
--- include/test/mir_test_doubles/stub_surface_controller.h 2013-11-21 12:34:49 +0000
+++ include/test/mir_test_doubles/stub_surface_ranker.h 2013-12-11 07:33:52 +0000
@@ -17,10 +17,10 @@
17 */17 */
1818
1919
20#ifndef MIR_TEST_DOUBLES_STUB_SURFACE_CONTROLLER_H_20#ifndef MIR_TEST_DOUBLES_STUB_SURFACE_RANKER_H_
21#define MIR_TEST_DOUBLES_STUB_SURFACE_CONTROLLER_H_21#define MIR_TEST_DOUBLES_STUB_SURFACE_RANKER_H_
2222
23#include "mir/shell/surface_controller.h"23#include "src/server/scene/surface_ranker.h"
2424
25namespace mir25namespace mir
26{26{
@@ -29,7 +29,7 @@
29namespace doubles29namespace doubles
30{30{
3131
32struct StubSurfaceController : public shell::SurfaceController32struct StubSurfaceRanker : public scene::SurfaceRanker
33{33{
34 void raise(std::weak_ptr<scene::BasicSurface> const&) override34 void raise(std::weak_ptr<scene::BasicSurface> const&) override
35 {35 {
@@ -41,4 +41,4 @@
41}41}
4242
4343
44#endif /* MIR_TEST_DOUBLES_STUB_SURFACE_CONTROLLER_H_ */44#endif /* MIR_TEST_DOUBLES_STUB_SURFACE_RANKER_H_ */
4545
=== modified file 'include/test/mir_test_framework/cross_process_sync.h'
--- include/test/mir_test_framework/cross_process_sync.h 2013-09-20 22:16:11 +0000
+++ include/test/mir_test_framework/cross_process_sync.h 2013-12-11 07:33:52 +0000
@@ -45,7 +45,7 @@
45 // Throws std::runtime_error if not successful.45 // Throws std::runtime_error if not successful.
46 unsigned int wait_for_signal_ready_for(const std::chrono::milliseconds& duration);46 unsigned int wait_for_signal_ready_for(const std::chrono::milliseconds& duration);
47 unsigned int wait_for_signal_ready_for();47 unsigned int wait_for_signal_ready_for();
48 48
49 void signal_ready();49 void signal_ready();
50 unsigned int wait_for_signal_ready();50 unsigned int wait_for_signal_ready();
5151
5252
=== added file 'include/test/mir_test_framework/input_testing_client_configuration.h'
--- include/test/mir_test_framework/input_testing_client_configuration.h 1970-01-01 00:00:00 +0000
+++ include/test/mir_test_framework/input_testing_client_configuration.h 2013-12-11 07:33:52 +0000
@@ -0,0 +1,67 @@
1/*
2 * Copyright © 2013 Canonical Ltd.
3 *
4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License version 3,
6 * as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authored by: Robert Carr <robert.carr@canonical.com>n
17 */
18
19#ifndef MIR_TEST_FRAMEWORK_INPUT_TESTING_CLIENT_CONFIGURATION
20#define MIR_TEST_FRAMEWORK_INPUT_TESTING_CLIENT_CONFIGURATION
21
22#include "mir_test_framework/testing_client_configuration.h"
23#include "mir_test_framework/cross_process_sync.h"
24#include "mir_test/wait_condition.h"
25
26#include <mir_toolkit/event.h>
27
28#include <gmock/gmock.h>
29
30#include <string>
31
32namespace mir_test_framework
33{
34
35/// A fixture to be used with InputTestingServerConfiguration for input acceptance testing scenarios.
36/// By default, the client will connect and a surface will be created.
37/// The framework ensures the server will not send events before client is ready through CrossProcessSync.
38class InputTestingClientConfiguration : public TestingClientConfiguration
39{
40public:
41 InputTestingClientConfiguration(std::string const& client_name, CrossProcessSync const& input_cb_setup_fence);
42 virtual ~InputTestingClientConfiguration() = default;
43
44 void exec();
45
46 struct MockInputHandler
47 {
48 MOCK_METHOD1(handle_input, void(MirEvent const*));
49 };
50 // This function will be called at an appropriate time for input expectations to be set.
51 // on handler. It is expected that mt::WakeUp(all_events_received) will be triggered by
52 // the last expectation, as this is what triggers the verification of the Mock and
53 // termination of the testing client.
54 virtual void expect_input(MockInputHandler &handler, mir::test::WaitCondition& all_events_received) = 0;
55
56 // This fixture is intended to be used with InputTestingServer
57 // which allows for setting surface sizes as part of the
58 // input-testing shell.
59 static int const surface_width = 100;
60 static int const surface_height = 100;
61private:
62 std::string const client_name;
63 CrossProcessSync input_cb_setup_fence;
64};
65
66}
67#endif /* MIR_TEST_FRAMEWORK_INPUT_TESTING_CLIENT_CONFIGURATION */
068
=== modified file 'include/test/mir_test_framework/input_testing_server_configuration.h'
--- include/test/mir_test_framework/input_testing_server_configuration.h 2013-11-21 03:16:21 +0000
+++ include/test/mir_test_framework/input_testing_server_configuration.h 2013-12-11 07:33:52 +0000
@@ -59,7 +59,7 @@
5959
60 void exec();60 void exec();
61 void on_exit();61 void on_exit();
62 62
63 std::shared_ptr<mir::input::InputConfiguration> the_input_configuration() override;63 std::shared_ptr<mir::input::InputConfiguration> the_input_configuration() override;
6464
65 mir::input::android::FakeEventHub* fake_event_hub;65 mir::input::android::FakeEventHub* fake_event_hub;
@@ -71,7 +71,7 @@
7171
72private:72private:
73 std::thread input_injection_thread;73 std::thread input_injection_thread;
74 74
75 std::shared_ptr<mir::test::doubles::FakeEventHubInputConfiguration> input_configuration;75 std::shared_ptr<mir::test::doubles::FakeEventHubInputConfiguration> input_configuration;
76};76};
7777
7878
=== modified file 'include/test/mir_test_framework/testing_client_configuration.h'
--- include/test/mir_test_framework/testing_client_configuration.h 2013-09-25 18:25:11 +0000
+++ include/test/mir_test_framework/testing_client_configuration.h 2013-12-11 07:33:52 +0000
@@ -36,7 +36,7 @@
36 virtual bool use_real_graphics(mir::options::Option const& options)36 virtual bool use_real_graphics(mir::options::Option const& options)
37 {37 {
38 return options.get("tests-use-real-graphics", false);38 return options.get("tests-use-real-graphics", false);
39 } 39 }
40};40};
4141
42}42}
4343
=== modified file 'native-compile.sh'
--- native-compile.sh 2012-11-19 19:21:52 +0000
+++ native-compile.sh 2013-12-11 07:33:52 +0000
@@ -12,6 +12,6 @@
12cmake --build ${BUILD_DIR}12cmake --build ${BUILD_DIR}
1313
14GTEST_OUTPUT=xml:./14GTEST_OUTPUT=xml:./
15${BUILD_DIR}/bin/acceptance-tests15${BUILD_DIR}/bin/mir_acceptance_tests
16${BUILD_DIR}/bin/integration-tests16${BUILD_DIR}/bin/mir_integration_tests
17${BUILD_DIR}/bin/unit-tests17${BUILD_DIR}/bin/mir_unit_tests
1818
=== modified file 'src/client/CMakeLists.txt'
--- src/client/CMakeLists.txt 2013-11-21 03:16:21 +0000
+++ src/client/CMakeLists.txt 2013-12-11 07:33:52 +0000
@@ -50,15 +50,15 @@
50)50)
51endif()51endif()
5252
53if( MIR_PLATFORM STREQUAL "gbm")53if( MIR_PLATFORM STREQUAL "mesa")
54set(54set(
55 CLIENT_SOURCES55 CLIENT_SOURCES
5656
57 gbm/gbm_client_platform.cpp57 mesa/client_platform.cpp
58 gbm/gbm_client_buffer_factory.cpp58 mesa/client_buffer_factory.cpp
59 gbm/gbm_client_buffer.cpp59 mesa/client_buffer.cpp
60 gbm/mesa_native_display_container.cpp60 mesa/mesa_native_display_container.cpp
61 gbm/gbm_native_surface.cpp61 mesa/native_surface.cpp
62 ${CLIENT_SOURCES}62 ${CLIENT_SOURCES}
63)63)
64endif()64endif()
6565
=== modified file 'src/client/aging_buffer.h'
--- src/client/aging_buffer.h 2013-06-14 09:00:20 +0000
+++ src/client/aging_buffer.h 2013-12-11 07:33:52 +0000
@@ -30,7 +30,6 @@
30{30{
31public:31public:
32 AgingBuffer();32 AgingBuffer();
33 ~AgingBuffer() noexcept {}
3433
35 virtual uint32_t age() const;34 virtual uint32_t age() const;
36 virtual void increment_age();35 virtual void increment_age();
3736
=== modified file 'src/client/android/android_client_buffer.cpp'
--- src/client/android/android_client_buffer.cpp 2013-11-21 03:16:21 +0000
+++ src/client/android/android_client_buffer.cpp 2013-12-11 07:33:52 +0000
@@ -29,7 +29,7 @@
2929
30mcla::AndroidClientBuffer::AndroidClientBuffer(std::shared_ptr<AndroidRegistrar> const& registrar,30mcla::AndroidClientBuffer::AndroidClientBuffer(std::shared_ptr<AndroidRegistrar> const& registrar,
31 std::shared_ptr<const native_handle_t> const& handle,31 std::shared_ptr<const native_handle_t> const& handle,
32 geom::Size size, geom::PixelFormat pf, geometry::Stride stride)32 geom::Size size, MirPixelFormat pf, geometry::Stride stride)
33 : buffer_registrar(registrar),33 : buffer_registrar(registrar),
34 native_handle(handle),34 native_handle(handle),
35 buffer_pf(pf), buffer_stride{stride}, buffer_size(size)35 buffer_pf(pf), buffer_stride{stride}, buffer_size(size)
@@ -48,7 +48,7 @@
48 //note: mir uses stride in bytes, ANativeWindowBuffer needs it in pixel units. some drivers care48 //note: mir uses stride in bytes, ANativeWindowBuffer needs it in pixel units. some drivers care
49 //about byte-stride, they will pass stride via ANativeWindowBuffer::handle (which is opaque to us)49 //about byte-stride, they will pass stride via ANativeWindowBuffer::handle (which is opaque to us)
50 anwb->stride = stride.as_uint32_t() /50 anwb->stride = stride.as_uint32_t() /
51 geom::bytes_per_pixel(buffer_pf);51 MIR_BYTES_PER_PIXEL(buffer_pf);
52 anwb->usage = GRALLOC_USAGE_HW_TEXTURE | GRALLOC_USAGE_HW_RENDER;52 anwb->usage = GRALLOC_USAGE_HW_TEXTURE | GRALLOC_USAGE_HW_RENDER;
53 anwb->handle = native_handle.get();53 anwb->handle = native_handle.get();
5454
@@ -82,7 +82,7 @@
82 return buffer_stride;82 return buffer_stride;
83}83}
8484
85geom::PixelFormat mcla::AndroidClientBuffer::pixel_format() const85MirPixelFormat mcla::AndroidClientBuffer::pixel_format() const
86{86{
87 return buffer_pf;87 return buffer_pf;
88}88}
8989
=== modified file 'src/client/android/android_client_buffer.h'
--- src/client/android/android_client_buffer.h 2013-11-21 03:16:21 +0000
+++ src/client/android/android_client_buffer.h 2013-12-11 07:33:52 +0000
@@ -39,13 +39,13 @@
39public:39public:
40 AndroidClientBuffer(std::shared_ptr<AndroidRegistrar> const&,40 AndroidClientBuffer(std::shared_ptr<AndroidRegistrar> const&,
41 std::shared_ptr<const native_handle_t> const&,41 std::shared_ptr<const native_handle_t> const&,
42 geometry::Size size, geometry::PixelFormat pf, geometry::Stride stride);42 geometry::Size size, MirPixelFormat pf, geometry::Stride stride);
43 ~AndroidClientBuffer() noexcept;43 ~AndroidClientBuffer() noexcept;
4444
45 std::shared_ptr<MemoryRegion> secure_for_cpu_write();45 std::shared_ptr<MemoryRegion> secure_for_cpu_write();
46 geometry::Size size() const;46 geometry::Size size() const;
47 geometry::Stride stride() const;47 geometry::Stride stride() const;
48 geometry::PixelFormat pixel_format() const;48 MirPixelFormat pixel_format() const;
49 std::shared_ptr<mir::graphics::NativeBuffer> native_buffer_handle() const;49 std::shared_ptr<mir::graphics::NativeBuffer> native_buffer_handle() const;
5050
51 AndroidClientBuffer(const AndroidClientBuffer&) = delete;51 AndroidClientBuffer(const AndroidClientBuffer&) = delete;
@@ -56,7 +56,7 @@
56 std::shared_ptr<AndroidRegistrar> buffer_registrar;56 std::shared_ptr<AndroidRegistrar> buffer_registrar;
57 std::shared_ptr<graphics::android::AndroidNativeBuffer> native_window_buffer;57 std::shared_ptr<graphics::android::AndroidNativeBuffer> native_window_buffer;
58 std::shared_ptr<const native_handle_t> native_handle;58 std::shared_ptr<const native_handle_t> native_handle;
59 const geometry::PixelFormat buffer_pf;59 const MirPixelFormat buffer_pf;
60 geometry::Stride const buffer_stride;60 geometry::Stride const buffer_stride;
61 geometry::Size const buffer_size;61 geometry::Size const buffer_size;
62};62};
6363
=== modified file 'src/client/android/android_client_buffer_factory.cpp'
--- src/client/android/android_client_buffer_factory.cpp 2013-11-21 03:16:21 +0000
+++ src/client/android/android_client_buffer_factory.cpp 2013-12-11 07:33:52 +0000
@@ -29,7 +29,7 @@
29{29{
30}30}
3131
32std::shared_ptr<mcl::ClientBuffer> mcla::AndroidClientBufferFactory::create_buffer(std::shared_ptr<MirBufferPackage> const& package, geom::Size size, geom::PixelFormat pf)32std::shared_ptr<mcl::ClientBuffer> mcla::AndroidClientBufferFactory::create_buffer(std::shared_ptr<MirBufferPackage> const& package, geom::Size size, MirPixelFormat pf)
33{33{
34 (void)size; // TODO: remove this unused parameter34 (void)size; // TODO: remove this unused parameter
35 auto handle = registrar->register_buffer(package);35 auto handle = registrar->register_buffer(package);
3636
=== modified file 'src/client/android/android_client_buffer_factory.h'
--- src/client/android/android_client_buffer_factory.h 2013-04-24 05:22:20 +0000
+++ src/client/android/android_client_buffer_factory.h 2013-12-11 07:33:52 +0000
@@ -23,7 +23,7 @@
23#include <memory>23#include <memory>
2424
25#include "mir_toolkit/mir_client_library.h"25#include "mir_toolkit/mir_client_library.h"
26#include "mir/geometry/pixel_format.h"26#include "mir_toolkit/common.h"
27#include "mir/geometry/size.h"27#include "mir/geometry/size.h"
2828
29#include "../client_buffer_factory.h"29#include "../client_buffer_factory.h"
@@ -44,7 +44,7 @@
44 explicit AndroidClientBufferFactory(std::shared_ptr<AndroidRegistrar> const&);44 explicit AndroidClientBufferFactory(std::shared_ptr<AndroidRegistrar> const&);
4545
46 virtual std::shared_ptr<ClientBuffer> create_buffer(std::shared_ptr<MirBufferPackage> const& package,46 virtual std::shared_ptr<ClientBuffer> create_buffer(std::shared_ptr<MirBufferPackage> const& package,
47 geometry::Size size, geometry::PixelFormat pf);47 geometry::Size size, MirPixelFormat pf);
48private:48private:
49 std::shared_ptr<AndroidRegistrar> registrar;49 std::shared_ptr<AndroidRegistrar> registrar;
50};50};
5151
=== modified file 'src/client/android/android_client_platform.cpp'
--- src/client/android/android_client_platform.cpp 2013-10-15 08:53:10 +0000
+++ src/client/android/android_client_platform.cpp 2013-12-11 07:33:52 +0000
@@ -105,9 +105,9 @@
105105
106MirPlatformType mcla::AndroidClientPlatform::platform_type() const106MirPlatformType mcla::AndroidClientPlatform::platform_type() const
107{107{
108 return mir_platform_type_android; 108 return mir_platform_type_android;
109}109}
110 110
111MirNativeBuffer* mcla::AndroidClientPlatform::convert_native_buffer(graphics::NativeBuffer* buf) const111MirNativeBuffer* mcla::AndroidClientPlatform::convert_native_buffer(graphics::NativeBuffer* buf) const
112{112{
113 return buf->anwb();113 return buf->anwb();
114114
=== modified file 'src/client/android/android_client_platform.h'
--- src/client/android/android_client_platform.h 2013-10-15 08:53:10 +0000
+++ src/client/android/android_client_platform.h 2013-12-11 07:33:52 +0000
@@ -32,7 +32,7 @@
32class AndroidClientPlatform : public ClientPlatform32class AndroidClientPlatform : public ClientPlatform
33{33{
34public:34public:
35 MirPlatformType platform_type() const; 35 MirPlatformType platform_type() const;
36 std::shared_ptr<ClientBufferFactory> create_buffer_factory();36 std::shared_ptr<ClientBufferFactory> create_buffer_factory();
37 std::shared_ptr<EGLNativeWindowType> create_egl_native_window(ClientSurface *surface);37 std::shared_ptr<EGLNativeWindowType> create_egl_native_window(ClientSurface *surface);
38 std::shared_ptr<EGLNativeDisplayType> create_egl_native_display();38 std::shared_ptr<EGLNativeDisplayType> create_egl_native_display();
3939
=== modified file 'src/client/android/android_registrar.cpp'
--- src/client/android/android_registrar.cpp 2013-08-28 03:41:48 +0000
+++ src/client/android/android_registrar.cpp 2013-12-11 07:33:52 +0000
@@ -75,7 +75,7 @@
75 std::shared_ptr<MirBufferPackage> const& package) const75 std::shared_ptr<MirBufferPackage> const& package) const
76{76{
77 int native_handle_header_size = sizeof(native_handle_t);77 int native_handle_header_size = sizeof(native_handle_t);
78 int total_size = sizeof(int) * 78 int total_size = sizeof(int) *
79 (package->fd_items + package->data_items + native_handle_header_size);79 (package->fd_items + package->data_items + native_handle_header_size);
80 native_handle_t* handle = static_cast<native_handle_t*>(::operator new(total_size));80 native_handle_t* handle = static_cast<native_handle_t*>(::operator new(total_size));
81 handle->version = native_handle_header_size;81 handle->version = native_handle_header_size;
8282
=== modified file 'src/client/android/android_registrar_gralloc.h'
--- src/client/android/android_registrar_gralloc.h 2013-06-21 23:24:37 +0000
+++ src/client/android/android_registrar_gralloc.h 2013-12-11 07:33:52 +0000
@@ -20,7 +20,7 @@
20#ifndef MIR_CLIENT_ANDROID_ANDROID_REGISTRAR_GRALLOC_H_20#ifndef MIR_CLIENT_ANDROID_ANDROID_REGISTRAR_GRALLOC_H_
21#define MIR_CLIENT_ANDROID_ANDROID_REGISTRAR_GRALLOC_H_21#define MIR_CLIENT_ANDROID_ANDROID_REGISTRAR_GRALLOC_H_
2222
23#include "mir/geometry/pixel_format.h"23#include "mir_toolkit/common.h"
24#include "android_registrar.h"24#include "android_registrar.h"
25#include <hardware/gralloc.h>25#include <hardware/gralloc.h>
2626
2727
=== modified file 'src/client/android/client_surface_interpreter.cpp'
--- src/client/android/client_surface_interpreter.cpp 2013-11-21 03:16:21 +0000
+++ src/client/android/client_surface_interpreter.cpp 2013-12-11 07:33:52 +0000
@@ -29,7 +29,7 @@
29 : surface(surface),29 : surface(surface),
30 driver_pixel_format(-1),30 driver_pixel_format(-1),
31 sync_ops(std::make_shared<mga::RealSyncFileOps>())31 sync_ops(std::make_shared<mga::RealSyncFileOps>())
32 32
33{33{
34}34}
3535
3636
=== modified file 'src/client/android/client_surface_interpreter.h'
--- src/client/android/client_surface_interpreter.h 2013-10-15 08:53:10 +0000
+++ src/client/android/client_surface_interpreter.h 2013-12-11 07:33:52 +0000
@@ -30,7 +30,7 @@
30{30{
31class SyncFileOps;31class SyncFileOps;
32}32}
33} 33}
34namespace client34namespace client
35{35{
36namespace android36namespace android
3737
=== modified file 'src/client/client_buffer.h'
--- src/client/client_buffer.h 2013-10-15 08:53:10 +0000
+++ src/client/client_buffer.h 2013-12-11 07:33:52 +0000
@@ -22,7 +22,6 @@
2222
23#include "mir/graphics/native_buffer.h"23#include "mir/graphics/native_buffer.h"
24#include "mir_toolkit/common.h"24#include "mir_toolkit/common.h"
25#include "mir/geometry/pixel_format.h"
26#include "mir/geometry/size.h"25#include "mir/geometry/size.h"
2726
28#include <memory>27#include <memory>
@@ -46,7 +45,7 @@
46 geometry::Width width;45 geometry::Width width;
47 geometry::Height height;46 geometry::Height height;
48 geometry::Stride stride;47 geometry::Stride stride;
49 geometry::PixelFormat format;48 MirPixelFormat format;
50 std::shared_ptr<char> vaddr;49 std::shared_ptr<char> vaddr;
51};50};
5251
@@ -54,14 +53,20 @@
54{53{
55public:54public:
56 virtual ~ClientBuffer() = default;55 virtual ~ClientBuffer() = default;
56
57 virtual std::shared_ptr<MemoryRegion> secure_for_cpu_write() = 0;57 virtual std::shared_ptr<MemoryRegion> secure_for_cpu_write() = 0;
58 virtual geometry::Size size() const = 0;58 virtual geometry::Size size() const = 0;
59 virtual geometry::Stride stride() const = 0;59 virtual geometry::Stride stride() const = 0;
60 virtual geometry::PixelFormat pixel_format() const = 0;60 virtual MirPixelFormat pixel_format() const = 0;
61 virtual uint32_t age() const = 0;61 virtual uint32_t age() const = 0;
62 virtual void increment_age() = 0;62 virtual void increment_age() = 0;
63 virtual void mark_as_submitted() = 0;63 virtual void mark_as_submitted() = 0;
64 virtual std::shared_ptr<graphics::NativeBuffer> native_buffer_handle() const = 0;64 virtual std::shared_ptr<graphics::NativeBuffer> native_buffer_handle() const = 0;
65
66protected:
67 ClientBuffer() = default;
68 ClientBuffer(ClientBuffer const&) = delete;
69 ClientBuffer& operator=(ClientBuffer const&) = delete;
65};70};
6671
67}72}
6873
=== modified file 'src/client/client_buffer_depository.cpp'
--- src/client/client_buffer_depository.cpp 2013-08-28 03:41:48 +0000
+++ src/client/client_buffer_depository.cpp 2013-12-11 07:33:52 +0000
@@ -33,7 +33,7 @@
33{33{
34}34}
3535
36void mcl::ClientBufferDepository::deposit_package(std::shared_ptr<MirBufferPackage> const& package, int id, geometry::Size size, geometry::PixelFormat pf)36void mcl::ClientBufferDepository::deposit_package(std::shared_ptr<MirBufferPackage> const& package, int id, geometry::Size size, MirPixelFormat pf)
37{37{
38 auto existing_buffer_id_pair = buffers.end();38 auto existing_buffer_id_pair = buffers.end();
39 for (auto pair = buffers.begin(); pair != buffers.end(); ++pair)39 for (auto pair = buffers.begin(); pair != buffers.end(); ++pair)
4040
=== modified file 'src/client/client_buffer_depository.h'
--- src/client/client_buffer_depository.h 2013-08-28 03:41:48 +0000
+++ src/client/client_buffer_depository.h 2013-12-11 07:33:52 +0000
@@ -23,7 +23,7 @@
23#include <list>23#include <list>
24#include <memory>24#include <memory>
2525
26#include "mir/geometry/pixel_format.h"26#include "mir_toolkit/common.h"
27#include "mir/geometry/size.h"27#include "mir/geometry/size.h"
2828
29namespace mir29namespace mir
@@ -59,7 +59,7 @@
59 /// This also marks the previous current buffer (if any) as being submitted to the server.59 /// This also marks the previous current buffer (if any) as being submitted to the server.
60 /// \post current_buffer() will return a ClientBuffer constructed from this IPC data.60 /// \post current_buffer() will return a ClientBuffer constructed from this IPC data.
61 void deposit_package(std::shared_ptr<MirBufferPackage> const&, int id,61 void deposit_package(std::shared_ptr<MirBufferPackage> const&, int id,
62 geometry::Size, geometry::PixelFormat);62 geometry::Size, MirPixelFormat);
63 std::shared_ptr<ClientBuffer> current_buffer();63 std::shared_ptr<ClientBuffer> current_buffer();
64 uint32_t current_buffer_id() const;64 uint32_t current_buffer_id() const;
6565
6666
=== modified file 'src/client/client_buffer_factory.h'
--- src/client/client_buffer_factory.h 2013-06-17 09:51:42 +0000
+++ src/client/client_buffer_factory.h 2013-12-11 07:33:52 +0000
@@ -23,7 +23,7 @@
23#include <memory>23#include <memory>
2424
25#include "mir_toolkit/mir_client_library.h"25#include "mir_toolkit/mir_client_library.h"
26#include "mir/geometry/pixel_format.h"26#include "mir_toolkit/common.h"
27#include "mir/geometry/size.h"27#include "mir/geometry/size.h"
2828
29namespace mir29namespace mir
@@ -46,7 +46,7 @@
46 * \param [in] pf the buffer's pixel format46 * \param [in] pf the buffer's pixel format
47 */47 */
48 virtual std::shared_ptr<ClientBuffer> create_buffer(std::shared_ptr<MirBufferPackage> const& package,48 virtual std::shared_ptr<ClientBuffer> create_buffer(std::shared_ptr<MirBufferPackage> const& package,
49 geometry::Size size, geometry::PixelFormat pf) = 0;49 geometry::Size size, MirPixelFormat pf) = 0;
5050
51protected:51protected:
52 ClientBufferFactory() = default;52 ClientBufferFactory() = default;
5353
=== modified file 'src/client/client_platform.h'
--- src/client/client_platform.h 2013-10-15 08:53:10 +0000
+++ src/client/client_platform.h 2013-12-11 07:33:52 +0000
@@ -46,7 +46,7 @@
4646
47 virtual ~ClientPlatform() { /* TODO: make nothrow */ }47 virtual ~ClientPlatform() { /* TODO: make nothrow */ }
4848
49 virtual MirPlatformType platform_type() const = 0; 49 virtual MirPlatformType platform_type() const = 0;
50 virtual std::shared_ptr<ClientBufferFactory> create_buffer_factory() = 0;50 virtual std::shared_ptr<ClientBufferFactory> create_buffer_factory() = 0;
51 virtual std::shared_ptr<EGLNativeWindowType> create_egl_native_window(ClientSurface *surface) = 0;51 virtual std::shared_ptr<EGLNativeWindowType> create_egl_native_window(ClientSurface *surface) = 0;
52 virtual std::shared_ptr<EGLNativeDisplayType> create_egl_native_display() = 0;52 virtual std::shared_ptr<EGLNativeDisplayType> create_egl_native_display() = 0;
5353
=== modified file 'src/client/default_connection_configuration.cpp'
--- src/client/default_connection_configuration.cpp 2013-11-21 03:16:21 +0000
+++ src/client/default_connection_configuration.cpp 2013-12-11 07:33:52 +0000
@@ -128,7 +128,7 @@
128 {128 {
129 auto val_raw = getenv("MIR_CLIENT_INPUT_RECEIVER_REPORT");129 auto val_raw = getenv("MIR_CLIENT_INPUT_RECEIVER_REPORT");
130 std::string const val{val_raw ? val_raw : off_opt_val};130 std::string const val{val_raw ? val_raw : off_opt_val};
131 131
132 if (val == log_opt_val)132 if (val == log_opt_val)
133 return std::make_shared<mcl::logging::InputReceiverReport>(the_logger());133 return std::make_shared<mcl::logging::InputReceiverReport>(the_logger());
134 else134 else
135135
=== modified file 'src/client/display_configuration.cpp'
--- src/client/display_configuration.cpp 2013-10-15 08:53:10 +0000
+++ src/client/display_configuration.cpp 2013-12-11 07:33:52 +0000
@@ -48,8 +48,8 @@
48{48{
49 num_modes = num_modes_;49 num_modes = num_modes_;
50 modes = new MirDisplayMode[num_modes];50 modes = new MirDisplayMode[num_modes];
51 51
52 num_output_formats = num_formats; 52 num_output_formats = num_formats;
53 output_formats = new MirPixelFormat[num_formats];53 output_formats = new MirPixelFormat[num_formats];
54}54}
5555
@@ -77,8 +77,8 @@
77 for (auto i = 0u; i < output.num_modes; i++)77 for (auto i = 0u; i < output.num_modes; i++)
78 {78 {
79 auto mode = msg.mode(i);79 auto mode = msg.mode(i);
80 output.modes[i].horizontal_resolution = mode.horizontal_resolution(); 80 output.modes[i].horizontal_resolution = mode.horizontal_resolution();
81 output.modes[i].vertical_resolution = mode.vertical_resolution(); 81 output.modes[i].vertical_resolution = mode.vertical_resolution();
82 output.modes[i].refresh_rate = mode.refresh_rate();82 output.modes[i].refresh_rate = mode.refresh_rate();
83 }83 }
84 output.preferred_mode = msg.preferred_mode();84 output.preferred_mode = msg.preferred_mode();
@@ -161,7 +161,7 @@
161 {161 {
162 auto new_info = &new_config->outputs[i];162 auto new_info = &new_config->outputs[i];
163 MirDisplayOutput* output = outputs[i].get();163 MirDisplayOutput* output = outputs[i].get();
164 std::memcpy(new_info, output, sizeof(MirDisplayOutput)); 164 std::memcpy(new_info, output, sizeof(MirDisplayOutput));
165165
166 new_info->output_formats = new MirPixelFormat[new_info->num_output_formats];166 new_info->output_formats = new MirPixelFormat[new_info->num_output_formats];
167 auto format_size = sizeof(MirPixelFormat) * new_info->num_output_formats;167 auto format_size = sizeof(MirPixelFormat) * new_info->num_output_formats;
168168
=== modified file 'src/client/egl_native_display_container.h'
--- src/client/egl_native_display_container.h 2013-05-02 00:11:18 +0000
+++ src/client/egl_native_display_container.h 2013-12-11 07:33:52 +0000
@@ -16,8 +16,8 @@
16 * Authored by: Robert Carr <robert.carr@canonical.com>16 * Authored by: Robert Carr <robert.carr@canonical.com>
17 */17 */
1818
19#ifndef MIR_CLIENT_GBM_EGL_NATIVE_DISPLAY_CONTAINER_H_19#ifndef MIR_CLIENT_EGL_NATIVE_DISPLAY_CONTAINER_H_
20#define MIR_CLIENT_GBM_EGL_NATIVE_DISPLAY_CONTAINER_H_20#define MIR_CLIENT_EGL_NATIVE_DISPLAY_CONTAINER_H_
2121
22#include "mir_toolkit/client_types.h"22#include "mir_toolkit/client_types.h"
2323
@@ -47,4 +47,4 @@
47}47}
48} // namespace mir48} // namespace mir
4949
50#endif // MIR_CLIENT_GBM_EGL_NATIVE_DISPLAY_CONTAINER_H_50#endif // MIR_CLIENT_EGL_NATIVE_DISPLAY_CONTAINER_H_
5151
=== modified file 'src/client/logging/input_receiver_report.cpp'
--- src/client/logging/input_receiver_report.cpp 2013-11-05 22:31:59 +0000
+++ src/client/logging/input_receiver_report.cpp 2013-12-11 07:33:52 +0000
@@ -118,7 +118,7 @@
118 std::stringstream ss;118 std::stringstream ss;
119119
120 ss << "Received event:" << std::endl;120 ss << "Received event:" << std::endl;
121 121
122 format_event(ss, event);122 format_event(ss, event);
123123
124 logger->log<ml::Logger::debug>(ss.str(), component);124 logger->log<ml::Logger::debug>(ss.str(), component);
125125
=== renamed directory 'src/client/gbm' => 'src/client/mesa'
=== renamed file 'src/client/gbm/drm_fd_handler.h' => 'src/client/mesa/buffer_file_ops.h'
--- src/client/gbm/drm_fd_handler.h 2013-04-24 05:22:20 +0000
+++ src/client/mesa/buffer_file_ops.h 2013-12-11 07:33:52 +0000
@@ -16,8 +16,8 @@
16 * Authored by: Alexandros Frantzis <alexandros.frantzis@canonical.com>16 * Authored by: Alexandros Frantzis <alexandros.frantzis@canonical.com>
17 */17 */
1818
19#ifndef MIR_CLIENT_GBM_DRM_FD_HANDLER_19#ifndef MIR_CLIENT_MESA_BUFFER_FILE_OPS_
20#define MIR_CLIENT_GBM_DRM_FD_HANDLER_20#define MIR_CLIENT_MESA_BUFFER_FILE_OPS_
2121
22#include <sys/types.h>22#include <sys/types.h>
2323
@@ -25,28 +25,26 @@
25{25{
26namespace client26namespace client
27{27{
28namespace gbm28namespace mesa
29{29{
3030
31class DRMFDHandler31class BufferFileOps
32{32{
33public:33public:
34 virtual ~DRMFDHandler() {}34 virtual ~BufferFileOps() = default;
3535
36 virtual int ioctl(unsigned long request, void* arg) = 0;36 virtual int close(int fd) const = 0;
37 virtual int primeFDToHandle(int prime_fd, uint32_t *handle) = 0;37 virtual void* map(int fd, off_t offset, size_t size) const = 0;
38 virtual int close(int fd) = 0;38 virtual void unmap(void* addr, size_t size) const = 0;
39 virtual void* map(size_t size, off_t offset) = 0;
40 virtual void unmap(void* addr, size_t size) = 0;
4139
42protected:40protected:
43 DRMFDHandler() = default;41 BufferFileOps() = default;
44 DRMFDHandler(const DRMFDHandler&) = delete;42 BufferFileOps(BufferFileOps const&) = delete;
45 DRMFDHandler& operator=(const DRMFDHandler&) = delete;43 BufferFileOps& operator=(BufferFileOps const&) = delete;
46};44};
4745
48}46}
49}47}
50}48}
5149
52#endif /* MIR_CLIENT_GBM_DRM_FD_HANDLER_ */50#endif /* MIR_CLIENT_MESA_BUFFER_FILE_OPS_ */
5351
=== renamed file 'src/client/gbm/gbm_client_buffer.cpp' => 'src/client/mesa/client_buffer.cpp'
--- src/client/gbm/gbm_client_buffer.cpp 2013-11-21 03:16:21 +0000
+++ src/client/mesa/client_buffer.cpp 2013-12-11 07:33:52 +0000
@@ -17,91 +17,47 @@
17 */17 */
1818
19#include "mir_toolkit/mir_client_library.h"19#include "mir_toolkit/mir_client_library.h"
20#include "gbm_client_buffer.h"20#include "client_buffer.h"
21#include "drm_fd_handler.h"21#include "buffer_file_ops.h"
2222
23#include <boost/exception/errinfo_errno.hpp>23#include <boost/exception/errinfo_errno.hpp>
24#include <boost/throw_exception.hpp>24#include <boost/throw_exception.hpp>
2525
26#include <stdexcept>26#include <stdexcept>
2727
28#include <xf86drm.h>
29#include <string.h>
30#include <errno.h>28#include <errno.h>
31#include <sys/mman.h>29#include <sys/mman.h>
3230
33namespace mcl=mir::client;31namespace mcl=mir::client;
34namespace mclg=mir::client::gbm;32namespace mclm=mir::client::mesa;
35namespace geom=mir::geometry;33namespace geom=mir::geometry;
3634
37namespace35namespace
38{36{
3937
40struct GEMHandle
41{
42 GEMHandle(std::shared_ptr<mclg::DRMFDHandler> const& drm_fd_handler,
43 int prime_fd)
44 : drm_fd_handler{drm_fd_handler}
45 {
46 int ret = drm_fd_handler->primeFDToHandle(prime_fd, &handle);
47 if (ret)
48 {
49 std::string msg("Failed to import PRIME fd for DRM buffer");
50 BOOST_THROW_EXCEPTION(
51 boost::enable_error_info(
52 std::runtime_error(msg)) << boost::errinfo_errno(errno));
53 }
54 }
55
56 ~GEMHandle()
57 {
58 struct drm_gem_close arg;
59 arg.handle = handle;
60 // TODO (@raof): Error reporting? I do not believe it should be possible for this to fail,
61 // so if it does we should probably flag it.
62 drm_fd_handler->ioctl(DRM_IOCTL_GEM_CLOSE, &arg);
63 }
64
65 std::shared_ptr<mclg::DRMFDHandler> const drm_fd_handler;
66 uint32_t handle;
67};
68
69struct NullDeleter38struct NullDeleter
70{39{
71 void operator()(char *) const {}40 void operator()(char *) const {}
72};41};
7342
74struct GBMMemoryRegion : mcl::MemoryRegion43struct ShmMemoryRegion : mcl::MemoryRegion
75{44{
76 GBMMemoryRegion(std::shared_ptr<mclg::DRMFDHandler> const& drm_fd_handler,45 ShmMemoryRegion(std::shared_ptr<mclm::BufferFileOps> const& buffer_file_ops,
77 int prime_fd, geom::Size const& size_param,46 int buffer_fd, geom::Size const& size_param,
78 geom::Stride stride_param, geom::PixelFormat format_param)47 geom::Stride stride_param, MirPixelFormat format_param)
79 : drm_fd_handler{drm_fd_handler},48 : buffer_file_ops{buffer_file_ops},
80 gem_handle{drm_fd_handler, prime_fd},
81 size_in_bytes{size_param.height.as_uint32_t() * stride_param.as_uint32_t()}49 size_in_bytes{size_param.height.as_uint32_t() * stride_param.as_uint32_t()}
82 {50 {
51 static off_t const map_offset = 0;
83 width = size_param.width;52 width = size_param.width;
84 height = size_param.height;53 height = size_param.height;
85 stride = stride_param;54 stride = stride_param;
86 format = format_param;55 format = format_param;
8756
88 struct drm_mode_map_dumb map_dumb;57 void* map = buffer_file_ops->map(buffer_fd, map_offset, size_in_bytes);
89 memset(&map_dumb, 0, sizeof(map_dumb));
90 map_dumb.handle = gem_handle.handle;
91
92 int ret = drm_fd_handler->ioctl(DRM_IOCTL_MODE_MAP_DUMB, &map_dumb);
93 if (ret)
94 {
95 std::string msg("Failed to map dumb DRM buffer");
96 BOOST_THROW_EXCEPTION(
97 boost::enable_error_info(
98 std::runtime_error(msg)) << boost::errinfo_errno(errno));
99 }
100
101 void* map = drm_fd_handler->map(size_in_bytes, map_dumb.offset);
102 if (map == MAP_FAILED)58 if (map == MAP_FAILED)
103 {59 {
104 std::string msg("Failed to mmap DRM buffer");60 std::string msg("Failed to mmap buffer");
105 BOOST_THROW_EXCEPTION(61 BOOST_THROW_EXCEPTION(
106 boost::enable_error_info(62 boost::enable_error_info(
107 std::runtime_error(msg)) << boost::errinfo_errno(errno));63 std::runtime_error(msg)) << boost::errinfo_errno(errno));
@@ -110,63 +66,62 @@
110 vaddr = std::shared_ptr<char>(static_cast<char*>(map), NullDeleter());66 vaddr = std::shared_ptr<char>(static_cast<char*>(map), NullDeleter());
111 }67 }
11268
113 ~GBMMemoryRegion()69 ~ShmMemoryRegion()
114 {70 {
115 drm_fd_handler->unmap(vaddr.get(), size_in_bytes);71 buffer_file_ops->unmap(vaddr.get(), size_in_bytes);
116 }72 }
11773
118 std::shared_ptr<mclg::DRMFDHandler> const drm_fd_handler;74 std::shared_ptr<mclm::BufferFileOps> const buffer_file_ops;
119 GEMHandle const gem_handle;
120 size_t const size_in_bytes;75 size_t const size_in_bytes;
121};76};
12277
123}78}
12479
125mclg::GBMClientBuffer::GBMClientBuffer(80mclm::ClientBuffer::ClientBuffer(
126 std::shared_ptr<mclg::DRMFDHandler> const& drm_fd_handler,81 std::shared_ptr<mclm::BufferFileOps> const& buffer_file_ops,
127 std::shared_ptr<MirBufferPackage> const& package,82 std::shared_ptr<MirBufferPackage> const& package,
128 geom::Size size, geom::PixelFormat pf)83 geom::Size size, MirPixelFormat pf)
129 : drm_fd_handler{drm_fd_handler},84 : buffer_file_ops{buffer_file_ops},
130 creation_package(std::move(package)),85 creation_package{package},
131 rect({geom::Point{0, 0}, size}),86 rect({geom::Point{0, 0}, size}),
132 buffer_pf{pf}87 buffer_pf{pf}
133{88{
134}89}
13590
136mclg::GBMClientBuffer::~GBMClientBuffer() noexcept91mclm::ClientBuffer::~ClientBuffer() noexcept
137{92{
138 // TODO (@raof): Error reporting? It should not be possible for this to fail; if it does,93 // TODO (@raof): Error reporting? It should not be possible for this to fail; if it does,
139 // something's seriously wrong.94 // something's seriously wrong.
140 drm_fd_handler->close(creation_package->fd[0]);95 buffer_file_ops->close(creation_package->fd[0]);
141}96}
14297
143std::shared_ptr<mcl::MemoryRegion> mclg::GBMClientBuffer::secure_for_cpu_write()98std::shared_ptr<mcl::MemoryRegion> mclm::ClientBuffer::secure_for_cpu_write()
144{99{
145 const int prime_fd = creation_package->fd[0];100 int const buffer_fd = creation_package->fd[0];
146101
147 return std::make_shared<GBMMemoryRegion>(drm_fd_handler,102 return std::make_shared<ShmMemoryRegion>(buffer_file_ops,
148 prime_fd,103 buffer_fd,
149 size(),104 size(),
150 stride(),105 stride(),
151 pixel_format());106 pixel_format());
152}107}
153108
154geom::Size mclg::GBMClientBuffer::size() const109geom::Size mclm::ClientBuffer::size() const
155{110{
156 return rect.size;111 return rect.size;
157}112}
158113
159geom::Stride mclg::GBMClientBuffer::stride() const114geom::Stride mclm::ClientBuffer::stride() const
160{115{
161 return geom::Stride{creation_package->stride};116 return geom::Stride{creation_package->stride};
162}117}
163118
164geom::PixelFormat mclg::GBMClientBuffer::pixel_format() const119MirPixelFormat mclm::ClientBuffer::pixel_format() const
165{120{
166 return buffer_pf;121 return buffer_pf;
167}122}
168123
169std::shared_ptr<MirNativeBuffer> mclg::GBMClientBuffer::native_buffer_handle() const124std::shared_ptr<MirNativeBuffer> mclm::ClientBuffer::native_buffer_handle() const
170{125{
171 creation_package->age = age();126 creation_package->age = age();
172 return creation_package;127 return creation_package;
173128
=== renamed file 'src/client/gbm/gbm_client_buffer.h' => 'src/client/mesa/client_buffer.h'
--- src/client/gbm/gbm_client_buffer.h 2013-11-21 03:16:21 +0000
+++ src/client/mesa/client_buffer.h 2013-12-11 07:33:52 +0000
@@ -17,8 +17,8 @@
17 * Kevin DuBois <kevin.dubois@canonical.com>17 * Kevin DuBois <kevin.dubois@canonical.com>
18 */18 */
1919
20#ifndef MIR_CLIENT_GBM_GBM_CLIENT_BUFFER_H_20#ifndef MIR_CLIENT_MESA_CLIENT_BUFFER_H_
21#define MIR_CLIENT_GBM_GBM_CLIENT_BUFFER_H_21#define MIR_CLIENT_MESA_CLIENT_BUFFER_H_
2222
23#include "../aging_buffer.h"23#include "../aging_buffer.h"
24#include "mir_toolkit/mir_client_library.h"24#include "mir_toolkit/mir_client_library.h"
@@ -30,37 +30,35 @@
30{30{
31namespace client31namespace client
32{32{
33namespace gbm33namespace mesa
34{34{
3535
36class DRMFDHandler;36class BufferFileOps;
3737
38class GBMClientBuffer : public AgingBuffer38class ClientBuffer : public AgingBuffer
39{39{
40public:40public:
41 GBMClientBuffer(std::shared_ptr<DRMFDHandler> const& drm_fd_handler,41 ClientBuffer(std::shared_ptr<BufferFileOps> const& buffer_file_ops,
42 std::shared_ptr<MirBufferPackage> const& buffer_package,42 std::shared_ptr<MirBufferPackage> const& buffer_package,
43 geometry::Size size,43 geometry::Size size,
44 geometry::PixelFormat pf);44 MirPixelFormat pf);
4545
46 virtual ~GBMClientBuffer() noexcept;46 ~ClientBuffer() noexcept;
4747
48 std::shared_ptr<MemoryRegion> secure_for_cpu_write();48 std::shared_ptr<MemoryRegion> secure_for_cpu_write();
49 geometry::Size size() const;49 geometry::Size size() const;
50 geometry::Stride stride() const;50 geometry::Stride stride() const;
51 geometry::PixelFormat pixel_format() const;51 MirPixelFormat pixel_format() const;
52 std::shared_ptr<MirNativeBuffer> native_buffer_handle() const;52 std::shared_ptr<MirNativeBuffer> native_buffer_handle() const;
5353
54 GBMClientBuffer(const GBMClientBuffer&) = delete;
55 GBMClientBuffer& operator=(const GBMClientBuffer&) = delete;
56private:54private:
57 const std::shared_ptr<DRMFDHandler> drm_fd_handler;55 std::shared_ptr<BufferFileOps> const buffer_file_ops;
58 const std::shared_ptr<MirBufferPackage> creation_package;56 std::shared_ptr<MirBufferPackage> const creation_package;
59 const geometry::Rectangle rect;57 geometry::Rectangle const rect;
60 const geometry::PixelFormat buffer_pf;58 MirPixelFormat const buffer_pf;
61};59};
6260
63}61}
64}62}
65}63}
66#endif /* MIR_CLIENT_GBM_GBM_CLIENT_BUFFER_H_ */64#endif /* MIR_CLIENT_MESA_CLIENT_BUFFER_H_ */
6765
=== renamed file 'src/client/gbm/gbm_client_buffer_factory.cpp' => 'src/client/mesa/client_buffer_factory.cpp'
--- src/client/gbm/gbm_client_buffer_factory.cpp 2013-11-21 03:16:21 +0000
+++ src/client/mesa/client_buffer_factory.cpp 2013-12-11 07:33:52 +0000
@@ -17,23 +17,27 @@
17 * Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>17 * Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
18 */18 */
1919
20#include "gbm_client_buffer_factory.h"20#include "client_buffer_factory.h"
21#include "gbm_client_buffer.h"21#include "client_buffer.h"
2222
23namespace mcl=mir::client;23namespace mcl=mir::client;
24namespace mclg=mir::client::gbm;24namespace mclm=mir::client::mesa;
2525
26mclg::GBMClientBufferFactory::GBMClientBufferFactory(26mclm::ClientBufferFactory::ClientBufferFactory(
27 std::shared_ptr<DRMFDHandler> const& drm_fd_handler)27 std::shared_ptr<BufferFileOps> const& buffer_file_ops)
28 : drm_fd_handler{drm_fd_handler}28 : buffer_file_ops{buffer_file_ops}
29{29{
30}30}
3131
32std::shared_ptr<mcl::ClientBuffer> mclg::GBMClientBufferFactory::create_buffer(std::shared_ptr<MirBufferPackage> const& package, geometry::Size size, geometry::PixelFormat pf)32std::shared_ptr<mcl::ClientBuffer>
33mclm::ClientBufferFactory::create_buffer(
34 std::shared_ptr<MirBufferPackage> const& package,
35 geometry::Size size,
36 MirPixelFormat pf)
33{37{
34 (void)size; // TODO: remove this unused parameter38 (void)size; // TODO: remove this unused parameter
35 return std::make_shared<mclg::GBMClientBuffer>(39 return std::make_shared<mclm::ClientBuffer>(
36 drm_fd_handler,40 buffer_file_ops,
37 package,41 package,
38 geometry::Size{package->width, package->height},42 geometry::Size{package->width, package->height},
39 pf);43 pf);
4044
=== renamed file 'src/client/gbm/gbm_client_buffer_factory.h' => 'src/client/mesa/client_buffer_factory.h'
--- src/client/gbm/gbm_client_buffer_factory.h 2013-04-24 05:22:20 +0000
+++ src/client/mesa/client_buffer_factory.h 2013-12-11 07:33:52 +0000
@@ -17,35 +17,33 @@
17 * Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>17 * Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
18 */18 */
1919
20#ifndef MIR_CLIENT_GBM_GBM_CLIENT_BUFFER_FACTORY_H_20#ifndef MIR_CLIENT_MESA_CLIENT_BUFFER_FACTORY_H_
21#define MIR_CLIENT_GBM_GBM_CLIENT_BUFFER_FACTORY_H_21#define MIR_CLIENT_MESA_CLIENT_BUFFER_FACTORY_H_
2222
23#include "../client_buffer_factory.h"23#include "../client_buffer_factory.h"
24#include "gbm_client_buffer.h"
2524
26namespace mir25namespace mir
27{26{
28namespace client27namespace client
29{28{
30class ClientBuffer;29namespace mesa
31
32namespace gbm
33{30{
3431
35class DRMFDHandler;32class BufferFileOps;
3633
37class GBMClientBufferFactory : public ClientBufferFactory34class ClientBufferFactory : public client::ClientBufferFactory
38{35{
39public:36public:
40 explicit GBMClientBufferFactory(std::shared_ptr<DRMFDHandler> const& drm_fd_handler);37 explicit ClientBufferFactory(std::shared_ptr<BufferFileOps> const& buffer_file_ops);
4138
42 std::shared_ptr<ClientBuffer> create_buffer(std::shared_ptr<MirBufferPackage> const& package,39 std::shared_ptr<client::ClientBuffer> create_buffer(
43 geometry::Size size, geometry::PixelFormat pf);40 std::shared_ptr<MirBufferPackage> const& package,
41 geometry::Size size, MirPixelFormat pf);
44private:42private:
45 std::shared_ptr<DRMFDHandler> drm_fd_handler;43 std::shared_ptr<BufferFileOps> const buffer_file_ops;
46};44};
4745
48}46}
49}47}
50}48}
51#endif /* MIR_CLIENT_GBM_GBM_CLIENT_BUFFER_FACTORY_H_ */49#endif /* MIR_CLIENT_MESA_CLIENT_BUFFER_FACTORY_H_ */
5250
=== renamed file 'src/client/gbm/gbm_client_platform.cpp' => 'src/client/mesa/client_platform.cpp'
--- src/client/gbm/gbm_client_platform.cpp 2013-10-15 08:53:10 +0000
+++ src/client/mesa/client_platform.cpp 2013-12-11 07:33:52 +0000
@@ -17,44 +17,28 @@
17 */17 */
1818
19#include "mir_toolkit/mir_client_library.h"19#include "mir_toolkit/mir_client_library.h"
20#include "gbm_client_platform.h"20#include "client_platform.h"
21#include "gbm_client_buffer_factory.h"21#include "client_buffer_factory.h"
22#include "mesa_native_display_container.h"22#include "mesa_native_display_container.h"
23#include "drm_fd_handler.h"23#include "buffer_file_ops.h"
24#include "gbm_native_surface.h"24#include "native_surface.h"
25#include "../mir_connection.h"25#include "../mir_connection.h"
26#include "../client_buffer_factory.h"26#include "../client_buffer_factory.h"
27#include "../native_client_platform_factory.h"27#include "../native_client_platform_factory.h"
2828
29#include <xf86drm.h>
30#include <sys/mman.h>29#include <sys/mman.h>
31#include <unistd.h>30#include <unistd.h>
3231
33namespace mcl=mir::client;32namespace mcl=mir::client;
34namespace mclg=mir::client::gbm;33namespace mclm=mir::client::mesa;
35namespace geom=mir::geometry;34namespace geom=mir::geometry;
3635
37namespace36namespace
38{37{
3938
40class RealDRMFDHandler : public mclg::DRMFDHandler39struct RealBufferFileOps : public mclm::BufferFileOps
41{40{
42public:41 int close(int fd) const
43 RealDRMFDHandler(int drm_fd) : drm_fd{drm_fd}
44 {
45 }
46
47 int ioctl(unsigned long request, void* arg)
48 {
49 return drmIoctl(drm_fd, request, arg);
50 }
51
52 int primeFDToHandle(int prime_fd, uint32_t *handle)
53 {
54 return drmPrimeFDToHandle(drm_fd, prime_fd, handle);
55 }
56
57 int close(int fd)
58 {42 {
59 while (::close(fd) == -1)43 while (::close(fd) == -1)
60 {44 {
@@ -65,19 +49,16 @@
65 return 0;49 return 0;
66 }50 }
6751
68 void* map(size_t size, off_t offset)52 void* map(int fd, off_t offset, size_t size) const
69 {53 {
70 return mmap(0, size, PROT_READ | PROT_WRITE, MAP_SHARED,54 return mmap(nullptr, size, PROT_READ | PROT_WRITE, MAP_SHARED,
71 drm_fd, offset);55 fd, offset);
72 }56 }
7357
74 void unmap(void* addr, size_t size)58 void unmap(void* addr, size_t size) const
75 {59 {
76 munmap(addr, size);60 munmap(addr, size);
77 }61 }
78
79private:
80 int drm_fd;
81};62};
8263
83struct NativeDisplayDeleter64struct NativeDisplayDeleter
@@ -101,40 +82,31 @@
101std::shared_ptr<mcl::ClientPlatform>82std::shared_ptr<mcl::ClientPlatform>
102mcl::NativeClientPlatformFactory::create_client_platform(mcl::ClientContext* context)83mcl::NativeClientPlatformFactory::create_client_platform(mcl::ClientContext* context)
103{84{
104 MirPlatformPackage platform_package;85 auto buffer_file_ops = std::make_shared<RealBufferFileOps>();
10586 return std::make_shared<mclm::ClientPlatform>(
106 memset(&platform_package, 0, sizeof(platform_package));87 context, buffer_file_ops, mcl::EGLNativeDisplayContainer::instance());
107 context->populate(platform_package);
108
109 int drm_fd = -1;
110
111 if (platform_package.fd_items > 0)
112 drm_fd = platform_package.fd[0];
113
114 auto drm_fd_handler = std::make_shared<RealDRMFDHandler>(drm_fd);
115 return std::make_shared<mclg::GBMClientPlatform>(context, drm_fd_handler, mcl::EGLNativeDisplayContainer::instance());
116}88}
11789
118mclg::GBMClientPlatform::GBMClientPlatform(90mclm::ClientPlatform::ClientPlatform(
119 ClientContext* const context,91 ClientContext* const context,
120 std::shared_ptr<DRMFDHandler> const& drm_fd_handler,92 std::shared_ptr<BufferFileOps> const& buffer_file_ops,
121 mcl::EGLNativeDisplayContainer& display_container)93 mcl::EGLNativeDisplayContainer& display_container)
122 : context{context},94 : context{context},
123 drm_fd_handler{drm_fd_handler},95 buffer_file_ops{buffer_file_ops},
124 display_container(display_container)96 display_container(display_container)
125{97{
126}98}
12799
128std::shared_ptr<mcl::ClientBufferFactory> mclg::GBMClientPlatform::create_buffer_factory()100std::shared_ptr<mcl::ClientBufferFactory> mclm::ClientPlatform::create_buffer_factory()
129{101{
130 return std::make_shared<mclg::GBMClientBufferFactory>(drm_fd_handler);102 return std::make_shared<mclm::ClientBufferFactory>(buffer_file_ops);
131}103}
132104
133namespace105namespace
134{106{
135struct NativeWindowDeleter107struct NativeWindowDeleter
136{108{
137 NativeWindowDeleter(mclg::GBMNativeSurface* window)109 NativeWindowDeleter(mclm::NativeSurface* window)
138 : window(window) {}110 : window(window) {}
139111
140 void operator()(EGLNativeWindowType* type)112 void operator()(EGLNativeWindowType* type)
@@ -144,21 +116,21 @@
144 }116 }
145117
146private:118private:
147 mclg::GBMNativeSurface* window;119 mclm::NativeSurface* window;
148};120};
149}121}
150122
151std::shared_ptr<EGLNativeWindowType> mclg::GBMClientPlatform::create_egl_native_window(ClientSurface* client_surface)123std::shared_ptr<EGLNativeWindowType> mclm::ClientPlatform::create_egl_native_window(ClientSurface* client_surface)
152{124{
153 //TODO: this is awkward on both android and gbm...125 //TODO: this is awkward on both android and gbm...
154 auto gbm_window = new GBMNativeSurface(*client_surface);126 auto native_window = new NativeSurface(*client_surface);
155 auto egl_native_window = new EGLNativeWindowType;127 auto egl_native_window = new EGLNativeWindowType;
156 *egl_native_window = gbm_window; 128 *egl_native_window = native_window;
157 NativeWindowDeleter deleter(gbm_window);129 NativeWindowDeleter deleter(native_window);
158 return std::shared_ptr<EGLNativeWindowType>(egl_native_window, deleter);130 return std::shared_ptr<EGLNativeWindowType>(egl_native_window, deleter);
159}131}
160132
161std::shared_ptr<EGLNativeDisplayType> mclg::GBMClientPlatform::create_egl_native_display()133std::shared_ptr<EGLNativeDisplayType> mclm::ClientPlatform::create_egl_native_display()
162{134{
163 MirEGLNativeDisplayType *mir_native_display = new MirEGLNativeDisplayType;135 MirEGLNativeDisplayType *mir_native_display = new MirEGLNativeDisplayType;
164 *mir_native_display = display_container.create(context->mir_connection());136 *mir_native_display = display_container.create(context->mir_connection());
@@ -167,12 +139,12 @@
167 return std::shared_ptr<EGLNativeDisplayType>(egl_native_display, NativeDisplayDeleter(display_container));139 return std::shared_ptr<EGLNativeDisplayType>(egl_native_display, NativeDisplayDeleter(display_container));
168}140}
169141
170MirPlatformType mclg::GBMClientPlatform::platform_type() const142MirPlatformType mclm::ClientPlatform::platform_type() const
171{143{
172 return mir_platform_type_gbm; 144 return mir_platform_type_gbm;
173} 145}
174146
175MirNativeBuffer* mclg::GBMClientPlatform::convert_native_buffer(graphics::NativeBuffer* buf) const147MirNativeBuffer* mclm::ClientPlatform::convert_native_buffer(graphics::NativeBuffer* buf) const
176{148{
177 //MirNativeBuffer is type-compatible with the MirNativeBuffer149 //MirNativeBuffer is type-compatible with the MirNativeBuffer
178 return buf;150 return buf;
179151
=== renamed file 'src/client/gbm/gbm_client_platform.h' => 'src/client/mesa/client_platform.h'
--- src/client/gbm/gbm_client_platform.h 2013-10-15 08:53:10 +0000
+++ src/client/mesa/client_platform.h 2013-12-11 07:33:52 +0000
@@ -15,8 +15,8 @@
15 *15 *
16 * Authored by: Kevin DuBois <kevin.dubois@canonical.com>16 * Authored by: Kevin DuBois <kevin.dubois@canonical.com>
17 */17 */
18#ifndef MIR_CLIENT_GBM_GBM_CLIENT_PLATFORM_H_18#ifndef MIR_CLIENT_MESA_CLIENT_PLATFORM_H_
19#define MIR_CLIENT_GBM_GBM_CLIENT_PLATFORM_H_19#define MIR_CLIENT_MESA_CLIENT_PLATFORM_H_
2020
21#include "../client_platform.h"21#include "../client_platform.h"
2222
@@ -27,19 +27,19 @@
27class ClientBufferDepository;27class ClientBufferDepository;
28class EGLNativeDisplayContainer;28class EGLNativeDisplayContainer;
2929
30namespace gbm30namespace mesa
31{31{
3232
33class DRMFDHandler;33class BufferFileOps;
3434
35class GBMClientPlatform : public ClientPlatform35class ClientPlatform : public client::ClientPlatform
36{36{
37public:37public:
38 GBMClientPlatform(ClientContext* const context,38 ClientPlatform(ClientContext* const context,
39 std::shared_ptr<DRMFDHandler> const& drm_fd_handler,39 std::shared_ptr<BufferFileOps> const& buffer_file_ops,
40 EGLNativeDisplayContainer& display_container);40 EGLNativeDisplayContainer& display_container);
4141
42 MirPlatformType platform_type() const; 42 MirPlatformType platform_type() const;
43 std::shared_ptr<ClientBufferFactory> create_buffer_factory();43 std::shared_ptr<ClientBufferFactory> create_buffer_factory();
44 std::shared_ptr<EGLNativeWindowType> create_egl_native_window(ClientSurface *surface);44 std::shared_ptr<EGLNativeWindowType> create_egl_native_window(ClientSurface *surface);
45 std::shared_ptr<EGLNativeDisplayType> create_egl_native_display();45 std::shared_ptr<EGLNativeDisplayType> create_egl_native_display();
@@ -47,7 +47,7 @@
4747
48private:48private:
49 ClientContext* const context;49 ClientContext* const context;
50 std::shared_ptr<DRMFDHandler> const drm_fd_handler;50 std::shared_ptr<BufferFileOps> const buffer_file_ops;
51 EGLNativeDisplayContainer& display_container;51 EGLNativeDisplayContainer& display_container;
52};52};
5353
@@ -55,4 +55,4 @@
55}55}
56}56}
5757
58#endif /* MIR_CLIENT_GBM_GBM_CLIENT_PLATFORM_H_ */58#endif /* MIR_CLIENT_MESA_CLIENT_PLATFORM_H_ */
5959
=== modified file 'src/client/mesa/mesa_native_display_container.cpp'
--- src/client/gbm/mesa_native_display_container.cpp 2013-08-28 03:41:48 +0000
+++ src/client/mesa/mesa_native_display_container.cpp 2013-12-11 07:33:52 +0000
@@ -25,15 +25,15 @@
25#include <mutex>25#include <mutex>
2626
27namespace mcl = mir::client;27namespace mcl = mir::client;
28namespace mclg = mcl::gbm;28namespace mclm = mcl::mesa;
2929
30namespace30namespace
31{31{
32extern "C"32extern "C"
33{33{
3434
35static int gbm_egl_display_get_platform(MirMesaEGLNativeDisplay* display,35static int egl_display_get_platform(MirMesaEGLNativeDisplay* display,
36 MirPlatformPackage* package)36 MirPlatformPackage* package)
37{37{
38 auto connection = static_cast<MirConnection*>(display->context);38 auto connection = static_cast<MirConnection*>(display->context);
39 mir_connection_get_platform(connection, package);39 mir_connection_get_platform(connection, package);
@@ -50,15 +50,15 @@
5050
51mcl::EGLNativeDisplayContainer& mcl::EGLNativeDisplayContainer::instance()51mcl::EGLNativeDisplayContainer& mcl::EGLNativeDisplayContainer::instance()
52{52{
53 static mclg::MesaNativeDisplayContainer default_display_container;53 static mclm::MesaNativeDisplayContainer default_display_container;
54 return default_display_container;54 return default_display_container;
55}55}
5656
57mclg::MesaNativeDisplayContainer::MesaNativeDisplayContainer()57mclm::MesaNativeDisplayContainer::MesaNativeDisplayContainer()
58{58{
59}59}
6060
61mclg::MesaNativeDisplayContainer::~MesaNativeDisplayContainer()61mclm::MesaNativeDisplayContainer::~MesaNativeDisplayContainer()
62{62{
63 std::lock_guard<std::mutex> lg(guard);63 std::lock_guard<std::mutex> lg(guard);
6464
@@ -68,17 +68,17 @@
68 }68 }
69}69}
7070
71bool mclg::MesaNativeDisplayContainer::validate(MirEGLNativeDisplayType display) const71bool mclm::MesaNativeDisplayContainer::validate(MirEGLNativeDisplayType display) const
72{72{
73 std::lock_guard<std::mutex> lg(guard);73 std::lock_guard<std::mutex> lg(guard);
74 return (valid_displays.find(display) != valid_displays.end());74 return (valid_displays.find(display) != valid_displays.end());
75}75}
7676
77MirEGLNativeDisplayType77MirEGLNativeDisplayType
78mclg::MesaNativeDisplayContainer::create(MirConnection* connection)78mclm::MesaNativeDisplayContainer::create(MirConnection* connection)
79{79{
80 MirMesaEGLNativeDisplay* display = new MirMesaEGLNativeDisplay();80 MirMesaEGLNativeDisplay* display = new MirMesaEGLNativeDisplay();
81 display->display_get_platform = gbm_egl_display_get_platform;81 display->display_get_platform = egl_display_get_platform;
82 display->context = connection;82 display->context = connection;
8383
84 std::lock_guard<std::mutex> lg(guard);84 std::lock_guard<std::mutex> lg(guard);
@@ -88,7 +88,7 @@
88 return egl_display;88 return egl_display;
89}89}
9090
91void mclg::MesaNativeDisplayContainer::release(MirEGLNativeDisplayType display)91void mclm::MesaNativeDisplayContainer::release(MirEGLNativeDisplayType display)
92{92{
93 std::lock_guard<std::mutex> lg(guard);93 std::lock_guard<std::mutex> lg(guard);
9494
9595
=== modified file 'src/client/mesa/mesa_native_display_container.h'
--- src/client/gbm/mesa_native_display_container.h 2013-08-28 03:41:48 +0000
+++ src/client/mesa/mesa_native_display_container.h 2013-12-11 07:33:52 +0000
@@ -16,8 +16,8 @@
16 * Authored by: Robert Carr <robert.carr@canonical.com>16 * Authored by: Robert Carr <robert.carr@canonical.com>
17 */17 */
1818
19#ifndef MIR_CLIENT_GBM_MESA_NATIVE_DISPLAY_CONTAINER_H_19#ifndef MIR_CLIENT_MESA_MESA_NATIVE_DISPLAY_CONTAINER_H_
20#define MIR_CLIENT_GBM_MESA_NATIVE_DISPLAY_CONTAINER_H_20#define MIR_CLIENT_MESA_MESA_NATIVE_DISPLAY_CONTAINER_H_
2121
22#include "../egl_native_display_container.h"22#include "../egl_native_display_container.h"
2323
@@ -31,7 +31,7 @@
31{31{
32namespace client32namespace client
33{33{
34namespace gbm34namespace mesa
35{35{
3636
37class MesaNativeDisplayContainer : public EGLNativeDisplayContainer37class MesaNativeDisplayContainer : public EGLNativeDisplayContainer
@@ -60,4 +60,4 @@
60}60}
61} // namespace mir61} // namespace mir
6262
63#endif // MIR_CLIENT_GBM_MESA_NATIVE_DISPLAY_CONTAINER_H_63#endif // MIR_CLIENT_MESA_MESA_NATIVE_DISPLAY_CONTAINER_H_
6464
=== renamed file 'src/client/gbm/gbm_native_surface.cpp' => 'src/client/mesa/native_surface.cpp'
--- src/client/gbm/gbm_native_surface.cpp 2013-06-28 00:25:30 +0000
+++ src/client/mesa/native_surface.cpp 2013-12-11 07:33:52 +0000
@@ -18,31 +18,31 @@
1818
19#include <cstring>19#include <cstring>
20#include "../client_buffer.h"20#include "../client_buffer.h"
21#include "gbm_native_surface.h"21#include "native_surface.h"
2222
23namespace mclg=mir::client::gbm;23namespace mclm=mir::client::mesa;
2424
25namespace25namespace
26{26{
27static int advance_buffer_static(MirMesaEGLNativeSurface* surface,27static int advance_buffer_static(MirMesaEGLNativeSurface* surface,
28 MirBufferPackage* buffer_package)28 MirBufferPackage* buffer_package)
29{29{
30 auto s = static_cast<mclg::GBMNativeSurface*>(surface);30 auto s = static_cast<mclm::NativeSurface*>(surface);
31 return s->advance_buffer(buffer_package);31 return s->advance_buffer(buffer_package);
32}32}
3333
34static int get_parameters_static(MirMesaEGLNativeSurface* surface,34static int get_parameters_static(MirMesaEGLNativeSurface* surface,
35 MirSurfaceParameters* surface_parameters)35 MirSurfaceParameters* surface_parameters)
36{36{
37 auto s = static_cast<mclg::GBMNativeSurface*>(surface);37 auto s = static_cast<mclm::NativeSurface*>(surface);
38 return s->get_parameters(surface_parameters);38 return s->get_parameters(surface_parameters);
39}39}
4040
41static int set_swapinterval_static(MirMesaEGLNativeSurface* surface, int interval)41static int set_swapinterval_static(MirMesaEGLNativeSurface* surface, int interval)
42{42{
43 auto s = static_cast<mclg::GBMNativeSurface*>(surface);43 auto s = static_cast<mclm::NativeSurface*>(surface);
44 return s->set_swapinterval(interval);44 return s->set_swapinterval(interval);
45} 45}
4646
47static void buffer_advanced_callback(MirSurface* /* surface */,47static void buffer_advanced_callback(MirSurface* /* surface */,
48 void* /* context */)48 void* /* context */)
@@ -50,15 +50,15 @@
50}50}
51}51}
5252
53mclg::GBMNativeSurface::GBMNativeSurface(ClientSurface& surface)53mclm::NativeSurface::NativeSurface(ClientSurface& surface)
54 : surface(surface)54 : surface(surface)
55{55{
56 surface_advance_buffer = advance_buffer_static; 56 surface_advance_buffer = advance_buffer_static;
57 surface_get_parameters = get_parameters_static; 57 surface_get_parameters = get_parameters_static;
58 surface_set_swapinterval = set_swapinterval_static; 58 surface_set_swapinterval = set_swapinterval_static;
59}59}
6060
61int mclg::GBMNativeSurface::advance_buffer(MirBufferPackage* buffer_package)61int mclm::NativeSurface::advance_buffer(MirBufferPackage* buffer_package)
62{62{
63 mir_wait_for(surface.next_buffer(buffer_advanced_callback, NULL));63 mir_wait_for(surface.next_buffer(buffer_advanced_callback, NULL));
64 auto buffer = surface.get_current_buffer();64 auto buffer = surface.get_current_buffer();
@@ -68,18 +68,18 @@
68 return MIR_MESA_TRUE;68 return MIR_MESA_TRUE;
69}69}
7070
71int mclg::GBMNativeSurface::get_parameters(MirSurfaceParameters* surface_parameters)71int mclm::NativeSurface::get_parameters(MirSurfaceParameters* surface_parameters)
72{72{
73 auto params = surface.get_parameters();73 auto params = surface.get_parameters();
74 memcpy(surface_parameters, &params, sizeof(MirSurfaceParameters));74 memcpy(surface_parameters, &params, sizeof(MirSurfaceParameters));
75 return MIR_MESA_TRUE;75 return MIR_MESA_TRUE;
76}76}
7777
78int mclg::GBMNativeSurface::set_swapinterval(int interval)78int mclm::NativeSurface::set_swapinterval(int interval)
79{79{
80 if ((interval < 0) || (interval > 1))80 if ((interval < 0) || (interval > 1))
81 return MIR_MESA_FALSE;81 return MIR_MESA_FALSE;
8282
83 mir_wait_for(surface.configure(mir_surface_attrib_swapinterval, interval)); 83 mir_wait_for(surface.configure(mir_surface_attrib_swapinterval, interval));
84 return MIR_MESA_TRUE;84 return MIR_MESA_TRUE;
85}85}
8686
=== renamed file 'src/client/gbm/gbm_native_surface.h' => 'src/client/mesa/native_surface.h'
--- src/client/gbm/gbm_native_surface.h 2013-06-28 00:05:44 +0000
+++ src/client/mesa/native_surface.h 2013-12-11 07:33:52 +0000
@@ -16,6 +16,9 @@
16 * Authored by: Kevin DuBois <kevin.dubois@canonical.com>16 * Authored by: Kevin DuBois <kevin.dubois@canonical.com>
17 */17 */
1818
19#ifndef MIR_CLIENT_MESA_NATIVE_SURFACES_H_
20#define MIR_CLIENT_MESA_NATIVE_SURFACES_H_
21
19#include "mir_toolkit/mesa/native_display.h"22#include "mir_toolkit/mesa/native_display.h"
20#include "../mir_client_surface.h"23#include "../mir_client_surface.h"
2124
@@ -23,13 +26,13 @@
23{26{
24namespace client27namespace client
25{28{
26namespace gbm29namespace mesa
27{30{
2831
29class GBMNativeSurface : public MirMesaEGLNativeSurface32class NativeSurface : public MirMesaEGLNativeSurface
30{33{
31public:34public:
32 explicit GBMNativeSurface(ClientSurface&);35 explicit NativeSurface(ClientSurface&);
3336
34 int advance_buffer(MirBufferPackage* buffer_package);37 int advance_buffer(MirBufferPackage* buffer_package);
35 int get_parameters(MirSurfaceParameters* surface_parameters);38 int get_parameters(MirSurfaceParameters* surface_parameters);
@@ -42,3 +45,5 @@
42}45}
43}46}
44}47}
48
49#endif /* MIR_CLIENT_MESA_NATIVE_SURFACE_H_ */
4550
=== modified file 'src/client/mir_client_library.cpp'
--- src/client/mir_client_library.cpp 2013-11-21 03:16:21 +0000
+++ src/client/mir_client_library.cpp 2013-12-11 07:33:52 +0000
@@ -176,9 +176,9 @@
176 return conn;176 return conn;
177}177}
178178
179int mir_connection_is_valid(MirConnection * connection)179MirBool mir_connection_is_valid(MirConnection * connection)
180{180{
181 return MirConnection::is_valid(connection);181 return MirConnection::is_valid(connection) ? mir_true : mir_false;
182}182}
183183
184char const * mir_connection_get_error_message(MirConnection * connection)184char const * mir_connection_get_error_message(MirConnection * connection)
@@ -266,12 +266,12 @@
266266
267int mir_debug_surface_id(MirSurface * surface)267int mir_debug_surface_id(MirSurface * surface)
268{268{
269 return surface->id(); 269 return surface->id();
270}270}
271271
272int mir_surface_is_valid(MirSurface* surface)272MirBool mir_surface_is_valid(MirSurface* surface)
273{273{
274 return surface->is_valid();274 return surface->is_valid() ? mir_true : mir_false;
275}275}
276276
277char const * mir_surface_get_error_message(MirSurface * surface)277char const * mir_surface_get_error_message(MirSurface * surface)
278278
=== modified file 'src/client/mir_connection.cpp'
--- src/client/mir_connection.cpp 2013-11-21 03:16:21 +0000
+++ src/client/mir_connection.cpp 2013-12-11 07:33:52 +0000
@@ -370,7 +370,7 @@
370 for (auto i = 0u; i < valid_formats; i++)370 for (auto i = 0u; i < valid_formats; i++)
371 {371 {
372 formats[i] = static_cast<MirPixelFormat>(connect_result.surface_pixel_format(i));372 formats[i] = static_cast<MirPixelFormat>(connect_result.surface_pixel_format(i));
373 } 373 }
374 }374 }
375}375}
376376
@@ -458,11 +458,11 @@
458 {458 {
459 auto output = config->outputs[i];459 auto output = config->outputs[i];
460 auto display_request = request.add_display_output();460 auto display_request = request.add_display_output();
461 display_request->set_output_id(output.output_id); 461 display_request->set_output_id(output.output_id);
462 display_request->set_used(output.used); 462 display_request->set_used(output.used);
463 display_request->set_current_mode(output.current_mode); 463 display_request->set_current_mode(output.current_mode);
464 display_request->set_position_x(output.position_x); 464 display_request->set_position_x(output.position_x);
465 display_request->set_position_y(output.position_y); 465 display_request->set_position_y(output.position_y);
466 display_request->set_power_mode(output.power_mode);466 display_request->set_power_mode(output.power_mode);
467 }467 }
468468
469469
=== modified file 'src/client/mir_connection.h'
--- src/client/mir_connection.h 2013-11-21 03:16:21 +0000
+++ src/client/mir_connection.h 2013-12-11 07:33:52 +0000
@@ -105,7 +105,7 @@
105 void register_display_change_callback(mir_display_config_callback callback, void* context);105 void register_display_change_callback(mir_display_config_callback callback, void* context);
106106
107 void populate(MirPlatformPackage& platform_package);107 void populate(MirPlatformPackage& platform_package);
108 MirDisplayConfiguration* create_copy_of_display_config(); 108 MirDisplayConfiguration* create_copy_of_display_config();
109 void available_surface_formats(MirPixelFormat* formats,109 void available_surface_formats(MirPixelFormat* formats,
110 unsigned int formats_size, unsigned int& valid_formats);110 unsigned int formats_size, unsigned int& valid_formats);
111111
112112
=== modified file 'src/client/mir_surface.cpp'
--- src/client/mir_surface.cpp 2013-11-21 03:16:21 +0000
+++ src/client/mir_surface.cpp 2013-12-11 07:33:52 +0000
@@ -52,7 +52,7 @@
52 message.set_pixel_format(params.pixel_format);52 message.set_pixel_format(params.pixel_format);
53 message.set_buffer_usage(params.buffer_usage);53 message.set_buffer_usage(params.buffer_usage);
54 message.set_output_id(params.output_id);54 message.set_output_id(params.output_id);
55 55
56 server.create_surface(0, &message, &surface, gp::NewCallback(this, &MirSurface::created, callback, context));56 server.create_surface(0, &message, &surface, gp::NewCallback(this, &MirSurface::created, callback, context));
5757
58 for (int i = 0; i < mir_surface_attribs; i++)58 for (int i = 0; i < mir_surface_attribs; i++)
@@ -159,10 +159,10 @@
159}159}
160160
161/* todo: all these conversion functions are a bit of a kludge, probably161/* todo: all these conversion functions are a bit of a kludge, probably
162 better to have a more developed geometry::PixelFormat that can handle this */162 better to have a more developed MirPixelFormat that can handle this */
163geom::PixelFormat MirSurface::convert_ipc_pf_to_geometry(gp::int32 pf)163MirPixelFormat MirSurface::convert_ipc_pf_to_geometry(gp::int32 pf)
164{164{
165 return static_cast<geom::PixelFormat>(pf);165 return static_cast<MirPixelFormat>(pf);
166}166}
167167
168void MirSurface::process_incoming_buffer()168void MirSurface::process_incoming_buffer()
@@ -254,7 +254,7 @@
254{254{
255 std::lock_guard<std::recursive_mutex> lock(mutex);255 std::lock_guard<std::recursive_mutex> lock(mutex);
256256
257 return buffer_depository->current_buffer_id(); 257 return buffer_depository->current_buffer_id();
258}258}
259259
260void MirSurface::populate(MirBufferPackage& buffer_package)260void MirSurface::populate(MirBufferPackage& buffer_package)
261261
=== modified file 'src/client/mir_surface.h'
--- src/client/mir_surface.h 2013-11-21 03:16:21 +0000
+++ src/client/mir_surface.h 2013-12-11 07:33:52 +0000
@@ -20,7 +20,6 @@
2020
21#include "mir_protobuf.pb.h"21#include "mir_protobuf.pb.h"
2222
23#include "mir/geometry/pixel_format.h"
24#include "mir/geometry/dimensions.h"23#include "mir/geometry/dimensions.h"
25#include "mir_toolkit/mir_client_library.h"24#include "mir_toolkit/mir_client_library.h"
26#include "mir_toolkit/common.h"25#include "mir_toolkit/common.h"
@@ -101,7 +100,7 @@
101 void populate(MirBufferPackage& buffer_package);100 void populate(MirBufferPackage& buffer_package);
102 void created(mir_surface_callback callback, void * context);101 void created(mir_surface_callback callback, void * context);
103 void new_buffer(mir_surface_callback callback, void * context);102 void new_buffer(mir_surface_callback callback, void * context);
104 mir::geometry::PixelFormat convert_ipc_pf_to_geometry(google::protobuf::int32 pf);103 MirPixelFormat convert_ipc_pf_to_geometry(google::protobuf::int32 pf);
105104
106 /* todo: race condition. protobuf does not guarantee that callbacks will be synchronized. potential105 /* todo: race condition. protobuf does not guarantee that callbacks will be synchronized. potential
107 race in surface, last_buffer_id */106 race in surface, last_buffer_id */
108107
=== modified file 'src/client/rpc/mir_socket_rpc_channel.cpp'
--- src/client/rpc/mir_socket_rpc_channel.cpp 2013-11-21 03:16:21 +0000
+++ src/client/rpc/mir_socket_rpc_channel.cpp 2013-12-11 07:33:52 +0000
@@ -415,7 +415,7 @@
415 {415 {
416 rpc_report->event_parsing_failed(event);416 rpc_report->event_parsing_failed(event);
417 }417 }
418 } 418 }
419 }419 }
420}420}
421421
422422
=== modified file 'src/client/surface_map.cpp'
--- src/client/surface_map.cpp 2013-11-20 17:13:18 +0000
+++ src/client/surface_map.cpp 2013-12-11 07:33:52 +0000
@@ -42,7 +42,7 @@
42 ss << __PRETTY_FUNCTION__42 ss << __PRETTY_FUNCTION__
43 << "executed with non-existent surface ID "43 << "executed with non-existent surface ID "
44 << surface_id << ".\n";44 << surface_id << ".\n";
45 45
46 BOOST_THROW_EXCEPTION(std::runtime_error(ss.str()));46 BOOST_THROW_EXCEPTION(std::runtime_error(ss.str()));
47 }47 }
48}48}
@@ -50,11 +50,11 @@
50void mcl::ConnectionSurfaceMap::insert(int const& surface_id, MirSurface* surface)50void mcl::ConnectionSurfaceMap::insert(int const& surface_id, MirSurface* surface)
51{51{
52 std::unique_lock<std::mutex> lk(guard);52 std::unique_lock<std::mutex> lk(guard);
53 surfaces[surface_id] = surface; 53 surfaces[surface_id] = surface;
54}54}
5555
56void mcl::ConnectionSurfaceMap::erase(int surface_id)56void mcl::ConnectionSurfaceMap::erase(int surface_id)
57{57{
58 std::unique_lock<std::mutex> lk(guard);58 std::unique_lock<std::mutex> lk(guard);
59 surfaces.erase(surface_id); 59 surfaces.erase(surface_id);
60}60}
6161
=== modified file 'src/platform/graphics/CMakeLists.txt'
--- src/platform/graphics/CMakeLists.txt 2013-11-21 03:16:21 +0000
+++ src/platform/graphics/CMakeLists.txt 2013-12-11 07:33:52 +0000
@@ -26,3 +26,13 @@
26)26)
2727
28install(TARGETS mirplatform LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})28install(TARGETS mirplatform LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
29
30if (MIR_PLATFORM STREQUAL "android")
31 include_directories(${LIBHARDWARE_INCLUDE_DIRS})
32 add_subdirectory(android/)
33endif()
34
35if (MIR_PLATFORM STREQUAL "mesa")
36 add_subdirectory(mesa/)
37endif()
38
2939
=== renamed directory 'src/server/graphics/android' => 'src/platform/graphics/android'
=== modified file 'src/platform/graphics/android/android_alloc_adaptor.cpp'
--- src/server/graphics/android/android_alloc_adaptor.cpp 2013-11-21 03:16:21 +0000
+++ src/platform/graphics/android/android_alloc_adaptor.cpp 2013-12-11 07:33:52 +0000
@@ -2,15 +2,15 @@
2 * Copyright © 2012 Canonical Ltd.2 * Copyright © 2012 Canonical Ltd.
3 *3 *
4 * This program is free software: you can redistribute it and/or modify it4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License version 3,5 * under the terms of the GNU Lesser General Public License version 3,
6 * as published by the Free Software Foundation.6 * as published by the Free Software Foundation.
7 *7 *
8 * This program is distributed in the hope that it will be useful,8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.11 * GNU Lesser General Public License for more details.
12 *12 *
13 * You should have received a copy of the GNU General Public License13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *15 *
16 * Authored by:16 * Authored by:
@@ -52,7 +52,7 @@
52}52}
5353
54std::shared_ptr<mg::NativeBuffer> mga::AndroidAllocAdaptor::alloc_buffer(54std::shared_ptr<mg::NativeBuffer> mga::AndroidAllocAdaptor::alloc_buffer(
55 geometry::Size size, geometry::PixelFormat pf, BufferUsage usage)55 geometry::Size size, MirPixelFormat pf, BufferUsage usage)
56{56{
57 buffer_handle_t buf_handle = NULL;57 buffer_handle_t buf_handle = NULL;
58 auto stride = 0;58 auto stride = 0;
5959
=== modified file 'src/platform/graphics/android/android_alloc_adaptor.h'
--- src/server/graphics/android/android_alloc_adaptor.h 2013-10-15 08:53:10 +0000
+++ src/platform/graphics/android/android_alloc_adaptor.h 2013-12-11 07:33:52 +0000
@@ -2,15 +2,15 @@
2 * Copyright © 2012 Canonical Ltd.2 * Copyright © 2012 Canonical Ltd.
3 *3 *
4 * This program is free software: you can redistribute it and/or modify it4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License version 3,5 * under the terms of the GNU Lesser General Public License version 3,
6 * as published by the Free Software Foundation.6 * as published by the Free Software Foundation.
7 *7 *
8 * This program is distributed in the hope that it will be useful,8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.11 * GNU Lesser General Public License for more details.
12 *12 *
13 * You should have received a copy of the GNU General Public License13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *15 *
16 * Authored by: Kevin DuBois <kevin.dubois@canonical.com>16 * Authored by: Kevin DuBois <kevin.dubois@canonical.com>
@@ -36,7 +36,7 @@
36public:36public:
37 explicit AndroidAllocAdaptor(const std::shared_ptr<struct alloc_device_t>& alloc_device);37 explicit AndroidAllocAdaptor(const std::shared_ptr<struct alloc_device_t>& alloc_device);
38 std::shared_ptr<NativeBuffer> alloc_buffer(geometry::Size,38 std::shared_ptr<NativeBuffer> alloc_buffer(geometry::Size,
39 geometry::PixelFormat, BufferUsage usage);39 MirPixelFormat, BufferUsage usage);
4040
41 /* note: alloc_device_t has a third method (dump) that isn't needed by us. it can be used to check buffer contents */41 /* note: alloc_device_t has a third method (dump) that isn't needed by us. it can be used to check buffer contents */
4242
4343
=== modified file 'src/platform/graphics/android/android_buffer_allocator.cpp'
--- src/server/graphics/android/android_buffer_allocator.cpp 2013-11-21 03:16:21 +0000
+++ src/platform/graphics/android/android_buffer_allocator.cpp 2013-12-11 07:33:52 +0000
@@ -2,15 +2,15 @@
2 * Copyright © 2012 Canonical Ltd.2 * Copyright © 2012 Canonical Ltd.
3 *3 *
4 * This program is free software: you can redistribute it and/or modify it4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License version 3,5 * under the terms of the GNU Lesser General Public License version 3,
6 * as published by the Free Software Foundation.6 * as published by the Free Software Foundation.
7 *7 *
8 * This program is distributed in the hope that it will be useful,8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.11 * GNU Lesser General Public License for more details.
12 *12 *
13 * You should have received a copy of the GNU General Public License13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *15 *
16 * Authored by:16 * Authored by:
@@ -78,7 +78,7 @@
78}78}
7979
80std::shared_ptr<mg::Buffer> mga::AndroidGraphicBufferAllocator::alloc_buffer_platform(80std::shared_ptr<mg::Buffer> mga::AndroidGraphicBufferAllocator::alloc_buffer_platform(
81 geom::Size sz, geom::PixelFormat pf, mga::BufferUsage use)81 geom::Size sz, MirPixelFormat pf, mga::BufferUsage use)
82{82{
83 auto native_handle = alloc_device->alloc_buffer(sz, pf, use);83 auto native_handle = alloc_device->alloc_buffer(sz, pf, use);
84 auto buffer = std::make_shared<Buffer>(native_handle, egl_extensions);84 auto buffer = std::make_shared<Buffer>(native_handle, egl_extensions);
@@ -86,12 +86,12 @@
86 return buffer;86 return buffer;
87}87}
8888
89std::vector<geom::PixelFormat> mga::AndroidGraphicBufferAllocator::supported_pixel_formats()89std::vector<MirPixelFormat> mga::AndroidGraphicBufferAllocator::supported_pixel_formats()
90{90{
91 static std::vector<geom::PixelFormat> const pixel_formats{91 static std::vector<MirPixelFormat> const pixel_formats{
92 geom::PixelFormat::abgr_8888,92 mir_pixel_format_abgr_8888,
93 geom::PixelFormat::xbgr_8888,93 mir_pixel_format_xbgr_8888,
94 geom::PixelFormat::bgr_88894 mir_pixel_format_bgr_888
95 };95 };
9696
97 return pixel_formats;97 return pixel_formats;
@@ -106,5 +106,5 @@
106 case mg::BufferUsage::hardware:106 case mg::BufferUsage::hardware:
107 default:107 default:
108 return mga::BufferUsage::use_hardware;108 return mga::BufferUsage::use_hardware;
109 } 109 }
110}110}
111111
=== modified file 'src/platform/graphics/android/android_display.cpp'
--- src/server/graphics/android/android_display.cpp 2013-11-21 17:20:14 +0000
+++ src/platform/graphics/android/android_display.cpp 2013-12-11 07:33:52 +0000
@@ -2,15 +2,15 @@
2 * Copyright © 2012 Canonical Ltd.2 * Copyright © 2012 Canonical Ltd.
3 *3 *
4 * This program is free software: you can redistribute it and/or modify it4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License version 3,5 * under the terms of the GNU Lesser General Public License version 3,
6 * as published by the Free Software Foundation.6 * as published by the Free Software Foundation.
7 *7 *
8 * This program is distributed in the hope that it will be useful,8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.11 * GNU Lesser General Public License for more details.
12 *12 *
13 * You should have received a copy of the GNU General Public License13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *15 *
16 * Authored by: Kevin DuBois <kevin.dubois@canonical.com>16 * Authored by: Kevin DuBois <kevin.dubois@canonical.com>
1717
=== modified file 'src/platform/graphics/android/android_display.h'
--- src/server/graphics/android/android_display.h 2013-11-21 17:20:14 +0000
+++ src/platform/graphics/android/android_display.h 2013-12-11 07:33:52 +0000
@@ -2,15 +2,15 @@
2 * Copyright © 2012 Canonical Ltd.2 * Copyright © 2012 Canonical Ltd.
3 *3 *
4 * This program is free software: you can redistribute it and/or modify it4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License version 3,5 * under the terms of the GNU Lesser General Public License version 3,
6 * as published by the Free Software Foundation.6 * as published by the Free Software Foundation.
7 *7 *
8 * This program is distributed in the hope that it will be useful,8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.11 * GNU Lesser General Public License for more details.
12 *12 *
13 * You should have received a copy of the GNU General Public License13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *15 *
16 * Authored by: Kevin DuBois <kevin.dubois@canonical.com>16 * Authored by: Kevin DuBois <kevin.dubois@canonical.com>
@@ -71,7 +71,7 @@
71 GLContext gl_context;71 GLContext gl_context;
72 std::shared_ptr<DisplayDevice> const display_device;72 std::shared_ptr<DisplayDevice> const display_device;
73 //we only have a primary display at the moment73 //we only have a primary display at the moment
74 std::unique_ptr<graphics::DisplayBuffer> const display_buffer; 74 std::unique_ptr<graphics::DisplayBuffer> const display_buffer;
75 AndroidDisplayConfiguration current_configuration;75 AndroidDisplayConfiguration current_configuration;
76};76};
7777
7878
=== modified file 'src/platform/graphics/android/android_display_configuration.cpp'
--- src/server/graphics/android/android_display_configuration.cpp 2013-09-12 23:48:21 +0000
+++ src/platform/graphics/android/android_display_configuration.cpp 2013-12-11 07:33:52 +0000
@@ -2,15 +2,15 @@
2 * Copyright © 2013 Canonical Ltd.2 * Copyright © 2013 Canonical Ltd.
3 *3 *
4 * This program is free software: you can redistribute it and/or modify it4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License version 3,5 * under the terms of the GNU Lesser General Public License version 3,
6 * as published by the Free Software Foundation.6 * as published by the Free Software Foundation.
7 *7 *
8 * This program is distributed in the hope that it will be useful,8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.11 * GNU Lesser General Public License for more details.
12 *12 *
13 * You should have received a copy of the GNU General Public License13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */15 */
1616
@@ -24,7 +24,7 @@
24 : configuration{mg::DisplayConfigurationOutputId{1},24 : configuration{mg::DisplayConfigurationOutputId{1},
25 mg::DisplayConfigurationCardId{0},25 mg::DisplayConfigurationCardId{0},
26 mg::DisplayConfigurationOutputType::lvds,26 mg::DisplayConfigurationOutputType::lvds,
27 {geom::PixelFormat::abgr_8888},27 {mir_pixel_format_abgr_8888},
28 {mg::DisplayConfigurationMode{display_size,0.0f}},28 {mg::DisplayConfigurationMode{display_size,0.0f}},
29 0,29 0,
30 geom::Size{0,0},30 geom::Size{0,0},
3131
=== modified file 'src/platform/graphics/android/android_display_configuration.h'
--- src/server/graphics/android/android_display_configuration.h 2013-09-12 23:48:21 +0000
+++ src/platform/graphics/android/android_display_configuration.h 2013-12-11 07:33:52 +0000
@@ -2,15 +2,15 @@
2 * Copyright © 2013 Canonical Ltd.2 * Copyright © 2013 Canonical Ltd.
3 *3 *
4 * This program is free software: you can redistribute it and/or modify it4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License version 3,5 * under the terms of the GNU Lesser General Public License version 3,
6 * as published by the Free Software Foundation.6 * as published by the Free Software Foundation.
7 *7 *
8 * This program is distributed in the hope that it will be useful,8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.11 * GNU Lesser General Public License for more details.
12 *12 *
13 * You should have received a copy of the GNU General Public License13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */15 */
1616
@@ -32,7 +32,7 @@
32 AndroidDisplayConfiguration(geometry::Size const& display_size);32 AndroidDisplayConfiguration(geometry::Size const& display_size);
33 AndroidDisplayConfiguration(AndroidDisplayConfiguration const& other);33 AndroidDisplayConfiguration(AndroidDisplayConfiguration const& other);
34 AndroidDisplayConfiguration& operator=(AndroidDisplayConfiguration const& other);34 AndroidDisplayConfiguration& operator=(AndroidDisplayConfiguration const& other);
35 35
36 virtual ~AndroidDisplayConfiguration() = default;36 virtual ~AndroidDisplayConfiguration() = default;
3737
38 void for_each_card(std::function<void(DisplayConfigurationCard const&)> f) const;38 void for_each_card(std::function<void(DisplayConfigurationCard const&)> f) const;
3939
=== modified file 'src/platform/graphics/android/android_format_conversion-inl.h'
--- src/server/graphics/android/android_format_conversion-inl.h 2013-04-19 15:58:22 +0000
+++ src/platform/graphics/android/android_format_conversion-inl.h 2013-12-11 07:33:52 +0000
@@ -2,15 +2,15 @@
2 * Copyright © 2013 Canonical Ltd.2 * Copyright © 2013 Canonical Ltd.
3 *3 *
4 * This program is free software: you can redistribute it and/or modify it4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License version 3,5 * under the terms of the GNU Lesser General Public License version 3,
6 * as published by the Free Software Foundation.6 * as published by the Free Software Foundation.
7 *7 *
8 * This program is distributed in the hope that it will be useful,8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.11 * GNU Lesser General Public License for more details.
12 *12 *
13 * You should have received a copy of the GNU General Public License13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *15 *
16 * Authored by: Kevin DuBois <kevin.dubois@canonical.com>16 * Authored by: Kevin DuBois <kevin.dubois@canonical.com>
@@ -19,7 +19,7 @@
19#ifndef MIR_GRAPHICS_ANDROID_ANDROID_FORMAT_CONVERSION_INL_H_19#ifndef MIR_GRAPHICS_ANDROID_ANDROID_FORMAT_CONVERSION_INL_H_
20#define MIR_GRAPHICS_ANDROID_ANDROID_FORMAT_CONVERSION_INL_H_20#define MIR_GRAPHICS_ANDROID_ANDROID_FORMAT_CONVERSION_INL_H_
2121
22#include "mir/geometry/pixel_format.h"22#include "mir_toolkit/common.h"
23#include <system/graphics.h>23#include <system/graphics.h>
2424
25namespace mir25namespace mir
@@ -29,39 +29,39 @@
29namespace android29namespace android
30{30{
3131
32inline static int to_android_format(geometry::PixelFormat format)32inline static int to_android_format(MirPixelFormat format)
33{33{
34 switch(format)34 switch(format)
35 {35 {
36 case geometry::PixelFormat::abgr_8888:36 case mir_pixel_format_abgr_8888:
37 return HAL_PIXEL_FORMAT_RGBA_8888;37 return HAL_PIXEL_FORMAT_RGBA_8888;
38 case geometry::PixelFormat::xbgr_8888:38 case mir_pixel_format_xbgr_8888:
39 return HAL_PIXEL_FORMAT_RGBX_8888;39 return HAL_PIXEL_FORMAT_RGBX_8888;
40 case geometry::PixelFormat::argb_8888:40 case mir_pixel_format_argb_8888:
41 return HAL_PIXEL_FORMAT_BGRA_8888;41 return HAL_PIXEL_FORMAT_BGRA_8888;
42 case geometry::PixelFormat::xrgb_8888:42 case mir_pixel_format_xrgb_8888:
43 return HAL_PIXEL_FORMAT_BGRA_8888;43 return HAL_PIXEL_FORMAT_BGRA_8888;
44 case geometry::PixelFormat::bgr_888:44 case mir_pixel_format_bgr_888:
45 return HAL_PIXEL_FORMAT_RGB_888;45 return HAL_PIXEL_FORMAT_RGB_888;
46 default:46 default:
47 return 0;47 return 0;
48 }48 }
49}49}
5050
51inline static mir::geometry::PixelFormat to_mir_format(int format)51inline static MirPixelFormat to_mir_format(int format)
52{52{
53 switch(format)53 switch(format)
54 {54 {
55 case HAL_PIXEL_FORMAT_RGBA_8888:55 case HAL_PIXEL_FORMAT_RGBA_8888:
56 return geometry::PixelFormat::abgr_8888;56 return mir_pixel_format_abgr_8888;
57 case HAL_PIXEL_FORMAT_RGBX_8888:57 case HAL_PIXEL_FORMAT_RGBX_8888:
58 return geometry::PixelFormat::xbgr_8888;58 return mir_pixel_format_xbgr_8888;
59 case HAL_PIXEL_FORMAT_BGRA_8888:59 case HAL_PIXEL_FORMAT_BGRA_8888:
60 return geometry::PixelFormat::argb_8888;60 return mir_pixel_format_argb_8888;
61 case HAL_PIXEL_FORMAT_RGB_888:61 case HAL_PIXEL_FORMAT_RGB_888:
62 return geometry::PixelFormat::bgr_888;62 return mir_pixel_format_bgr_888;
63 default:63 default:
64 return geometry::PixelFormat::invalid;64 return mir_pixel_format_invalid;
65 }65 }
66}66}
6767
6868
=== modified file 'src/platform/graphics/android/android_graphic_buffer_allocator.h'
--- src/server/graphics/android/android_graphic_buffer_allocator.h 2013-11-21 03:16:21 +0000
+++ src/platform/graphics/android/android_graphic_buffer_allocator.h 2013-12-11 07:33:52 +0000
@@ -2,15 +2,15 @@
2 * Copyright © 2012 Canonical Ltd.2 * Copyright © 2012 Canonical Ltd.
3 *3 *
4 * This program is free software: you can redistribute it and/or modify it4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License version 3,5 * under the terms of the GNU Lesser General Public License version 3,
6 * as published by the Free Software Foundation.6 * as published by the Free Software Foundation.
7 *7 *
8 * This program is distributed in the hope that it will be useful,8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.11 * GNU Lesser General Public License for more details.
12 *12 *
13 * You should have received a copy of the GNU General Public License13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *15 *
16 * Authored by:16 * Authored by:
@@ -49,9 +49,9 @@
49 graphics::BufferProperties const& buffer_properties);49 graphics::BufferProperties const& buffer_properties);
5050
51 std::shared_ptr<graphics::Buffer> alloc_buffer_platform(51 std::shared_ptr<graphics::Buffer> alloc_buffer_platform(
52 geometry::Size sz, geometry::PixelFormat pf, BufferUsage use);52 geometry::Size sz, MirPixelFormat pf, BufferUsage use);
5353
54 std::vector<geometry::PixelFormat> supported_pixel_formats();54 std::vector<MirPixelFormat> supported_pixel_formats();
5555
56 static BufferUsage convert_from_compositor_usage(graphics::BufferUsage usage);56 static BufferUsage convert_from_compositor_usage(graphics::BufferUsage usage);
5757
5858
=== modified file 'src/platform/graphics/android/android_platform.cpp'
--- src/server/graphics/android/android_platform.cpp 2013-11-21 17:20:14 +0000
+++ src/platform/graphics/android/android_platform.cpp 2013-12-11 07:33:52 +0000
@@ -2,15 +2,15 @@
2 * Copyright © 2012 Canonical Ltd.2 * Copyright © 2012 Canonical Ltd.
3 *3 *
4 * This program is free software: you can redistribute it and/or modify it4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License version 3,5 * under the terms of the GNU Lesser General Public License version 3,
6 * as published by the Free Software Foundation.6 * as published by the Free Software Foundation.
7 *7 *
8 * This program is distributed in the hope that it will be useful,8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.11 * GNU Lesser General Public License for more details.
12 *12 *
13 * You should have received a copy of the GNU General Public License13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *15 *
16 * Authored by:16 * Authored by:
@@ -77,7 +77,7 @@
77 auto buffer_handle = native_buffer->handle();77 auto buffer_handle = native_buffer->handle();
7878
79 int offset = 0;79 int offset = 0;
80 80
81 for(auto i=0; i<buffer_handle->numFds; i++)81 for(auto i=0; i<buffer_handle->numFds; i++)
82 {82 {
83 packer->pack_fd(buffer_handle->data[offset++]);83 packer->pack_fd(buffer_handle->data[offset++]);
@@ -119,11 +119,7 @@
119119
120extern "C" std::shared_ptr<mg::NativePlatform> create_native_platform(std::shared_ptr<mg::DisplayReport> const& display_report)120extern "C" std::shared_ptr<mg::NativePlatform> create_native_platform(std::shared_ptr<mg::DisplayReport> const& display_report)
121{121{
122 auto should_use_fb_fallback = false;122 //TODO: remove nullptr parameter once platform classes are sorted.
123 auto buffer_initializer = std::make_shared<mg::NullBufferInitializer>();123 // mg::NativePlatform cannot create a display anyways, so it doesnt need a display builder
124 auto fb_allocator = std::make_shared<mga::AndroidGraphicBufferAllocator>(buffer_initializer);124 return std::make_shared<mga::AndroidPlatform>(nullptr, display_report);
125 auto display_resource_factory = std::make_shared<mga::ResourceFactory>();
126 auto display_builder = std::make_shared<mga::OutputBuilder>(
127 fb_allocator, display_resource_factory, display_report, should_use_fb_fallback);
128 return std::make_shared<mga::AndroidPlatform>(display_builder, display_report);
129}125}
130126
=== modified file 'src/platform/graphics/android/android_platform.h'
--- src/server/graphics/android/android_platform.h 2013-11-21 17:20:14 +0000
+++ src/platform/graphics/android/android_platform.h 2013-12-11 07:33:52 +0000
@@ -2,15 +2,15 @@
2 * Copyright © 2012 Canonical Ltd.2 * Copyright © 2012 Canonical Ltd.
3 *3 *
4 * This program is free software: you can redistribute it and/or modify it4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License version 3,5 * under the terms of the GNU Lesser General Public License version 3,
6 * as published by the Free Software Foundation.6 * as published by the Free Software Foundation.
7 *7 *
8 * This program is distributed in the hope that it will be useful,8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.11 * GNU Lesser General Public License for more details.
12 *12 *
13 * You should have received a copy of the GNU General Public License13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *15 *
16 * Authored by: Alexandros Frantzis <alexandros.frantzis@canonical.com>16 * Authored by: Alexandros Frantzis <alexandros.frantzis@canonical.com>
1717
=== modified file 'src/platform/graphics/android/buffer.cpp'
--- src/server/graphics/android/buffer.cpp 2013-10-15 08:53:10 +0000
+++ src/platform/graphics/android/buffer.cpp 2013-12-11 07:33:52 +0000
@@ -2,15 +2,15 @@
2 * Copyright © 2012 Canonical Ltd.2 * Copyright © 2012 Canonical Ltd.
3 *3 *
4 * This program is free software: you can redistribute it and/or modify it4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License version 3,5 * under the terms of the GNU Lesser General Public License version 3,
6 * as published by the Free Software Foundation.6 * as published by the Free Software Foundation.
7 *7 *
8 * This program is distributed in the hope that it will be useful,8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.11 * GNU Lesser General Public License for more details.
12 *12 *
13 * You should have received a copy of the GNU General Public License13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *15 *
16 * Authored by:16 * Authored by:
@@ -60,10 +60,10 @@
60{60{
61 ANativeWindowBuffer *anwb = native_buffer->anwb();61 ANativeWindowBuffer *anwb = native_buffer->anwb();
62 return geom::Stride{anwb->stride *62 return geom::Stride{anwb->stride *
63 geom::bytes_per_pixel(pixel_format())};63 MIR_BYTES_PER_PIXEL(pixel_format())};
64}64}
6565
66geom::PixelFormat mga::Buffer::pixel_format() const66MirPixelFormat mga::Buffer::pixel_format() const
67{67{
68 ANativeWindowBuffer *anwb = native_buffer->anwb();68 ANativeWindowBuffer *anwb = native_buffer->anwb();
69 return mga::to_mir_format(anwb->format);69 return mga::to_mir_format(anwb->format);
@@ -123,7 +123,7 @@
123 content_lock.unlock();123 content_lock.unlock();
124 });124 });
125125
126 //lock remains in effect until the native handle is released 126 //lock remains in effect until the native handle is released
127 lk.release();127 lk.release();
128 return native_resource;128 return native_resource;
129}129}
130130
=== modified file 'src/platform/graphics/android/buffer.h'
--- src/server/graphics/android/buffer.h 2013-10-15 08:53:10 +0000
+++ src/platform/graphics/android/buffer.h 2013-12-11 07:33:52 +0000
@@ -2,15 +2,15 @@
2 * Copyright © 2012,2013 Canonical Ltd.2 * Copyright © 2012,2013 Canonical Ltd.
3 *3 *
4 * This program is free software: you can redistribute it and/or modify it4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License version 3,5 * under the terms of the GNU Lesser General Public License version 3,
6 * as published by the Free Software Foundation.6 * as published by the Free Software Foundation.
7 *7 *
8 * This program is distributed in the hope that it will be useful,8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.11 * GNU Lesser General Public License for more details.
12 *12 *
13 * You should have received a copy of the GNU General Public License13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *15 *
16 * Authored by:16 * Authored by:
@@ -49,7 +49,7 @@
4949
50 geometry::Size size() const;50 geometry::Size size() const;
51 geometry::Stride stride() const;51 geometry::Stride stride() const;
52 geometry::PixelFormat pixel_format() const;52 MirPixelFormat pixel_format() const;
53 void bind_to_texture();53 void bind_to_texture();
54 bool can_bypass() const override;54 bool can_bypass() const override;
5555
5656
=== modified file 'src/platform/graphics/android/buffer_usage.h'
--- src/server/graphics/android/buffer_usage.h 2013-05-21 21:51:13 +0000
+++ src/platform/graphics/android/buffer_usage.h 2013-12-11 07:33:52 +0000
@@ -2,15 +2,15 @@
2 * Copyright © 2013 Canonical Ltd.2 * Copyright © 2013 Canonical Ltd.
3 *3 *
4 * This program is free software: you can redistribute it and/or modify it4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License version 3,5 * under the terms of the GNU Lesser General Public License version 3,
6 * as published by the Free Software Foundation.6 * as published by the Free Software Foundation.
7 *7 *
8 * This program is distributed in the hope that it will be useful,8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.11 * GNU Lesser General Public License for more details.
12 *12 *
13 * You should have received a copy of the GNU General Public License13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *15 *
16 * Authored by: Kevin DuBois <kevin.dubois@canonical.com>16 * Authored by: Kevin DuBois <kevin.dubois@canonical.com>
1717
=== modified file 'src/platform/graphics/android/display_buffer.cpp'
--- src/server/graphics/android/display_buffer.cpp 2013-11-19 19:59:27 +0000
+++ src/platform/graphics/android/display_buffer.cpp 2013-12-11 07:33:52 +0000
@@ -2,15 +2,15 @@
2 * Copyright © 2013 Canonical Ltd.2 * Copyright © 2013 Canonical Ltd.
3 *3 *
4 * This program is free software: you can redistribute it and/or modify it4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License version 3,5 * under the terms of the GNU Lesser General Public License version 3,
6 * as published by the Free Software Foundation.6 * as published by the Free Software Foundation.
7 *7 *
8 * This program is distributed in the hope that it will be useful,8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.11 * GNU Lesser General Public License for more details.
12 *12 *
13 * You should have received a copy of the GNU General Public License13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *15 *
16 * Authored by: Kevin DuBois <kevin.dubois@canonical.com>16 * Authored by: Kevin DuBois <kevin.dubois@canonical.com>
1717
=== modified file 'src/platform/graphics/android/display_buffer.h'
--- src/server/graphics/android/display_buffer.h 2013-11-18 22:44:06 +0000
+++ src/platform/graphics/android/display_buffer.h 2013-12-11 07:33:52 +0000
@@ -2,15 +2,15 @@
2 * Copyright © 2013 Canonical Ltd.2 * Copyright © 2013 Canonical Ltd.
3 *3 *
4 * This program is free software: you can redistribute it and/or modify it4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License version 3,5 * under the terms of the GNU Lesser General Public License version 3,
6 * as published by the Free Software Foundation.6 * as published by the Free Software Foundation.
7 *7 *
8 * This program is distributed in the hope that it will be useful,8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.11 * GNU Lesser General Public License for more details.
12 *12 *
13 * You should have received a copy of the GNU General Public License13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *15 *
16 * Authored by: Kevin DuBois <kevin.dubois@canonical.com>16 * Authored by: Kevin DuBois <kevin.dubois@canonical.com>
@@ -46,7 +46,7 @@
46 void release_current();46 void release_current();
47 void post_update();47 void post_update();
48 bool can_bypass() const override;48 bool can_bypass() const override;
49 49
50private:50private:
51 std::shared_ptr<FramebufferBundle> const fb_bundle;51 std::shared_ptr<FramebufferBundle> const fb_bundle;
52 std::shared_ptr<DisplayDevice> const display_device;52 std::shared_ptr<DisplayDevice> const display_device;
5353
=== modified file 'src/platform/graphics/android/display_builder.h'
--- src/server/graphics/android/display_builder.h 2013-11-21 17:20:14 +0000
+++ src/platform/graphics/android/display_builder.h 2013-12-11 07:33:52 +0000
@@ -2,15 +2,15 @@
2 * Copyright © 2013 Canonical Ltd.2 * Copyright © 2013 Canonical Ltd.
3 *3 *
4 * This program is free software: you can redistribute it and/or modify it4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License version 3,5 * under the terms of the GNU Lesser General Public License version 3,
6 * as published by the Free Software Foundation.6 * as published by the Free Software Foundation.
7 *7 *
8 * This program is distributed in the hope that it will be useful,8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.11 * GNU Lesser General Public License for more details.
12 *12 *
13 * You should have received a copy of the GNU General Public License13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *15 *
16 * Authored by: Alexandros Frantzis <alexandros.frantzis@canonical.com>16 * Authored by: Alexandros Frantzis <alexandros.frantzis@canonical.com>
@@ -20,7 +20,7 @@
20#define MIR_GRAPHICS_ANDROID_DISPLAY_BUILDER_H_20#define MIR_GRAPHICS_ANDROID_DISPLAY_BUILDER_H_
2121
22#include "mir/graphics/display_buffer.h"22#include "mir/graphics/display_buffer.h"
23#include "mir/geometry/pixel_format.h"23#include "mir_toolkit/common.h"
24#include <memory>24#include <memory>
2525
26namespace mir26namespace mir
@@ -37,7 +37,7 @@
37public:37public:
38 virtual ~DisplayBuilder() = default;38 virtual ~DisplayBuilder() = default;
3939
40 virtual geometry::PixelFormat display_format() = 0;40 virtual MirPixelFormat display_format() = 0;
41 virtual std::shared_ptr<DisplayDevice> create_display_device() = 0;41 virtual std::shared_ptr<DisplayDevice> create_display_device() = 0;
42 virtual std::unique_ptr<graphics::DisplayBuffer> create_display_buffer(42 virtual std::unique_ptr<graphics::DisplayBuffer> create_display_buffer(
43 std::shared_ptr<DisplayDevice> const& display_device,43 std::shared_ptr<DisplayDevice> const& display_device,
4444
=== modified file 'src/platform/graphics/android/display_device.h'
--- src/server/graphics/android/display_device.h 2013-11-21 17:20:14 +0000
+++ src/platform/graphics/android/display_device.h 2013-12-11 07:33:52 +0000
@@ -2,15 +2,15 @@
2 * Copyright © 2013 Canonical Ltd.2 * Copyright © 2013 Canonical Ltd.
3 *3 *
4 * This program is free software: you can redistribute it and/or modify4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 3 as5 * it under the terms of the GNU Lesser General Public License version 3 as
6 * published by the Free Software Foundation.6 * published by the Free Software Foundation.
7 *7 *
8 * This program is distributed in the hope that it will be useful,8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.11 * GNU Lesser General Public License for more details.
12 *12 *
13 * You should have received a copy of the GNU General Public License13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *15 *
16 * Authored by: Kevin DuBois <kevin.dubois@canonical.com>16 * Authored by: Kevin DuBois <kevin.dubois@canonical.com>
@@ -38,7 +38,7 @@
3838
39 virtual void mode(MirPowerMode mode) = 0;39 virtual void mode(MirPowerMode mode) = 0;
40 virtual void prepare_composition() = 0;40 virtual void prepare_composition() = 0;
41 virtual void gpu_render(EGLDisplay dpy, EGLSurface sur) = 0; 41 virtual void gpu_render(EGLDisplay dpy, EGLSurface sur) = 0;
42 virtual void post(Buffer const& buffer) = 0;42 virtual void post(Buffer const& buffer) = 0;
4343
44protected:44protected:
4545
=== modified file 'src/platform/graphics/android/display_resource_factory.h'
--- src/server/graphics/android/display_resource_factory.h 2013-11-21 17:20:14 +0000
+++ src/platform/graphics/android/display_resource_factory.h 2013-12-11 07:33:52 +0000
@@ -2,15 +2,15 @@
2 * Copyright © 2013 Canonical Ltd.2 * Copyright © 2013 Canonical Ltd.
3 *3 *
4 * This program is free software: you can redistribute it and/or modify4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 3 as5 * it under the terms of the GNU Lesser General Public License version 3 as
6 * published by the Free Software Foundation.6 * published by the Free Software Foundation.
7 *7 *
8 * This program is distributed in the hope that it will be useful,8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.11 * GNU Lesser General Public License for more details.
12 *12 *
13 * You should have received a copy of the GNU General Public License13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *15 *
16 * Authored by: Kevin DuBois <kevin.dubois@canonical.com>16 * Authored by: Kevin DuBois <kevin.dubois@canonical.com>
1717
=== modified file 'src/platform/graphics/android/fb_device.cpp'
--- src/server/graphics/android/fb_device.cpp 2013-11-21 17:20:14 +0000
+++ src/platform/graphics/android/fb_device.cpp 2013-12-11 07:33:52 +0000
@@ -2,15 +2,15 @@
2 * Copyright © 2013 Canonical Ltd.2 * Copyright © 2013 Canonical Ltd.
3 *3 *
4 * This program is free software: you can redistribute it and/or modify it4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License version 3,5 * under the terms of the GNU Lesser General Public License version 3,
6 * as published by the Free Software Foundation.6 * as published by the Free Software Foundation.
7 *7 *
8 * This program is distributed in the hope that it will be useful,8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.11 * GNU Lesser General Public License for more details.
12 *12 *
13 * You should have received a copy of the GNU General Public License13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *15 *
16 * Authored by: Kevin DuBois <kevin.dubois@canonical.com>16 * Authored by: Kevin DuBois <kevin.dubois@canonical.com>
@@ -39,6 +39,8 @@
39 {39 {
40 fb_device->setSwapInterval(fb_device.get(), 1);40 fb_device->setSwapInterval(fb_device.get(), 1);
41 }41 }
42
43 mode(mir_power_mode_on);
42}44}
4345
44void mga::FBDevice::prepare_composition()46void mga::FBDevice::prepare_composition()
@@ -65,6 +67,14 @@
6567
66void mga::FBDevice::mode(MirPowerMode mode)68void mga::FBDevice::mode(MirPowerMode mode)
67{69{
68 // TODO: Implement70 int enable = 0;
69 (void) mode;71 if (mode == mir_power_mode_on)
72 {
73 enable = 1;
74 }
75
76 if (fb_device->enableScreen)
77 {
78 fb_device->enableScreen(fb_device.get(), enable);
79 }
70}80}
7181
=== modified file 'src/platform/graphics/android/fb_device.h'
--- src/server/graphics/android/fb_device.h 2013-11-21 17:20:14 +0000
+++ src/platform/graphics/android/fb_device.h 2013-12-11 07:33:52 +0000
@@ -2,15 +2,15 @@
2 * Copyright © 2013 Canonical Ltd.2 * Copyright © 2013 Canonical Ltd.
3 *3 *
4 * This program is free software: you can redistribute it and/or modify it4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License version 3,5 * under the terms of the GNU Lesser General Public License version 3,
6 * as published by the Free Software Foundation.6 * as published by the Free Software Foundation.
7 *7 *
8 * This program is distributed in the hope that it will be useful,8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.11 * GNU Lesser General Public License for more details.
12 *12 *
13 * You should have received a copy of the GNU General Public License13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *15 *
16 * Authored by: Kevin DuBois <kevin.dubois@canonical.com>16 * Authored by: Kevin DuBois <kevin.dubois@canonical.com>
@@ -22,7 +22,7 @@
22#include "display_device.h"22#include "display_device.h"
23#include <hardware/gralloc.h>23#include <hardware/gralloc.h>
24#include <hardware/fb.h>24#include <hardware/fb.h>
25 25
26namespace mir26namespace mir
27{27{
28namespace graphics28namespace graphics
@@ -30,14 +30,14 @@
30namespace android30namespace android
31{31{
3232
33class FBDevice : public DisplayDevice 33class FBDevice : public DisplayDevice
34{34{
35public:35public:
36 FBDevice(std::shared_ptr<framebuffer_device_t> const& fbdev);36 FBDevice(std::shared_ptr<framebuffer_device_t> const& fbdev);
3737
38 void mode(MirPowerMode mode);38 void mode(MirPowerMode mode);
39 void prepare_composition();39 void prepare_composition();
40 void gpu_render(EGLDisplay dpy, EGLSurface sur); 40 void gpu_render(EGLDisplay dpy, EGLSurface sur);
41 void post(Buffer const& buffer);41 void post(Buffer const& buffer);
4242
43private:43private:
4444
=== modified file 'src/platform/graphics/android/framebuffer_bundle.h'
--- src/server/graphics/android/framebuffer_bundle.h 2013-11-21 17:20:14 +0000
+++ src/platform/graphics/android/framebuffer_bundle.h 2013-12-11 07:33:52 +0000
@@ -2,15 +2,15 @@
2 * Copyright © 2013 Canonical Ltd.2 * Copyright © 2013 Canonical Ltd.
3 *3 *
4 * This program is free software: you can redistribute it and/or modify it4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License version 3,5 * under the terms of the GNU Lesser General Public License version 3,
6 * as published by the Free Software Foundation.6 * as published by the Free Software Foundation.
7 *7 *
8 * This program is distributed in the hope that it will be useful,8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.11 * GNU Lesser General Public License for more details.
12 *12 *
13 * You should have received a copy of the GNU General Public License13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *15 *
16 * Authored by:16 * Authored by:
@@ -20,7 +20,7 @@
20#ifndef MIR_GRAPHICS_ANDROID_FRAMEBUFFER_BUNDLE_H_20#ifndef MIR_GRAPHICS_ANDROID_FRAMEBUFFER_BUNDLE_H_
21#define MIR_GRAPHICS_ANDROID_FRAMEBUFFER_BUNDLE_H_21#define MIR_GRAPHICS_ANDROID_FRAMEBUFFER_BUNDLE_H_
2222
23#include "mir/geometry/pixel_format.h"23#include "mir_toolkit/common.h"
24#include "mir/geometry/size.h"24#include "mir/geometry/size.h"
25#include <memory>25#include <memory>
2626
@@ -37,7 +37,7 @@
37public:37public:
38 virtual ~FramebufferBundle() = default;38 virtual ~FramebufferBundle() = default;
3939
40 virtual geometry::PixelFormat fb_format() = 0;40 virtual MirPixelFormat fb_format() = 0;
41 virtual geometry::Size fb_size() = 0;41 virtual geometry::Size fb_size() = 0;
42 virtual std::shared_ptr<Buffer> buffer_for_render() = 0;42 virtual std::shared_ptr<Buffer> buffer_for_render() = 0;
43 virtual std::shared_ptr<Buffer> last_rendered_buffer() = 0;43 virtual std::shared_ptr<Buffer> last_rendered_buffer() = 0;
4444
=== modified file 'src/platform/graphics/android/framebuffers.cpp'
--- src/server/graphics/android/framebuffers.cpp 2013-11-21 17:20:14 +0000
+++ src/platform/graphics/android/framebuffers.cpp 2013-12-11 07:33:52 +0000
@@ -2,15 +2,15 @@
2 * Copyright © 2013 Canonical Ltd.2 * Copyright © 2013 Canonical Ltd.
3 *3 *
4 * This program is free software: you can redistribute it and/or modify it4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License version 3,5 * under the terms of the GNU Lesser General Public License version 3,
6 * as published by the Free Software Foundation.6 * as published by the Free Software Foundation.
7 *7 *
8 * This program is distributed in the hope that it will be useful,8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.11 * GNU Lesser General Public License for more details.
12 *12 *
13 * You should have received a copy of the GNU General Public License13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *15 *
16 * Authored by:16 * Authored by:
@@ -33,7 +33,7 @@
3333
34namespace34namespace
35{35{
36geom::PixelFormat determine_hwc11_fb_format()36MirPixelFormat determine_hwc11_fb_format()
37{37{
38 static EGLint const fb_egl_config_attr [] =38 static EGLint const fb_egl_config_attr [] =
39 {39 {
@@ -50,18 +50,18 @@
50 eglInitialize(egl_display, &major, &minor);50 eglInitialize(egl_display, &major, &minor);
51 eglChooseConfig(egl_display, fb_egl_config_attr, &fb_egl_config, 1, &matching_configs);51 eglChooseConfig(egl_display, fb_egl_config_attr, &fb_egl_config, 1, &matching_configs);
5252
53 geom::PixelFormat fb_format;53 MirPixelFormat fb_format;
54 if (matching_configs)54 if (matching_configs)
55 {55 {
56 int visual_id;56 int visual_id;
57 eglGetConfigAttrib(egl_display, fb_egl_config, EGL_NATIVE_VISUAL_ID, &visual_id);57 eglGetConfigAttrib(egl_display, fb_egl_config, EGL_NATIVE_VISUAL_ID, &visual_id);
58 fb_format = mga::to_mir_format(visual_id); 58 fb_format = mga::to_mir_format(visual_id);
59 }59 }
60 else60 else
61 {61 {
62 //we couldn't figure out the fb format via egl. In this case, we62 //we couldn't figure out the fb format via egl. In this case, we
63 //assume abgr_8888. HWC api really should provide this information directly.63 //assume abgr_8888. HWC api really should provide this information directly.
64 fb_format = geom::PixelFormat::abgr_8888;64 fb_format = mir_pixel_format_abgr_8888;
65 }65 }
6666
67 eglTerminate(egl_display);67 eglTerminate(egl_display);
@@ -76,7 +76,7 @@
76 auto rc = hwc_device->getDisplayConfigs(hwc_device.get(), HWC_DISPLAY_PRIMARY, &primary_display_config, &num_configs);76 auto rc = hwc_device->getDisplayConfigs(hwc_device.get(), HWC_DISPLAY_PRIMARY, &primary_display_config, &num_configs);
77 if (rc != 0)77 if (rc != 0)
78 {78 {
79 BOOST_THROW_EXCEPTION(std::runtime_error("could not determine hwc display config")); 79 BOOST_THROW_EXCEPTION(std::runtime_error("could not determine hwc display config"));
80 }80 }
81 static uint32_t size_request[3] = { HWC_DISPLAY_WIDTH,81 static uint32_t size_request[3] = { HWC_DISPLAY_WIDTH,
82 HWC_DISPLAY_HEIGHT,82 HWC_DISPLAY_HEIGHT,
@@ -94,7 +94,7 @@
94 std::shared_ptr<mga::GraphicBufferAllocator> const& buffer_allocator,94 std::shared_ptr<mga::GraphicBufferAllocator> const& buffer_allocator,
95 std::shared_ptr<hwc_composer_device_1> const& hwc)95 std::shared_ptr<hwc_composer_device_1> const& hwc)
96 : format(determine_hwc11_fb_format()),96 : format(determine_hwc11_fb_format()),
97 size(determine_hwc11_size(hwc)) 97 size(determine_hwc11_size(hwc))
98{98{
99 for(auto i = 0u; i < 2; i++)99 for(auto i = 0u; i < 2; i++)
100 {100 {
@@ -106,7 +106,7 @@
106 std::shared_ptr<mga::GraphicBufferAllocator> const& buffer_allocator,106 std::shared_ptr<mga::GraphicBufferAllocator> const& buffer_allocator,
107 std::shared_ptr<framebuffer_device_t> const& fb)107 std::shared_ptr<framebuffer_device_t> const& fb)
108 : format{mga::to_mir_format(fb->format)},108 : format{mga::to_mir_format(fb->format)},
109 size({fb->width, fb->height}) 109 size({fb->width, fb->height})
110{110{
111 //guarantee always 2 fb's allocated111 //guarantee always 2 fb's allocated
112 auto fb_num = static_cast<unsigned int>(fb->numFramebuffers);112 auto fb_num = static_cast<unsigned int>(fb->numFramebuffers);
@@ -117,7 +117,7 @@
117 }117 }
118}118}
119119
120geom::PixelFormat mga::Framebuffers::fb_format()120MirPixelFormat mga::Framebuffers::fb_format()
121{121{
122 return format;122 return format;
123}123}
@@ -154,5 +154,5 @@
154154
155void mga::Framebuffers::wait_for_consumed_buffer(bool)155void mga::Framebuffers::wait_for_consumed_buffer(bool)
156{156{
157 //TODO: change swapping so buffer_for_render() does not wait 157 //TODO: change swapping so buffer_for_render() does not wait
158}158}
159159
=== modified file 'src/platform/graphics/android/framebuffers.h'
--- src/server/graphics/android/framebuffers.h 2013-11-21 17:20:14 +0000
+++ src/platform/graphics/android/framebuffers.h 2013-12-11 07:33:52 +0000
@@ -2,15 +2,15 @@
2 * Copyright © 2013 Canonical Ltd.2 * Copyright © 2013 Canonical Ltd.
3 *3 *
4 * This program is free software: you can redistribute it and/or modify it4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License version 3,5 * under the terms of the GNU Lesser General Public License version 3,
6 * as published by the Free Software Foundation.6 * as published by the Free Software Foundation.
7 *7 *
8 * This program is distributed in the hope that it will be useful,8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.11 * GNU Lesser General Public License for more details.
12 *12 *
13 * You should have received a copy of the GNU General Public License13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *15 *
16 * Authored by:16 * Authored by:
@@ -46,14 +46,14 @@
46 Framebuffers(std::shared_ptr<GraphicBufferAllocator> const& buffer_allocator,46 Framebuffers(std::shared_ptr<GraphicBufferAllocator> const& buffer_allocator,
47 std::shared_ptr<framebuffer_device_t> const& fb);47 std::shared_ptr<framebuffer_device_t> const& fb);
4848
49 geometry::PixelFormat fb_format();49 MirPixelFormat fb_format();
50 geometry::Size fb_size();50 geometry::Size fb_size();
51 std::shared_ptr<Buffer> buffer_for_render();51 std::shared_ptr<Buffer> buffer_for_render();
52 std::shared_ptr<Buffer> last_rendered_buffer();52 std::shared_ptr<Buffer> last_rendered_buffer();
53 void wait_for_consumed_buffer(bool);53 void wait_for_consumed_buffer(bool);
5454
55private:55private:
56 geometry::PixelFormat const format;56 MirPixelFormat const format;
57 geometry::Size const size;57 geometry::Size const size;
5858
59 std::mutex queue_lock;59 std::mutex queue_lock;
6060
=== modified file 'src/platform/graphics/android/gl_context.cpp'
--- src/server/graphics/android/gl_context.cpp 2013-11-15 20:34:17 +0000
+++ src/platform/graphics/android/gl_context.cpp 2013-12-11 07:33:52 +0000
@@ -2,15 +2,15 @@
2 * Copyright © 2013 Canonical Ltd.2 * Copyright © 2013 Canonical Ltd.
3 *3 *
4 * This program is free software: you can redistribute it and/or modify it4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License version 3,5 * under the terms of the GNU Lesser General Public License version 3,
6 * as published by the Free Software Foundation.6 * as published by the Free Software Foundation.
7 *7 *
8 * This program is distributed in the hope that it will be useful,8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.11 * GNU Lesser General Public License for more details.
12 *12 *
13 * You should have received a copy of the GNU General Public License13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *15 *
16 * Authored by: Kevin DuBois <kevin.dubois@canonical.com>16 * Authored by: Kevin DuBois <kevin.dubois@canonical.com>
@@ -26,7 +26,6 @@
2626
27namespace mg=mir::graphics;27namespace mg=mir::graphics;
28namespace mga=mir::graphics::android;28namespace mga=mir::graphics::android;
29namespace geom=mir::geometry;
3029
31namespace30namespace
32{31{
@@ -69,7 +68,7 @@
6968
70/* the minimum requirement is to have EGL_WINDOW_BIT and EGL_OPENGL_ES2_BIT, and to select a config69/* the minimum requirement is to have EGL_WINDOW_BIT and EGL_OPENGL_ES2_BIT, and to select a config
71 whose pixel format matches that of the framebuffer. */70 whose pixel format matches that of the framebuffer. */
72static EGLConfig select_egl_config_with_format(EGLDisplay egl_display, geom::PixelFormat display_format)71static EGLConfig select_egl_config_with_format(EGLDisplay egl_display, MirPixelFormat display_format)
73{72{
74 int required_visual_id = mga::to_android_format(display_format);73 int required_visual_id = mga::to_android_format(display_format);
75 int num_potential_configs;74 int num_potential_configs;
@@ -107,7 +106,7 @@
107 return eglCreateWindowSurface(disp, config, native, NULL);106 return eglCreateWindowSurface(disp, config, native, NULL);
108}107}
109108
110mga::GLContext::GLContext(geom::PixelFormat display_format, mg::DisplayReport& report)109mga::GLContext::GLContext(MirPixelFormat display_format, mg::DisplayReport& report)
111 : egl_display(create_and_initialize_display()),110 : egl_display(create_and_initialize_display()),
112 own_display(true),111 own_display(true),
113 egl_config(select_egl_config_with_format(egl_display, display_format)),112 egl_config(select_egl_config_with_format(egl_display, display_format)),
@@ -115,7 +114,7 @@
115 eglCreateContext(egl_display, egl_config, EGL_NO_CONTEXT, default_egl_context_attr)},114 eglCreateContext(egl_display, egl_config, EGL_NO_CONTEXT, default_egl_context_attr)},
116 egl_surface{egl_display,115 egl_surface{egl_display,
117 eglCreatePbufferSurface(egl_display, egl_config, dummy_pbuffer_attribs)}116 eglCreatePbufferSurface(egl_display, egl_config, dummy_pbuffer_attribs)}
118{ 117{
119 report.report_egl_configuration(egl_display, egl_config);118 report.report_egl_configuration(egl_display, egl_config);
120}119}
121120
122121
=== modified file 'src/platform/graphics/android/gl_context.h'
--- src/server/graphics/android/gl_context.h 2013-11-15 20:34:17 +0000
+++ src/platform/graphics/android/gl_context.h 2013-12-11 07:33:52 +0000
@@ -2,15 +2,15 @@
2 * Copyright © 2013 Canonical Ltd.2 * Copyright © 2013 Canonical Ltd.
3 *3 *
4 * This program is free software: you can redistribute it and/or modify it4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License version 3,5 * under the terms of the GNU Lesser General Public License version 3,
6 * as published by the Free Software Foundation.6 * as published by the Free Software Foundation.
7 *7 *
8 * This program is distributed in the hope that it will be useful,8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.11 * GNU Lesser General Public License for more details.
12 *12 *
13 * You should have received a copy of the GNU General Public License13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *15 *
16 * Authored by: Kevin DuBois <kevin.dubois@canonical.com>16 * Authored by: Kevin DuBois <kevin.dubois@canonical.com>
@@ -21,7 +21,7 @@
2121
22#include "mir/graphics/gl_context.h"22#include "mir/graphics/gl_context.h"
23#include "mir/graphics/egl_resources.h"23#include "mir/graphics/egl_resources.h"
24#include "mir/geometry/pixel_format.h"24#include "mir_toolkit/common.h"
25#include <functional>25#include <functional>
2626
27namespace mir27namespace mir
@@ -40,7 +40,7 @@
40{40{
41public:41public:
42 //For creating a gl context42 //For creating a gl context
43 GLContext(geometry::PixelFormat display_format, DisplayReport& report);43 GLContext(MirPixelFormat display_format, DisplayReport& report);
4444
45 //For creating a gl context shared with another GLContext45 //For creating a gl context shared with another GLContext
46 GLContext(GLContext const& shared_gl_context,46 GLContext(GLContext const& shared_gl_context,
4747
=== modified file 'src/platform/graphics/android/graphic_alloc_adaptor.h'
--- src/server/graphics/android/graphic_alloc_adaptor.h 2013-10-15 08:53:10 +0000
+++ src/platform/graphics/android/graphic_alloc_adaptor.h 2013-12-11 07:33:52 +0000
@@ -2,15 +2,15 @@
2 * Copyright © 2012 Canonical Ltd.2 * Copyright © 2012 Canonical Ltd.
3 *3 *
4 * This program is free software: you can redistribute it and/or modify it4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License version 3,5 * under the terms of the GNU Lesser General Public License version 3,
6 * as published by the Free Software Foundation.6 * as published by the Free Software Foundation.
7 *7 *
8 * This program is distributed in the hope that it will be useful,8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.11 * GNU Lesser General Public License for more details.
12 *12 *
13 * You should have received a copy of the GNU General Public License13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *15 *
16 * Authored by: Kevin DuBois <kevin.dubois@canonical.com>16 * Authored by: Kevin DuBois <kevin.dubois@canonical.com>
@@ -20,7 +20,7 @@
20#define MIR_GRAPHICS_ANDROID_GRAPHIC_ALLOC_ADAPTOR_H_20#define MIR_GRAPHICS_ANDROID_GRAPHIC_ALLOC_ADAPTOR_H_
2121
22#include "mir/geometry/size.h"22#include "mir/geometry/size.h"
23#include "mir/geometry/pixel_format.h"23#include "mir_toolkit/common.h"
24#include "buffer_usage.h"24#include "buffer_usage.h"
25#include <memory>25#include <memory>
2626
@@ -37,7 +37,7 @@
37{37{
38public:38public:
39 virtual std::shared_ptr<NativeBuffer> alloc_buffer(geometry::Size size,39 virtual std::shared_ptr<NativeBuffer> alloc_buffer(geometry::Size size,
40 geometry::PixelFormat, BufferUsage usage) = 0;40 MirPixelFormat, BufferUsage usage) = 0;
41protected:41protected:
42 GraphicAllocAdaptor() = default;42 GraphicAllocAdaptor() = default;
43 virtual ~GraphicAllocAdaptor() {}43 virtual ~GraphicAllocAdaptor() {}
4444
=== modified file 'src/platform/graphics/android/graphic_buffer_allocator.h'
--- src/server/graphics/android/graphic_buffer_allocator.h 2013-11-21 17:20:14 +0000
+++ src/platform/graphics/android/graphic_buffer_allocator.h 2013-12-11 07:33:52 +0000
@@ -2,15 +2,15 @@
2 * Copyright © 2013 Canonical Ltd.2 * Copyright © 2013 Canonical Ltd.
3 *3 *
4 * This program is free software: you can redistribute it and/or modify it4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License version 3,5 * under the terms of the GNU Lesser General Public License version 3,
6 * as published by the Free Software Foundation.6 * as published by the Free Software Foundation.
7 *7 *
8 * This program is distributed in the hope that it will be useful,8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.11 * GNU Lesser General Public License for more details.
12 *12 *
13 * You should have received a copy of the GNU General Public License13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *15 *
16 * Authored by:16 * Authored by:
@@ -23,7 +23,7 @@
23#include "buffer_usage.h"23#include "buffer_usage.h"
2424
25#include "mir/geometry/size.h"25#include "mir/geometry/size.h"
26#include "mir/geometry/pixel_format.h"26#include "mir_toolkit/common.h"
2727
28#include <memory>28#include <memory>
2929
@@ -39,7 +39,7 @@
39{39{
40public:40public:
41 virtual std::shared_ptr<graphics::Buffer> alloc_buffer_platform(41 virtual std::shared_ptr<graphics::Buffer> alloc_buffer_platform(
42 geometry::Size sz, geometry::PixelFormat pf, BufferUsage use) = 0;42 geometry::Size sz, MirPixelFormat pf, BufferUsage use) = 0;
4343
44protected:44protected:
45 GraphicBufferAllocator() = default;45 GraphicBufferAllocator() = default;
4646
=== modified file 'src/platform/graphics/android/hwc10_device.cpp'
--- src/server/graphics/android/hwc10_device.cpp 2013-11-21 17:20:14 +0000
+++ src/platform/graphics/android/hwc10_device.cpp 2013-12-11 07:33:52 +0000
@@ -2,15 +2,15 @@
2 * Copyright © 2013 Canonical Ltd.2 * Copyright © 2013 Canonical Ltd.
3 *3 *
4 * This program is free software: you can redistribute it and/or modify it4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License version 3,5 * under the terms of the GNU Lesser General Public License version 3,
6 * as published by the Free Software Foundation.6 * as published by the Free Software Foundation.
7 *7 *
8 * This program is distributed in the hope that it will be useful,8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.11 * GNU Lesser General Public License for more details.
12 *12 *
13 * You should have received a copy of the GNU General Public License13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *15 *
16 * Authored by:16 * Authored by:
1717
=== modified file 'src/platform/graphics/android/hwc10_device.h'
--- src/server/graphics/android/hwc10_device.h 2013-11-21 17:20:14 +0000
+++ src/platform/graphics/android/hwc10_device.h 2013-12-11 07:33:52 +0000
@@ -2,15 +2,15 @@
2 * Copyright © 2013 Canonical Ltd.2 * Copyright © 2013 Canonical Ltd.
3 *3 *
4 * This program is free software: you can redistribute it and/or modify it4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License version 3,5 * under the terms of the GNU Lesser General Public License version 3,
6 * as published by the Free Software Foundation.6 * as published by the Free Software Foundation.
7 *7 *
8 * This program is distributed in the hope that it will be useful,8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches