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.
lp:~raof/mir/check-for-surfaceless updated
1283. By Chris Halse Rogers

Move surface creation to a EGLSurfaceStore::create_dummy_surface helper

1284. By Chris Halse Rogers

Move EGLSurfacelessContext and GLExtensionsBase into server/graphics in preparation for sharing them between Nested and Offscreen

Also make EGLSurfacelessContext a mg::GLContext

1285. By Chris Halse Rogers

Use SurfacelessEGLContext in Nested Mir

1286. By Chris Halse Rogers

Remove no-longer-needed create_dummy_surface from EGLSurfaceStore

1287. By Chris Halse Rogers

Add SurfacelessEGLContext constructor that takes an EGL attrib list

This way we can create a context with the desired attributes that *also* definitely supports
pbuffer surfaces if we need them.

1288. By Chris Halse Rogers

Add some tests for SurfacelessEGLContext

1289. By Chris Halse Rogers

…and fix up logic error exposed by said tests

1290. By Chris Halse Rogers

Add the rest of the EGL_SURFACE_TYPE bits to the attrib matcher

Because why not!

1291. By Chris Halse Rogers

Help g++'s not-very-good flow analysis out.

For some reason it can't deduce that found_surface_type is true iff surface_type has been
set, but only on amd64 and armhf? Whatever.

1292. By Chris Halse Rogers

Whoops. EGL_NONE is the terminator for EGL attribute lists, not 0

1293. By Chris Halse Rogers

Fix typo

1294. By Chris Halse Rogers

Fix { style

1295. By Chris Halse Rogers

Remove ugly mutable specification from EGLHelper

1296. By Chris Halse Rogers

Implement simple SurfacelessEGLContext constructor in terms of complex constructor

1297. By Chris Halse Rogers

Address move semantics review comments

1298. By Chris Halse Rogers

Don't try and release a context if there's no current context

1299. By Chris Halse Rogers

Fix { placement in unit-tests, too

1300. By Chris Halse Rogers

Fix { style harder

1301. By Chris Halse Rogers

More {inating, even when it's stupid.

Also try finding shorter names for the testcases

Unmerged revisions

Preview Diff

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

Subscribers

People subscribed via source and target branches