Merge lp:~raof/mir/check-for-surfaceless into lp:mir/0.1
- check-for-surfaceless
- Merge into trusty
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 |
Related bugs: |
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_
It seems that at least one of our Android stacks doesn't support EGL_KHR_
and Mesa doesn't support pbuffer surfaces.
Fixes nested on Mesa
Description of the change
nested: Check for, and prefer, EGL_KHR_
It seems that at least one of our Android stacks doesn't support EGL_KHR_
and Mesa doesn't support pbuffer surfaces.
Fixes nested on Mesa
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
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 | 87 | ) | 87 | ) |
6 | 88 | endif(MIR_DISABLE_EPOLL_REACTOR) | 88 | endif(MIR_DISABLE_EPOLL_REACTOR) |
7 | 89 | 89 | ||
9 | 90 | # Default to gbm backend | 90 | # Default to mesa backend |
10 | 91 | set( | 91 | set( |
11 | 92 | MIR_PLATFORM | 92 | MIR_PLATFORM |
13 | 93 | gbm | 93 | mesa |
14 | 94 | CACHE | 94 | CACHE |
15 | 95 | STRING | 95 | STRING |
17 | 96 | "graphics backend to build (options are 'gbm' or 'android')" | 96 | "graphics backend to build (options are 'mesa' or 'android')" |
18 | 97 | ) | 97 | ) |
19 | 98 | 98 | ||
20 | 99 | find_package(EGL REQUIRED) | 99 | find_package(EGL REQUIRED) |
21 | @@ -124,14 +124,14 @@ | |||
22 | 124 | 124 | ||
23 | 125 | #ctest does not work for android, so turn test discovery off | 125 | #ctest does not work for android, so turn test discovery off |
24 | 126 | set(DISABLE_GTEST_TEST_DISCOVERY ON) | 126 | set(DISABLE_GTEST_TEST_DISCOVERY ON) |
26 | 127 | elseif (MIR_PLATFORM STREQUAL "gbm") | 127 | elseif (MIR_PLATFORM STREQUAL "mesa") |
27 | 128 | find_package( PkgConfig ) | 128 | find_package( PkgConfig ) |
28 | 129 | pkg_check_modules( GBM REQUIRED gbm>=9.0.0) | 129 | pkg_check_modules( GBM REQUIRED gbm>=9.0.0) |
29 | 130 | pkg_check_modules( DRM REQUIRED libdrm ) | 130 | pkg_check_modules( DRM REQUIRED libdrm ) |
30 | 131 | pkg_check_modules( UDEV REQUIRED libudev ) | 131 | pkg_check_modules( UDEV REQUIRED libudev ) |
31 | 132 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__GBM__") | 132 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__GBM__") |
32 | 133 | else () | 133 | else () |
34 | 134 | message (FATAL_ERROR "MIR_BACKEND must be either 'android' or 'gbm'") | 134 | message (FATAL_ERROR "MIR_BACKEND must be either 'android' or 'mesa'") |
35 | 135 | endif() | 135 | endif() |
36 | 136 | 136 | ||
37 | 137 | set(MIR_ANDROID_INCLUDE_DIRECTORIES) # to be filled by android-input | 137 | set(MIR_ANDROID_INCLUDE_DIRECTORIES) # to be filled by android-input |
38 | 138 | 138 | ||
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 | 19 | valgrind) | 19 | valgrind) |
44 | 20 | 20 | ||
45 | 21 | if(VALGRIND_EXECUTABLE) | 21 | if(VALGRIND_EXECUTABLE) |
47 | 22 | set(VALGRIND_ARGS "--error-exitcode=1 --trace-children=yes") | 22 | if(MIR_PLATFORM STREQUAL "android") |
48 | 23 | # don't exit with an error when valgrind find errors | ||
49 | 24 | #set(VALGRIND_ARGS "--error-exitcode=1") | ||
50 | 25 | else() | ||
51 | 26 | set(VALGRIND_ARGS "--error-exitcode=1 --trace-children=yes") | ||
52 | 27 | endif() | ||
53 | 28 | |||
54 | 23 | set(ENABLE_MEMCHECK_FLAG "--enable-memcheck") | 29 | set(ENABLE_MEMCHECK_FLAG "--enable-memcheck") |
55 | 30 | |||
56 | 24 | else(VALGRIND_EXECUTABLE) | 31 | else(VALGRIND_EXECUTABLE) |
57 | 25 | message("Not enabling memcheck as valgrind is missing on your system") | 32 | message("Not enabling memcheck as valgrind is missing on your system") |
58 | 26 | endif(VALGRIND_EXECUTABLE) | 33 | endif(VALGRIND_EXECUTABLE) |
59 | 27 | 34 | ||
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 | 69 | . | 69 | . |
65 | 70 | Contains the protocol's definition files. | 70 | Contains the protocol's definition files. |
66 | 71 | 71 | ||
68 | 72 | Package: libmirserver11 | 72 | Package: libmirserver12 |
69 | 73 | Section: libs | 73 | Section: libs |
70 | 74 | Architecture: i386 amd64 armhf arm64 | 74 | Architecture: i386 amd64 armhf arm64 |
71 | 75 | Multi-Arch: same | 75 | Multi-Arch: same |
72 | @@ -115,7 +115,7 @@ | |||
73 | 115 | Architecture: i386 amd64 armhf arm64 | 115 | Architecture: i386 amd64 armhf arm64 |
74 | 116 | Multi-Arch: same | 116 | Multi-Arch: same |
75 | 117 | Pre-Depends: ${misc:Pre-Depends} | 117 | Pre-Depends: ${misc:Pre-Depends} |
77 | 118 | Depends: libmirserver11 (= ${binary:Version}), | 118 | Depends: libmirserver12 (= ${binary:Version}), |
78 | 119 | libmirprotobuf-dev (= ${binary:Version}), | 119 | libmirprotobuf-dev (= ${binary:Version}), |
79 | 120 | mircommon-dev (= ${binary:Version}), | 120 | mircommon-dev (= ${binary:Version}), |
80 | 121 | libglm-dev, | 121 | libglm-dev, |
81 | 122 | 122 | ||
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 @@ | |||
87 | 1 | usr/lib/*/libmirserver.so.11 | 1 | usr/lib/*/libmirserver.so.12 |
88 | 2 | 2 | ||
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 | 1 | usr/bin/mir_stress | 1 | usr/bin/mir_stress |
94 | 2 | usr/bin/mir_unit_tests | ||
95 | 3 | usr/bin/mir_acceptance_tests | ||
96 | 4 | usr/bin/mir_integration_tests | ||
97 | 2 | usr/lib/*/mir/tools/libmirclientlttng.so | 5 | usr/lib/*/mir/tools/libmirclientlttng.so |
98 | 3 | usr/lib/*/mir/tools/libmirserverlttng.so | 6 | usr/lib/*/mir/tools/libmirserverlttng.so |
99 | 4 | 7 | ||
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 | 21 | ifeq ($(DEB_HOST_ARCH),armhf) | 21 | ifeq ($(DEB_HOST_ARCH),armhf) |
105 | 22 | dh_auto_configure -- \ | 22 | dh_auto_configure -- \ |
106 | 23 | $(COMMON_CONFIGURE_OPTIONS) \ | 23 | $(COMMON_CONFIGURE_OPTIONS) \ |
111 | 24 | -DMIR_PLATFORM=android \ | 24 | -DMIR_PLATFORM=android |
108 | 25 | -DMIR_ENABLE_UNIT_TESTS=NO \ | ||
109 | 26 | -DMIR_ENABLE_ACCEPTANCE_TESTS=NO \ | ||
110 | 27 | -DMIR_ENABLE_INTEGRATION_TESTS=NO | ||
112 | 28 | else | 25 | else |
113 | 29 | ifeq ($(DEB_HOST_ARCH),powerpc) | 26 | ifeq ($(DEB_HOST_ARCH),powerpc) |
114 | 30 | dh_auto_configure -- \ | 27 | dh_auto_configure -- \ |
115 | 31 | 28 | ||
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 | 92 | auto params = msh::a_surface().of_name("Inprocess EGL Demo") | 92 | auto params = msh::a_surface().of_name("Inprocess EGL Demo") |
121 | 93 | .of_size(surface_size) | 93 | .of_size(surface_size) |
122 | 94 | .of_buffer_usage(mg::BufferUsage::hardware) | 94 | .of_buffer_usage(mg::BufferUsage::hardware) |
124 | 95 | .of_pixel_format(geom::PixelFormat::argb_8888); | 95 | .of_pixel_format(mir_pixel_format_argb_8888); |
125 | 96 | auto session = shell->open_session("Inprocess client", std::make_shared<NullEventSink>()); | 96 | auto session = shell->open_session("Inprocess client", std::make_shared<NullEventSink>()); |
126 | 97 | // TODO: Why do we get an ID? ~racarr | 97 | // TODO: Why do we get an ID? ~racarr |
127 | 98 | auto surface = session->get_surface(shell->create_surface_for(session, params)); | 98 | auto surface = session->get_surface(shell->create_surface_for(session, params)); |
128 | 99 | 99 | ||
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 | 27 | #include "mir/compositor/compositor.h" | 27 | #include "mir/compositor/compositor.h" |
134 | 28 | 28 | ||
135 | 29 | #include <linux/input.h> | 29 | #include <linux/input.h> |
136 | 30 | #include <android/keycodes.h> // TODO remove this dependency | ||
137 | 30 | 31 | ||
138 | 31 | #include <cassert> | 32 | #include <cassert> |
139 | 32 | #include <cstdlib> | 33 | #include <cstdlib> |
140 | @@ -133,7 +134,9 @@ | |||
141 | 133 | focus_controller->focus_next(); | 134 | focus_controller->focus_next(); |
142 | 134 | return true; | 135 | return true; |
143 | 135 | } | 136 | } |
145 | 136 | if (event.key.modifiers & mir_key_modifier_alt && event.key.scan_code == KEY_P) | 137 | else if ((event.key.modifiers & mir_key_modifier_alt && |
146 | 138 | event.key.scan_code == KEY_P) || | ||
147 | 139 | (event.key.key_code == AKEYCODE_POWER)) | ||
148 | 137 | { | 140 | { |
149 | 138 | compositor->stop(); | 141 | compositor->stop(); |
150 | 139 | auto conf = display->configuration(); | 142 | auto conf = display->configuration(); |
151 | @@ -155,7 +158,8 @@ | |||
152 | 155 | display_off = !display_off; | 158 | display_off = !display_off; |
153 | 156 | 159 | ||
154 | 157 | display->configure(*conf.get()); | 160 | display->configure(*conf.get()); |
156 | 158 | compositor->start(); | 161 | if (!display_off) |
157 | 162 | compositor->start(); | ||
158 | 159 | return true; | 163 | return true; |
159 | 160 | } | 164 | } |
160 | 161 | } | 165 | } |
161 | 162 | 166 | ||
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 | 93 | lastcount = count; | 93 | lastcount = count; |
167 | 94 | } | 94 | } |
168 | 95 | 95 | ||
171 | 96 | /* This is one way to handle window resizing. But in future it would be | 96 | /* |
172 | 97 | better to have resize events coming from the server */ | 97 | * Querying the surface (actually the current buffer) dimensions here is |
173 | 98 | * the only truly safe way to be sure that the dimensions we think we | ||
174 | 99 | * have are those of the buffer being rendered to. But this should be | ||
175 | 100 | * improved in future; https://bugs.launchpad.net/mir/+bug/1194384 | ||
176 | 101 | */ | ||
177 | 98 | if (eglQuerySurface(egldisplay, eglsurface, EGL_WIDTH, &width) && | 102 | if (eglQuerySurface(egldisplay, eglsurface, EGL_WIDTH, &width) && |
178 | 99 | eglQuerySurface(egldisplay, eglsurface, EGL_HEIGHT, &height)) | 103 | eglQuerySurface(egldisplay, eglsurface, EGL_HEIGHT, &height)) |
179 | 100 | { | 104 | { |
180 | @@ -102,7 +106,7 @@ | |||
181 | 102 | } | 106 | } |
182 | 103 | } | 107 | } |
183 | 104 | 108 | ||
185 | 105 | static void mir_eglapp_handle_input(MirSurface* surface, MirEvent const* ev, void* context) | 109 | static void mir_eglapp_handle_event(MirSurface* surface, MirEvent const* ev, void* context) |
186 | 106 | { | 110 | { |
187 | 107 | (void) surface; | 111 | (void) surface; |
188 | 108 | (void) context; | 112 | (void) context; |
189 | @@ -112,22 +116,16 @@ | |||
190 | 112 | { | 116 | { |
191 | 113 | running = 0; | 117 | running = 0; |
192 | 114 | } | 118 | } |
198 | 115 | } | 119 | else if (ev->type == mir_event_type_resize) |
194 | 116 | |||
195 | 117 | static unsigned int get_bpp(MirPixelFormat pf) | ||
196 | 118 | { | ||
197 | 119 | switch (pf) | ||
199 | 120 | { | 120 | { |
210 | 121 | case mir_pixel_format_abgr_8888: | 121 | /* |
211 | 122 | case mir_pixel_format_xbgr_8888: | 122 | * FIXME: https://bugs.launchpad.net/mir/+bug/1194384 |
212 | 123 | case mir_pixel_format_argb_8888: | 123 | * It is unsafe to set the width and height here because we're in a |
213 | 124 | case mir_pixel_format_xrgb_8888: | 124 | * different thread to that doing the rendering. So we either need |
214 | 125 | return 32; | 125 | * support for event queuing (directing them to another thread) or |
215 | 126 | case mir_pixel_format_bgr_888: | 126 | * full single-threaded callbacks. (LP: #1194384). |
216 | 127 | return 24; | 127 | */ |
217 | 128 | case mir_pixel_format_invalid: | 128 | printf("Resized to %dx%d\n", ev->resize.width, ev->resize.height); |
208 | 129 | default: | ||
209 | 130 | return 0; | ||
218 | 131 | } | 129 | } |
219 | 132 | } | 130 | } |
220 | 133 | 131 | ||
221 | @@ -172,7 +170,7 @@ | |||
222 | 172 | }; | 170 | }; |
223 | 173 | MirEventDelegate delegate = | 171 | MirEventDelegate delegate = |
224 | 174 | { | 172 | { |
226 | 175 | mir_eglapp_handle_input, | 173 | mir_eglapp_handle_event, |
227 | 176 | NULL | 174 | NULL |
228 | 177 | }; | 175 | }; |
229 | 178 | EGLConfig eglconfig; | 176 | EGLConfig eglconfig; |
230 | @@ -342,7 +340,7 @@ | |||
231 | 342 | 340 | ||
232 | 343 | printf("Server supports %d of %d surface pixel formats. Using format: %d\n", | 341 | printf("Server supports %d of %d surface pixel formats. Using format: %d\n", |
233 | 344 | nformats, mir_pixel_formats, surfaceparm.pixel_format); | 342 | nformats, mir_pixel_formats, surfaceparm.pixel_format); |
235 | 345 | unsigned int bpp = get_bpp(surfaceparm.pixel_format); | 343 | unsigned int bpp = 8 * MIR_BYTES_PER_PIXEL(surfaceparm.pixel_format); |
236 | 346 | EGLint attribs[] = | 344 | EGLint attribs[] = |
237 | 347 | { | 345 | { |
238 | 348 | EGL_SURFACE_TYPE, EGL_WINDOW_BIT, | 346 | EGL_SURFACE_TYPE, EGL_WINDOW_BIT, |
239 | 349 | 347 | ||
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 | 247 | redraw(surface, canvas); | 247 | redraw(surface, canvas); |
245 | 248 | } | 248 | } |
246 | 249 | } | 249 | } |
247 | 250 | else if (event->type == mir_event_type_resize) | ||
248 | 251 | { | ||
249 | 252 | /* FIXME: https://bugs.launchpad.net/mir/+bug/1194384 | ||
250 | 253 | * mir_event_type_resize will arrive in a different thread to that of | ||
251 | 254 | * mir_event_type_motion, so we cannot safely redraw from this thread. | ||
252 | 255 | * Either the callbacks will need to become thread-safe, or we'd have | ||
253 | 256 | * to employ some non-trivial event queuing and inter-thread signals, | ||
254 | 257 | * which I think is beyond the scope of this example code. | ||
255 | 258 | * | ||
256 | 259 | * redraw(surface, canvas); | ||
257 | 260 | */ | ||
258 | 261 | } | ||
259 | 250 | } | 262 | } |
260 | 251 | 263 | ||
261 | 252 | static const MirDisplayOutput *find_active_output( | 264 | static const MirDisplayOutput *find_active_output( |
262 | 253 | 265 | ||
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 | 414 | mf::SurfaceId(), {}); | 414 | mf::SurfaceId(), {}); |
268 | 415 | 415 | ||
269 | 416 | /* | 416 | /* |
271 | 417 | * We call advance_client_buffer() twice so that the surface is | 417 | * We call swap_buffers() twice so that the surface is |
272 | 418 | * considers the first buffer to be posted. | 418 | * considers the first buffer to be posted. |
273 | 419 | * (TODO There must be a better way!) | 419 | * (TODO There must be a better way!) |
274 | 420 | */ | 420 | */ |
277 | 421 | s->advance_client_buffer(); | 421 | { |
278 | 422 | s->advance_client_buffer(); | 422 | mg::Buffer* buffer{nullptr}; |
279 | 423 | s->swap_buffers(buffer); | ||
280 | 424 | s->swap_buffers(buffer); | ||
281 | 425 | } | ||
282 | 423 | 426 | ||
283 | 424 | /* | 427 | /* |
284 | 425 | * Place each surface at a different starting location and give it a | 428 | * Place each surface at a different starting location and give it a |
285 | 426 | 429 | ||
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 | 66 | /** | 66 | /** |
291 | 67 | * Test for a valid connection | 67 | * Test for a valid connection |
292 | 68 | * \param [in] connection The connection | 68 | * \param [in] connection The connection |
295 | 69 | * \return A non-zero value if the supplied connection is | 69 | * \return True if the supplied connection is valid, or |
296 | 70 | * valid, 0 otherwise | 70 | * false otherwise. |
297 | 71 | */ | 71 | */ |
299 | 72 | int mir_connection_is_valid(MirConnection *connection); | 72 | MirBool mir_connection_is_valid(MirConnection *connection); |
300 | 73 | 73 | ||
301 | 74 | /** | 74 | /** |
302 | 75 | * Retrieve a text description of the last error. The returned string is owned | 75 | * Retrieve a text description of the last error. The returned string is owned |
303 | @@ -104,7 +104,7 @@ | |||
304 | 104 | void mir_connection_set_lifecycle_event_callback(MirConnection* connection, | 104 | void mir_connection_set_lifecycle_event_callback(MirConnection* connection, |
305 | 105 | mir_lifecycle_event_callback callback, void* context); | 105 | mir_lifecycle_event_callback callback, void* context); |
306 | 106 | 106 | ||
308 | 107 | /** | 107 | /** |
309 | 108 | * \deprecated Use mir_connection_create_display_config | 108 | * \deprecated Use mir_connection_create_display_config |
310 | 109 | */ | 109 | */ |
311 | 110 | __attribute__((__deprecated__("Use mir_connection_create_display_config()"))) | 110 | __attribute__((__deprecated__("Use mir_connection_create_display_config()"))) |
312 | @@ -112,8 +112,8 @@ | |||
313 | 112 | 112 | ||
314 | 113 | /** | 113 | /** |
315 | 114 | * Query the display | 114 | * Query the display |
318 | 115 | * \warning return value must be destroyed via mir_display_config_destroy() | 115 | * \warning return value must be destroyed via mir_display_config_destroy() |
319 | 116 | * \warning may return null if connection is invalid | 116 | * \warning may return null if connection is invalid |
320 | 117 | * \param [in] connection The connection | 117 | * \param [in] connection The connection |
321 | 118 | * \return structure that describes the display configuration | 118 | * \return structure that describes the display configuration |
322 | 119 | */ | 119 | */ |
323 | @@ -135,7 +135,7 @@ | |||
324 | 135 | 135 | ||
325 | 136 | /** | 136 | /** |
326 | 137 | * Destroy the DisplayConfiguration resource acquired from mir_connection_create_display_config | 137 | * Destroy the DisplayConfiguration resource acquired from mir_connection_create_display_config |
328 | 138 | * \param [in] display_configuration The display_configuration information resource to be destroyed | 138 | * \param [in] display_configuration The display_configuration information resource to be destroyed |
329 | 139 | */ | 139 | */ |
330 | 140 | void mir_display_config_destroy(MirDisplayConfiguration* display_configuration); | 140 | void mir_display_config_destroy(MirDisplayConfiguration* display_configuration); |
331 | 141 | 141 | ||
332 | @@ -149,7 +149,7 @@ | |||
333 | 149 | * | 149 | * |
334 | 150 | * \warning This request may be denied. Check that the request succeeded with mir_connection_get_error_message. | 150 | * \warning This request may be denied. Check that the request succeeded with mir_connection_get_error_message. |
335 | 151 | * \param [in] connection The connection | 151 | * \param [in] connection The connection |
337 | 152 | * \param [in] display_configuration The display_configuration to apply | 152 | * \param [in] display_configuration The display_configuration to apply |
338 | 153 | * \return A handle that can be passed to mir_wait_for | 153 | * \return A handle that can be passed to mir_wait_for |
339 | 154 | */ | 154 | */ |
340 | 155 | MirWaitHandle* mir_connection_apply_display_config(MirConnection *connection, MirDisplayConfiguration* display_configuration); | 155 | MirWaitHandle* mir_connection_apply_display_config(MirConnection *connection, MirDisplayConfiguration* display_configuration); |
341 | @@ -164,10 +164,10 @@ | |||
342 | 164 | /** | 164 | /** |
343 | 165 | * Get the list of possible formats that a surface can be created with. | 165 | * Get the list of possible formats that a surface can be created with. |
344 | 166 | * \param [in] connection The connection | 166 | * \param [in] connection The connection |
346 | 167 | * \param [out] formats List of valid formats to create surfaces with | 167 | * \param [out] formats List of valid formats to create surfaces with |
347 | 168 | * \param [in] formats_size size of formats list | 168 | * \param [in] formats_size size of formats list |
348 | 169 | * \param [out] num_valid_formats number of valid formats returned in formats | 169 | * \param [out] num_valid_formats number of valid formats returned in formats |
350 | 170 | */ | 170 | */ |
351 | 171 | void mir_connection_get_available_surface_formats( | 171 | void mir_connection_get_available_surface_formats( |
352 | 172 | MirConnection* connection, MirPixelFormat* formats, | 172 | MirConnection* connection, MirPixelFormat* formats, |
353 | 173 | unsigned const int format_size, unsigned int *num_valid_formats); | 173 | unsigned const int format_size, unsigned int *num_valid_formats); |
354 | @@ -227,10 +227,10 @@ | |||
355 | 227 | /** | 227 | /** |
356 | 228 | * Test for a valid surface | 228 | * Test for a valid surface |
357 | 229 | * \param [in] surface The surface | 229 | * \param [in] surface The surface |
360 | 230 | * \return A non-zero value if the supplied surface is valid, | 230 | * \return True if the supplied surface is valid, or |
361 | 231 | * 0 otherwise | 231 | * false otherwise. |
362 | 232 | */ | 232 | */ |
364 | 233 | int mir_surface_is_valid(MirSurface *surface); | 233 | MirBool mir_surface_is_valid(MirSurface *surface); |
365 | 234 | 234 | ||
366 | 235 | /** | 235 | /** |
367 | 236 | * Retrieve a text description of the error. The returned string is owned by | 236 | * Retrieve a text description of the error. The returned string is owned by |
368 | @@ -253,7 +253,7 @@ | |||
369 | 253 | 253 | ||
370 | 254 | /** | 254 | /** |
371 | 255 | * Get the underlying platform type so the buffer obtained in "raw" representation | 255 | * Get the underlying platform type so the buffer obtained in "raw" representation |
373 | 256 | * in mir_surface_get_current_buffer() can be understood | 256 | * in mir_surface_get_current_buffer() can be understood |
374 | 257 | * \pre The surface is valid | 257 | * \pre The surface is valid |
375 | 258 | * \param [in] surface The surface | 258 | * \param [in] surface The surface |
376 | 259 | * \return One of mir_platform_type_android or mir_platform_type_gbm | 259 | * \return One of mir_platform_type_android or mir_platform_type_gbm |
377 | @@ -386,12 +386,12 @@ | |||
378 | 386 | /** | 386 | /** |
379 | 387 | * Set the swapinterval for mir_surface_swap_buffers. EGL users should use | 387 | * Set the swapinterval for mir_surface_swap_buffers. EGL users should use |
380 | 388 | * eglSwapInterval directly. | 388 | * eglSwapInterval directly. |
382 | 389 | * At the time being, only swapinterval of 0 or 1 is supported. | 389 | * At the time being, only swapinterval of 0 or 1 is supported. |
383 | 390 | * \param [in] surface The surface to operate on | 390 | * \param [in] surface The surface to operate on |
384 | 391 | * \param [in] interval The number of vblank signals that | 391 | * \param [in] interval The number of vblank signals that |
386 | 392 | * mir_surface_swap_buffers will wait for | 392 | * mir_surface_swap_buffers will wait for |
387 | 393 | * \return A wait handle that can be passed to mir_wait_for, | 393 | * \return A wait handle that can be passed to mir_wait_for, |
389 | 394 | * or NULL if the interval could not be supported | 394 | * or NULL if the interval could not be supported |
390 | 395 | */ | 395 | */ |
391 | 396 | MirWaitHandle* mir_surface_set_swapinterval(MirSurface* surface, int interval); | 396 | MirWaitHandle* mir_surface_set_swapinterval(MirSurface* surface, int interval); |
392 | 397 | 397 | ||
393 | 398 | 398 | ||
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 | 38 | * This is the buffer that is currently being drawn to, | 38 | * This is the buffer that is currently being drawn to, |
399 | 39 | * and would be returned by mir_surface_get_current_buffer. | 39 | * and would be returned by mir_surface_get_current_buffer. |
400 | 40 | */ | 40 | */ |
402 | 41 | uint32_t mir_debug_surface_current_buffer_id(MirSurface *surface); | 41 | uint32_t mir_debug_surface_current_buffer_id(MirSurface *surface); |
403 | 42 | 42 | ||
404 | 43 | #endif /* MIR_CLIENT_LIBRARY_DEBUG_H */ | 43 | #endif /* MIR_CLIENT_LIBRARY_DEBUG_H */ |
405 | 44 | 44 | ||
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 | 21 | 21 | ||
411 | 22 | #include "mir/graphics/native_buffer.h" | 22 | #include "mir/graphics/native_buffer.h" |
412 | 23 | #include "mir/geometry/size.h" | 23 | #include "mir/geometry/size.h" |
414 | 24 | #include "mir/geometry/pixel_format.h" | 24 | #include "mir_toolkit/common.h" |
415 | 25 | 25 | ||
416 | 26 | #include <memory> | 26 | #include <memory> |
417 | 27 | 27 | ||
418 | @@ -40,7 +40,7 @@ | |||
419 | 40 | virtual BufferID id() const = 0; | 40 | virtual BufferID id() const = 0; |
420 | 41 | virtual geometry::Size size() const = 0; | 41 | virtual geometry::Size size() const = 0; |
421 | 42 | virtual geometry::Stride stride() const = 0; | 42 | virtual geometry::Stride stride() const = 0; |
423 | 43 | virtual geometry::PixelFormat pixel_format() const = 0; | 43 | virtual MirPixelFormat pixel_format() const = 0; |
424 | 44 | virtual void bind_to_texture() = 0; | 44 | virtual void bind_to_texture() = 0; |
425 | 45 | virtual bool can_bypass() const = 0; | 45 | virtual bool can_bypass() const = 0; |
426 | 46 | 46 | ||
427 | 47 | 47 | ||
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 | 20 | #define MIR_GRAPHICS_BUFFER_PROPERTIES_H_ | 20 | #define MIR_GRAPHICS_BUFFER_PROPERTIES_H_ |
433 | 21 | 21 | ||
434 | 22 | #include "mir/geometry/size.h" | 22 | #include "mir/geometry/size.h" |
436 | 23 | #include "mir/geometry/pixel_format.h" | 23 | #include "mir_toolkit/common.h" |
437 | 24 | 24 | ||
438 | 25 | namespace mir | 25 | namespace mir |
439 | 26 | { | 26 | { |
440 | @@ -49,13 +49,13 @@ | |||
441 | 49 | { | 49 | { |
442 | 50 | BufferProperties() : | 50 | BufferProperties() : |
443 | 51 | size(), | 51 | size(), |
445 | 52 | format(geometry::PixelFormat::invalid), | 52 | format(mir_pixel_format_invalid), |
446 | 53 | usage(BufferUsage::undefined) | 53 | usage(BufferUsage::undefined) |
447 | 54 | { | 54 | { |
448 | 55 | } | 55 | } |
449 | 56 | 56 | ||
450 | 57 | BufferProperties(const geometry::Size& size, | 57 | BufferProperties(const geometry::Size& size, |
452 | 58 | const geometry::PixelFormat& format, | 58 | const MirPixelFormat& format, |
453 | 59 | BufferUsage usage) : | 59 | BufferUsage usage) : |
454 | 60 | size{size}, | 60 | size{size}, |
455 | 61 | format{format}, | 61 | format{format}, |
456 | @@ -64,7 +64,7 @@ | |||
457 | 64 | } | 64 | } |
458 | 65 | 65 | ||
459 | 66 | geometry::Size size; | 66 | geometry::Size size; |
461 | 67 | geometry::PixelFormat format; | 67 | MirPixelFormat format; |
462 | 68 | BufferUsage usage; | 68 | BufferUsage usage; |
463 | 69 | }; | 69 | }; |
464 | 70 | 70 | ||
465 | 71 | 71 | ||
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 | 22 | #include "mir/int_wrapper.h" | 22 | #include "mir/int_wrapper.h" |
471 | 23 | #include "mir/geometry/size.h" | 23 | #include "mir/geometry/size.h" |
472 | 24 | #include "mir/geometry/point.h" | 24 | #include "mir/geometry/point.h" |
473 | 25 | #include "mir/geometry/pixel_format.h" | ||
474 | 26 | #include "mir_toolkit/common.h" | 25 | #include "mir_toolkit/common.h" |
475 | 27 | 26 | ||
476 | 28 | #include <functional> | 27 | #include <functional> |
477 | @@ -89,7 +88,7 @@ | |||
478 | 89 | /** The type of the output. */ | 88 | /** The type of the output. */ |
479 | 90 | DisplayConfigurationOutputType type; | 89 | DisplayConfigurationOutputType type; |
480 | 91 | /** The pixel formats supported by the output */ | 90 | /** The pixel formats supported by the output */ |
482 | 92 | std::vector<geometry::PixelFormat> pixel_formats; | 91 | std::vector<MirPixelFormat> pixel_formats; |
483 | 93 | /** The modes supported by the output. */ | 92 | /** The modes supported by the output. */ |
484 | 94 | std::vector<DisplayConfigurationMode> modes; | 93 | std::vector<DisplayConfigurationMode> modes; |
485 | 95 | /** The index in the 'modes' vector of the preferred output mode. */ | 94 | /** The index in the 'modes' vector of the preferred output mode. */ |
486 | 96 | 95 | ||
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 | 50 | /** | 50 | /** |
492 | 51 | * The supported buffer pixel formats. | 51 | * The supported buffer pixel formats. |
493 | 52 | */ | 52 | */ |
495 | 53 | virtual std::vector<geometry::PixelFormat> supported_pixel_formats() = 0; | 53 | virtual std::vector<MirPixelFormat> supported_pixel_formats() = 0; |
496 | 54 | 54 | ||
497 | 55 | protected: | 55 | protected: |
498 | 56 | GraphicBufferAllocator() = default; | 56 | GraphicBufferAllocator() = default; |
499 | 57 | 57 | ||
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 | 35 | public: | 35 | public: |
505 | 36 | virtual ~InternalSurface() = default; | 36 | virtual ~InternalSurface() = default; |
506 | 37 | 37 | ||
508 | 38 | virtual std::shared_ptr<Buffer> advance_client_buffer() = 0; | 38 | virtual void swap_buffers(graphics::Buffer*&) = 0; |
509 | 39 | virtual geometry::Size size() const = 0; | 39 | virtual geometry::Size size() const = 0; |
510 | 40 | virtual MirPixelFormat pixel_format() const = 0; | 40 | virtual MirPixelFormat pixel_format() const = 0; |
511 | 41 | 41 | ||
512 | 42 | 42 | ||
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 | 21 | #define MIR_COMPOSITOR_BUFFER_STREAM_H_ | 21 | #define MIR_COMPOSITOR_BUFFER_STREAM_H_ |
518 | 22 | 22 | ||
519 | 23 | #include "mir/geometry/size.h" | 23 | #include "mir/geometry/size.h" |
521 | 24 | #include "mir/geometry/pixel_format.h" | 24 | #include "mir_toolkit/common.h" |
522 | 25 | #include "mir/graphics/buffer_id.h" | 25 | #include "mir/graphics/buffer_id.h" |
523 | 26 | 26 | ||
524 | 27 | #include <memory> | 27 | #include <memory> |
525 | @@ -41,11 +41,11 @@ | |||
526 | 41 | public: | 41 | public: |
527 | 42 | virtual ~BufferStream() = default; | 42 | virtual ~BufferStream() = default; |
528 | 43 | 43 | ||
530 | 44 | virtual std::shared_ptr<graphics::Buffer> secure_client_buffer() = 0; | 44 | virtual void swap_client_buffers(graphics::Buffer*& buffer) = 0; |
531 | 45 | virtual std::shared_ptr<graphics::Buffer> | 45 | virtual std::shared_ptr<graphics::Buffer> |
532 | 46 | lock_compositor_buffer(unsigned long frameno) = 0; | 46 | lock_compositor_buffer(unsigned long frameno) = 0; |
533 | 47 | virtual std::shared_ptr<graphics::Buffer> lock_snapshot_buffer() = 0; | 47 | virtual std::shared_ptr<graphics::Buffer> lock_snapshot_buffer() = 0; |
535 | 48 | virtual geometry::PixelFormat get_stream_pixel_format() = 0; | 48 | virtual MirPixelFormat get_stream_pixel_format() = 0; |
536 | 49 | virtual geometry::Size stream_size() = 0; | 49 | virtual geometry::Size stream_size() = 0; |
537 | 50 | virtual void resize(geometry::Size const& size) = 0; | 50 | virtual void resize(geometry::Size const& size) = 0; |
538 | 51 | virtual void allow_framedropping(bool) = 0; | 51 | virtual void allow_framedropping(bool) = 0; |
539 | 52 | 52 | ||
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 | 30 | namespace compositor | 30 | namespace compositor |
545 | 31 | { | 31 | { |
546 | 32 | 32 | ||
548 | 33 | class CompositingCriteria | 33 | class CompositingCriteria |
549 | 34 | { | 34 | { |
550 | 35 | public: | 35 | public: |
551 | 36 | virtual float alpha() const = 0; | 36 | virtual float alpha() const = 0; |
552 | 37 | 37 | ||
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 | 35 | class Drawer; | 35 | class Drawer; |
558 | 36 | class DisplayBufferCompositorFactory; | 36 | class DisplayBufferCompositorFactory; |
559 | 37 | class Compositor; | 37 | class Compositor; |
560 | 38 | class OverlayRenderer; | ||
561 | 39 | class RendererFactory; | 38 | class RendererFactory; |
562 | 40 | } | 39 | } |
563 | 41 | namespace frontend | 40 | namespace frontend |
564 | @@ -55,7 +54,6 @@ | |||
565 | 55 | namespace shell | 54 | namespace shell |
566 | 56 | { | 55 | { |
567 | 57 | class SurfaceFactory; | 56 | class SurfaceFactory; |
568 | 58 | class SurfaceController; | ||
569 | 59 | class InputTargeter; | 57 | class InputTargeter; |
570 | 60 | class FocusSetter; | 58 | class FocusSetter; |
571 | 61 | class PlacementStrategy; | 59 | class PlacementStrategy; |
572 | @@ -82,6 +80,7 @@ | |||
573 | 82 | class SurfaceBuilder; | 80 | class SurfaceBuilder; |
574 | 83 | class SurfaceStackModel; | 81 | class SurfaceStackModel; |
575 | 84 | class SurfaceStack; | 82 | class SurfaceStack; |
576 | 83 | class SurfaceRanker; | ||
577 | 85 | class SurfaceController; | 84 | class SurfaceController; |
578 | 86 | class InputRegistrar; | 85 | class InputRegistrar; |
579 | 87 | class SceneReport; | 86 | class SceneReport; |
580 | @@ -152,7 +151,6 @@ | |||
581 | 152 | * configurable interfaces for modifying compositor | 151 | * configurable interfaces for modifying compositor |
582 | 153 | * @{ */ | 152 | * @{ */ |
583 | 154 | virtual std::shared_ptr<compositor::DisplayBufferCompositorFactory> the_display_buffer_compositor_factory(); | 153 | virtual std::shared_ptr<compositor::DisplayBufferCompositorFactory> the_display_buffer_compositor_factory(); |
584 | 155 | virtual std::shared_ptr<compositor::OverlayRenderer> the_overlay_renderer(); | ||
585 | 156 | /** @} */ | 154 | /** @} */ |
586 | 157 | 155 | ||
587 | 158 | /** @name compositor configuration - dependencies | 156 | /** @name compositor configuration - dependencies |
588 | @@ -191,7 +189,6 @@ | |||
589 | 191 | virtual std::shared_ptr<shell::SessionListener> the_shell_session_listener(); | 189 | virtual std::shared_ptr<shell::SessionListener> the_shell_session_listener(); |
590 | 192 | virtual std::shared_ptr<shell::DisplayLayout> the_shell_display_layout(); | 190 | virtual std::shared_ptr<shell::DisplayLayout> the_shell_display_layout(); |
591 | 193 | virtual std::shared_ptr<shell::SurfaceConfigurator> the_shell_surface_configurator(); | 191 | virtual std::shared_ptr<shell::SurfaceConfigurator> the_shell_surface_configurator(); |
592 | 194 | virtual std::shared_ptr<shell::SurfaceController> the_shell_surface_controller(); | ||
593 | 195 | /** @} */ | 192 | /** @} */ |
594 | 196 | 193 | ||
595 | 197 | /** @name internal scene configuration | 194 | /** @name internal scene configuration |
596 | @@ -204,6 +201,7 @@ | |||
597 | 204 | virtual std::shared_ptr<scene::SessionEventSink> the_session_event_sink(); | 201 | virtual std::shared_ptr<scene::SessionEventSink> the_session_event_sink(); |
598 | 205 | virtual std::shared_ptr<scene::SessionEventHandlerRegister> the_session_event_handler_register(); | 202 | virtual std::shared_ptr<scene::SessionEventHandlerRegister> the_session_event_handler_register(); |
599 | 206 | virtual std::shared_ptr<scene::SurfaceStackModel> the_surface_stack_model(); | 203 | virtual std::shared_ptr<scene::SurfaceStackModel> the_surface_stack_model(); |
600 | 204 | virtual std::shared_ptr<scene::SurfaceRanker> the_surface_ranker(); | ||
601 | 207 | /** @} */ | 205 | /** @} */ |
602 | 208 | 206 | ||
603 | 209 | /** @name scene configuration - dependencies | 207 | /** @name scene configuration - dependencies |
604 | @@ -279,7 +277,6 @@ | |||
605 | 279 | CachedPtr<shell::DisplayLayout> shell_display_layout; | 277 | CachedPtr<shell::DisplayLayout> shell_display_layout; |
606 | 280 | CachedPtr<shell::SurfaceConfigurator> shell_surface_configurator; | 278 | CachedPtr<shell::SurfaceConfigurator> shell_surface_configurator; |
607 | 281 | CachedPtr<compositor::DisplayBufferCompositorFactory> display_buffer_compositor_factory; | 279 | CachedPtr<compositor::DisplayBufferCompositorFactory> display_buffer_compositor_factory; |
608 | 282 | CachedPtr<compositor::OverlayRenderer> overlay_renderer; | ||
609 | 283 | CachedPtr<compositor::Compositor> compositor; | 280 | CachedPtr<compositor::Compositor> compositor; |
610 | 284 | CachedPtr<logging::Logger> logger; | 281 | CachedPtr<logging::Logger> logger; |
611 | 285 | CachedPtr<graphics::DisplayReport> display_report; | 282 | CachedPtr<graphics::DisplayReport> display_report; |
612 | 286 | 283 | ||
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 | 44 | virtual void exception_handled(void const* mediator, int id, std::exception const& error) = 0; | 44 | virtual void exception_handled(void const* mediator, int id, std::exception const& error) = 0; |
618 | 45 | 45 | ||
619 | 46 | virtual void exception_handled(void const* mediator, std::exception const& error) = 0; | 46 | virtual void exception_handled(void const* mediator, std::exception const& error) = 0; |
621 | 47 | 47 | ||
622 | 48 | virtual void sent_event(void const* mediator, MirSurfaceEvent const& ev) = 0; | 48 | virtual void sent_event(void const* mediator, MirSurfaceEvent const& ev) = 0; |
623 | 49 | 49 | ||
624 | 50 | private: | 50 | private: |
625 | 51 | 51 | ||
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 | 36 | void exception_handled(void const*, int, std::exception const&); | 36 | void exception_handled(void const*, int, std::exception const&); |
631 | 37 | 37 | ||
632 | 38 | void exception_handled(void const*, std::exception const&); | 38 | void exception_handled(void const*, std::exception const&); |
634 | 39 | 39 | ||
635 | 40 | void sent_event(void const*, MirSurfaceEvent const& e); | 40 | void sent_event(void const*, MirSurfaceEvent const& e); |
636 | 41 | }; | 41 | }; |
637 | 42 | } | 42 | } |
638 | 43 | 43 | ||
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 | 30 | { | 30 | { |
644 | 31 | public: | 31 | public: |
645 | 32 | virtual ~SessionAuthorizer() {} | 32 | virtual ~SessionAuthorizer() {} |
647 | 33 | 33 | ||
648 | 34 | virtual bool connection_is_allowed(pid_t pid) = 0; | 34 | virtual bool connection_is_allowed(pid_t pid) = 0; |
649 | 35 | virtual bool configure_display_is_allowed(pid_t pid) = 0; | 35 | virtual bool configure_display_is_allowed(pid_t pid) = 0; |
650 | 36 | protected: | 36 | protected: |
651 | 37 | 37 | ||
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 | 20 | #ifndef MIR_FRONTEND_SURFACE_H_ | 20 | #ifndef MIR_FRONTEND_SURFACE_H_ |
657 | 21 | #define MIR_FRONTEND_SURFACE_H_ | 21 | #define MIR_FRONTEND_SURFACE_H_ |
658 | 22 | 22 | ||
659 | 23 | #include "mir/geometry/pixel_format.h" | ||
660 | 24 | #include "mir/geometry/point.h" | 23 | #include "mir/geometry/point.h" |
661 | 25 | #include "mir/geometry/size.h" | 24 | #include "mir/geometry/size.h" |
662 | 26 | #include "mir_toolkit/common.h" | 25 | #include "mir_toolkit/common.h" |
663 | @@ -55,9 +54,9 @@ | |||
664 | 55 | virtual void force_requests_to_complete() = 0; | 54 | virtual void force_requests_to_complete() = 0; |
665 | 56 | 55 | ||
666 | 57 | virtual geometry::Size size() const = 0; | 56 | virtual geometry::Size size() const = 0; |
668 | 58 | virtual geometry::PixelFormat pixel_format() const = 0; | 57 | virtual MirPixelFormat pixel_format() const = 0; |
669 | 59 | 58 | ||
671 | 60 | virtual std::shared_ptr<graphics::Buffer> advance_client_buffer() = 0; | 59 | virtual void swap_buffers(graphics::Buffer*&) = 0; |
672 | 61 | 60 | ||
673 | 62 | virtual bool supports_input() const = 0; | 61 | virtual bool supports_input() const = 0; |
674 | 63 | virtual int client_input_fd() const = 0; | 62 | virtual int client_input_fd() const = 0; |
675 | 64 | 63 | ||
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 | 44 | virtual std::shared_ptr<scene::InputRegistrar> the_input_registrar() = 0; | 44 | virtual std::shared_ptr<scene::InputRegistrar> the_input_registrar() = 0; |
681 | 45 | virtual std::shared_ptr<shell::InputTargeter> the_input_targeter() = 0; | 45 | virtual std::shared_ptr<shell::InputTargeter> the_input_targeter() = 0; |
682 | 46 | virtual std::shared_ptr<input::InputManager> the_input_manager() = 0; | 46 | virtual std::shared_ptr<input::InputManager> the_input_manager() = 0; |
684 | 47 | 47 | ||
685 | 48 | virtual void set_input_targets(std::shared_ptr<input::InputTargets> const& targets) = 0; | 48 | virtual void set_input_targets(std::shared_ptr<input::InputTargets> const& targets) = 0; |
686 | 49 | 49 | ||
687 | 50 | protected: | 50 | protected: |
688 | 51 | 51 | ||
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 | 31 | { | 31 | { |
694 | 32 | public: | 32 | public: |
695 | 33 | virtual ~InputReport() = default; | 33 | virtual ~InputReport() = default; |
697 | 34 | 34 | ||
698 | 35 | virtual void received_event_from_kernel(int64_t when, int type, int code, int value) = 0; | 35 | virtual void received_event_from_kernel(int64_t when, int type, int code, int value) = 0; |
699 | 36 | 36 | ||
700 | 37 | virtual void published_key_event(int dest_fd, uint32_t seq_id, int64_t event_time) = 0; | 37 | virtual void published_key_event(int dest_fd, uint32_t seq_id, int64_t event_time) = 0; |
701 | @@ -39,7 +39,7 @@ | |||
702 | 39 | virtual void published_motion_event(int dest_fd, uint32_t seq_id, int64_t event_time) = 0; | 39 | virtual void published_motion_event(int dest_fd, uint32_t seq_id, int64_t event_time) = 0; |
703 | 40 | 40 | ||
704 | 41 | virtual void received_event_finished_signal(int src_fd, uint32_t seq_id) = 0; | 41 | virtual void received_event_finished_signal(int src_fd, uint32_t seq_id) = 0; |
706 | 42 | 42 | ||
707 | 43 | protected: | 43 | protected: |
708 | 44 | InputReport() = default; | 44 | InputReport() = default; |
709 | 45 | InputReport(InputReport const&) = delete; | 45 | InputReport(InputReport const&) = delete; |
710 | 46 | 46 | ||
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 | 32 | public: | 32 | public: |
716 | 33 | NullInputReport() = default; | 33 | NullInputReport() = default; |
717 | 34 | virtual ~NullInputReport() noexcept(true) = default; | 34 | virtual ~NullInputReport() noexcept(true) = default; |
719 | 35 | 35 | ||
720 | 36 | void received_event_from_kernel(int64_t when, int type, int code, int value); | 36 | void received_event_from_kernel(int64_t when, int type, int code, int value); |
721 | 37 | 37 | ||
722 | 38 | void published_key_event(int dest_fd, uint32_t seq_id, int64_t event_time); | 38 | void published_key_event(int dest_fd, uint32_t seq_id, int64_t event_time); |
723 | 39 | 39 | ||
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 | 27 | { | 27 | { |
729 | 28 | namespace input | 28 | namespace input |
730 | 29 | { | 29 | { |
732 | 30 | class Surface | 30 | class Surface |
733 | 31 | { | 31 | { |
734 | 32 | public: | 32 | public: |
735 | 33 | virtual std::string const& name() const = 0; | 33 | virtual std::string const& name() const = 0; |
736 | @@ -36,7 +36,7 @@ | |||
737 | 36 | virtual bool contains(geometry::Point const& point) const = 0; | 36 | virtual bool contains(geometry::Point const& point) const = 0; |
738 | 37 | 37 | ||
739 | 38 | protected: | 38 | protected: |
741 | 39 | Surface() = default; | 39 | Surface() = default; |
742 | 40 | virtual ~Surface() = default; | 40 | virtual ~Surface() = default; |
743 | 41 | Surface(const Surface&) = delete; | 41 | Surface(const Surface&) = delete; |
744 | 42 | Surface& operator=(const Surface& ) = delete; | 42 | Surface& operator=(const Surface& ) = delete; |
745 | 43 | 43 | ||
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 | 39 | public: | 39 | public: |
751 | 40 | InputReport(std::shared_ptr<Logger> const& logger); | 40 | InputReport(std::shared_ptr<Logger> const& logger); |
752 | 41 | virtual ~InputReport() noexcept(true) = default; | 41 | virtual ~InputReport() noexcept(true) = default; |
754 | 42 | 42 | ||
755 | 43 | void received_event_from_kernel(int64_t when, int type, int code, int value); | 43 | void received_event_from_kernel(int64_t when, int type, int code, int value); |
756 | 44 | 44 | ||
757 | 45 | void published_key_event(int dest_fd, uint32_t seq_id, int64_t event_time); | 45 | void published_key_event(int dest_fd, uint32_t seq_id, int64_t event_time); |
758 | 46 | void published_motion_event(int dest_fd, uint32_t seq_id, int64_t event_time); | 46 | void published_motion_event(int dest_fd, uint32_t seq_id, int64_t event_time); |
759 | 47 | 47 | ||
760 | 48 | void received_event_finished_signal(int src_fd, uint32_t seq_id); | 48 | void received_event_finished_signal(int src_fd, uint32_t seq_id); |
762 | 49 | 49 | ||
763 | 50 | private: | 50 | private: |
764 | 51 | char const* component(); | 51 | char const* component(); |
765 | 52 | std::shared_ptr<Logger> const logger; | 52 | std::shared_ptr<Logger> const logger; |
766 | 53 | 53 | ||
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 | 32 | public: | 32 | public: |
772 | 33 | InputReport() = default; | 33 | InputReport() = default; |
773 | 34 | virtual ~InputReport() noexcept(true) = default; | 34 | virtual ~InputReport() noexcept(true) = default; |
775 | 35 | 35 | ||
776 | 36 | void received_event_from_kernel(int64_t when, int type, int code, int value); | 36 | void received_event_from_kernel(int64_t when, int type, int code, int value); |
777 | 37 | 37 | ||
778 | 38 | void published_key_event(int dest_fd, uint32_t seq_id, int64_t event_time); | 38 | void published_key_event(int dest_fd, uint32_t seq_id, int64_t event_time); |
779 | 39 | void published_motion_event(int dest_fd, uint32_t seq_id, int64_t event_time); | 39 | void published_motion_event(int dest_fd, uint32_t seq_id, int64_t event_time); |
780 | 40 | 40 | ||
781 | 41 | void received_event_finished_signal(int src_fd, uint32_t seq_id); | 41 | void received_event_finished_signal(int src_fd, uint32_t seq_id); |
783 | 42 | 42 | ||
784 | 43 | private: | 43 | private: |
785 | 44 | ServerTracepointProvider tp_provider; | 44 | ServerTracepointProvider tp_provider; |
786 | 45 | }; | 45 | }; |
787 | 46 | 46 | ||
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 | 41 | { | 41 | { |
793 | 42 | public: | 42 | public: |
794 | 43 | virtual ~InputRegistrar() = default; | 43 | virtual ~InputRegistrar() = default; |
796 | 44 | 44 | ||
797 | 45 | virtual void input_channel_opened(std::shared_ptr<input::InputChannel> const& opened_channel, | 45 | virtual void input_channel_opened(std::shared_ptr<input::InputChannel> const& opened_channel, |
798 | 46 | std::shared_ptr<input::Surface> const& info, | 46 | std::shared_ptr<input::Surface> const& info, |
799 | 47 | input::InputReceptionMode input_mode) = 0; | 47 | input::InputReceptionMode input_mode) = 0; |
800 | 48 | 48 | ||
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 | 36 | { | 36 | { |
806 | 37 | public: | 37 | public: |
807 | 38 | virtual ~InputTargeter() = default; | 38 | virtual ~InputTargeter() = default; |
809 | 39 | 39 | ||
810 | 40 | virtual void focus_changed(std::shared_ptr<input::InputChannel const> const& focus_channel) = 0; | 40 | virtual void focus_changed(std::shared_ptr<input::InputChannel const> const& focus_channel) = 0; |
811 | 41 | virtual void focus_cleared() = 0; | 41 | virtual void focus_cleared() = 0; |
812 | 42 | 42 | ||
813 | 43 | 43 | ||
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 | 35 | virtual void stopping(std::shared_ptr<Session> const& session) = 0; | 35 | virtual void stopping(std::shared_ptr<Session> const& session) = 0; |
819 | 36 | virtual void focused(std::shared_ptr<Session> const& session) = 0; | 36 | virtual void focused(std::shared_ptr<Session> const& session) = 0; |
820 | 37 | virtual void unfocused() = 0; | 37 | virtual void unfocused() = 0; |
822 | 38 | 38 | ||
823 | 39 | virtual void surface_created(Session& session, std::shared_ptr<Surface> const& surface) = 0; | 39 | virtual void surface_created(Session& session, std::shared_ptr<Surface> const& surface) = 0; |
824 | 40 | virtual void destroying_surface(Session& session, std::shared_ptr<Surface> const& surface) = 0; | 40 | virtual void destroying_surface(Session& session, std::shared_ptr<Surface> const& surface) = 0; |
825 | 41 | 41 | ||
826 | 42 | 42 | ||
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 | 29 | 29 | ||
832 | 30 | namespace mir | 30 | namespace mir |
833 | 31 | { | 31 | { |
834 | 32 | namespace scene { class SurfaceRanker; } | ||
835 | 32 | namespace shell | 33 | namespace shell |
836 | 33 | { | 34 | { |
837 | 34 | class InputTargeter; | 35 | class InputTargeter; |
838 | 35 | class SurfaceController; | ||
839 | 36 | 36 | ||
840 | 37 | class Surface : public frontend::Surface, public shell::SurfaceBufferAccess | 37 | class Surface : public frontend::Surface, public shell::SurfaceBufferAccess |
841 | 38 | { | 38 | { |
842 | @@ -50,7 +50,7 @@ | |||
843 | 50 | 50 | ||
844 | 51 | virtual void allow_framedropping(bool) = 0; | 51 | virtual void allow_framedropping(bool) = 0; |
845 | 52 | 52 | ||
847 | 53 | virtual void raise(std::shared_ptr<SurfaceController> const& controller) = 0; | 53 | virtual void raise(std::shared_ptr<scene::SurfaceRanker> const& controller) = 0; |
848 | 54 | 54 | ||
849 | 55 | virtual void resize(geometry::Size const& size) = 0; | 55 | virtual void resize(geometry::Size const& size) = 0; |
850 | 56 | virtual void set_rotation(float degrees, glm::vec3 const& axis) = 0; | 56 | virtual void set_rotation(float degrees, glm::vec3 const& axis) = 0; |
851 | 57 | 57 | ||
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 | 34 | { | 34 | { |
857 | 35 | public: | 35 | public: |
858 | 36 | virtual ~SurfaceConfigurator() = default; | 36 | virtual ~SurfaceConfigurator() = default; |
860 | 37 | 37 | ||
861 | 38 | /// Returns the selected value. | 38 | /// Returns the selected value. |
862 | 39 | virtual int select_attribute_value(Surface const& surface, MirSurfaceAttrib attrib, | 39 | virtual int select_attribute_value(Surface const& surface, MirSurfaceAttrib attrib, |
863 | 40 | int requested_value) = 0; | 40 | int requested_value) = 0; |
864 | 41 | 41 | ||
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 | 19 | #ifndef MIR_SHELL_SURFACE_CREATION_PARAMETERS_H_ | 19 | #ifndef MIR_SHELL_SURFACE_CREATION_PARAMETERS_H_ |
870 | 20 | #define MIR_SHELL_SURFACE_CREATION_PARAMETERS_H_ | 20 | #define MIR_SHELL_SURFACE_CREATION_PARAMETERS_H_ |
871 | 21 | 21 | ||
873 | 22 | #include "mir/geometry/pixel_format.h" | 22 | #include "mir_toolkit/common.h" |
874 | 23 | #include "mir/geometry/point.h" | 23 | #include "mir/geometry/point.h" |
875 | 24 | #include "mir/geometry/size.h" | 24 | #include "mir/geometry/size.h" |
876 | 25 | #include "mir/graphics/buffer_properties.h" | 25 | #include "mir/graphics/buffer_properties.h" |
877 | @@ -44,15 +44,15 @@ | |||
878 | 44 | SurfaceCreationParameters& of_size(geometry::Size new_size); | 44 | SurfaceCreationParameters& of_size(geometry::Size new_size); |
879 | 45 | 45 | ||
880 | 46 | SurfaceCreationParameters& of_size(geometry::Width::ValueType width, geometry::Height::ValueType height); | 46 | SurfaceCreationParameters& of_size(geometry::Width::ValueType width, geometry::Height::ValueType height); |
882 | 47 | 47 | ||
883 | 48 | SurfaceCreationParameters& of_position(geometry::Point const& top_left); | 48 | SurfaceCreationParameters& of_position(geometry::Point const& top_left); |
884 | 49 | 49 | ||
885 | 50 | SurfaceCreationParameters& of_buffer_usage(graphics::BufferUsage new_buffer_usage); | 50 | SurfaceCreationParameters& of_buffer_usage(graphics::BufferUsage new_buffer_usage); |
886 | 51 | 51 | ||
889 | 52 | SurfaceCreationParameters& of_pixel_format(geometry::PixelFormat new_pixel_format); | 52 | SurfaceCreationParameters& of_pixel_format(MirPixelFormat new_pixel_format); |
890 | 53 | 53 | ||
891 | 54 | SurfaceCreationParameters& of_depth(scene::DepthId const& new_depth); | 54 | SurfaceCreationParameters& of_depth(scene::DepthId const& new_depth); |
893 | 55 | 55 | ||
894 | 56 | SurfaceCreationParameters& with_input_mode(input::InputReceptionMode const& new_mode); | 56 | SurfaceCreationParameters& with_input_mode(input::InputReceptionMode const& new_mode); |
895 | 57 | 57 | ||
896 | 58 | SurfaceCreationParameters& with_output_id(graphics::DisplayConfigurationOutputId const& output_id); | 58 | SurfaceCreationParameters& with_output_id(graphics::DisplayConfigurationOutputId const& output_id); |
897 | @@ -61,7 +61,7 @@ | |||
898 | 61 | geometry::Size size; | 61 | geometry::Size size; |
899 | 62 | geometry::Point top_left; | 62 | geometry::Point top_left; |
900 | 63 | graphics::BufferUsage buffer_usage; | 63 | graphics::BufferUsage buffer_usage; |
902 | 64 | geometry::PixelFormat pixel_format; | 64 | MirPixelFormat pixel_format; |
903 | 65 | scene::DepthId depth; | 65 | scene::DepthId depth; |
904 | 66 | input::InputReceptionMode input_mode; | 66 | input::InputReceptionMode input_mode; |
905 | 67 | graphics::DisplayConfigurationOutputId output_id; | 67 | graphics::DisplayConfigurationOutputId output_id; |
906 | 68 | 68 | ||
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 | 1 | /* | ||
912 | 2 | * Copyright © 2012 Canonical Ltd. | ||
913 | 3 | * | ||
914 | 4 | * This program is free software: you can redistribute it and/or modify it | ||
915 | 5 | * under the terms of the GNU Lesser General Public License version 3, | ||
916 | 6 | * as published by the Free Software Foundation. | ||
917 | 7 | * | ||
918 | 8 | * This program is distributed in the hope that it will be useful, | ||
919 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
920 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
921 | 11 | * GNU Lesser General Public License for more details. | ||
922 | 12 | * | ||
923 | 13 | * You should have received a copy of the GNU Lesser General Public License | ||
924 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
925 | 15 | * | ||
926 | 16 | * Authored by: Alan Griffiths <alan@octopull.co.uk> | ||
927 | 17 | */ | ||
928 | 18 | |||
929 | 19 | |||
930 | 20 | #ifndef MIR_COMPOSITOR_PIXEL_FORMAT_H_ | ||
931 | 21 | #define MIR_COMPOSITOR_PIXEL_FORMAT_H_ | ||
932 | 22 | |||
933 | 23 | #include <cstdint> | ||
934 | 24 | #include <cstddef> | ||
935 | 25 | |||
936 | 26 | namespace mir | ||
937 | 27 | { | ||
938 | 28 | namespace geometry | ||
939 | 29 | { | ||
940 | 30 | enum class PixelFormat : uint32_t | ||
941 | 31 | { | ||
942 | 32 | invalid, | ||
943 | 33 | abgr_8888, | ||
944 | 34 | xbgr_8888, | ||
945 | 35 | argb_8888, | ||
946 | 36 | xrgb_8888, | ||
947 | 37 | bgr_888 | ||
948 | 38 | }; | ||
949 | 39 | |||
950 | 40 | static inline size_t bytes_per_pixel(PixelFormat fmt) | ||
951 | 41 | { | ||
952 | 42 | return (fmt == PixelFormat::bgr_888) ? 3 : 4; | ||
953 | 43 | } | ||
954 | 44 | |||
955 | 45 | static inline bool has_alpha(PixelFormat fmt) | ||
956 | 46 | { | ||
957 | 47 | return (fmt == PixelFormat::abgr_8888) || | ||
958 | 48 | (fmt == PixelFormat::argb_8888); | ||
959 | 49 | } | ||
960 | 50 | |||
961 | 51 | } | ||
962 | 52 | } | ||
963 | 53 | |||
964 | 54 | #endif /* MIR_COMPOSITOR_PIXEL_FORMAT_H_ */ | ||
965 | 55 | 0 | ||
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 | 35 | Point top_left; | 35 | Point top_left; |
971 | 36 | Size size; | 36 | Size size; |
972 | 37 | 37 | ||
974 | 38 | /** | 38 | /** |
975 | 39 | * The bottom right boundary point of the rectangle. | 39 | * The bottom right boundary point of the rectangle. |
976 | 40 | * | 40 | * |
977 | 41 | * Note that the returned point is *not* included in the rectangle | 41 | * Note that the returned point is *not* included in the rectangle |
978 | 42 | 42 | ||
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 | 36 | virtual void driver_returns_buffer(ANativeWindowBuffer*, int fence) = 0; | 36 | virtual void driver_returns_buffer(ANativeWindowBuffer*, int fence) = 0; |
984 | 37 | virtual void dispatch_driver_request_format(int format) = 0; | 37 | virtual void dispatch_driver_request_format(int format) = 0; |
985 | 38 | virtual int driver_requests_info(int key) const = 0; | 38 | virtual int driver_requests_info(int key) const = 0; |
987 | 39 | virtual void sync_to_display(bool sync) = 0; | 39 | virtual void sync_to_display(bool sync) = 0; |
988 | 40 | protected: | 40 | protected: |
989 | 41 | AndroidDriverInterpreter() {}; | 41 | AndroidDriverInterpreter() {}; |
990 | 42 | virtual ~AndroidDriverInterpreter() {}; | 42 | virtual ~AndroidDriverInterpreter() {}; |
991 | 43 | 43 | ||
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 | 25 | 25 | ||
997 | 26 | namespace mir | 26 | namespace mir |
998 | 27 | { | 27 | { |
1000 | 28 | namespace graphics | 28 | namespace graphics |
1001 | 29 | { | 29 | { |
1002 | 30 | namespace android | 30 | namespace android |
1003 | 31 | { | 31 | { |
1004 | 32 | 32 | ||
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 | 27 | namespace graphics | 27 | namespace graphics |
1010 | 28 | { | 28 | { |
1011 | 29 | 29 | ||
1013 | 30 | class NativeBuffer | 30 | class NativeBuffer |
1014 | 31 | { | 31 | { |
1015 | 32 | public: | 32 | public: |
1016 | 33 | virtual ~NativeBuffer() = default; | 33 | virtual ~NativeBuffer() = default; |
1017 | @@ -37,7 +37,7 @@ | |||
1018 | 37 | virtual android::NativeFence copy_fence() const = 0; | 37 | virtual android::NativeFence copy_fence() const = 0; |
1019 | 38 | 38 | ||
1020 | 39 | virtual void wait_for_content() = 0; | 39 | virtual void wait_for_content() = 0; |
1022 | 40 | virtual void update_fence(android::NativeFence& fence) = 0; | 40 | virtual void update_fence(android::NativeFence& fence) = 0; |
1023 | 41 | 41 | ||
1024 | 42 | protected: | 42 | protected: |
1025 | 43 | NativeBuffer() = default; | 43 | NativeBuffer() = default; |
1026 | 44 | 44 | ||
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 | 36 | namespace android | 36 | namespace android |
1032 | 37 | { | 37 | { |
1033 | 38 | 38 | ||
1035 | 39 | /// The Lexicon translates droidinput event types to MirEvent types prior to | 39 | /// The Lexicon translates droidinput event types to MirEvent types prior to |
1036 | 40 | /// shell or client handling. | 40 | /// shell or client handling. |
1037 | 41 | class Lexicon | 41 | class Lexicon |
1038 | 42 | { | 42 | { |
1039 | 43 | 43 | ||
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 | 37 | class InputPlatform | 37 | class InputPlatform |
1045 | 38 | { | 38 | { |
1046 | 39 | public: | 39 | public: |
1048 | 40 | virtual ~InputPlatform() {}; | 40 | virtual ~InputPlatform() {}; |
1049 | 41 | 41 | ||
1050 | 42 | virtual std::shared_ptr<InputReceiverThread> create_input_thread(int fd, std::function<void(MirEvent *)> const& callback) = 0; | 42 | virtual std::shared_ptr<InputReceiverThread> create_input_thread(int fd, std::function<void(MirEvent *)> const& callback) = 0; |
1051 | 43 | 43 | ||
1052 | 44 | 44 | ||
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 | 37 | public: | 37 | public: |
1058 | 38 | XKBMapper(); | 38 | XKBMapper(); |
1059 | 39 | virtual ~XKBMapper() = default; | 39 | virtual ~XKBMapper() = default; |
1061 | 40 | 40 | ||
1062 | 41 | void update_state_and_map_event(MirKeyEvent& key_ev); | 41 | void update_state_and_map_event(MirKeyEvent& key_ev); |
1063 | 42 | 42 | ||
1064 | 43 | protected: | 43 | protected: |
1065 | 44 | 44 | ||
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 | 34 | extern "C" { | 34 | extern "C" { |
1071 | 35 | #endif | 35 | #endif |
1072 | 36 | 36 | ||
1073 | 37 | typedef enum MirBool | ||
1074 | 38 | { | ||
1075 | 39 | mir_false = 0, | ||
1076 | 40 | mir_true = 1 | ||
1077 | 41 | } MirBool; | ||
1078 | 42 | |||
1079 | 37 | /* Display server connection API */ | 43 | /* Display server connection API */ |
1080 | 38 | typedef void* MirEGLNativeWindowType; | 44 | typedef void* MirEGLNativeWindowType; |
1081 | 39 | typedef void* MirEGLNativeDisplayType; | 45 | typedef void* MirEGLNativeDisplayType; |
1082 | @@ -97,26 +103,6 @@ | |||
1083 | 97 | MirConnection* connection, void* context); | 103 | MirConnection* connection, void* context); |
1084 | 98 | 104 | ||
1085 | 99 | /** | 105 | /** |
1086 | 100 | * The order of components in a format enum matches the | ||
1087 | 101 | * order of the components as they would be written in an | ||
1088 | 102 | * integer representing a pixel value of that format. | ||
1089 | 103 | * | ||
1090 | 104 | * For example, abgr_8888 corresponds to 0xAABBGGRR, which will | ||
1091 | 105 | * end up as R,G,B,A in memory in a little endian system, and | ||
1092 | 106 | * as A,B,G,R in memory in a big endian system. | ||
1093 | 107 | */ | ||
1094 | 108 | typedef enum MirPixelFormat | ||
1095 | 109 | { | ||
1096 | 110 | mir_pixel_format_invalid, | ||
1097 | 111 | mir_pixel_format_abgr_8888, | ||
1098 | 112 | mir_pixel_format_xbgr_8888, | ||
1099 | 113 | mir_pixel_format_argb_8888, | ||
1100 | 114 | mir_pixel_format_xrgb_8888, | ||
1101 | 115 | mir_pixel_format_bgr_888, | ||
1102 | 116 | mir_pixel_formats | ||
1103 | 117 | } MirPixelFormat; | ||
1104 | 118 | |||
1105 | 119 | /** | ||
1106 | 120 | * MirBufferUsage specifies how a surface can and will be used. A "hardware" | 106 | * MirBufferUsage specifies how a surface can and will be used. A "hardware" |
1107 | 121 | * surface can be used for OpenGL accelerated rendering. A "software" surface | 107 | * surface can be used for OpenGL accelerated rendering. A "software" surface |
1108 | 122 | * is one that can be addressed in main memory and blitted to directly. | 108 | * is one that can be addressed in main memory and blitted to directly. |
1109 | @@ -157,7 +143,7 @@ | |||
1110 | 157 | typedef enum MirPlatformType | 143 | typedef enum MirPlatformType |
1111 | 158 | { | 144 | { |
1112 | 159 | mir_platform_type_gbm, | 145 | mir_platform_type_gbm, |
1114 | 160 | mir_platform_type_android | 146 | mir_platform_type_android |
1115 | 161 | } MirPlatformType; | 147 | } MirPlatformType; |
1116 | 162 | 148 | ||
1117 | 163 | typedef struct MirPlatformPackage | 149 | typedef struct MirPlatformPackage |
1118 | @@ -184,7 +170,7 @@ | |||
1119 | 184 | 170 | ||
1120 | 185 | } MirGraphicsRegion; | 171 | } MirGraphicsRegion; |
1121 | 186 | 172 | ||
1123 | 187 | /** | 173 | /** |
1124 | 188 | * DEPRECATED. use MirDisplayConfiguration | 174 | * DEPRECATED. use MirDisplayConfiguration |
1125 | 189 | */ | 175 | */ |
1126 | 190 | enum { mir_supported_pixel_format_max = 32 }; | 176 | enum { mir_supported_pixel_format_max = 32 }; |
1127 | @@ -192,7 +178,7 @@ | |||
1128 | 192 | { | 178 | { |
1129 | 193 | uint32_t width; | 179 | uint32_t width; |
1130 | 194 | uint32_t height; | 180 | uint32_t height; |
1132 | 195 | 181 | ||
1133 | 196 | int supported_pixel_format_items; | 182 | int supported_pixel_format_items; |
1134 | 197 | MirPixelFormat supported_pixel_format[mir_supported_pixel_format_max]; | 183 | MirPixelFormat supported_pixel_format[mir_supported_pixel_format_max]; |
1135 | 198 | } MirDisplayInfo; | 184 | } MirDisplayInfo; |
1136 | @@ -240,7 +226,7 @@ | |||
1137 | 240 | uint32_t num_modes; | 226 | uint32_t num_modes; |
1138 | 241 | MirDisplayMode* modes; | 227 | MirDisplayMode* modes; |
1139 | 242 | uint32_t preferred_mode; | 228 | uint32_t preferred_mode; |
1141 | 243 | uint32_t current_mode; | 229 | uint32_t current_mode; |
1142 | 244 | 230 | ||
1143 | 245 | uint32_t num_output_formats; | 231 | uint32_t num_output_formats; |
1144 | 246 | MirPixelFormat* output_formats; | 232 | MirPixelFormat* output_formats; |
1145 | @@ -257,7 +243,7 @@ | |||
1146 | 257 | 243 | ||
1147 | 258 | uint32_t physical_width_mm; | 244 | uint32_t physical_width_mm; |
1148 | 259 | uint32_t physical_height_mm; | 245 | uint32_t physical_height_mm; |
1150 | 260 | 246 | ||
1151 | 261 | MirPowerMode power_mode; | 247 | MirPowerMode power_mode; |
1152 | 262 | } MirDisplayOutput; | 248 | } MirDisplayOutput; |
1153 | 263 | 249 | ||
1154 | 264 | 250 | ||
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 | 86 | mir_power_mode_suspend, /* Blanked, lowest power. */ | 86 | mir_power_mode_suspend, /* Blanked, lowest power. */ |
1160 | 87 | mir_power_mode_off /* Powered down. */ | 87 | mir_power_mode_off /* Powered down. */ |
1161 | 88 | } MirPowerMode; | 88 | } MirPowerMode; |
1162 | 89 | |||
1163 | 90 | /** | ||
1164 | 91 | * The order of components in a format enum matches the | ||
1165 | 92 | * order of the components as they would be written in an | ||
1166 | 93 | * integer representing a pixel value of that format. | ||
1167 | 94 | * | ||
1168 | 95 | * For example, abgr_8888 corresponds to 0xAABBGGRR, which will | ||
1169 | 96 | * end up as R,G,B,A in memory in a little endian system, and | ||
1170 | 97 | * as A,B,G,R in memory in a big endian system. | ||
1171 | 98 | */ | ||
1172 | 99 | typedef enum MirPixelFormat | ||
1173 | 100 | { | ||
1174 | 101 | mir_pixel_format_invalid, | ||
1175 | 102 | mir_pixel_format_abgr_8888, | ||
1176 | 103 | mir_pixel_format_xbgr_8888, | ||
1177 | 104 | mir_pixel_format_argb_8888, | ||
1178 | 105 | mir_pixel_format_xrgb_8888, | ||
1179 | 106 | mir_pixel_format_bgr_888, | ||
1180 | 107 | mir_pixel_formats | ||
1181 | 108 | } MirPixelFormat; | ||
1182 | 109 | |||
1183 | 110 | /* This could be improved... https://bugs.launchpad.net/mir/+bug/1236254 */ | ||
1184 | 111 | #define MIR_BYTES_PER_PIXEL(f) (((f) == mir_pixel_format_bgr_888) ? 3 : 4) | ||
1185 | 112 | |||
1186 | 89 | /**@}*/ | 113 | /**@}*/ |
1187 | 90 | 114 | ||
1188 | 91 | #endif | 115 | #endif |
1189 | 92 | 116 | ||
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 | 39 | { | 39 | { |
1195 | 40 | mir_event_type_key, | 40 | mir_event_type_key, |
1196 | 41 | mir_event_type_motion, | 41 | mir_event_type_motion, |
1198 | 42 | mir_event_type_surface | 42 | mir_event_type_surface, |
1199 | 43 | mir_event_type_resize | ||
1200 | 43 | } MirEventType; | 44 | } MirEventType; |
1201 | 44 | 45 | ||
1202 | 45 | typedef enum { | 46 | typedef enum { |
1203 | @@ -141,7 +142,7 @@ | |||
1204 | 141 | 142 | ||
1205 | 142 | int32_t device_id; | 143 | int32_t device_id; |
1206 | 143 | int32_t source_id; | 144 | int32_t source_id; |
1208 | 144 | /* | 145 | /* |
1209 | 145 | * TODO(racarr): We would like to store this as a MirMotionAction but the android input stack | 146 | * TODO(racarr): We would like to store this as a MirMotionAction but the android input stack |
1210 | 146 | * encodes some non enumerable values in it. It's convenient to keep things | 147 | * encodes some non enumerable values in it. It's convenient to keep things |
1211 | 147 | * this way for now until we can drop SF/Hybris support in QtUbuntu. | 148 | * this way for now until we can drop SF/Hybris support in QtUbuntu. |
1212 | @@ -194,12 +195,22 @@ | |||
1213 | 194 | int value; | 195 | int value; |
1214 | 195 | } MirSurfaceEvent; | 196 | } MirSurfaceEvent; |
1215 | 196 | 197 | ||
1216 | 198 | typedef struct | ||
1217 | 199 | { | ||
1218 | 200 | MirEventType type; | ||
1219 | 201 | |||
1220 | 202 | int surface_id; | ||
1221 | 203 | int width; | ||
1222 | 204 | int height; | ||
1223 | 205 | } MirResizeEvent; | ||
1224 | 206 | |||
1225 | 197 | typedef union | 207 | typedef union |
1226 | 198 | { | 208 | { |
1227 | 199 | MirEventType type; | 209 | MirEventType type; |
1228 | 200 | MirKeyEvent key; | 210 | MirKeyEvent key; |
1229 | 201 | MirMotionEvent motion; | 211 | MirMotionEvent motion; |
1230 | 202 | MirSurfaceEvent surface; | 212 | MirSurfaceEvent surface; |
1231 | 213 | MirResizeEvent resize; | ||
1232 | 203 | } MirEvent; | 214 | } MirEvent; |
1233 | 204 | 215 | ||
1234 | 205 | #ifdef __cplusplus | 216 | #ifdef __cplusplus |
1235 | 206 | 217 | ||
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 | 52 | struct ANativeWindowBuffer; | 52 | struct ANativeWindowBuffer; |
1241 | 53 | typedef struct ANativeWindowBuffer MirNativeBuffer; | 53 | typedef struct ANativeWindowBuffer MirNativeBuffer; |
1242 | 54 | #else | 54 | #else |
1244 | 55 | typedef struct MirBufferPackage MirNativeBuffer; | 55 | typedef struct MirBufferPackage MirNativeBuffer; |
1245 | 56 | #endif | 56 | #endif |
1246 | 57 | #endif /* MIR_CLIENT_MIR_NATIVE_BUFFER_H_ */ | 57 | #endif /* MIR_CLIENT_MIR_NATIVE_BUFFER_H_ */ |
1247 | 58 | 58 | ||
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 | 1 | /* | ||
1253 | 2 | * Copyright © 2013 Canonical Ltd. | ||
1254 | 3 | * | ||
1255 | 4 | * This program is free software: you can redistribute it and/or modify it | ||
1256 | 5 | * under the terms of the GNU General Public License version 3, | ||
1257 | 6 | * as published by the Free Software Foundation. | ||
1258 | 7 | * | ||
1259 | 8 | * This program is distributed in the hope that it will be useful, | ||
1260 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
1261 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
1262 | 11 | * GNU General Public License for more details. | ||
1263 | 12 | * | ||
1264 | 13 | * You should have received a copy of the GNU General Public License | ||
1265 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
1266 | 15 | * | ||
1267 | 16 | * Authored by: Alan Griffiths <alan@octopull.co.uk> | ||
1268 | 17 | */ | ||
1269 | 18 | |||
1270 | 19 | #ifndef GMOCK_SET_ARG_H_ | ||
1271 | 20 | #define GMOCK_SET_ARG_H_ | ||
1272 | 21 | |||
1273 | 22 | #include <gmock/gmock.h> | ||
1274 | 23 | |||
1275 | 24 | namespace testing | ||
1276 | 25 | { | ||
1277 | 26 | namespace internal | ||
1278 | 27 | { | ||
1279 | 28 | template <size_t N, typename A, bool kIsProto> | ||
1280 | 29 | class SetArgumentAction { | ||
1281 | 30 | public: | ||
1282 | 31 | // Constructs an action that sets the variable pointed to by the | ||
1283 | 32 | // N-th function argument to 'value'. | ||
1284 | 33 | explicit SetArgumentAction(const A& value) : value_(value) {} | ||
1285 | 34 | |||
1286 | 35 | template <typename Result, typename ArgumentTuple> | ||
1287 | 36 | void Perform(const ArgumentTuple& args) const { | ||
1288 | 37 | CompileAssertTypesEqual<void, Result>(); | ||
1289 | 38 | ::std::tr1::get<N>(args) = value_; | ||
1290 | 39 | } | ||
1291 | 40 | |||
1292 | 41 | private: | ||
1293 | 42 | const A value_; | ||
1294 | 43 | |||
1295 | 44 | GTEST_DISALLOW_ASSIGN_(SetArgumentAction); | ||
1296 | 45 | }; | ||
1297 | 46 | } | ||
1298 | 47 | template <size_t N, typename T> | ||
1299 | 48 | PolymorphicAction< | ||
1300 | 49 | internal::SetArgumentAction< | ||
1301 | 50 | N, T, internal::IsAProtocolMessage<T>::value> > | ||
1302 | 51 | SetArg(const T& x) { | ||
1303 | 52 | return MakePolymorphicAction(internal::SetArgumentAction< | ||
1304 | 53 | N, T, internal::IsAProtocolMessage<T>::value>(x)); | ||
1305 | 54 | } | ||
1306 | 55 | } | ||
1307 | 56 | |||
1308 | 57 | #endif /* GMOCK_SET_ARG_H_ */ | ||
1309 | 0 | 58 | ||
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 | 16 | * Authored by: Kevin DuBois <kevin.dubois@canonical.com> | 16 | * Authored by: Kevin DuBois <kevin.dubois@canonical.com> |
1315 | 17 | */ | 17 | */ |
1316 | 18 | 18 | ||
1319 | 19 | #include "mir/geometry/pixel_format.h" | 19 | #include "mir_toolkit/common.h" |
1318 | 20 | namespace geom = mir::geometry; | ||
1320 | 21 | 20 | ||
1321 | 22 | template<size_t Rows, size_t Cols> | 21 | template<size_t Rows, size_t Cols> |
1322 | 23 | DrawPatternCheckered<Rows,Cols>::DrawPatternCheckered(uint32_t (&pattern) [Rows][Cols]) | 22 | DrawPatternCheckered<Rows,Cols>::DrawPatternCheckered(uint32_t (&pattern) [Rows][Cols]) |
1323 | @@ -32,14 +31,14 @@ | |||
1324 | 32 | if (region.pixel_format != mir_pixel_format_abgr_8888) | 31 | if (region.pixel_format != mir_pixel_format_abgr_8888) |
1325 | 33 | throw(std::runtime_error("cannot draw region, incorrect format")); | 32 | throw(std::runtime_error("cannot draw region, incorrect format")); |
1326 | 34 | 33 | ||
1328 | 35 | auto bpp = geom::bytes_per_pixel(geom::PixelFormat::abgr_8888); | 34 | auto bpp = MIR_BYTES_PER_PIXEL(mir_pixel_format_abgr_8888); |
1329 | 36 | for(int i=0; i < region.width; i++) | 35 | for(int i=0; i < region.width; i++) |
1330 | 37 | { | 36 | { |
1331 | 38 | for(int j=0; j<region.height; j++) | 37 | for(int j=0; j<region.height; j++) |
1332 | 39 | { | 38 | { |
1333 | 40 | int key_row = i % Rows; | 39 | int key_row = i % Rows; |
1334 | 41 | int key_col = j % Cols; | 40 | int key_col = j % Cols; |
1336 | 42 | uint32_t *pixel = reinterpret_cast<uint32_t*>(®ion.vaddr[j*region.stride + (i * bpp)]); | 41 | uint32_t *pixel = reinterpret_cast<uint32_t*>(®ion.vaddr[j*region.stride + (i * bpp)]); |
1337 | 43 | *pixel = color_pattern[key_row][key_col]; | 42 | *pixel = color_pattern[key_row][key_col]; |
1338 | 44 | } | 43 | } |
1339 | 45 | } | 44 | } |
1340 | @@ -51,14 +50,14 @@ | |||
1341 | 51 | if (region.pixel_format != mir_pixel_format_abgr_8888) | 50 | if (region.pixel_format != mir_pixel_format_abgr_8888) |
1342 | 52 | throw(std::runtime_error("cannot check region, incorrect format")); | 51 | throw(std::runtime_error("cannot check region, incorrect format")); |
1343 | 53 | 52 | ||
1345 | 54 | auto bpp = geom::bytes_per_pixel(geom::PixelFormat::abgr_8888); | 53 | auto bpp = MIR_BYTES_PER_PIXEL(mir_pixel_format_abgr_8888); |
1346 | 55 | for(int i=0; i< region.width; i++) | 54 | for(int i=0; i< region.width; i++) |
1347 | 56 | { | 55 | { |
1348 | 57 | for(int j=0; j<region.height; j++) | 56 | for(int j=0; j<region.height; j++) |
1349 | 58 | { | 57 | { |
1350 | 59 | int key_row = i % Rows; | 58 | int key_row = i % Rows; |
1351 | 60 | int key_col = j % Cols; | 59 | int key_col = j % Cols; |
1353 | 61 | uint32_t *pixel = reinterpret_cast<uint32_t*>(®ion.vaddr[j*region.stride + (i * bpp)]); | 60 | uint32_t *pixel = reinterpret_cast<uint32_t*>(®ion.vaddr[j*region.stride + (i * bpp)]); |
1354 | 62 | if ( *pixel != color_pattern[key_row][key_col] ) | 61 | if ( *pixel != color_pattern[key_row][key_col] ) |
1355 | 63 | { | 62 | { |
1356 | 64 | return false; | 63 | return false; |
1357 | 65 | 64 | ||
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 | 59 | 59 | ||
1363 | 60 | droidinput::sp<droidinput::EventHubInterface> the_event_hub(); | 60 | droidinput::sp<droidinput::EventHubInterface> the_event_hub(); |
1364 | 61 | input::android::FakeEventHub* the_fake_event_hub(); | 61 | input::android::FakeEventHub* the_fake_event_hub(); |
1366 | 62 | 62 | ||
1367 | 63 | bool is_key_repeat_enabled() override { return false; } | 63 | bool is_key_repeat_enabled() override { return false; } |
1368 | 64 | 64 | ||
1369 | 65 | 65 | ||
1370 | 66 | 66 | ||
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 | 19 | #ifndef MIR_TEST_DOUBLES_MOCK_ALLOC_ADAPTOR_H_ | 19 | #ifndef MIR_TEST_DOUBLES_MOCK_ALLOC_ADAPTOR_H_ |
1376 | 20 | #define MIR_TEST_DOUBLES_MOCK_ALLOC_ADAPTOR_H_ | 20 | #define MIR_TEST_DOUBLES_MOCK_ALLOC_ADAPTOR_H_ |
1377 | 21 | 21 | ||
1379 | 22 | #include "src/server/graphics/android/graphic_alloc_adaptor.h" | 22 | #include "src/platform/graphics/android/graphic_alloc_adaptor.h" |
1380 | 23 | 23 | ||
1381 | 24 | #include <system/window.h> | 24 | #include <system/window.h> |
1382 | 25 | #include <gmock/gmock.h> | 25 | #include <gmock/gmock.h> |
1383 | @@ -34,8 +34,8 @@ | |||
1384 | 34 | class MockAllocAdaptor : public graphics::android::GraphicAllocAdaptor | 34 | class MockAllocAdaptor : public graphics::android::GraphicAllocAdaptor |
1385 | 35 | { | 35 | { |
1386 | 36 | public: | 36 | public: |
1389 | 37 | MOCK_METHOD3(alloc_buffer, | 37 | MOCK_METHOD3(alloc_buffer, |
1390 | 38 | std::shared_ptr<graphics::NativeBuffer>(geometry::Size, geometry::PixelFormat, graphics::android::BufferUsage)); | 38 | std::shared_ptr<graphics::NativeBuffer>(geometry::Size, MirPixelFormat, graphics::android::BufferUsage)); |
1391 | 39 | }; | 39 | }; |
1392 | 40 | 40 | ||
1393 | 41 | } | 41 | } |
1394 | 42 | 42 | ||
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 | 20 | #define MIR_TEST_DOUBLES_MOCK_ANDROID_NATIVE_BUFFER_H_ | 20 | #define MIR_TEST_DOUBLES_MOCK_ANDROID_NATIVE_BUFFER_H_ |
1400 | 21 | 21 | ||
1401 | 22 | #include "mir/graphics/android/native_buffer.h" | 22 | #include "mir/graphics/android/native_buffer.h" |
1403 | 23 | #include <gmock/gmock.h> | 23 | #include <gmock/gmock.h> |
1404 | 24 | 24 | ||
1405 | 25 | namespace mir | 25 | namespace mir |
1406 | 26 | { | 26 | { |
1407 | 27 | 27 | ||
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 | 36 | struct MockAndroidRegistrar : public client::android::AndroidRegistrar | 36 | struct MockAndroidRegistrar : public client::android::AndroidRegistrar |
1413 | 37 | { | 37 | { |
1414 | 38 | ~MockAndroidRegistrar() noexcept {} | 38 | ~MockAndroidRegistrar() noexcept {} |
1416 | 39 | MOCK_CONST_METHOD1(register_buffer, | 39 | MOCK_CONST_METHOD1(register_buffer, |
1417 | 40 | std::shared_ptr<const native_handle_t>(std::shared_ptr<MirBufferPackage> const&)); | 40 | std::shared_ptr<const native_handle_t>(std::shared_ptr<MirBufferPackage> const&)); |
1418 | 41 | MOCK_METHOD2(secure_for_cpu, std::shared_ptr<char>(std::shared_ptr<const native_handle_t>, geometry::Rectangle)); | 41 | MOCK_METHOD2(secure_for_cpu, std::shared_ptr<char>(std::shared_ptr<const native_handle_t>, geometry::Rectangle)); |
1419 | 42 | }; | 42 | }; |
1420 | 43 | 43 | ||
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 | 42 | 42 | ||
1426 | 43 | MockBuffer(geometry::Size size, | 43 | MockBuffer(geometry::Size size, |
1427 | 44 | geometry::Stride s, | 44 | geometry::Stride s, |
1429 | 45 | geometry::PixelFormat pf) | 45 | MirPixelFormat pf) |
1430 | 46 | { | 46 | { |
1431 | 47 | using namespace testing; | 47 | using namespace testing; |
1432 | 48 | ON_CALL(*this, size()) | 48 | ON_CALL(*this, size()) |
1433 | @@ -60,7 +60,7 @@ | |||
1434 | 60 | 60 | ||
1435 | 61 | MOCK_CONST_METHOD0(size, geometry::Size()); | 61 | MOCK_CONST_METHOD0(size, geometry::Size()); |
1436 | 62 | MOCK_CONST_METHOD0(stride, geometry::Stride()); | 62 | MOCK_CONST_METHOD0(stride, geometry::Stride()); |
1438 | 63 | MOCK_CONST_METHOD0(pixel_format, geometry::PixelFormat()); | 63 | MOCK_CONST_METHOD0(pixel_format, MirPixelFormat()); |
1439 | 64 | MOCK_CONST_METHOD0(native_buffer_handle, std::shared_ptr<graphics::NativeBuffer>()); | 64 | MOCK_CONST_METHOD0(native_buffer_handle, std::shared_ptr<graphics::NativeBuffer>()); |
1440 | 65 | 65 | ||
1441 | 66 | MOCK_METHOD0(bind_to_texture, void()); | 66 | MOCK_METHOD0(bind_to_texture, void()); |
1442 | 67 | 67 | ||
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 | 37 | ~MockBufferBundle() noexcept | 37 | ~MockBufferBundle() noexcept |
1448 | 38 | {} | 38 | {} |
1449 | 39 | 39 | ||
1452 | 40 | MOCK_METHOD0(client_acquire, std::shared_ptr<graphics::Buffer>()); | 40 | MOCK_METHOD0(client_acquire, graphics::Buffer*()); |
1453 | 41 | MOCK_METHOD1(client_release, void(std::shared_ptr<graphics::Buffer> const&)); | 41 | MOCK_METHOD1(client_release, void(graphics::Buffer*)); |
1454 | 42 | MOCK_METHOD1(compositor_acquire, std::shared_ptr<graphics::Buffer>(unsigned long)); | 42 | MOCK_METHOD1(compositor_acquire, std::shared_ptr<graphics::Buffer>(unsigned long)); |
1455 | 43 | MOCK_METHOD1(compositor_release, void(std::shared_ptr<graphics::Buffer> const&)); | 43 | MOCK_METHOD1(compositor_release, void(std::shared_ptr<graphics::Buffer> const&)); |
1456 | 44 | MOCK_METHOD0(snapshot_acquire, std::shared_ptr<graphics::Buffer>()); | 44 | MOCK_METHOD0(snapshot_acquire, std::shared_ptr<graphics::Buffer>()); |
1457 | 45 | 45 | ||
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 | 31 | { | 31 | { |
1463 | 32 | struct MockBufferStream : public compositor::BufferStream | 32 | struct MockBufferStream : public compositor::BufferStream |
1464 | 33 | { | 33 | { |
1466 | 34 | MOCK_METHOD0(secure_client_buffer, std::shared_ptr<graphics::Buffer>()); | 34 | MOCK_METHOD1(swap_client_buffers, void(graphics::Buffer*&)); |
1467 | 35 | MOCK_METHOD1(lock_compositor_buffer, | 35 | MOCK_METHOD1(lock_compositor_buffer, |
1468 | 36 | std::shared_ptr<graphics::Buffer>(unsigned long)); | 36 | std::shared_ptr<graphics::Buffer>(unsigned long)); |
1469 | 37 | MOCK_METHOD0(lock_snapshot_buffer, std::shared_ptr<graphics::Buffer>()); | 37 | MOCK_METHOD0(lock_snapshot_buffer, std::shared_ptr<graphics::Buffer>()); |
1470 | 38 | 38 | ||
1472 | 39 | MOCK_METHOD0(get_stream_pixel_format, geometry::PixelFormat()); | 39 | MOCK_METHOD0(get_stream_pixel_format, MirPixelFormat()); |
1473 | 40 | MOCK_METHOD0(stream_size, geometry::Size()); | 40 | MOCK_METHOD0(stream_size, geometry::Size()); |
1474 | 41 | MOCK_METHOD1(resize, void(geometry::Size const&)); | 41 | MOCK_METHOD1(resize, void(geometry::Size const&)); |
1475 | 42 | MOCK_METHOD0(force_client_completion, void()); | 42 | MOCK_METHOD0(force_client_completion, void()); |
1476 | 43 | 43 | ||
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 | 20 | #define MIR_TEST_DOUBLES_MOCK_DISPLAY_DEVICE_H_ | 20 | #define MIR_TEST_DOUBLES_MOCK_DISPLAY_DEVICE_H_ |
1482 | 21 | 21 | ||
1483 | 22 | #include "mir/graphics/buffer.h" | 22 | #include "mir/graphics/buffer.h" |
1485 | 23 | #include "src/server/graphics/android/display_device.h" | 23 | #include "src/platform/graphics/android/display_device.h" |
1486 | 24 | #include <gmock/gmock.h> | 24 | #include <gmock/gmock.h> |
1488 | 25 | 25 | ||
1489 | 26 | namespace mir | 26 | namespace mir |
1490 | 27 | { | 27 | { |
1491 | 28 | namespace test | 28 | namespace test |
1492 | 29 | 29 | ||
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 | 58 | public: | 58 | public: |
1498 | 59 | MockEGL(); | 59 | MockEGL(); |
1499 | 60 | ~MockEGL(); | 60 | ~MockEGL(); |
1500 | 61 | void silence_uninteresting(); | ||
1501 | 62 | 61 | ||
1502 | 63 | typedef void (*generic_function_pointer_t)(void); | 62 | typedef void (*generic_function_pointer_t)(void); |
1503 | 64 | 63 | ||
1504 | 65 | 64 | ||
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 | 52 | {0,0,0,0,0,0,0}, | 52 | {0,0,0,0,0,0,0}, |
1510 | 53 | nullptr, nullptr,nullptr,nullptr, nullptr,nullptr, | 53 | nullptr, nullptr,nullptr,nullptr, nullptr,nullptr, |
1511 | 54 | {0,0,0,0,0,0} | 54 | {0,0,0,0,0,0} |
1513 | 55 | }) | 55 | }) |
1514 | 56 | { | 56 | { |
1515 | 57 | post = hook_post; | 57 | post = hook_post; |
1517 | 58 | setSwapInterval = hook_setSwapInterval; | 58 | setSwapInterval = hook_setSwapInterval; |
1518 | 59 | enableScreen = hook_enableScreen; | ||
1519 | 59 | } | 60 | } |
1520 | 60 | 61 | ||
1521 | 61 | MockFBHalDevice() | 62 | MockFBHalDevice() |
1522 | @@ -72,12 +73,20 @@ | |||
1523 | 72 | static int hook_setSwapInterval(struct framebuffer_device_t* mock_fb, int interval) | 73 | static int hook_setSwapInterval(struct framebuffer_device_t* mock_fb, int interval) |
1524 | 73 | { | 74 | { |
1525 | 74 | MockFBHalDevice* mocker = static_cast<MockFBHalDevice*>(mock_fb); | 75 | MockFBHalDevice* mocker = static_cast<MockFBHalDevice*>(mock_fb); |
1529 | 75 | return mocker->setSwapInterval_interface(mock_fb, interval); | 76 | return mocker->setSwapInterval_interface(mock_fb, interval); |
1530 | 76 | } | 77 | } |
1531 | 77 | 78 | ||
1532 | 79 | static int hook_enableScreen(struct framebuffer_device_t* mock_fb, int enable) | ||
1533 | 80 | { | ||
1534 | 81 | MockFBHalDevice* mocker = static_cast<MockFBHalDevice*>(mock_fb); | ||
1535 | 82 | return mocker->enableScreen_interface(mock_fb, enable); | ||
1536 | 83 | } | ||
1537 | 84 | |||
1538 | 85 | |||
1539 | 86 | MOCK_METHOD2(enableScreen_interface, int(struct framebuffer_device_t*, int)); | ||
1540 | 78 | MOCK_METHOD2(post_interface, int(struct framebuffer_device_t*, buffer_handle_t)); | 87 | MOCK_METHOD2(post_interface, int(struct framebuffer_device_t*, buffer_handle_t)); |
1541 | 79 | MOCK_METHOD2(setSwapInterval_interface, int(struct framebuffer_device_t*, int)); | 88 | MOCK_METHOD2(setSwapInterval_interface, int(struct framebuffer_device_t*, int)); |
1543 | 80 | 89 | ||
1544 | 81 | hw_device_t empty_module; | 90 | hw_device_t empty_module; |
1545 | 82 | }; | 91 | }; |
1546 | 83 | 92 | ||
1547 | 84 | 93 | ||
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 | 19 | #ifndef MIR_TEST_DOUBLES_MOCK_FRAMEBUFFER_BUNDLE_H_ | 19 | #ifndef MIR_TEST_DOUBLES_MOCK_FRAMEBUFFER_BUNDLE_H_ |
1553 | 20 | #define MIR_TEST_DOUBLES_MOCK_FRAMEBUFFER_BUNDLE_H_ | 20 | #define MIR_TEST_DOUBLES_MOCK_FRAMEBUFFER_BUNDLE_H_ |
1554 | 21 | 21 | ||
1556 | 22 | #include "src/server/graphics/android/framebuffer_bundle.h" | 22 | #include "src/platform/graphics/android/framebuffer_bundle.h" |
1557 | 23 | #include "stub_buffer.h" | 23 | #include "stub_buffer.h" |
1558 | 24 | #include <gmock/gmock.h> | 24 | #include <gmock/gmock.h> |
1559 | 25 | 25 | ||
1560 | @@ -38,7 +38,7 @@ | |||
1561 | 38 | ON_CALL(*this, last_rendered_buffer()) | 38 | ON_CALL(*this, last_rendered_buffer()) |
1562 | 39 | .WillByDefault(Return(std::make_shared<StubBuffer>())); | 39 | .WillByDefault(Return(std::make_shared<StubBuffer>())); |
1563 | 40 | } | 40 | } |
1565 | 41 | MOCK_METHOD0(fb_format, geometry::PixelFormat()); | 41 | MOCK_METHOD0(fb_format, MirPixelFormat()); |
1566 | 42 | MOCK_METHOD0(fb_size, geometry::Size()); | 42 | MOCK_METHOD0(fb_size, geometry::Size()); |
1567 | 43 | MOCK_METHOD0(buffer_for_render, std::shared_ptr<graphics::Buffer>()); | 43 | MOCK_METHOD0(buffer_for_render, std::shared_ptr<graphics::Buffer>()); |
1568 | 44 | MOCK_METHOD0(last_rendered_buffer, std::shared_ptr<graphics::Buffer>()); | 44 | MOCK_METHOD0(last_rendered_buffer, std::shared_ptr<graphics::Buffer>()); |
1569 | 45 | 45 | ||
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 | 39 | 39 | ||
1575 | 40 | MOCK_METHOD0(destroy, void()); | 40 | MOCK_METHOD0(destroy, void()); |
1576 | 41 | MOCK_METHOD0(force_requests_to_complete, void()); | 41 | MOCK_METHOD0(force_requests_to_complete, void()); |
1578 | 42 | MOCK_METHOD0(advance_client_buffer, std::shared_ptr<graphics::Buffer>()); | 42 | MOCK_METHOD1(swap_buffers, void(graphics::Buffer*&)); |
1579 | 43 | 43 | ||
1580 | 44 | MOCK_CONST_METHOD0(size, geometry::Size()); | 44 | MOCK_CONST_METHOD0(size, geometry::Size()); |
1582 | 45 | MOCK_CONST_METHOD0(pixel_format, geometry::PixelFormat()); | 45 | MOCK_CONST_METHOD0(pixel_format, MirPixelFormat()); |
1583 | 46 | 46 | ||
1584 | 47 | MOCK_CONST_METHOD0(supports_input, bool()); | 47 | MOCK_CONST_METHOD0(supports_input, bool()); |
1585 | 48 | MOCK_CONST_METHOD0(client_input_fd, int()); | 48 | MOCK_CONST_METHOD0(client_input_fd, int()); |
1586 | 49 | 49 | ||
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 | 66 | 66 | ||
1592 | 67 | void hwc_set_return_fence(int fence) | 67 | void hwc_set_return_fence(int fence) |
1593 | 68 | { | 68 | { |
1595 | 69 | fb_fence = fence; | 69 | fb_fence = fence; |
1596 | 70 | } | 70 | } |
1597 | 71 | 71 | ||
1598 | 72 | int save_last_prepare_arguments(struct hwc_composer_device_1 *, size_t, hwc_display_contents_1_t** displays) | 72 | int save_last_prepare_arguments(struct hwc_composer_device_1 *, size_t, hwc_display_contents_1_t** displays) |
1599 | @@ -87,7 +87,7 @@ | |||
1600 | 87 | set_layerlist.back().visibleRegionScreen = {0, nullptr}; | 87 | set_layerlist.back().visibleRegionScreen = {0, nullptr}; |
1601 | 88 | } | 88 | } |
1602 | 89 | 89 | ||
1604 | 90 | if (primary_display->hwLayers) | 90 | if (primary_display->numHwLayers >= 2) |
1605 | 91 | { | 91 | { |
1606 | 92 | primary_display->hwLayers[1].releaseFenceFd = fb_fence; | 92 | primary_display->hwLayers[1].releaseFenceFd = fb_fence; |
1607 | 93 | } | 93 | } |
1608 | 94 | 94 | ||
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 | 19 | #ifndef MIR_TEST_DOUBLES_MOCK_HWC_LAYERLIST_H_ | 19 | #ifndef MIR_TEST_DOUBLES_MOCK_HWC_LAYERLIST_H_ |
1614 | 20 | #define MIR_TEST_DOUBLES_MOCK_HWC_LAYERLIST_H_ | 20 | #define MIR_TEST_DOUBLES_MOCK_HWC_LAYERLIST_H_ |
1615 | 21 | 21 | ||
1617 | 22 | #include "src/server/graphics/android/hwc_layerlist.h" | 22 | #include "src/platform/graphics/android/hwc_layerlist.h" |
1618 | 23 | 23 | ||
1619 | 24 | #include <gmock/gmock.h> | 24 | #include <gmock/gmock.h> |
1620 | 25 | 25 | ||
1621 | 26 | 26 | ||
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 | 19 | #ifndef MIR_TEST_DOUBLES_MOCK_HWC_VSYNC_COORDINATOR_H_ | 19 | #ifndef MIR_TEST_DOUBLES_MOCK_HWC_VSYNC_COORDINATOR_H_ |
1627 | 20 | #define MIR_TEST_DOUBLES_MOCK_HWC_VSYNC_COORDINATOR_H_ | 20 | #define MIR_TEST_DOUBLES_MOCK_HWC_VSYNC_COORDINATOR_H_ |
1628 | 21 | 21 | ||
1630 | 22 | #include "src/server/graphics/android/hwc_vsync_coordinator.h" | 22 | #include "src/platform/graphics/android/hwc_vsync_coordinator.h" |
1631 | 23 | 23 | ||
1632 | 24 | #include <gmock/gmock.h> | 24 | #include <gmock/gmock.h> |
1633 | 25 | 25 | ||
1634 | 26 | 26 | ||
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 | 45 | MOCK_METHOD2(transferTouchFocus, bool(droidinput::sp<droidinput::InputChannel> const&, droidinput::sp<droidinput::InputChannel> const&)); | 45 | MOCK_METHOD2(transferTouchFocus, bool(droidinput::sp<droidinput::InputChannel> const&, droidinput::sp<droidinput::InputChannel> const&)); |
1640 | 46 | MOCK_METHOD3(registerInputChannel, droidinput::status_t(droidinput::sp<droidinput::InputChannel> const&, droidinput::sp<droidinput::InputWindowHandle> const&, bool)); | 46 | MOCK_METHOD3(registerInputChannel, droidinput::status_t(droidinput::sp<droidinput::InputChannel> const&, droidinput::sp<droidinput::InputWindowHandle> const&, bool)); |
1641 | 47 | MOCK_METHOD1(unregisterInputChannel, droidinput::status_t(droidinput::sp<droidinput::InputChannel> const&)); | 47 | MOCK_METHOD1(unregisterInputChannel, droidinput::status_t(droidinput::sp<droidinput::InputChannel> const&)); |
1643 | 48 | 48 | ||
1644 | 49 | MOCK_METHOD1(setKeyboardFocus, void(droidinput::sp<droidinput::InputWindowHandle> const&)); | 49 | MOCK_METHOD1(setKeyboardFocus, void(droidinput::sp<droidinput::InputWindowHandle> const&)); |
1645 | 50 | MOCK_METHOD1(notifyWindowRemoved, void(droidinput::sp<droidinput::InputWindowHandle> const&)); | 50 | MOCK_METHOD1(notifyWindowRemoved, void(droidinput::sp<droidinput::InputWindowHandle> const&)); |
1646 | 51 | 51 | ||
1647 | 52 | 52 | ||
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 | 29 | namespace doubles | 29 | namespace doubles |
1653 | 30 | { | 30 | { |
1654 | 31 | 31 | ||
1656 | 32 | class MockInputSurface : public input::Surface | 32 | class MockInputSurface : public input::Surface |
1657 | 33 | { | 33 | { |
1658 | 34 | public: | 34 | public: |
1659 | 35 | MockInputSurface() | 35 | MockInputSurface() |
1660 | 36 | 36 | ||
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 | 18 | #ifndef MIR_TEST_DOUBLES_MOCK_INTERPRETER_RESOURCE_CACHE_H_ | 18 | #ifndef MIR_TEST_DOUBLES_MOCK_INTERPRETER_RESOURCE_CACHE_H_ |
1666 | 19 | #define MIR_TEST_DOUBLES_MOCK_INTERPRETER_RESOURCE_CACHE_H_ | 19 | #define MIR_TEST_DOUBLES_MOCK_INTERPRETER_RESOURCE_CACHE_H_ |
1667 | 20 | 20 | ||
1669 | 21 | #include "src/server/graphics/android/interpreter_resource_cache.h" | 21 | #include "src/platform/graphics/android/interpreter_resource_cache.h" |
1670 | 22 | 22 | ||
1671 | 23 | namespace mir | 23 | namespace mir |
1672 | 24 | { | 24 | { |
1673 | 25 | 25 | ||
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 | 38 | MOCK_METHOD1(stopping, void(std::shared_ptr<shell::Session> const&)); | 38 | MOCK_METHOD1(stopping, void(std::shared_ptr<shell::Session> const&)); |
1679 | 39 | MOCK_METHOD1(focused, void(std::shared_ptr<shell::Session> const&)); | 39 | MOCK_METHOD1(focused, void(std::shared_ptr<shell::Session> const&)); |
1680 | 40 | MOCK_METHOD0(unfocused, void()); | 40 | MOCK_METHOD0(unfocused, void()); |
1682 | 41 | 41 | ||
1683 | 42 | MOCK_METHOD2(surface_created, void(shell::Session&, std::shared_ptr<shell::Surface> const&)); | 42 | MOCK_METHOD2(surface_created, void(shell::Session&, std::shared_ptr<shell::Surface> const&)); |
1684 | 43 | MOCK_METHOD2(destroying_surface, void(shell::Session&, std::shared_ptr<shell::Surface> const&)); | 43 | MOCK_METHOD2(destroying_surface, void(shell::Session&, std::shared_ptr<shell::Surface> const&)); |
1685 | 44 | }; | 44 | }; |
1686 | 45 | 45 | ||
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 | 46 | 46 | ||
1692 | 47 | MOCK_METHOD0(hide, void()); | 47 | MOCK_METHOD0(hide, void()); |
1693 | 48 | MOCK_METHOD0(show, void()); | 48 | MOCK_METHOD0(show, void()); |
1695 | 49 | 49 | ||
1696 | 50 | MOCK_METHOD1(send_display_config, void(graphics::DisplayConfiguration const&)); | 50 | MOCK_METHOD1(send_display_config, void(graphics::DisplayConfiguration const&)); |
1697 | 51 | MOCK_METHOD3(configure_surface, int(frontend::SurfaceId, MirSurfaceAttrib, int)); | 51 | MOCK_METHOD3(configure_surface, int(frontend::SurfaceId, MirSurfaceAttrib, int)); |
1698 | 52 | 52 | ||
1699 | 53 | 53 | ||
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 | 38 | 38 | ||
1705 | 39 | struct MockSurface : public scene::SurfaceImpl | 39 | struct MockSurface : public scene::SurfaceImpl |
1706 | 40 | { | 40 | { |
1709 | 41 | MockSurface(shell::Session* session, std::shared_ptr<scene::SurfaceBuilder> const& builder) : | 41 | MockSurface(std::shared_ptr<scene::SurfaceBuilder> const& builder) : |
1710 | 42 | scene::SurfaceImpl(session, builder, std::make_shared<NullSurfaceConfigurator>(), shell::a_surface(), | 42 | scene::SurfaceImpl(builder, std::make_shared<NullSurfaceConfigurator>(), shell::a_surface(), |
1711 | 43 | frontend::SurfaceId{}, std::make_shared<NullEventSink>()) | 43 | frontend::SurfaceId{}, std::make_shared<NullEventSink>()) |
1712 | 44 | { | 44 | { |
1713 | 45 | } | 45 | } |
1714 | @@ -49,14 +49,14 @@ | |||
1715 | 49 | MOCK_METHOD0(hide, void()); | 49 | MOCK_METHOD0(hide, void()); |
1716 | 50 | MOCK_METHOD0(show, void()); | 50 | MOCK_METHOD0(show, void()); |
1717 | 51 | MOCK_METHOD0(visible, bool()); | 51 | MOCK_METHOD0(visible, bool()); |
1719 | 52 | MOCK_METHOD1(raise, void(std::shared_ptr<shell::SurfaceController> const&)); | 52 | MOCK_METHOD1(raise, void(std::shared_ptr<scene::SurfaceRanker> const&)); |
1720 | 53 | 53 | ||
1721 | 54 | MOCK_METHOD0(force_requests_to_complete, void()); | 54 | MOCK_METHOD0(force_requests_to_complete, void()); |
1722 | 55 | MOCK_METHOD0(advance_client_buffer, std::shared_ptr<graphics::Buffer>()); | 55 | MOCK_METHOD0(advance_client_buffer, std::shared_ptr<graphics::Buffer>()); |
1723 | 56 | 56 | ||
1724 | 57 | MOCK_CONST_METHOD0(name, std::string()); | 57 | MOCK_CONST_METHOD0(name, std::string()); |
1725 | 58 | MOCK_CONST_METHOD0(size, geometry::Size()); | 58 | MOCK_CONST_METHOD0(size, geometry::Size()); |
1727 | 59 | MOCK_CONST_METHOD0(pixel_format, geometry::PixelFormat()); | 59 | MOCK_CONST_METHOD0(pixel_format, MirPixelFormat()); |
1728 | 60 | 60 | ||
1729 | 61 | MOCK_CONST_METHOD0(supports_input, bool()); | 61 | MOCK_CONST_METHOD0(supports_input, bool()); |
1730 | 62 | MOCK_CONST_METHOD0(client_input_fd, int()); | 62 | MOCK_CONST_METHOD0(client_input_fd, int()); |
1731 | 63 | 63 | ||
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 | 17 | */ | 17 | */ |
1737 | 18 | 18 | ||
1738 | 19 | 19 | ||
1741 | 20 | #ifndef MIR_TEST_DOUBLES_MOCK_SURFACE_CONTROLLER_H_ | 20 | #ifndef MIR_TEST_DOUBLES_MOCK_SURFACE_RANKER_H_ |
1742 | 21 | #define MIR_TEST_DOUBLES_MOCK_SURFACE_CONTROLLER_H_ | 21 | #define MIR_TEST_DOUBLES_MOCK_SURFACE_RANKER_H_ |
1743 | 22 | 22 | ||
1745 | 23 | #include "mir/shell/surface_controller.h" | 23 | #include "src/server/scene/surface_ranker.h" |
1746 | 24 | 24 | ||
1747 | 25 | #include <gmock/gmock.h> | 25 | #include <gmock/gmock.h> |
1748 | 26 | 26 | ||
1749 | @@ -31,7 +31,7 @@ | |||
1750 | 31 | namespace doubles | 31 | namespace doubles |
1751 | 32 | { | 32 | { |
1752 | 33 | 33 | ||
1754 | 34 | struct MockSurfaceController : public shell::SurfaceController | 34 | struct MockSurfaceRanker : public scene::SurfaceRanker |
1755 | 35 | { | 35 | { |
1756 | 36 | MOCK_METHOD1(raise, void(std::weak_ptr<scene::BasicSurface> const&)); | 36 | MOCK_METHOD1(raise, void(std::weak_ptr<scene::BasicSurface> const&)); |
1757 | 37 | }; | 37 | }; |
1758 | @@ -41,4 +41,4 @@ | |||
1759 | 41 | } | 41 | } |
1760 | 42 | 42 | ||
1761 | 43 | 43 | ||
1763 | 44 | #endif /* MIR_TEST_DOUBLES_MOCK_SURFACE_CONTROLLER_H_ */ | 44 | #endif /* MIR_TEST_DOUBLES_MOCK_SURFACE_RANKER_H_ */ |
1764 | 45 | 45 | ||
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 | 18 | #ifndef MIR_TEST_DOUBLES_MOCK_SURFACE_RENDERER_H_ | 18 | #ifndef MIR_TEST_DOUBLES_MOCK_SURFACE_RENDERER_H_ |
1770 | 19 | #define MIR_TEST_DOUBLES_MOCK_SURFACE_RENDERER_H_ | 19 | #define MIR_TEST_DOUBLES_MOCK_SURFACE_RENDERER_H_ |
1771 | 20 | 20 | ||
1772 | 21 | #include "mir/compositor/buffer_stream.h" | ||
1773 | 22 | #include "src/server/compositor/renderer.h" | 21 | #include "src/server/compositor/renderer.h" |
1774 | 23 | 22 | ||
1775 | 24 | #include <gmock/gmock.h> | 23 | #include <gmock/gmock.h> |
1776 | @@ -32,9 +31,8 @@ | |||
1777 | 32 | 31 | ||
1778 | 33 | struct MockSurfaceRenderer : public compositor::Renderer | 32 | struct MockSurfaceRenderer : public compositor::Renderer |
1779 | 34 | { | 33 | { |
1783 | 35 | MOCK_METHOD3(render, void( | 34 | MOCK_CONST_METHOD2(render, void(compositor::CompositingCriteria const&, graphics::Buffer&)); |
1784 | 36 | std::function<void(std::shared_ptr<void> const&)>, compositor::CompositingCriteria const&, compositor::BufferStream&)); | 35 | MOCK_CONST_METHOD0(clear, void()); |
1782 | 37 | MOCK_METHOD1(clear, void(unsigned long)); | ||
1785 | 38 | 36 | ||
1786 | 39 | ~MockSurfaceRenderer() noexcept {} | 37 | ~MockSurfaceRenderer() noexcept {} |
1787 | 40 | }; | 38 | }; |
1788 | 41 | 39 | ||
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 | 19 | #ifndef MIR_TEST_DOUBLES_NULL_VIDEO_DEVICES_H_ | 19 | #ifndef MIR_TEST_DOUBLES_NULL_VIDEO_DEVICES_H_ |
1794 | 20 | #define MIR_TEST_DOUBLES_NULL_VIDEO_DEVICES_H_ | 20 | #define MIR_TEST_DOUBLES_NULL_VIDEO_DEVICES_H_ |
1795 | 21 | 21 | ||
1797 | 22 | #include "src/server/graphics/gbm/video_devices.h" | 22 | #include "src/platform/graphics/mesa/video_devices.h" |
1798 | 23 | 23 | ||
1799 | 24 | namespace mir | 24 | namespace mir |
1800 | 25 | { | 25 | { |
1801 | @@ -28,7 +28,7 @@ | |||
1802 | 28 | namespace doubles | 28 | namespace doubles |
1803 | 29 | { | 29 | { |
1804 | 30 | 30 | ||
1806 | 31 | class NullVideoDevices : public graphics::gbm::VideoDevices | 31 | class NullVideoDevices : public graphics::mesa::VideoDevices |
1807 | 32 | { | 32 | { |
1808 | 33 | public: | 33 | public: |
1809 | 34 | void register_change_handler( | 34 | void register_change_handler( |
1810 | 35 | 35 | ||
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 | 19 | #ifndef MIR_TEST_DOUBLES_NULL_VIRTUAL_TERMINAL_H_ | 19 | #ifndef MIR_TEST_DOUBLES_NULL_VIRTUAL_TERMINAL_H_ |
1816 | 20 | #define MIR_TEST_DOUBLES_NULL_VIRTUAL_TERMINAL_H_ | 20 | #define MIR_TEST_DOUBLES_NULL_VIRTUAL_TERMINAL_H_ |
1817 | 21 | 21 | ||
1819 | 22 | #include "src/server/graphics/gbm/virtual_terminal.h" | 22 | #include "src/platform/graphics/mesa/virtual_terminal.h" |
1820 | 23 | 23 | ||
1821 | 24 | namespace mir | 24 | namespace mir |
1822 | 25 | { | 25 | { |
1823 | @@ -28,7 +28,7 @@ | |||
1824 | 28 | namespace doubles | 28 | namespace doubles |
1825 | 29 | { | 29 | { |
1826 | 30 | 30 | ||
1828 | 31 | class NullVirtualTerminal : public graphics::gbm::VirtualTerminal | 31 | class NullVirtualTerminal : public graphics::mesa::VirtualTerminal |
1829 | 32 | { | 32 | { |
1830 | 33 | public: | 33 | public: |
1831 | 34 | void set_graphics_mode() {} | 34 | void set_graphics_mode() {} |
1832 | 35 | 35 | ||
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 | 40 | public: | 40 | public: |
1838 | 41 | StubBuffer() | 41 | StubBuffer() |
1839 | 42 | : buf_size{0, 0}, | 42 | : buf_size{0, 0}, |
1841 | 43 | buf_pixel_format{geometry::PixelFormat::abgr_8888} | 43 | buf_pixel_format{mir_pixel_format_abgr_8888} |
1842 | 44 | { | 44 | { |
1843 | 45 | } | 45 | } |
1844 | 46 | 46 | ||
1845 | @@ -54,7 +54,7 @@ | |||
1846 | 54 | 54 | ||
1847 | 55 | virtual geometry::Stride stride() const { return geometry::Stride(); } | 55 | virtual geometry::Stride stride() const { return geometry::Stride(); } |
1848 | 56 | 56 | ||
1850 | 57 | virtual geometry::PixelFormat pixel_format() const { return buf_pixel_format; } | 57 | virtual MirPixelFormat pixel_format() const { return buf_pixel_format; } |
1851 | 58 | 58 | ||
1852 | 59 | virtual std::shared_ptr<graphics::NativeBuffer> native_buffer_handle() const | 59 | virtual std::shared_ptr<graphics::NativeBuffer> native_buffer_handle() const |
1853 | 60 | { | 60 | { |
1854 | @@ -69,7 +69,7 @@ | |||
1855 | 69 | virtual bool can_bypass() const override { return false; } | 69 | virtual bool can_bypass() const override { return false; } |
1856 | 70 | 70 | ||
1857 | 71 | geometry::Size const buf_size; | 71 | geometry::Size const buf_size; |
1859 | 72 | geometry::PixelFormat const buf_pixel_format; | 72 | MirPixelFormat const buf_pixel_format; |
1860 | 73 | }; | 73 | }; |
1861 | 74 | } | 74 | } |
1862 | 75 | } | 75 | } |
1863 | 76 | 76 | ||
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 | 43 | return std::make_shared<StubBuffer>(properties); | 43 | return std::make_shared<StubBuffer>(properties); |
1869 | 44 | } | 44 | } |
1870 | 45 | 45 | ||
1872 | 46 | std::vector<geometry::PixelFormat> supported_pixel_formats() | 46 | std::vector<MirPixelFormat> supported_pixel_formats() |
1873 | 47 | { | 47 | { |
1874 | 48 | return {}; | 48 | return {}; |
1875 | 49 | } | 49 | } |
1876 | 50 | 50 | ||
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 | 34 | public: | 34 | public: |
1882 | 35 | StubBufferStream() | 35 | StubBufferStream() |
1883 | 36 | { | 36 | { |
1884 | 37 | stub_client_buffer = std::make_shared<StubBuffer>(); | ||
1885 | 38 | stub_compositor_buffer = std::make_shared<StubBuffer>(); | 37 | stub_compositor_buffer = std::make_shared<StubBuffer>(); |
1886 | 39 | } | 38 | } |
1908 | 40 | std::shared_ptr<graphics::Buffer> secure_client_buffer() | 39 | void swap_client_buffers(graphics::Buffer*& buffer) override |
1909 | 41 | { | 40 | { |
1910 | 42 | return stub_client_buffer; | 41 | buffer = &stub_client_buffer; |
1911 | 43 | } | 42 | } |
1912 | 44 | 43 | std::shared_ptr<graphics::Buffer> lock_compositor_buffer(unsigned long) override | |
1913 | 45 | std::shared_ptr<graphics::Buffer> lock_compositor_buffer(unsigned long) | 44 | { |
1914 | 46 | { | 45 | return stub_compositor_buffer; |
1915 | 47 | return stub_compositor_buffer; | 46 | } |
1916 | 48 | } | 47 | |
1917 | 49 | 48 | std::shared_ptr<graphics::Buffer> lock_snapshot_buffer() override | |
1918 | 50 | std::shared_ptr<graphics::Buffer> lock_snapshot_buffer() | 49 | { |
1919 | 51 | { | 50 | return stub_compositor_buffer; |
1920 | 52 | return stub_compositor_buffer; | 51 | } |
1921 | 53 | } | 52 | |
1922 | 54 | 53 | MirPixelFormat get_stream_pixel_format() override | |
1923 | 55 | geometry::PixelFormat get_stream_pixel_format() | 54 | { |
1924 | 56 | { | 55 | return MirPixelFormat(); |
1925 | 57 | return geometry::PixelFormat(); | 56 | } |
1926 | 58 | } | 57 | |
1927 | 59 | 58 | geometry::Size stream_size() override | |
1907 | 60 | geometry::Size stream_size() | ||
1928 | 61 | { | 59 | { |
1929 | 62 | return geometry::Size(); | 60 | return geometry::Size(); |
1930 | 63 | } | 61 | } |
1931 | @@ -66,15 +64,15 @@ | |||
1932 | 66 | { | 64 | { |
1933 | 67 | } | 65 | } |
1934 | 68 | 66 | ||
1944 | 69 | void force_requests_to_complete() | 67 | void force_requests_to_complete() override |
1945 | 70 | { | 68 | { |
1946 | 71 | } | 69 | } |
1947 | 72 | 70 | ||
1948 | 73 | void allow_framedropping(bool) | 71 | void allow_framedropping(bool) override |
1949 | 74 | { | 72 | { |
1950 | 75 | } | 73 | } |
1951 | 76 | 74 | ||
1952 | 77 | std::shared_ptr<graphics::Buffer> stub_client_buffer; | 75 | StubBuffer stub_client_buffer; |
1953 | 78 | std::shared_ptr<graphics::Buffer> stub_compositor_buffer; | 76 | std::shared_ptr<graphics::Buffer> stub_compositor_buffer; |
1954 | 79 | }; | 77 | }; |
1955 | 80 | 78 | ||
1956 | 81 | 79 | ||
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 | 19 | #ifndef MIR_TEST_DOUBLES_STUB_DISPLAY_BUILDER_H_ | 19 | #ifndef MIR_TEST_DOUBLES_STUB_DISPLAY_BUILDER_H_ |
1962 | 20 | #define MIR_TEST_DOUBLES_STUB_DISPLAY_BUILDER_H_ | 20 | #define MIR_TEST_DOUBLES_STUB_DISPLAY_BUILDER_H_ |
1963 | 21 | 21 | ||
1965 | 22 | #include "src/server/graphics/android/display_builder.h" | 22 | #include "src/platform/graphics/android/display_builder.h" |
1966 | 23 | #include "stub_display_buffer.h" | 23 | #include "stub_display_buffer.h" |
1967 | 24 | #include "stub_display_device.h" | 24 | #include "stub_display_device.h" |
1968 | 25 | #include <gmock/gmock.h> | 25 | #include <gmock/gmock.h> |
1969 | @@ -52,9 +52,9 @@ | |||
1970 | 52 | { | 52 | { |
1971 | 53 | } | 53 | } |
1972 | 54 | 54 | ||
1974 | 55 | geometry::PixelFormat display_format() | 55 | MirPixelFormat display_format() |
1975 | 56 | { | 56 | { |
1977 | 57 | return geometry::PixelFormat::abgr_8888; | 57 | return mir_pixel_format_abgr_8888; |
1978 | 58 | } | 58 | } |
1979 | 59 | 59 | ||
1980 | 60 | std::unique_ptr<graphics::DisplayBuffer> create_display_buffer( | 60 | std::unique_ptr<graphics::DisplayBuffer> create_display_buffer( |
1981 | @@ -64,7 +64,7 @@ | |||
1982 | 64 | return std::unique_ptr<graphics::DisplayBuffer>( | 64 | return std::unique_ptr<graphics::DisplayBuffer>( |
1983 | 65 | new StubDisplayBuffer(geometry::Rectangle{{0,0},sz})); | 65 | new StubDisplayBuffer(geometry::Rectangle{{0,0},sz})); |
1984 | 66 | } | 66 | } |
1986 | 67 | 67 | ||
1987 | 68 | std::shared_ptr<graphics::android::DisplayDevice> create_display_device() | 68 | std::shared_ptr<graphics::android::DisplayDevice> create_display_device() |
1988 | 69 | { | 69 | { |
1989 | 70 | return stub_dev; | 70 | return stub_dev; |
1990 | 71 | 71 | ||
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 | 21 | 21 | ||
1996 | 22 | #include "mir/graphics/display_configuration.h" | 22 | #include "mir/graphics/display_configuration.h" |
1997 | 23 | #include "mir/geometry/rectangle.h" | 23 | #include "mir/geometry/rectangle.h" |
1999 | 24 | #include "mir/geometry/pixel_format.h" | 24 | #include "mir_toolkit/common.h" |
2000 | 25 | 25 | ||
2001 | 26 | #include <vector> | 26 | #include <vector> |
2002 | 27 | 27 | ||
2003 | @@ -43,15 +43,15 @@ | |||
2004 | 43 | StubDisplayConfig(unsigned int num_displays) | 43 | StubDisplayConfig(unsigned int num_displays) |
2005 | 44 | : StubDisplayConfig(num_displays, | 44 | : StubDisplayConfig(num_displays, |
2006 | 45 | { | 45 | { |
2010 | 46 | geometry::PixelFormat::bgr_888, | 46 | mir_pixel_format_bgr_888, |
2011 | 47 | geometry::PixelFormat::abgr_8888, | 47 | mir_pixel_format_abgr_8888, |
2012 | 48 | geometry::PixelFormat::xbgr_8888 | 48 | mir_pixel_format_xbgr_8888 |
2013 | 49 | }) | 49 | }) |
2014 | 50 | { | 50 | { |
2015 | 51 | } | 51 | } |
2016 | 52 | 52 | ||
2017 | 53 | StubDisplayConfig(unsigned int num_displays, | 53 | StubDisplayConfig(unsigned int num_displays, |
2019 | 54 | std::vector<geometry::PixelFormat> const& pfs) | 54 | std::vector<MirPixelFormat> const& pfs) |
2020 | 55 | { | 55 | { |
2021 | 56 | /* construct a non-trivial dummy display config to send */ | 56 | /* construct a non-trivial dummy display config to send */ |
2022 | 57 | int mode_index = 0; | 57 | int mode_index = 0; |
2023 | @@ -67,7 +67,7 @@ | |||
2024 | 67 | modes.push_back(mode); | 67 | modes.push_back(mode); |
2025 | 68 | } | 68 | } |
2026 | 69 | 69 | ||
2028 | 70 | size_t mode_index = modes.size() - 1; | 70 | size_t mode_index = modes.size() - 1; |
2029 | 71 | geometry::Size physical_size{}; | 71 | geometry::Size physical_size{}; |
2030 | 72 | geometry::Point top_left{}; | 72 | geometry::Point top_left{}; |
2031 | 73 | graphics::DisplayConfigurationOutput output{ | 73 | graphics::DisplayConfigurationOutput output{ |
2032 | @@ -105,7 +105,7 @@ | |||
2033 | 105 | graphics::DisplayConfigurationOutputId{id}, | 105 | graphics::DisplayConfigurationOutputId{id}, |
2034 | 106 | graphics::DisplayConfigurationCardId{0}, | 106 | graphics::DisplayConfigurationCardId{0}, |
2035 | 107 | graphics::DisplayConfigurationOutputType::vga, | 107 | graphics::DisplayConfigurationOutputType::vga, |
2037 | 108 | std::vector<geometry::PixelFormat>{geometry::PixelFormat::abgr_8888}, | 108 | std::vector<MirPixelFormat>{mir_pixel_format_abgr_8888}, |
2038 | 109 | {{rect.size, 60.0}}, | 109 | {{rect.size, 60.0}}, |
2039 | 110 | 0, geometry::Size{}, true, true, rect.top_left, 0, 0, mir_power_mode_on | 110 | 0, geometry::Size{}, true, true, rect.top_left, 0, 0, mir_power_mode_on |
2040 | 111 | }; | 111 | }; |
2041 | 112 | 112 | ||
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 | 18 | #ifndef MIR_TEST_DOUBLES_STUB_DISPLAY_DEVICE_H_ | 18 | #ifndef MIR_TEST_DOUBLES_STUB_DISPLAY_DEVICE_H_ |
2047 | 19 | #define MIR_TEST_DOUBLES_STUB_DISPLAY_DEVICE_H_ | 19 | #define MIR_TEST_DOUBLES_STUB_DISPLAY_DEVICE_H_ |
2048 | 20 | 20 | ||
2051 | 21 | #include "src/server/graphics/android/display_device.h" | 21 | #include "src/platform/graphics/android/display_device.h" |
2052 | 22 | 22 | ||
2053 | 23 | namespace mir | 23 | namespace mir |
2054 | 24 | { | 24 | { |
2055 | 25 | namespace test | 25 | namespace test |
2056 | @@ -41,7 +41,7 @@ | |||
2057 | 41 | void prepare_composition() | 41 | void prepare_composition() |
2058 | 42 | { | 42 | { |
2059 | 43 | } | 43 | } |
2061 | 44 | void gpu_render(EGLDisplay, EGLSurface) | 44 | void gpu_render(EGLDisplay, EGLSurface) |
2062 | 45 | { | 45 | { |
2063 | 46 | } | 46 | } |
2064 | 47 | void post(graphics::Buffer const&) | 47 | void post(graphics::Buffer const&) |
2065 | 48 | 48 | ||
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 | 49 | void driver_returns_buffer(ANativeWindowBuffer*, int) | 49 | void driver_returns_buffer(ANativeWindowBuffer*, int) |
2071 | 50 | { | 50 | { |
2072 | 51 | } | 51 | } |
2074 | 52 | void dispatch_driver_request_format(int) | 52 | void dispatch_driver_request_format(int) |
2075 | 53 | { | 53 | { |
2076 | 54 | } | 54 | } |
2077 | 55 | int driver_requests_info(int index) const | 55 | int driver_requests_info(int index) const |
2078 | 56 | 56 | ||
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 | 66 | void take_snapshot(shell::SnapshotCallback const&) override | 66 | void take_snapshot(shell::SnapshotCallback const&) override |
2084 | 67 | { | 67 | { |
2085 | 68 | } | 68 | } |
2087 | 69 | 69 | ||
2088 | 70 | std::shared_ptr<shell::Surface> default_surface() const override | 70 | std::shared_ptr<shell::Surface> default_surface() const override |
2089 | 71 | { | 71 | { |
2090 | 72 | return std::shared_ptr<shell::Surface>(); | 72 | return std::shared_ptr<shell::Surface>(); |
2091 | 73 | 73 | ||
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 | 1 | /* | ||
2097 | 2 | * Copyright © 2013 Canonical Ltd. | ||
2098 | 3 | * | ||
2099 | 4 | * This program is free software: you can redistribute it and/or modify it | ||
2100 | 5 | * under the terms of the GNU General Public License version 3, | ||
2101 | 6 | * as published by the Free Software Foundation. | ||
2102 | 7 | * | ||
2103 | 8 | * This program is distributed in the hope that it will be useful, | ||
2104 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
2105 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
2106 | 11 | * GNU General Public License for more details. | ||
2107 | 12 | * | ||
2108 | 13 | * You should have received a copy of the GNU General Public License | ||
2109 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
2110 | 15 | * | ||
2111 | 16 | * Authored by: Robert Carr <robert.carr@canonical.com> | ||
2112 | 17 | */ | ||
2113 | 18 | |||
2114 | 19 | #ifndef MIR_TEST_DOUBLES_STUB_SURFACE_H_ | ||
2115 | 20 | #define MIR_TEST_DOUBLES_STUB_SURFACE_H_ | ||
2116 | 21 | |||
2117 | 22 | #include "mir/frontend/surface.h" | ||
2118 | 23 | |||
2119 | 24 | namespace mir | ||
2120 | 25 | { | ||
2121 | 26 | namespace test | ||
2122 | 27 | { | ||
2123 | 28 | namespace doubles | ||
2124 | 29 | { | ||
2125 | 30 | |||
2126 | 31 | class StubSurface : public frontend::Surface | ||
2127 | 32 | { | ||
2128 | 33 | public: | ||
2129 | 34 | virtual ~StubSurface() = default; | ||
2130 | 35 | |||
2131 | 36 | void hide() {} | ||
2132 | 37 | void show() {} | ||
2133 | 38 | void force_requests_to_complete() {} | ||
2134 | 39 | |||
2135 | 40 | geometry::Size size() const | ||
2136 | 41 | { | ||
2137 | 42 | return geometry::Size(); | ||
2138 | 43 | } | ||
2139 | 44 | geometry::PixelFormat pixel_format() const | ||
2140 | 45 | { | ||
2141 | 46 | return geometry::PixelFormat(); | ||
2142 | 47 | } | ||
2143 | 48 | |||
2144 | 49 | std::shared_ptr<graphics::Buffer> advance_client_buffer() | ||
2145 | 50 | { | ||
2146 | 51 | return std::shared_ptr<graphics::Buffer>(); | ||
2147 | 52 | } | ||
2148 | 53 | |||
2149 | 54 | virtual int configure(MirSurfaceAttrib, int) | ||
2150 | 55 | { | ||
2151 | 56 | return 0; | ||
2152 | 57 | } | ||
2153 | 58 | |||
2154 | 59 | virtual bool supports_input() const | ||
2155 | 60 | { | ||
2156 | 61 | return false; | ||
2157 | 62 | } | ||
2158 | 63 | |||
2159 | 64 | virtual int client_input_fd() const | ||
2160 | 65 | { | ||
2161 | 66 | return 0; | ||
2162 | 67 | } | ||
2163 | 68 | }; | ||
2164 | 69 | |||
2165 | 70 | } | ||
2166 | 71 | } | ||
2167 | 72 | } // namespace mir | ||
2168 | 73 | |||
2169 | 74 | #endif // MIR_TEST_DOUBLES_STUB_SURFACE_H_ | ||
2170 | 75 | 0 | ||
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 | 21 | #define MIR_TEST_DOUBLES_STUB_SURFACE_BUILDER_H_ | 21 | #define MIR_TEST_DOUBLES_STUB_SURFACE_BUILDER_H_ |
2176 | 22 | 22 | ||
2177 | 23 | #include "src/server/scene/surface_builder.h" | 23 | #include "src/server/scene/surface_builder.h" |
2179 | 24 | #include "src/server/scene/surface.h" | 24 | #include "src/server/scene/basic_surface.h" |
2180 | 25 | #include "mir/scene/scene_report.h" | 25 | #include "mir/scene/scene_report.h" |
2181 | 26 | #include "mir/shell/surface_creation_parameters.h" | 26 | #include "mir/shell/surface_creation_parameters.h" |
2182 | 27 | 27 | ||
2183 | @@ -44,10 +44,10 @@ | |||
2184 | 44 | { | 44 | { |
2185 | 45 | } | 45 | } |
2186 | 46 | 46 | ||
2188 | 47 | std::weak_ptr<scene::BasicSurface> create_surface(shell::Session*, shell::SurfaceCreationParameters const&) | 47 | std::weak_ptr<scene::BasicSurface> create_surface(shell::SurfaceCreationParameters const&) |
2189 | 48 | { | 48 | { |
2190 | 49 | auto state = std::make_shared<MockSurfaceState>(); | 49 | auto state = std::make_shared<MockSurfaceState>(); |
2192 | 50 | dummy_surface = std::make_shared<scene::Surface>( | 50 | dummy_surface = std::make_shared<scene::BasicSurface>( |
2193 | 51 | state, buffer_stream, | 51 | state, buffer_stream, |
2194 | 52 | std::shared_ptr<input::InputChannel>(), | 52 | std::shared_ptr<input::InputChannel>(), |
2195 | 53 | report); | 53 | report); |
2196 | 54 | 54 | ||
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 | 17 | */ | 17 | */ |
2202 | 18 | 18 | ||
2203 | 19 | 19 | ||
2206 | 20 | #ifndef MIR_TEST_DOUBLES_STUB_SURFACE_CONTROLLER_H_ | 20 | #ifndef MIR_TEST_DOUBLES_STUB_SURFACE_RANKER_H_ |
2207 | 21 | #define MIR_TEST_DOUBLES_STUB_SURFACE_CONTROLLER_H_ | 21 | #define MIR_TEST_DOUBLES_STUB_SURFACE_RANKER_H_ |
2208 | 22 | 22 | ||
2210 | 23 | #include "mir/shell/surface_controller.h" | 23 | #include "src/server/scene/surface_ranker.h" |
2211 | 24 | 24 | ||
2212 | 25 | namespace mir | 25 | namespace mir |
2213 | 26 | { | 26 | { |
2214 | @@ -29,7 +29,7 @@ | |||
2215 | 29 | namespace doubles | 29 | namespace doubles |
2216 | 30 | { | 30 | { |
2217 | 31 | 31 | ||
2219 | 32 | struct StubSurfaceController : public shell::SurfaceController | 32 | struct StubSurfaceRanker : public scene::SurfaceRanker |
2220 | 33 | { | 33 | { |
2221 | 34 | void raise(std::weak_ptr<scene::BasicSurface> const&) override | 34 | void raise(std::weak_ptr<scene::BasicSurface> const&) override |
2222 | 35 | { | 35 | { |
2223 | @@ -41,4 +41,4 @@ | |||
2224 | 41 | } | 41 | } |
2225 | 42 | 42 | ||
2226 | 43 | 43 | ||
2228 | 44 | #endif /* MIR_TEST_DOUBLES_STUB_SURFACE_CONTROLLER_H_ */ | 44 | #endif /* MIR_TEST_DOUBLES_STUB_SURFACE_RANKER_H_ */ |
2229 | 45 | 45 | ||
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 | 45 | // Throws std::runtime_error if not successful. | 45 | // Throws std::runtime_error if not successful. |
2235 | 46 | unsigned int wait_for_signal_ready_for(const std::chrono::milliseconds& duration); | 46 | unsigned int wait_for_signal_ready_for(const std::chrono::milliseconds& duration); |
2236 | 47 | unsigned int wait_for_signal_ready_for(); | 47 | unsigned int wait_for_signal_ready_for(); |
2238 | 48 | 48 | ||
2239 | 49 | void signal_ready(); | 49 | void signal_ready(); |
2240 | 50 | unsigned int wait_for_signal_ready(); | 50 | unsigned int wait_for_signal_ready(); |
2241 | 51 | 51 | ||
2242 | 52 | 52 | ||
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 | 1 | /* | ||
2248 | 2 | * Copyright © 2013 Canonical Ltd. | ||
2249 | 3 | * | ||
2250 | 4 | * This program is free software: you can redistribute it and/or modify it | ||
2251 | 5 | * under the terms of the GNU General Public License version 3, | ||
2252 | 6 | * as published by the Free Software Foundation. | ||
2253 | 7 | * | ||
2254 | 8 | * This program is distributed in the hope that it will be useful, | ||
2255 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
2256 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
2257 | 11 | * GNU General Public License for more details. | ||
2258 | 12 | * | ||
2259 | 13 | * You should have received a copy of the GNU General Public License | ||
2260 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
2261 | 15 | * | ||
2262 | 16 | * Authored by: Robert Carr <robert.carr@canonical.com>n | ||
2263 | 17 | */ | ||
2264 | 18 | |||
2265 | 19 | #ifndef MIR_TEST_FRAMEWORK_INPUT_TESTING_CLIENT_CONFIGURATION | ||
2266 | 20 | #define MIR_TEST_FRAMEWORK_INPUT_TESTING_CLIENT_CONFIGURATION | ||
2267 | 21 | |||
2268 | 22 | #include "mir_test_framework/testing_client_configuration.h" | ||
2269 | 23 | #include "mir_test_framework/cross_process_sync.h" | ||
2270 | 24 | #include "mir_test/wait_condition.h" | ||
2271 | 25 | |||
2272 | 26 | #include <mir_toolkit/event.h> | ||
2273 | 27 | |||
2274 | 28 | #include <gmock/gmock.h> | ||
2275 | 29 | |||
2276 | 30 | #include <string> | ||
2277 | 31 | |||
2278 | 32 | namespace mir_test_framework | ||
2279 | 33 | { | ||
2280 | 34 | |||
2281 | 35 | /// A fixture to be used with InputTestingServerConfiguration for input acceptance testing scenarios. | ||
2282 | 36 | /// By default, the client will connect and a surface will be created. | ||
2283 | 37 | /// The framework ensures the server will not send events before client is ready through CrossProcessSync. | ||
2284 | 38 | class InputTestingClientConfiguration : public TestingClientConfiguration | ||
2285 | 39 | { | ||
2286 | 40 | public: | ||
2287 | 41 | InputTestingClientConfiguration(std::string const& client_name, CrossProcessSync const& input_cb_setup_fence); | ||
2288 | 42 | virtual ~InputTestingClientConfiguration() = default; | ||
2289 | 43 | |||
2290 | 44 | void exec(); | ||
2291 | 45 | |||
2292 | 46 | struct MockInputHandler | ||
2293 | 47 | { | ||
2294 | 48 | MOCK_METHOD1(handle_input, void(MirEvent const*)); | ||
2295 | 49 | }; | ||
2296 | 50 | // This function will be called at an appropriate time for input expectations to be set. | ||
2297 | 51 | // on handler. It is expected that mt::WakeUp(all_events_received) will be triggered by | ||
2298 | 52 | // the last expectation, as this is what triggers the verification of the Mock and | ||
2299 | 53 | // termination of the testing client. | ||
2300 | 54 | virtual void expect_input(MockInputHandler &handler, mir::test::WaitCondition& all_events_received) = 0; | ||
2301 | 55 | |||
2302 | 56 | // This fixture is intended to be used with InputTestingServer | ||
2303 | 57 | // which allows for setting surface sizes as part of the | ||
2304 | 58 | // input-testing shell. | ||
2305 | 59 | static int const surface_width = 100; | ||
2306 | 60 | static int const surface_height = 100; | ||
2307 | 61 | private: | ||
2308 | 62 | std::string const client_name; | ||
2309 | 63 | CrossProcessSync input_cb_setup_fence; | ||
2310 | 64 | }; | ||
2311 | 65 | |||
2312 | 66 | } | ||
2313 | 67 | #endif /* MIR_TEST_FRAMEWORK_INPUT_TESTING_CLIENT_CONFIGURATION */ | ||
2314 | 0 | 68 | ||
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 | 59 | 59 | ||
2320 | 60 | void exec(); | 60 | void exec(); |
2321 | 61 | void on_exit(); | 61 | void on_exit(); |
2323 | 62 | 62 | ||
2324 | 63 | std::shared_ptr<mir::input::InputConfiguration> the_input_configuration() override; | 63 | std::shared_ptr<mir::input::InputConfiguration> the_input_configuration() override; |
2325 | 64 | 64 | ||
2326 | 65 | mir::input::android::FakeEventHub* fake_event_hub; | 65 | mir::input::android::FakeEventHub* fake_event_hub; |
2327 | @@ -71,7 +71,7 @@ | |||
2328 | 71 | 71 | ||
2329 | 72 | private: | 72 | private: |
2330 | 73 | std::thread input_injection_thread; | 73 | std::thread input_injection_thread; |
2332 | 74 | 74 | ||
2333 | 75 | std::shared_ptr<mir::test::doubles::FakeEventHubInputConfiguration> input_configuration; | 75 | std::shared_ptr<mir::test::doubles::FakeEventHubInputConfiguration> input_configuration; |
2334 | 76 | }; | 76 | }; |
2335 | 77 | 77 | ||
2336 | 78 | 78 | ||
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 | 36 | virtual bool use_real_graphics(mir::options::Option const& options) | 36 | virtual bool use_real_graphics(mir::options::Option const& options) |
2342 | 37 | { | 37 | { |
2343 | 38 | return options.get("tests-use-real-graphics", false); | 38 | return options.get("tests-use-real-graphics", false); |
2345 | 39 | } | 39 | } |
2346 | 40 | }; | 40 | }; |
2347 | 41 | 41 | ||
2348 | 42 | } | 42 | } |
2349 | 43 | 43 | ||
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 | 12 | cmake --build ${BUILD_DIR} | 12 | cmake --build ${BUILD_DIR} |
2355 | 13 | 13 | ||
2356 | 14 | GTEST_OUTPUT=xml:./ | 14 | GTEST_OUTPUT=xml:./ |
2360 | 15 | ${BUILD_DIR}/bin/acceptance-tests | 15 | ${BUILD_DIR}/bin/mir_acceptance_tests |
2361 | 16 | ${BUILD_DIR}/bin/integration-tests | 16 | ${BUILD_DIR}/bin/mir_integration_tests |
2362 | 17 | ${BUILD_DIR}/bin/unit-tests | 17 | ${BUILD_DIR}/bin/mir_unit_tests |
2363 | 18 | 18 | ||
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 | 50 | ) | 50 | ) |
2369 | 51 | endif() | 51 | endif() |
2370 | 52 | 52 | ||
2372 | 53 | if( MIR_PLATFORM STREQUAL "gbm") | 53 | if( MIR_PLATFORM STREQUAL "mesa") |
2373 | 54 | set( | 54 | set( |
2374 | 55 | CLIENT_SOURCES | 55 | CLIENT_SOURCES |
2375 | 56 | 56 | ||
2381 | 57 | gbm/gbm_client_platform.cpp | 57 | mesa/client_platform.cpp |
2382 | 58 | gbm/gbm_client_buffer_factory.cpp | 58 | mesa/client_buffer_factory.cpp |
2383 | 59 | gbm/gbm_client_buffer.cpp | 59 | mesa/client_buffer.cpp |
2384 | 60 | gbm/mesa_native_display_container.cpp | 60 | mesa/mesa_native_display_container.cpp |
2385 | 61 | gbm/gbm_native_surface.cpp | 61 | mesa/native_surface.cpp |
2386 | 62 | ${CLIENT_SOURCES} | 62 | ${CLIENT_SOURCES} |
2387 | 63 | ) | 63 | ) |
2388 | 64 | endif() | 64 | endif() |
2389 | 65 | 65 | ||
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 | 30 | { | 30 | { |
2395 | 31 | public: | 31 | public: |
2396 | 32 | AgingBuffer(); | 32 | AgingBuffer(); |
2397 | 33 | ~AgingBuffer() noexcept {} | ||
2398 | 34 | 33 | ||
2399 | 35 | virtual uint32_t age() const; | 34 | virtual uint32_t age() const; |
2400 | 36 | virtual void increment_age(); | 35 | virtual void increment_age(); |
2401 | 37 | 36 | ||
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 | 29 | 29 | ||
2407 | 30 | mcla::AndroidClientBuffer::AndroidClientBuffer(std::shared_ptr<AndroidRegistrar> const& registrar, | 30 | mcla::AndroidClientBuffer::AndroidClientBuffer(std::shared_ptr<AndroidRegistrar> const& registrar, |
2408 | 31 | std::shared_ptr<const native_handle_t> const& handle, | 31 | std::shared_ptr<const native_handle_t> const& handle, |
2410 | 32 | geom::Size size, geom::PixelFormat pf, geometry::Stride stride) | 32 | geom::Size size, MirPixelFormat pf, geometry::Stride stride) |
2411 | 33 | : buffer_registrar(registrar), | 33 | : buffer_registrar(registrar), |
2412 | 34 | native_handle(handle), | 34 | native_handle(handle), |
2413 | 35 | buffer_pf(pf), buffer_stride{stride}, buffer_size(size) | 35 | buffer_pf(pf), buffer_stride{stride}, buffer_size(size) |
2414 | @@ -48,7 +48,7 @@ | |||
2415 | 48 | //note: mir uses stride in bytes, ANativeWindowBuffer needs it in pixel units. some drivers care | 48 | //note: mir uses stride in bytes, ANativeWindowBuffer needs it in pixel units. some drivers care |
2416 | 49 | //about byte-stride, they will pass stride via ANativeWindowBuffer::handle (which is opaque to us) | 49 | //about byte-stride, they will pass stride via ANativeWindowBuffer::handle (which is opaque to us) |
2417 | 50 | anwb->stride = stride.as_uint32_t() / | 50 | anwb->stride = stride.as_uint32_t() / |
2419 | 51 | geom::bytes_per_pixel(buffer_pf); | 51 | MIR_BYTES_PER_PIXEL(buffer_pf); |
2420 | 52 | anwb->usage = GRALLOC_USAGE_HW_TEXTURE | GRALLOC_USAGE_HW_RENDER; | 52 | anwb->usage = GRALLOC_USAGE_HW_TEXTURE | GRALLOC_USAGE_HW_RENDER; |
2421 | 53 | anwb->handle = native_handle.get(); | 53 | anwb->handle = native_handle.get(); |
2422 | 54 | 54 | ||
2423 | @@ -82,7 +82,7 @@ | |||
2424 | 82 | return buffer_stride; | 82 | return buffer_stride; |
2425 | 83 | } | 83 | } |
2426 | 84 | 84 | ||
2428 | 85 | geom::PixelFormat mcla::AndroidClientBuffer::pixel_format() const | 85 | MirPixelFormat mcla::AndroidClientBuffer::pixel_format() const |
2429 | 86 | { | 86 | { |
2430 | 87 | return buffer_pf; | 87 | return buffer_pf; |
2431 | 88 | } | 88 | } |
2432 | 89 | 89 | ||
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 | 39 | public: | 39 | public: |
2438 | 40 | AndroidClientBuffer(std::shared_ptr<AndroidRegistrar> const&, | 40 | AndroidClientBuffer(std::shared_ptr<AndroidRegistrar> const&, |
2439 | 41 | std::shared_ptr<const native_handle_t> const&, | 41 | std::shared_ptr<const native_handle_t> const&, |
2441 | 42 | geometry::Size size, geometry::PixelFormat pf, geometry::Stride stride); | 42 | geometry::Size size, MirPixelFormat pf, geometry::Stride stride); |
2442 | 43 | ~AndroidClientBuffer() noexcept; | 43 | ~AndroidClientBuffer() noexcept; |
2443 | 44 | 44 | ||
2444 | 45 | std::shared_ptr<MemoryRegion> secure_for_cpu_write(); | 45 | std::shared_ptr<MemoryRegion> secure_for_cpu_write(); |
2445 | 46 | geometry::Size size() const; | 46 | geometry::Size size() const; |
2446 | 47 | geometry::Stride stride() const; | 47 | geometry::Stride stride() const; |
2448 | 48 | geometry::PixelFormat pixel_format() const; | 48 | MirPixelFormat pixel_format() const; |
2449 | 49 | std::shared_ptr<mir::graphics::NativeBuffer> native_buffer_handle() const; | 49 | std::shared_ptr<mir::graphics::NativeBuffer> native_buffer_handle() const; |
2450 | 50 | 50 | ||
2451 | 51 | AndroidClientBuffer(const AndroidClientBuffer&) = delete; | 51 | AndroidClientBuffer(const AndroidClientBuffer&) = delete; |
2452 | @@ -56,7 +56,7 @@ | |||
2453 | 56 | std::shared_ptr<AndroidRegistrar> buffer_registrar; | 56 | std::shared_ptr<AndroidRegistrar> buffer_registrar; |
2454 | 57 | std::shared_ptr<graphics::android::AndroidNativeBuffer> native_window_buffer; | 57 | std::shared_ptr<graphics::android::AndroidNativeBuffer> native_window_buffer; |
2455 | 58 | std::shared_ptr<const native_handle_t> native_handle; | 58 | std::shared_ptr<const native_handle_t> native_handle; |
2457 | 59 | const geometry::PixelFormat buffer_pf; | 59 | const MirPixelFormat buffer_pf; |
2458 | 60 | geometry::Stride const buffer_stride; | 60 | geometry::Stride const buffer_stride; |
2459 | 61 | geometry::Size const buffer_size; | 61 | geometry::Size const buffer_size; |
2460 | 62 | }; | 62 | }; |
2461 | 63 | 63 | ||
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 | 29 | { | 29 | { |
2467 | 30 | } | 30 | } |
2468 | 31 | 31 | ||
2470 | 32 | std::shared_ptr<mcl::ClientBuffer> mcla::AndroidClientBufferFactory::create_buffer(std::shared_ptr<MirBufferPackage> const& package, geom::Size size, geom::PixelFormat pf) | 32 | std::shared_ptr<mcl::ClientBuffer> mcla::AndroidClientBufferFactory::create_buffer(std::shared_ptr<MirBufferPackage> const& package, geom::Size size, MirPixelFormat pf) |
2471 | 33 | { | 33 | { |
2472 | 34 | (void)size; // TODO: remove this unused parameter | 34 | (void)size; // TODO: remove this unused parameter |
2473 | 35 | auto handle = registrar->register_buffer(package); | 35 | auto handle = registrar->register_buffer(package); |
2474 | 36 | 36 | ||
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 | 23 | #include <memory> | 23 | #include <memory> |
2480 | 24 | 24 | ||
2481 | 25 | #include "mir_toolkit/mir_client_library.h" | 25 | #include "mir_toolkit/mir_client_library.h" |
2483 | 26 | #include "mir/geometry/pixel_format.h" | 26 | #include "mir_toolkit/common.h" |
2484 | 27 | #include "mir/geometry/size.h" | 27 | #include "mir/geometry/size.h" |
2485 | 28 | 28 | ||
2486 | 29 | #include "../client_buffer_factory.h" | 29 | #include "../client_buffer_factory.h" |
2487 | @@ -44,7 +44,7 @@ | |||
2488 | 44 | explicit AndroidClientBufferFactory(std::shared_ptr<AndroidRegistrar> const&); | 44 | explicit AndroidClientBufferFactory(std::shared_ptr<AndroidRegistrar> const&); |
2489 | 45 | 45 | ||
2490 | 46 | virtual std::shared_ptr<ClientBuffer> create_buffer(std::shared_ptr<MirBufferPackage> const& package, | 46 | virtual std::shared_ptr<ClientBuffer> create_buffer(std::shared_ptr<MirBufferPackage> const& package, |
2492 | 47 | geometry::Size size, geometry::PixelFormat pf); | 47 | geometry::Size size, MirPixelFormat pf); |
2493 | 48 | private: | 48 | private: |
2494 | 49 | std::shared_ptr<AndroidRegistrar> registrar; | 49 | std::shared_ptr<AndroidRegistrar> registrar; |
2495 | 50 | }; | 50 | }; |
2496 | 51 | 51 | ||
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 | 105 | 105 | ||
2502 | 106 | MirPlatformType mcla::AndroidClientPlatform::platform_type() const | 106 | MirPlatformType mcla::AndroidClientPlatform::platform_type() const |
2503 | 107 | { | 107 | { |
2505 | 108 | return mir_platform_type_android; | 108 | return mir_platform_type_android; |
2506 | 109 | } | 109 | } |
2508 | 110 | 110 | ||
2509 | 111 | MirNativeBuffer* mcla::AndroidClientPlatform::convert_native_buffer(graphics::NativeBuffer* buf) const | 111 | MirNativeBuffer* mcla::AndroidClientPlatform::convert_native_buffer(graphics::NativeBuffer* buf) const |
2510 | 112 | { | 112 | { |
2511 | 113 | return buf->anwb(); | 113 | return buf->anwb(); |
2512 | 114 | 114 | ||
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 | 32 | class AndroidClientPlatform : public ClientPlatform | 32 | class AndroidClientPlatform : public ClientPlatform |
2518 | 33 | { | 33 | { |
2519 | 34 | public: | 34 | public: |
2521 | 35 | MirPlatformType platform_type() const; | 35 | MirPlatformType platform_type() const; |
2522 | 36 | std::shared_ptr<ClientBufferFactory> create_buffer_factory(); | 36 | std::shared_ptr<ClientBufferFactory> create_buffer_factory(); |
2523 | 37 | std::shared_ptr<EGLNativeWindowType> create_egl_native_window(ClientSurface *surface); | 37 | std::shared_ptr<EGLNativeWindowType> create_egl_native_window(ClientSurface *surface); |
2524 | 38 | std::shared_ptr<EGLNativeDisplayType> create_egl_native_display(); | 38 | std::shared_ptr<EGLNativeDisplayType> create_egl_native_display(); |
2525 | 39 | 39 | ||
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 | 75 | std::shared_ptr<MirBufferPackage> const& package) const | 75 | std::shared_ptr<MirBufferPackage> const& package) const |
2531 | 76 | { | 76 | { |
2532 | 77 | int native_handle_header_size = sizeof(native_handle_t); | 77 | int native_handle_header_size = sizeof(native_handle_t); |
2534 | 78 | int total_size = sizeof(int) * | 78 | int total_size = sizeof(int) * |
2535 | 79 | (package->fd_items + package->data_items + native_handle_header_size); | 79 | (package->fd_items + package->data_items + native_handle_header_size); |
2536 | 80 | native_handle_t* handle = static_cast<native_handle_t*>(::operator new(total_size)); | 80 | native_handle_t* handle = static_cast<native_handle_t*>(::operator new(total_size)); |
2537 | 81 | handle->version = native_handle_header_size; | 81 | handle->version = native_handle_header_size; |
2538 | 82 | 82 | ||
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 | 20 | #ifndef MIR_CLIENT_ANDROID_ANDROID_REGISTRAR_GRALLOC_H_ | 20 | #ifndef MIR_CLIENT_ANDROID_ANDROID_REGISTRAR_GRALLOC_H_ |
2544 | 21 | #define MIR_CLIENT_ANDROID_ANDROID_REGISTRAR_GRALLOC_H_ | 21 | #define MIR_CLIENT_ANDROID_ANDROID_REGISTRAR_GRALLOC_H_ |
2545 | 22 | 22 | ||
2547 | 23 | #include "mir/geometry/pixel_format.h" | 23 | #include "mir_toolkit/common.h" |
2548 | 24 | #include "android_registrar.h" | 24 | #include "android_registrar.h" |
2549 | 25 | #include <hardware/gralloc.h> | 25 | #include <hardware/gralloc.h> |
2550 | 26 | 26 | ||
2551 | 27 | 27 | ||
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 | 29 | : surface(surface), | 29 | : surface(surface), |
2557 | 30 | driver_pixel_format(-1), | 30 | driver_pixel_format(-1), |
2558 | 31 | sync_ops(std::make_shared<mga::RealSyncFileOps>()) | 31 | sync_ops(std::make_shared<mga::RealSyncFileOps>()) |
2560 | 32 | 32 | ||
2561 | 33 | { | 33 | { |
2562 | 34 | } | 34 | } |
2563 | 35 | 35 | ||
2564 | 36 | 36 | ||
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 | 30 | { | 30 | { |
2570 | 31 | class SyncFileOps; | 31 | class SyncFileOps; |
2571 | 32 | } | 32 | } |
2573 | 33 | } | 33 | } |
2574 | 34 | namespace client | 34 | namespace client |
2575 | 35 | { | 35 | { |
2576 | 36 | namespace android | 36 | namespace android |
2577 | 37 | 37 | ||
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 | 22 | 22 | ||
2583 | 23 | #include "mir/graphics/native_buffer.h" | 23 | #include "mir/graphics/native_buffer.h" |
2584 | 24 | #include "mir_toolkit/common.h" | 24 | #include "mir_toolkit/common.h" |
2585 | 25 | #include "mir/geometry/pixel_format.h" | ||
2586 | 26 | #include "mir/geometry/size.h" | 25 | #include "mir/geometry/size.h" |
2587 | 27 | 26 | ||
2588 | 28 | #include <memory> | 27 | #include <memory> |
2589 | @@ -46,7 +45,7 @@ | |||
2590 | 46 | geometry::Width width; | 45 | geometry::Width width; |
2591 | 47 | geometry::Height height; | 46 | geometry::Height height; |
2592 | 48 | geometry::Stride stride; | 47 | geometry::Stride stride; |
2594 | 49 | geometry::PixelFormat format; | 48 | MirPixelFormat format; |
2595 | 50 | std::shared_ptr<char> vaddr; | 49 | std::shared_ptr<char> vaddr; |
2596 | 51 | }; | 50 | }; |
2597 | 52 | 51 | ||
2598 | @@ -54,14 +53,20 @@ | |||
2599 | 54 | { | 53 | { |
2600 | 55 | public: | 54 | public: |
2601 | 56 | virtual ~ClientBuffer() = default; | 55 | virtual ~ClientBuffer() = default; |
2602 | 56 | |||
2603 | 57 | virtual std::shared_ptr<MemoryRegion> secure_for_cpu_write() = 0; | 57 | virtual std::shared_ptr<MemoryRegion> secure_for_cpu_write() = 0; |
2604 | 58 | virtual geometry::Size size() const = 0; | 58 | virtual geometry::Size size() const = 0; |
2605 | 59 | virtual geometry::Stride stride() const = 0; | 59 | virtual geometry::Stride stride() const = 0; |
2607 | 60 | virtual geometry::PixelFormat pixel_format() const = 0; | 60 | virtual MirPixelFormat pixel_format() const = 0; |
2608 | 61 | virtual uint32_t age() const = 0; | 61 | virtual uint32_t age() const = 0; |
2609 | 62 | virtual void increment_age() = 0; | 62 | virtual void increment_age() = 0; |
2610 | 63 | virtual void mark_as_submitted() = 0; | 63 | virtual void mark_as_submitted() = 0; |
2611 | 64 | virtual std::shared_ptr<graphics::NativeBuffer> native_buffer_handle() const = 0; | 64 | virtual std::shared_ptr<graphics::NativeBuffer> native_buffer_handle() const = 0; |
2612 | 65 | |||
2613 | 66 | protected: | ||
2614 | 67 | ClientBuffer() = default; | ||
2615 | 68 | ClientBuffer(ClientBuffer const&) = delete; | ||
2616 | 69 | ClientBuffer& operator=(ClientBuffer const&) = delete; | ||
2617 | 65 | }; | 70 | }; |
2618 | 66 | 71 | ||
2619 | 67 | } | 72 | } |
2620 | 68 | 73 | ||
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 | 33 | { | 33 | { |
2626 | 34 | } | 34 | } |
2627 | 35 | 35 | ||
2629 | 36 | void mcl::ClientBufferDepository::deposit_package(std::shared_ptr<MirBufferPackage> const& package, int id, geometry::Size size, geometry::PixelFormat pf) | 36 | void mcl::ClientBufferDepository::deposit_package(std::shared_ptr<MirBufferPackage> const& package, int id, geometry::Size size, MirPixelFormat pf) |
2630 | 37 | { | 37 | { |
2631 | 38 | auto existing_buffer_id_pair = buffers.end(); | 38 | auto existing_buffer_id_pair = buffers.end(); |
2632 | 39 | for (auto pair = buffers.begin(); pair != buffers.end(); ++pair) | 39 | for (auto pair = buffers.begin(); pair != buffers.end(); ++pair) |
2633 | 40 | 40 | ||
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 | 23 | #include <list> | 23 | #include <list> |
2639 | 24 | #include <memory> | 24 | #include <memory> |
2640 | 25 | 25 | ||
2642 | 26 | #include "mir/geometry/pixel_format.h" | 26 | #include "mir_toolkit/common.h" |
2643 | 27 | #include "mir/geometry/size.h" | 27 | #include "mir/geometry/size.h" |
2644 | 28 | 28 | ||
2645 | 29 | namespace mir | 29 | namespace mir |
2646 | @@ -59,7 +59,7 @@ | |||
2647 | 59 | /// This also marks the previous current buffer (if any) as being submitted to the server. | 59 | /// This also marks the previous current buffer (if any) as being submitted to the server. |
2648 | 60 | /// \post current_buffer() will return a ClientBuffer constructed from this IPC data. | 60 | /// \post current_buffer() will return a ClientBuffer constructed from this IPC data. |
2649 | 61 | void deposit_package(std::shared_ptr<MirBufferPackage> const&, int id, | 61 | void deposit_package(std::shared_ptr<MirBufferPackage> const&, int id, |
2651 | 62 | geometry::Size, geometry::PixelFormat); | 62 | geometry::Size, MirPixelFormat); |
2652 | 63 | std::shared_ptr<ClientBuffer> current_buffer(); | 63 | std::shared_ptr<ClientBuffer> current_buffer(); |
2653 | 64 | uint32_t current_buffer_id() const; | 64 | uint32_t current_buffer_id() const; |
2654 | 65 | 65 | ||
2655 | 66 | 66 | ||
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 | 23 | #include <memory> | 23 | #include <memory> |
2661 | 24 | 24 | ||
2662 | 25 | #include "mir_toolkit/mir_client_library.h" | 25 | #include "mir_toolkit/mir_client_library.h" |
2664 | 26 | #include "mir/geometry/pixel_format.h" | 26 | #include "mir_toolkit/common.h" |
2665 | 27 | #include "mir/geometry/size.h" | 27 | #include "mir/geometry/size.h" |
2666 | 28 | 28 | ||
2667 | 29 | namespace mir | 29 | namespace mir |
2668 | @@ -46,7 +46,7 @@ | |||
2669 | 46 | * \param [in] pf the buffer's pixel format | 46 | * \param [in] pf the buffer's pixel format |
2670 | 47 | */ | 47 | */ |
2671 | 48 | virtual std::shared_ptr<ClientBuffer> create_buffer(std::shared_ptr<MirBufferPackage> const& package, | 48 | virtual std::shared_ptr<ClientBuffer> create_buffer(std::shared_ptr<MirBufferPackage> const& package, |
2673 | 49 | geometry::Size size, geometry::PixelFormat pf) = 0; | 49 | geometry::Size size, MirPixelFormat pf) = 0; |
2674 | 50 | 50 | ||
2675 | 51 | protected: | 51 | protected: |
2676 | 52 | ClientBufferFactory() = default; | 52 | ClientBufferFactory() = default; |
2677 | 53 | 53 | ||
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 | 46 | 46 | ||
2683 | 47 | virtual ~ClientPlatform() { /* TODO: make nothrow */ } | 47 | virtual ~ClientPlatform() { /* TODO: make nothrow */ } |
2684 | 48 | 48 | ||
2686 | 49 | virtual MirPlatformType platform_type() const = 0; | 49 | virtual MirPlatformType platform_type() const = 0; |
2687 | 50 | virtual std::shared_ptr<ClientBufferFactory> create_buffer_factory() = 0; | 50 | virtual std::shared_ptr<ClientBufferFactory> create_buffer_factory() = 0; |
2688 | 51 | virtual std::shared_ptr<EGLNativeWindowType> create_egl_native_window(ClientSurface *surface) = 0; | 51 | virtual std::shared_ptr<EGLNativeWindowType> create_egl_native_window(ClientSurface *surface) = 0; |
2689 | 52 | virtual std::shared_ptr<EGLNativeDisplayType> create_egl_native_display() = 0; | 52 | virtual std::shared_ptr<EGLNativeDisplayType> create_egl_native_display() = 0; |
2690 | 53 | 53 | ||
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 | 128 | { | 128 | { |
2696 | 129 | auto val_raw = getenv("MIR_CLIENT_INPUT_RECEIVER_REPORT"); | 129 | auto val_raw = getenv("MIR_CLIENT_INPUT_RECEIVER_REPORT"); |
2697 | 130 | std::string const val{val_raw ? val_raw : off_opt_val}; | 130 | std::string const val{val_raw ? val_raw : off_opt_val}; |
2699 | 131 | 131 | ||
2700 | 132 | if (val == log_opt_val) | 132 | if (val == log_opt_val) |
2701 | 133 | return std::make_shared<mcl::logging::InputReceiverReport>(the_logger()); | 133 | return std::make_shared<mcl::logging::InputReceiverReport>(the_logger()); |
2702 | 134 | else | 134 | else |
2703 | 135 | 135 | ||
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 | 48 | { | 48 | { |
2709 | 49 | num_modes = num_modes_; | 49 | num_modes = num_modes_; |
2710 | 50 | modes = new MirDisplayMode[num_modes]; | 50 | modes = new MirDisplayMode[num_modes]; |
2713 | 51 | 51 | ||
2714 | 52 | num_output_formats = num_formats; | 52 | num_output_formats = num_formats; |
2715 | 53 | output_formats = new MirPixelFormat[num_formats]; | 53 | output_formats = new MirPixelFormat[num_formats]; |
2716 | 54 | } | 54 | } |
2717 | 55 | 55 | ||
2718 | @@ -77,8 +77,8 @@ | |||
2719 | 77 | for (auto i = 0u; i < output.num_modes; i++) | 77 | for (auto i = 0u; i < output.num_modes; i++) |
2720 | 78 | { | 78 | { |
2721 | 79 | auto mode = msg.mode(i); | 79 | auto mode = msg.mode(i); |
2724 | 80 | output.modes[i].horizontal_resolution = mode.horizontal_resolution(); | 80 | output.modes[i].horizontal_resolution = mode.horizontal_resolution(); |
2725 | 81 | output.modes[i].vertical_resolution = mode.vertical_resolution(); | 81 | output.modes[i].vertical_resolution = mode.vertical_resolution(); |
2726 | 82 | output.modes[i].refresh_rate = mode.refresh_rate(); | 82 | output.modes[i].refresh_rate = mode.refresh_rate(); |
2727 | 83 | } | 83 | } |
2728 | 84 | output.preferred_mode = msg.preferred_mode(); | 84 | output.preferred_mode = msg.preferred_mode(); |
2729 | @@ -161,7 +161,7 @@ | |||
2730 | 161 | { | 161 | { |
2731 | 162 | auto new_info = &new_config->outputs[i]; | 162 | auto new_info = &new_config->outputs[i]; |
2732 | 163 | MirDisplayOutput* output = outputs[i].get(); | 163 | MirDisplayOutput* output = outputs[i].get(); |
2734 | 164 | std::memcpy(new_info, output, sizeof(MirDisplayOutput)); | 164 | std::memcpy(new_info, output, sizeof(MirDisplayOutput)); |
2735 | 165 | 165 | ||
2736 | 166 | new_info->output_formats = new MirPixelFormat[new_info->num_output_formats]; | 166 | new_info->output_formats = new MirPixelFormat[new_info->num_output_formats]; |
2737 | 167 | auto format_size = sizeof(MirPixelFormat) * new_info->num_output_formats; | 167 | auto format_size = sizeof(MirPixelFormat) * new_info->num_output_formats; |
2738 | 168 | 168 | ||
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 | 16 | * Authored by: Robert Carr <robert.carr@canonical.com> | 16 | * Authored by: Robert Carr <robert.carr@canonical.com> |
2744 | 17 | */ | 17 | */ |
2745 | 18 | 18 | ||
2748 | 19 | #ifndef MIR_CLIENT_GBM_EGL_NATIVE_DISPLAY_CONTAINER_H_ | 19 | #ifndef MIR_CLIENT_EGL_NATIVE_DISPLAY_CONTAINER_H_ |
2749 | 20 | #define MIR_CLIENT_GBM_EGL_NATIVE_DISPLAY_CONTAINER_H_ | 20 | #define MIR_CLIENT_EGL_NATIVE_DISPLAY_CONTAINER_H_ |
2750 | 21 | 21 | ||
2751 | 22 | #include "mir_toolkit/client_types.h" | 22 | #include "mir_toolkit/client_types.h" |
2752 | 23 | 23 | ||
2753 | @@ -47,4 +47,4 @@ | |||
2754 | 47 | } | 47 | } |
2755 | 48 | } // namespace mir | 48 | } // namespace mir |
2756 | 49 | 49 | ||
2758 | 50 | #endif // MIR_CLIENT_GBM_EGL_NATIVE_DISPLAY_CONTAINER_H_ | 50 | #endif // MIR_CLIENT_EGL_NATIVE_DISPLAY_CONTAINER_H_ |
2759 | 51 | 51 | ||
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 | 118 | std::stringstream ss; | 118 | std::stringstream ss; |
2765 | 119 | 119 | ||
2766 | 120 | ss << "Received event:" << std::endl; | 120 | ss << "Received event:" << std::endl; |
2768 | 121 | 121 | ||
2769 | 122 | format_event(ss, event); | 122 | format_event(ss, event); |
2770 | 123 | 123 | ||
2771 | 124 | logger->log<ml::Logger::debug>(ss.str(), component); | 124 | logger->log<ml::Logger::debug>(ss.str(), component); |
2772 | 125 | 125 | ||
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 | 16 | * Authored by: Alexandros Frantzis <alexandros.frantzis@canonical.com> | 16 | * Authored by: Alexandros Frantzis <alexandros.frantzis@canonical.com> |
2779 | 17 | */ | 17 | */ |
2780 | 18 | 18 | ||
2783 | 19 | #ifndef MIR_CLIENT_GBM_DRM_FD_HANDLER_ | 19 | #ifndef MIR_CLIENT_MESA_BUFFER_FILE_OPS_ |
2784 | 20 | #define MIR_CLIENT_GBM_DRM_FD_HANDLER_ | 20 | #define MIR_CLIENT_MESA_BUFFER_FILE_OPS_ |
2785 | 21 | 21 | ||
2786 | 22 | #include <sys/types.h> | 22 | #include <sys/types.h> |
2787 | 23 | 23 | ||
2788 | @@ -25,28 +25,26 @@ | |||
2789 | 25 | { | 25 | { |
2790 | 26 | namespace client | 26 | namespace client |
2791 | 27 | { | 27 | { |
2793 | 28 | namespace gbm | 28 | namespace mesa |
2794 | 29 | { | 29 | { |
2795 | 30 | 30 | ||
2797 | 31 | class DRMFDHandler | 31 | class BufferFileOps |
2798 | 32 | { | 32 | { |
2799 | 33 | public: | 33 | public: |
2801 | 34 | virtual ~DRMFDHandler() {} | 34 | virtual ~BufferFileOps() = default; |
2802 | 35 | 35 | ||
2808 | 36 | virtual int ioctl(unsigned long request, void* arg) = 0; | 36 | virtual int close(int fd) const = 0; |
2809 | 37 | virtual int primeFDToHandle(int prime_fd, uint32_t *handle) = 0; | 37 | virtual void* map(int fd, off_t offset, size_t size) const = 0; |
2810 | 38 | virtual int close(int fd) = 0; | 38 | virtual void unmap(void* addr, size_t size) const = 0; |
2806 | 39 | virtual void* map(size_t size, off_t offset) = 0; | ||
2807 | 40 | virtual void unmap(void* addr, size_t size) = 0; | ||
2811 | 41 | 39 | ||
2812 | 42 | protected: | 40 | protected: |
2816 | 43 | DRMFDHandler() = default; | 41 | BufferFileOps() = default; |
2817 | 44 | DRMFDHandler(const DRMFDHandler&) = delete; | 42 | BufferFileOps(BufferFileOps const&) = delete; |
2818 | 45 | DRMFDHandler& operator=(const DRMFDHandler&) = delete; | 43 | BufferFileOps& operator=(BufferFileOps const&) = delete; |
2819 | 46 | }; | 44 | }; |
2820 | 47 | 45 | ||
2821 | 48 | } | 46 | } |
2822 | 49 | } | 47 | } |
2823 | 50 | } | 48 | } |
2824 | 51 | 49 | ||
2826 | 52 | #endif /* MIR_CLIENT_GBM_DRM_FD_HANDLER_ */ | 50 | #endif /* MIR_CLIENT_MESA_BUFFER_FILE_OPS_ */ |
2827 | 53 | 51 | ||
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 | 17 | */ | 17 | */ |
2833 | 18 | 18 | ||
2834 | 19 | #include "mir_toolkit/mir_client_library.h" | 19 | #include "mir_toolkit/mir_client_library.h" |
2837 | 20 | #include "gbm_client_buffer.h" | 20 | #include "client_buffer.h" |
2838 | 21 | #include "drm_fd_handler.h" | 21 | #include "buffer_file_ops.h" |
2839 | 22 | 22 | ||
2840 | 23 | #include <boost/exception/errinfo_errno.hpp> | 23 | #include <boost/exception/errinfo_errno.hpp> |
2841 | 24 | #include <boost/throw_exception.hpp> | 24 | #include <boost/throw_exception.hpp> |
2842 | 25 | 25 | ||
2843 | 26 | #include <stdexcept> | 26 | #include <stdexcept> |
2844 | 27 | 27 | ||
2845 | 28 | #include <xf86drm.h> | ||
2846 | 29 | #include <string.h> | ||
2847 | 30 | #include <errno.h> | 28 | #include <errno.h> |
2848 | 31 | #include <sys/mman.h> | 29 | #include <sys/mman.h> |
2849 | 32 | 30 | ||
2850 | 33 | namespace mcl=mir::client; | 31 | namespace mcl=mir::client; |
2852 | 34 | namespace mclg=mir::client::gbm; | 32 | namespace mclm=mir::client::mesa; |
2853 | 35 | namespace geom=mir::geometry; | 33 | namespace geom=mir::geometry; |
2854 | 36 | 34 | ||
2855 | 37 | namespace | 35 | namespace |
2856 | 38 | { | 36 | { |
2857 | 39 | 37 | ||
2858 | 40 | struct GEMHandle | ||
2859 | 41 | { | ||
2860 | 42 | GEMHandle(std::shared_ptr<mclg::DRMFDHandler> const& drm_fd_handler, | ||
2861 | 43 | int prime_fd) | ||
2862 | 44 | : drm_fd_handler{drm_fd_handler} | ||
2863 | 45 | { | ||
2864 | 46 | int ret = drm_fd_handler->primeFDToHandle(prime_fd, &handle); | ||
2865 | 47 | if (ret) | ||
2866 | 48 | { | ||
2867 | 49 | std::string msg("Failed to import PRIME fd for DRM buffer"); | ||
2868 | 50 | BOOST_THROW_EXCEPTION( | ||
2869 | 51 | boost::enable_error_info( | ||
2870 | 52 | std::runtime_error(msg)) << boost::errinfo_errno(errno)); | ||
2871 | 53 | } | ||
2872 | 54 | } | ||
2873 | 55 | |||
2874 | 56 | ~GEMHandle() | ||
2875 | 57 | { | ||
2876 | 58 | struct drm_gem_close arg; | ||
2877 | 59 | arg.handle = handle; | ||
2878 | 60 | // TODO (@raof): Error reporting? I do not believe it should be possible for this to fail, | ||
2879 | 61 | // so if it does we should probably flag it. | ||
2880 | 62 | drm_fd_handler->ioctl(DRM_IOCTL_GEM_CLOSE, &arg); | ||
2881 | 63 | } | ||
2882 | 64 | |||
2883 | 65 | std::shared_ptr<mclg::DRMFDHandler> const drm_fd_handler; | ||
2884 | 66 | uint32_t handle; | ||
2885 | 67 | }; | ||
2886 | 68 | |||
2887 | 69 | struct NullDeleter | 38 | struct NullDeleter |
2888 | 70 | { | 39 | { |
2889 | 71 | void operator()(char *) const {} | 40 | void operator()(char *) const {} |
2890 | 72 | }; | 41 | }; |
2891 | 73 | 42 | ||
2893 | 74 | struct GBMMemoryRegion : mcl::MemoryRegion | 43 | struct ShmMemoryRegion : mcl::MemoryRegion |
2894 | 75 | { | 44 | { |
2900 | 76 | GBMMemoryRegion(std::shared_ptr<mclg::DRMFDHandler> const& drm_fd_handler, | 45 | ShmMemoryRegion(std::shared_ptr<mclm::BufferFileOps> const& buffer_file_ops, |
2901 | 77 | int prime_fd, geom::Size const& size_param, | 46 | int buffer_fd, geom::Size const& size_param, |
2902 | 78 | geom::Stride stride_param, geom::PixelFormat format_param) | 47 | geom::Stride stride_param, MirPixelFormat format_param) |
2903 | 79 | : drm_fd_handler{drm_fd_handler}, | 48 | : buffer_file_ops{buffer_file_ops}, |
2899 | 80 | gem_handle{drm_fd_handler, prime_fd}, | ||
2904 | 81 | size_in_bytes{size_param.height.as_uint32_t() * stride_param.as_uint32_t()} | 49 | size_in_bytes{size_param.height.as_uint32_t() * stride_param.as_uint32_t()} |
2905 | 82 | { | 50 | { |
2906 | 51 | static off_t const map_offset = 0; | ||
2907 | 83 | width = size_param.width; | 52 | width = size_param.width; |
2908 | 84 | height = size_param.height; | 53 | height = size_param.height; |
2909 | 85 | stride = stride_param; | 54 | stride = stride_param; |
2910 | 86 | format = format_param; | 55 | format = format_param; |
2911 | 87 | 56 | ||
2926 | 88 | struct drm_mode_map_dumb map_dumb; | 57 | void* map = buffer_file_ops->map(buffer_fd, map_offset, size_in_bytes); |
2913 | 89 | memset(&map_dumb, 0, sizeof(map_dumb)); | ||
2914 | 90 | map_dumb.handle = gem_handle.handle; | ||
2915 | 91 | |||
2916 | 92 | int ret = drm_fd_handler->ioctl(DRM_IOCTL_MODE_MAP_DUMB, &map_dumb); | ||
2917 | 93 | if (ret) | ||
2918 | 94 | { | ||
2919 | 95 | std::string msg("Failed to map dumb DRM buffer"); | ||
2920 | 96 | BOOST_THROW_EXCEPTION( | ||
2921 | 97 | boost::enable_error_info( | ||
2922 | 98 | std::runtime_error(msg)) << boost::errinfo_errno(errno)); | ||
2923 | 99 | } | ||
2924 | 100 | |||
2925 | 101 | void* map = drm_fd_handler->map(size_in_bytes, map_dumb.offset); | ||
2927 | 102 | if (map == MAP_FAILED) | 58 | if (map == MAP_FAILED) |
2928 | 103 | { | 59 | { |
2930 | 104 | std::string msg("Failed to mmap DRM buffer"); | 60 | std::string msg("Failed to mmap buffer"); |
2931 | 105 | BOOST_THROW_EXCEPTION( | 61 | BOOST_THROW_EXCEPTION( |
2932 | 106 | boost::enable_error_info( | 62 | boost::enable_error_info( |
2933 | 107 | std::runtime_error(msg)) << boost::errinfo_errno(errno)); | 63 | std::runtime_error(msg)) << boost::errinfo_errno(errno)); |
2934 | @@ -110,63 +66,62 @@ | |||
2935 | 110 | vaddr = std::shared_ptr<char>(static_cast<char*>(map), NullDeleter()); | 66 | vaddr = std::shared_ptr<char>(static_cast<char*>(map), NullDeleter()); |
2936 | 111 | } | 67 | } |
2937 | 112 | 68 | ||
2939 | 113 | ~GBMMemoryRegion() | 69 | ~ShmMemoryRegion() |
2940 | 114 | { | 70 | { |
2942 | 115 | drm_fd_handler->unmap(vaddr.get(), size_in_bytes); | 71 | buffer_file_ops->unmap(vaddr.get(), size_in_bytes); |
2943 | 116 | } | 72 | } |
2944 | 117 | 73 | ||
2947 | 118 | std::shared_ptr<mclg::DRMFDHandler> const drm_fd_handler; | 74 | std::shared_ptr<mclm::BufferFileOps> const buffer_file_ops; |
2946 | 119 | GEMHandle const gem_handle; | ||
2948 | 120 | size_t const size_in_bytes; | 75 | size_t const size_in_bytes; |
2949 | 121 | }; | 76 | }; |
2950 | 122 | 77 | ||
2951 | 123 | } | 78 | } |
2952 | 124 | 79 | ||
2959 | 125 | mclg::GBMClientBuffer::GBMClientBuffer( | 80 | mclm::ClientBuffer::ClientBuffer( |
2960 | 126 | std::shared_ptr<mclg::DRMFDHandler> const& drm_fd_handler, | 81 | std::shared_ptr<mclm::BufferFileOps> const& buffer_file_ops, |
2961 | 127 | std::shared_ptr<MirBufferPackage> const& package, | 82 | std::shared_ptr<MirBufferPackage> const& package, |
2962 | 128 | geom::Size size, geom::PixelFormat pf) | 83 | geom::Size size, MirPixelFormat pf) |
2963 | 129 | : drm_fd_handler{drm_fd_handler}, | 84 | : buffer_file_ops{buffer_file_ops}, |
2964 | 130 | creation_package(std::move(package)), | 85 | creation_package{package}, |
2965 | 131 | rect({geom::Point{0, 0}, size}), | 86 | rect({geom::Point{0, 0}, size}), |
2966 | 132 | buffer_pf{pf} | 87 | buffer_pf{pf} |
2967 | 133 | { | 88 | { |
2968 | 134 | } | 89 | } |
2969 | 135 | 90 | ||
2971 | 136 | mclg::GBMClientBuffer::~GBMClientBuffer() noexcept | 91 | mclm::ClientBuffer::~ClientBuffer() noexcept |
2972 | 137 | { | 92 | { |
2973 | 138 | // TODO (@raof): Error reporting? It should not be possible for this to fail; if it does, | 93 | // TODO (@raof): Error reporting? It should not be possible for this to fail; if it does, |
2974 | 139 | // something's seriously wrong. | 94 | // something's seriously wrong. |
2976 | 140 | drm_fd_handler->close(creation_package->fd[0]); | 95 | buffer_file_ops->close(creation_package->fd[0]); |
2977 | 141 | } | 96 | } |
2978 | 142 | 97 | ||
2980 | 143 | std::shared_ptr<mcl::MemoryRegion> mclg::GBMClientBuffer::secure_for_cpu_write() | 98 | std::shared_ptr<mcl::MemoryRegion> mclm::ClientBuffer::secure_for_cpu_write() |
2981 | 144 | { | 99 | { |
2983 | 145 | const int prime_fd = creation_package->fd[0]; | 100 | int const buffer_fd = creation_package->fd[0]; |
2984 | 146 | 101 | ||
2987 | 147 | return std::make_shared<GBMMemoryRegion>(drm_fd_handler, | 102 | return std::make_shared<ShmMemoryRegion>(buffer_file_ops, |
2988 | 148 | prime_fd, | 103 | buffer_fd, |
2989 | 149 | size(), | 104 | size(), |
2990 | 150 | stride(), | 105 | stride(), |
2991 | 151 | pixel_format()); | 106 | pixel_format()); |
2992 | 152 | } | 107 | } |
2993 | 153 | 108 | ||
2995 | 154 | geom::Size mclg::GBMClientBuffer::size() const | 109 | geom::Size mclm::ClientBuffer::size() const |
2996 | 155 | { | 110 | { |
2997 | 156 | return rect.size; | 111 | return rect.size; |
2998 | 157 | } | 112 | } |
2999 | 158 | 113 | ||
3001 | 159 | geom::Stride mclg::GBMClientBuffer::stride() const | 114 | geom::Stride mclm::ClientBuffer::stride() const |
3002 | 160 | { | 115 | { |
3003 | 161 | return geom::Stride{creation_package->stride}; | 116 | return geom::Stride{creation_package->stride}; |
3004 | 162 | } | 117 | } |
3005 | 163 | 118 | ||
3007 | 164 | geom::PixelFormat mclg::GBMClientBuffer::pixel_format() const | 119 | MirPixelFormat mclm::ClientBuffer::pixel_format() const |
3008 | 165 | { | 120 | { |
3009 | 166 | return buffer_pf; | 121 | return buffer_pf; |
3010 | 167 | } | 122 | } |
3011 | 168 | 123 | ||
3013 | 169 | std::shared_ptr<MirNativeBuffer> mclg::GBMClientBuffer::native_buffer_handle() const | 124 | std::shared_ptr<MirNativeBuffer> mclm::ClientBuffer::native_buffer_handle() const |
3014 | 170 | { | 125 | { |
3015 | 171 | creation_package->age = age(); | 126 | creation_package->age = age(); |
3016 | 172 | return creation_package; | 127 | return creation_package; |
3017 | 173 | 128 | ||
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 | 17 | * Kevin DuBois <kevin.dubois@canonical.com> | 17 | * Kevin DuBois <kevin.dubois@canonical.com> |
3023 | 18 | */ | 18 | */ |
3024 | 19 | 19 | ||
3027 | 20 | #ifndef MIR_CLIENT_GBM_GBM_CLIENT_BUFFER_H_ | 20 | #ifndef MIR_CLIENT_MESA_CLIENT_BUFFER_H_ |
3028 | 21 | #define MIR_CLIENT_GBM_GBM_CLIENT_BUFFER_H_ | 21 | #define MIR_CLIENT_MESA_CLIENT_BUFFER_H_ |
3029 | 22 | 22 | ||
3030 | 23 | #include "../aging_buffer.h" | 23 | #include "../aging_buffer.h" |
3031 | 24 | #include "mir_toolkit/mir_client_library.h" | 24 | #include "mir_toolkit/mir_client_library.h" |
3032 | @@ -30,37 +30,35 @@ | |||
3033 | 30 | { | 30 | { |
3034 | 31 | namespace client | 31 | namespace client |
3035 | 32 | { | 32 | { |
3037 | 33 | namespace gbm | 33 | namespace mesa |
3038 | 34 | { | 34 | { |
3039 | 35 | 35 | ||
3041 | 36 | class DRMFDHandler; | 36 | class BufferFileOps; |
3042 | 37 | 37 | ||
3044 | 38 | class GBMClientBuffer : public AgingBuffer | 38 | class ClientBuffer : public AgingBuffer |
3045 | 39 | { | 39 | { |
3046 | 40 | public: | 40 | public: |
3051 | 41 | GBMClientBuffer(std::shared_ptr<DRMFDHandler> const& drm_fd_handler, | 41 | ClientBuffer(std::shared_ptr<BufferFileOps> const& buffer_file_ops, |
3052 | 42 | std::shared_ptr<MirBufferPackage> const& buffer_package, | 42 | std::shared_ptr<MirBufferPackage> const& buffer_package, |
3053 | 43 | geometry::Size size, | 43 | geometry::Size size, |
3054 | 44 | geometry::PixelFormat pf); | 44 | MirPixelFormat pf); |
3055 | 45 | 45 | ||
3057 | 46 | virtual ~GBMClientBuffer() noexcept; | 46 | ~ClientBuffer() noexcept; |
3058 | 47 | 47 | ||
3059 | 48 | std::shared_ptr<MemoryRegion> secure_for_cpu_write(); | 48 | std::shared_ptr<MemoryRegion> secure_for_cpu_write(); |
3060 | 49 | geometry::Size size() const; | 49 | geometry::Size size() const; |
3061 | 50 | geometry::Stride stride() const; | 50 | geometry::Stride stride() const; |
3063 | 51 | geometry::PixelFormat pixel_format() const; | 51 | MirPixelFormat pixel_format() const; |
3064 | 52 | std::shared_ptr<MirNativeBuffer> native_buffer_handle() const; | 52 | std::shared_ptr<MirNativeBuffer> native_buffer_handle() const; |
3065 | 53 | 53 | ||
3066 | 54 | GBMClientBuffer(const GBMClientBuffer&) = delete; | ||
3067 | 55 | GBMClientBuffer& operator=(const GBMClientBuffer&) = delete; | ||
3068 | 56 | private: | 54 | private: |
3073 | 57 | const std::shared_ptr<DRMFDHandler> drm_fd_handler; | 55 | std::shared_ptr<BufferFileOps> const buffer_file_ops; |
3074 | 58 | const std::shared_ptr<MirBufferPackage> creation_package; | 56 | std::shared_ptr<MirBufferPackage> const creation_package; |
3075 | 59 | const geometry::Rectangle rect; | 57 | geometry::Rectangle const rect; |
3076 | 60 | const geometry::PixelFormat buffer_pf; | 58 | MirPixelFormat const buffer_pf; |
3077 | 61 | }; | 59 | }; |
3078 | 62 | 60 | ||
3079 | 63 | } | 61 | } |
3080 | 64 | } | 62 | } |
3081 | 65 | } | 63 | } |
3083 | 66 | #endif /* MIR_CLIENT_GBM_GBM_CLIENT_BUFFER_H_ */ | 64 | #endif /* MIR_CLIENT_MESA_CLIENT_BUFFER_H_ */ |
3084 | 67 | 65 | ||
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 | 17 | * Christopher James Halse Rogers <christopher.halse.rogers@canonical.com> | 17 | * Christopher James Halse Rogers <christopher.halse.rogers@canonical.com> |
3090 | 18 | */ | 18 | */ |
3091 | 19 | 19 | ||
3094 | 20 | #include "gbm_client_buffer_factory.h" | 20 | #include "client_buffer_factory.h" |
3095 | 21 | #include "gbm_client_buffer.h" | 21 | #include "client_buffer.h" |
3096 | 22 | 22 | ||
3097 | 23 | namespace mcl=mir::client; | 23 | namespace mcl=mir::client; |
3099 | 24 | namespace mclg=mir::client::gbm; | 24 | namespace mclm=mir::client::mesa; |
3100 | 25 | 25 | ||
3104 | 26 | mclg::GBMClientBufferFactory::GBMClientBufferFactory( | 26 | mclm::ClientBufferFactory::ClientBufferFactory( |
3105 | 27 | std::shared_ptr<DRMFDHandler> const& drm_fd_handler) | 27 | std::shared_ptr<BufferFileOps> const& buffer_file_ops) |
3106 | 28 | : drm_fd_handler{drm_fd_handler} | 28 | : buffer_file_ops{buffer_file_ops} |
3107 | 29 | { | 29 | { |
3108 | 30 | } | 30 | } |
3109 | 31 | 31 | ||
3111 | 32 | std::shared_ptr<mcl::ClientBuffer> mclg::GBMClientBufferFactory::create_buffer(std::shared_ptr<MirBufferPackage> const& package, geometry::Size size, geometry::PixelFormat pf) | 32 | std::shared_ptr<mcl::ClientBuffer> |
3112 | 33 | mclm::ClientBufferFactory::create_buffer( | ||
3113 | 34 | std::shared_ptr<MirBufferPackage> const& package, | ||
3114 | 35 | geometry::Size size, | ||
3115 | 36 | MirPixelFormat pf) | ||
3116 | 33 | { | 37 | { |
3117 | 34 | (void)size; // TODO: remove this unused parameter | 38 | (void)size; // TODO: remove this unused parameter |
3120 | 35 | return std::make_shared<mclg::GBMClientBuffer>( | 39 | return std::make_shared<mclm::ClientBuffer>( |
3121 | 36 | drm_fd_handler, | 40 | buffer_file_ops, |
3122 | 37 | package, | 41 | package, |
3123 | 38 | geometry::Size{package->width, package->height}, | 42 | geometry::Size{package->width, package->height}, |
3124 | 39 | pf); | 43 | pf); |
3125 | 40 | 44 | ||
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 | 17 | * Christopher James Halse Rogers <christopher.halse.rogers@canonical.com> | 17 | * Christopher James Halse Rogers <christopher.halse.rogers@canonical.com> |
3131 | 18 | */ | 18 | */ |
3132 | 19 | 19 | ||
3135 | 20 | #ifndef MIR_CLIENT_GBM_GBM_CLIENT_BUFFER_FACTORY_H_ | 20 | #ifndef MIR_CLIENT_MESA_CLIENT_BUFFER_FACTORY_H_ |
3136 | 21 | #define MIR_CLIENT_GBM_GBM_CLIENT_BUFFER_FACTORY_H_ | 21 | #define MIR_CLIENT_MESA_CLIENT_BUFFER_FACTORY_H_ |
3137 | 22 | 22 | ||
3138 | 23 | #include "../client_buffer_factory.h" | 23 | #include "../client_buffer_factory.h" |
3139 | 24 | #include "gbm_client_buffer.h" | ||
3140 | 25 | 24 | ||
3141 | 26 | namespace mir | 25 | namespace mir |
3142 | 27 | { | 26 | { |
3143 | 28 | namespace client | 27 | namespace client |
3144 | 29 | { | 28 | { |
3148 | 30 | class ClientBuffer; | 29 | namespace mesa |
3146 | 31 | |||
3147 | 32 | namespace gbm | ||
3149 | 33 | { | 30 | { |
3150 | 34 | 31 | ||
3152 | 35 | class DRMFDHandler; | 32 | class BufferFileOps; |
3153 | 36 | 33 | ||
3155 | 37 | class GBMClientBufferFactory : public ClientBufferFactory | 34 | class ClientBufferFactory : public client::ClientBufferFactory |
3156 | 38 | { | 35 | { |
3157 | 39 | public: | 36 | public: |
3159 | 40 | explicit GBMClientBufferFactory(std::shared_ptr<DRMFDHandler> const& drm_fd_handler); | 37 | explicit ClientBufferFactory(std::shared_ptr<BufferFileOps> const& buffer_file_ops); |
3160 | 41 | 38 | ||
3163 | 42 | std::shared_ptr<ClientBuffer> create_buffer(std::shared_ptr<MirBufferPackage> const& package, | 39 | std::shared_ptr<client::ClientBuffer> create_buffer( |
3164 | 43 | geometry::Size size, geometry::PixelFormat pf); | 40 | std::shared_ptr<MirBufferPackage> const& package, |
3165 | 41 | geometry::Size size, MirPixelFormat pf); | ||
3166 | 44 | private: | 42 | private: |
3168 | 45 | std::shared_ptr<DRMFDHandler> drm_fd_handler; | 43 | std::shared_ptr<BufferFileOps> const buffer_file_ops; |
3169 | 46 | }; | 44 | }; |
3170 | 47 | 45 | ||
3171 | 48 | } | 46 | } |
3172 | 49 | } | 47 | } |
3173 | 50 | } | 48 | } |
3175 | 51 | #endif /* MIR_CLIENT_GBM_GBM_CLIENT_BUFFER_FACTORY_H_ */ | 49 | #endif /* MIR_CLIENT_MESA_CLIENT_BUFFER_FACTORY_H_ */ |
3176 | 52 | 50 | ||
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 | 17 | */ | 17 | */ |
3182 | 18 | 18 | ||
3183 | 19 | #include "mir_toolkit/mir_client_library.h" | 19 | #include "mir_toolkit/mir_client_library.h" |
3186 | 20 | #include "gbm_client_platform.h" | 20 | #include "client_platform.h" |
3187 | 21 | #include "gbm_client_buffer_factory.h" | 21 | #include "client_buffer_factory.h" |
3188 | 22 | #include "mesa_native_display_container.h" | 22 | #include "mesa_native_display_container.h" |
3191 | 23 | #include "drm_fd_handler.h" | 23 | #include "buffer_file_ops.h" |
3192 | 24 | #include "gbm_native_surface.h" | 24 | #include "native_surface.h" |
3193 | 25 | #include "../mir_connection.h" | 25 | #include "../mir_connection.h" |
3194 | 26 | #include "../client_buffer_factory.h" | 26 | #include "../client_buffer_factory.h" |
3195 | 27 | #include "../native_client_platform_factory.h" | 27 | #include "../native_client_platform_factory.h" |
3196 | 28 | 28 | ||
3197 | 29 | #include <xf86drm.h> | ||
3198 | 30 | #include <sys/mman.h> | 29 | #include <sys/mman.h> |
3199 | 31 | #include <unistd.h> | 30 | #include <unistd.h> |
3200 | 32 | 31 | ||
3201 | 33 | namespace mcl=mir::client; | 32 | namespace mcl=mir::client; |
3203 | 34 | namespace mclg=mir::client::gbm; | 33 | namespace mclm=mir::client::mesa; |
3204 | 35 | namespace geom=mir::geometry; | 34 | namespace geom=mir::geometry; |
3205 | 36 | 35 | ||
3206 | 37 | namespace | 36 | namespace |
3207 | 38 | { | 37 | { |
3208 | 39 | 38 | ||
3210 | 40 | class RealDRMFDHandler : public mclg::DRMFDHandler | 39 | struct RealBufferFileOps : public mclm::BufferFileOps |
3211 | 41 | { | 40 | { |
3228 | 42 | public: | 41 | int close(int fd) const |
3213 | 43 | RealDRMFDHandler(int drm_fd) : drm_fd{drm_fd} | ||
3214 | 44 | { | ||
3215 | 45 | } | ||
3216 | 46 | |||
3217 | 47 | int ioctl(unsigned long request, void* arg) | ||
3218 | 48 | { | ||
3219 | 49 | return drmIoctl(drm_fd, request, arg); | ||
3220 | 50 | } | ||
3221 | 51 | |||
3222 | 52 | int primeFDToHandle(int prime_fd, uint32_t *handle) | ||
3223 | 53 | { | ||
3224 | 54 | return drmPrimeFDToHandle(drm_fd, prime_fd, handle); | ||
3225 | 55 | } | ||
3226 | 56 | |||
3227 | 57 | int close(int fd) | ||
3229 | 58 | { | 42 | { |
3230 | 59 | while (::close(fd) == -1) | 43 | while (::close(fd) == -1) |
3231 | 60 | { | 44 | { |
3232 | @@ -65,19 +49,16 @@ | |||
3233 | 65 | return 0; | 49 | return 0; |
3234 | 66 | } | 50 | } |
3235 | 67 | 51 | ||
3237 | 68 | void* map(size_t size, off_t offset) | 52 | void* map(int fd, off_t offset, size_t size) const |
3238 | 69 | { | 53 | { |
3241 | 70 | return mmap(0, size, PROT_READ | PROT_WRITE, MAP_SHARED, | 54 | return mmap(nullptr, size, PROT_READ | PROT_WRITE, MAP_SHARED, |
3242 | 71 | drm_fd, offset); | 55 | fd, offset); |
3243 | 72 | } | 56 | } |
3244 | 73 | 57 | ||
3246 | 74 | void unmap(void* addr, size_t size) | 58 | void unmap(void* addr, size_t size) const |
3247 | 75 | { | 59 | { |
3248 | 76 | munmap(addr, size); | 60 | munmap(addr, size); |
3249 | 77 | } | 61 | } |
3250 | 78 | |||
3251 | 79 | private: | ||
3252 | 80 | int drm_fd; | ||
3253 | 81 | }; | 62 | }; |
3254 | 82 | 63 | ||
3255 | 83 | struct NativeDisplayDeleter | 64 | struct NativeDisplayDeleter |
3256 | @@ -101,40 +82,31 @@ | |||
3257 | 101 | std::shared_ptr<mcl::ClientPlatform> | 82 | std::shared_ptr<mcl::ClientPlatform> |
3258 | 102 | mcl::NativeClientPlatformFactory::create_client_platform(mcl::ClientContext* context) | 83 | mcl::NativeClientPlatformFactory::create_client_platform(mcl::ClientContext* context) |
3259 | 103 | { | 84 | { |
3272 | 104 | MirPlatformPackage platform_package; | 85 | auto buffer_file_ops = std::make_shared<RealBufferFileOps>(); |
3273 | 105 | 86 | return std::make_shared<mclm::ClientPlatform>( | |
3274 | 106 | memset(&platform_package, 0, sizeof(platform_package)); | 87 | context, buffer_file_ops, mcl::EGLNativeDisplayContainer::instance()); |
3263 | 107 | context->populate(platform_package); | ||
3264 | 108 | |||
3265 | 109 | int drm_fd = -1; | ||
3266 | 110 | |||
3267 | 111 | if (platform_package.fd_items > 0) | ||
3268 | 112 | drm_fd = platform_package.fd[0]; | ||
3269 | 113 | |||
3270 | 114 | auto drm_fd_handler = std::make_shared<RealDRMFDHandler>(drm_fd); | ||
3271 | 115 | return std::make_shared<mclg::GBMClientPlatform>(context, drm_fd_handler, mcl::EGLNativeDisplayContainer::instance()); | ||
3275 | 116 | } | 88 | } |
3276 | 117 | 89 | ||
3278 | 118 | mclg::GBMClientPlatform::GBMClientPlatform( | 90 | mclm::ClientPlatform::ClientPlatform( |
3279 | 119 | ClientContext* const context, | 91 | ClientContext* const context, |
3281 | 120 | std::shared_ptr<DRMFDHandler> const& drm_fd_handler, | 92 | std::shared_ptr<BufferFileOps> const& buffer_file_ops, |
3282 | 121 | mcl::EGLNativeDisplayContainer& display_container) | 93 | mcl::EGLNativeDisplayContainer& display_container) |
3283 | 122 | : context{context}, | 94 | : context{context}, |
3285 | 123 | drm_fd_handler{drm_fd_handler}, | 95 | buffer_file_ops{buffer_file_ops}, |
3286 | 124 | display_container(display_container) | 96 | display_container(display_container) |
3287 | 125 | { | 97 | { |
3288 | 126 | } | 98 | } |
3289 | 127 | 99 | ||
3291 | 128 | std::shared_ptr<mcl::ClientBufferFactory> mclg::GBMClientPlatform::create_buffer_factory() | 100 | std::shared_ptr<mcl::ClientBufferFactory> mclm::ClientPlatform::create_buffer_factory() |
3292 | 129 | { | 101 | { |
3294 | 130 | return std::make_shared<mclg::GBMClientBufferFactory>(drm_fd_handler); | 102 | return std::make_shared<mclm::ClientBufferFactory>(buffer_file_ops); |
3295 | 131 | } | 103 | } |
3296 | 132 | 104 | ||
3297 | 133 | namespace | 105 | namespace |
3298 | 134 | { | 106 | { |
3299 | 135 | struct NativeWindowDeleter | 107 | struct NativeWindowDeleter |
3300 | 136 | { | 108 | { |
3302 | 137 | NativeWindowDeleter(mclg::GBMNativeSurface* window) | 109 | NativeWindowDeleter(mclm::NativeSurface* window) |
3303 | 138 | : window(window) {} | 110 | : window(window) {} |
3304 | 139 | 111 | ||
3305 | 140 | void operator()(EGLNativeWindowType* type) | 112 | void operator()(EGLNativeWindowType* type) |
3306 | @@ -144,21 +116,21 @@ | |||
3307 | 144 | } | 116 | } |
3308 | 145 | 117 | ||
3309 | 146 | private: | 118 | private: |
3311 | 147 | mclg::GBMNativeSurface* window; | 119 | mclm::NativeSurface* window; |
3312 | 148 | }; | 120 | }; |
3313 | 149 | } | 121 | } |
3314 | 150 | 122 | ||
3316 | 151 | std::shared_ptr<EGLNativeWindowType> mclg::GBMClientPlatform::create_egl_native_window(ClientSurface* client_surface) | 123 | std::shared_ptr<EGLNativeWindowType> mclm::ClientPlatform::create_egl_native_window(ClientSurface* client_surface) |
3317 | 152 | { | 124 | { |
3318 | 153 | //TODO: this is awkward on both android and gbm... | 125 | //TODO: this is awkward on both android and gbm... |
3320 | 154 | auto gbm_window = new GBMNativeSurface(*client_surface); | 126 | auto native_window = new NativeSurface(*client_surface); |
3321 | 155 | auto egl_native_window = new EGLNativeWindowType; | 127 | auto egl_native_window = new EGLNativeWindowType; |
3324 | 156 | *egl_native_window = gbm_window; | 128 | *egl_native_window = native_window; |
3325 | 157 | NativeWindowDeleter deleter(gbm_window); | 129 | NativeWindowDeleter deleter(native_window); |
3326 | 158 | return std::shared_ptr<EGLNativeWindowType>(egl_native_window, deleter); | 130 | return std::shared_ptr<EGLNativeWindowType>(egl_native_window, deleter); |
3327 | 159 | } | 131 | } |
3328 | 160 | 132 | ||
3330 | 161 | std::shared_ptr<EGLNativeDisplayType> mclg::GBMClientPlatform::create_egl_native_display() | 133 | std::shared_ptr<EGLNativeDisplayType> mclm::ClientPlatform::create_egl_native_display() |
3331 | 162 | { | 134 | { |
3332 | 163 | MirEGLNativeDisplayType *mir_native_display = new MirEGLNativeDisplayType; | 135 | MirEGLNativeDisplayType *mir_native_display = new MirEGLNativeDisplayType; |
3333 | 164 | *mir_native_display = display_container.create(context->mir_connection()); | 136 | *mir_native_display = display_container.create(context->mir_connection()); |
3334 | @@ -167,12 +139,12 @@ | |||
3335 | 167 | return std::shared_ptr<EGLNativeDisplayType>(egl_native_display, NativeDisplayDeleter(display_container)); | 139 | return std::shared_ptr<EGLNativeDisplayType>(egl_native_display, NativeDisplayDeleter(display_container)); |
3336 | 168 | } | 140 | } |
3337 | 169 | 141 | ||
3339 | 170 | MirPlatformType mclg::GBMClientPlatform::platform_type() const | 142 | MirPlatformType mclm::ClientPlatform::platform_type() const |
3340 | 171 | { | 143 | { |
3343 | 172 | return mir_platform_type_gbm; | 144 | return mir_platform_type_gbm; |
3344 | 173 | } | 145 | } |
3345 | 174 | 146 | ||
3347 | 175 | MirNativeBuffer* mclg::GBMClientPlatform::convert_native_buffer(graphics::NativeBuffer* buf) const | 147 | MirNativeBuffer* mclm::ClientPlatform::convert_native_buffer(graphics::NativeBuffer* buf) const |
3348 | 176 | { | 148 | { |
3349 | 177 | //MirNativeBuffer is type-compatible with the MirNativeBuffer | 149 | //MirNativeBuffer is type-compatible with the MirNativeBuffer |
3350 | 178 | return buf; | 150 | return buf; |
3351 | 179 | 151 | ||
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 | 15 | * | 15 | * |
3357 | 16 | * Authored by: Kevin DuBois <kevin.dubois@canonical.com> | 16 | * Authored by: Kevin DuBois <kevin.dubois@canonical.com> |
3358 | 17 | */ | 17 | */ |
3361 | 18 | #ifndef MIR_CLIENT_GBM_GBM_CLIENT_PLATFORM_H_ | 18 | #ifndef MIR_CLIENT_MESA_CLIENT_PLATFORM_H_ |
3362 | 19 | #define MIR_CLIENT_GBM_GBM_CLIENT_PLATFORM_H_ | 19 | #define MIR_CLIENT_MESA_CLIENT_PLATFORM_H_ |
3363 | 20 | 20 | ||
3364 | 21 | #include "../client_platform.h" | 21 | #include "../client_platform.h" |
3365 | 22 | 22 | ||
3366 | @@ -27,19 +27,19 @@ | |||
3367 | 27 | class ClientBufferDepository; | 27 | class ClientBufferDepository; |
3368 | 28 | class EGLNativeDisplayContainer; | 28 | class EGLNativeDisplayContainer; |
3369 | 29 | 29 | ||
3371 | 30 | namespace gbm | 30 | namespace mesa |
3372 | 31 | { | 31 | { |
3373 | 32 | 32 | ||
3375 | 33 | class DRMFDHandler; | 33 | class BufferFileOps; |
3376 | 34 | 34 | ||
3378 | 35 | class GBMClientPlatform : public ClientPlatform | 35 | class ClientPlatform : public client::ClientPlatform |
3379 | 36 | { | 36 | { |
3380 | 37 | public: | 37 | public: |
3384 | 38 | GBMClientPlatform(ClientContext* const context, | 38 | ClientPlatform(ClientContext* const context, |
3385 | 39 | std::shared_ptr<DRMFDHandler> const& drm_fd_handler, | 39 | std::shared_ptr<BufferFileOps> const& buffer_file_ops, |
3386 | 40 | EGLNativeDisplayContainer& display_container); | 40 | EGLNativeDisplayContainer& display_container); |
3387 | 41 | 41 | ||
3389 | 42 | MirPlatformType platform_type() const; | 42 | MirPlatformType platform_type() const; |
3390 | 43 | std::shared_ptr<ClientBufferFactory> create_buffer_factory(); | 43 | std::shared_ptr<ClientBufferFactory> create_buffer_factory(); |
3391 | 44 | std::shared_ptr<EGLNativeWindowType> create_egl_native_window(ClientSurface *surface); | 44 | std::shared_ptr<EGLNativeWindowType> create_egl_native_window(ClientSurface *surface); |
3392 | 45 | std::shared_ptr<EGLNativeDisplayType> create_egl_native_display(); | 45 | std::shared_ptr<EGLNativeDisplayType> create_egl_native_display(); |
3393 | @@ -47,7 +47,7 @@ | |||
3394 | 47 | 47 | ||
3395 | 48 | private: | 48 | private: |
3396 | 49 | ClientContext* const context; | 49 | ClientContext* const context; |
3398 | 50 | std::shared_ptr<DRMFDHandler> const drm_fd_handler; | 50 | std::shared_ptr<BufferFileOps> const buffer_file_ops; |
3399 | 51 | EGLNativeDisplayContainer& display_container; | 51 | EGLNativeDisplayContainer& display_container; |
3400 | 52 | }; | 52 | }; |
3401 | 53 | 53 | ||
3402 | @@ -55,4 +55,4 @@ | |||
3403 | 55 | } | 55 | } |
3404 | 56 | } | 56 | } |
3405 | 57 | 57 | ||
3407 | 58 | #endif /* MIR_CLIENT_GBM_GBM_CLIENT_PLATFORM_H_ */ | 58 | #endif /* MIR_CLIENT_MESA_CLIENT_PLATFORM_H_ */ |
3408 | 59 | 59 | ||
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 | 25 | #include <mutex> | 25 | #include <mutex> |
3414 | 26 | 26 | ||
3415 | 27 | namespace mcl = mir::client; | 27 | namespace mcl = mir::client; |
3417 | 28 | namespace mclg = mcl::gbm; | 28 | namespace mclm = mcl::mesa; |
3418 | 29 | 29 | ||
3419 | 30 | namespace | 30 | namespace |
3420 | 31 | { | 31 | { |
3421 | 32 | extern "C" | 32 | extern "C" |
3422 | 33 | { | 33 | { |
3423 | 34 | 34 | ||
3426 | 35 | static int gbm_egl_display_get_platform(MirMesaEGLNativeDisplay* display, | 35 | static int egl_display_get_platform(MirMesaEGLNativeDisplay* display, |
3427 | 36 | MirPlatformPackage* package) | 36 | MirPlatformPackage* package) |
3428 | 37 | { | 37 | { |
3429 | 38 | auto connection = static_cast<MirConnection*>(display->context); | 38 | auto connection = static_cast<MirConnection*>(display->context); |
3430 | 39 | mir_connection_get_platform(connection, package); | 39 | mir_connection_get_platform(connection, package); |
3431 | @@ -50,15 +50,15 @@ | |||
3432 | 50 | 50 | ||
3433 | 51 | mcl::EGLNativeDisplayContainer& mcl::EGLNativeDisplayContainer::instance() | 51 | mcl::EGLNativeDisplayContainer& mcl::EGLNativeDisplayContainer::instance() |
3434 | 52 | { | 52 | { |
3436 | 53 | static mclg::MesaNativeDisplayContainer default_display_container; | 53 | static mclm::MesaNativeDisplayContainer default_display_container; |
3437 | 54 | return default_display_container; | 54 | return default_display_container; |
3438 | 55 | } | 55 | } |
3439 | 56 | 56 | ||
3441 | 57 | mclg::MesaNativeDisplayContainer::MesaNativeDisplayContainer() | 57 | mclm::MesaNativeDisplayContainer::MesaNativeDisplayContainer() |
3442 | 58 | { | 58 | { |
3443 | 59 | } | 59 | } |
3444 | 60 | 60 | ||
3446 | 61 | mclg::MesaNativeDisplayContainer::~MesaNativeDisplayContainer() | 61 | mclm::MesaNativeDisplayContainer::~MesaNativeDisplayContainer() |
3447 | 62 | { | 62 | { |
3448 | 63 | std::lock_guard<std::mutex> lg(guard); | 63 | std::lock_guard<std::mutex> lg(guard); |
3449 | 64 | 64 | ||
3450 | @@ -68,17 +68,17 @@ | |||
3451 | 68 | } | 68 | } |
3452 | 69 | } | 69 | } |
3453 | 70 | 70 | ||
3455 | 71 | bool mclg::MesaNativeDisplayContainer::validate(MirEGLNativeDisplayType display) const | 71 | bool mclm::MesaNativeDisplayContainer::validate(MirEGLNativeDisplayType display) const |
3456 | 72 | { | 72 | { |
3457 | 73 | std::lock_guard<std::mutex> lg(guard); | 73 | std::lock_guard<std::mutex> lg(guard); |
3458 | 74 | return (valid_displays.find(display) != valid_displays.end()); | 74 | return (valid_displays.find(display) != valid_displays.end()); |
3459 | 75 | } | 75 | } |
3460 | 76 | 76 | ||
3461 | 77 | MirEGLNativeDisplayType | 77 | MirEGLNativeDisplayType |
3463 | 78 | mclg::MesaNativeDisplayContainer::create(MirConnection* connection) | 78 | mclm::MesaNativeDisplayContainer::create(MirConnection* connection) |
3464 | 79 | { | 79 | { |
3465 | 80 | MirMesaEGLNativeDisplay* display = new MirMesaEGLNativeDisplay(); | 80 | MirMesaEGLNativeDisplay* display = new MirMesaEGLNativeDisplay(); |
3467 | 81 | display->display_get_platform = gbm_egl_display_get_platform; | 81 | display->display_get_platform = egl_display_get_platform; |
3468 | 82 | display->context = connection; | 82 | display->context = connection; |
3469 | 83 | 83 | ||
3470 | 84 | std::lock_guard<std::mutex> lg(guard); | 84 | std::lock_guard<std::mutex> lg(guard); |
3471 | @@ -88,7 +88,7 @@ | |||
3472 | 88 | return egl_display; | 88 | return egl_display; |
3473 | 89 | } | 89 | } |
3474 | 90 | 90 | ||
3476 | 91 | void mclg::MesaNativeDisplayContainer::release(MirEGLNativeDisplayType display) | 91 | void mclm::MesaNativeDisplayContainer::release(MirEGLNativeDisplayType display) |
3477 | 92 | { | 92 | { |
3478 | 93 | std::lock_guard<std::mutex> lg(guard); | 93 | std::lock_guard<std::mutex> lg(guard); |
3479 | 94 | 94 | ||
3480 | 95 | 95 | ||
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 | 16 | * Authored by: Robert Carr <robert.carr@canonical.com> | 16 | * Authored by: Robert Carr <robert.carr@canonical.com> |
3486 | 17 | */ | 17 | */ |
3487 | 18 | 18 | ||
3490 | 19 | #ifndef MIR_CLIENT_GBM_MESA_NATIVE_DISPLAY_CONTAINER_H_ | 19 | #ifndef MIR_CLIENT_MESA_MESA_NATIVE_DISPLAY_CONTAINER_H_ |
3491 | 20 | #define MIR_CLIENT_GBM_MESA_NATIVE_DISPLAY_CONTAINER_H_ | 20 | #define MIR_CLIENT_MESA_MESA_NATIVE_DISPLAY_CONTAINER_H_ |
3492 | 21 | 21 | ||
3493 | 22 | #include "../egl_native_display_container.h" | 22 | #include "../egl_native_display_container.h" |
3494 | 23 | 23 | ||
3495 | @@ -31,7 +31,7 @@ | |||
3496 | 31 | { | 31 | { |
3497 | 32 | namespace client | 32 | namespace client |
3498 | 33 | { | 33 | { |
3500 | 34 | namespace gbm | 34 | namespace mesa |
3501 | 35 | { | 35 | { |
3502 | 36 | 36 | ||
3503 | 37 | class MesaNativeDisplayContainer : public EGLNativeDisplayContainer | 37 | class MesaNativeDisplayContainer : public EGLNativeDisplayContainer |
3504 | @@ -60,4 +60,4 @@ | |||
3505 | 60 | } | 60 | } |
3506 | 61 | } // namespace mir | 61 | } // namespace mir |
3507 | 62 | 62 | ||
3509 | 63 | #endif // MIR_CLIENT_GBM_MESA_NATIVE_DISPLAY_CONTAINER_H_ | 63 | #endif // MIR_CLIENT_MESA_MESA_NATIVE_DISPLAY_CONTAINER_H_ |
3510 | 64 | 64 | ||
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 | 18 | 18 | ||
3516 | 19 | #include <cstring> | 19 | #include <cstring> |
3517 | 20 | #include "../client_buffer.h" | 20 | #include "../client_buffer.h" |
3519 | 21 | #include "gbm_native_surface.h" | 21 | #include "native_surface.h" |
3520 | 22 | 22 | ||
3522 | 23 | namespace mclg=mir::client::gbm; | 23 | namespace mclm=mir::client::mesa; |
3523 | 24 | 24 | ||
3524 | 25 | namespace | 25 | namespace |
3525 | 26 | { | 26 | { |
3526 | 27 | static int advance_buffer_static(MirMesaEGLNativeSurface* surface, | 27 | static int advance_buffer_static(MirMesaEGLNativeSurface* surface, |
3527 | 28 | MirBufferPackage* buffer_package) | 28 | MirBufferPackage* buffer_package) |
3528 | 29 | { | 29 | { |
3530 | 30 | auto s = static_cast<mclg::GBMNativeSurface*>(surface); | 30 | auto s = static_cast<mclm::NativeSurface*>(surface); |
3531 | 31 | return s->advance_buffer(buffer_package); | 31 | return s->advance_buffer(buffer_package); |
3532 | 32 | } | 32 | } |
3533 | 33 | 33 | ||
3534 | 34 | static int get_parameters_static(MirMesaEGLNativeSurface* surface, | 34 | static int get_parameters_static(MirMesaEGLNativeSurface* surface, |
3535 | 35 | MirSurfaceParameters* surface_parameters) | 35 | MirSurfaceParameters* surface_parameters) |
3536 | 36 | { | 36 | { |
3538 | 37 | auto s = static_cast<mclg::GBMNativeSurface*>(surface); | 37 | auto s = static_cast<mclm::NativeSurface*>(surface); |
3539 | 38 | return s->get_parameters(surface_parameters); | 38 | return s->get_parameters(surface_parameters); |
3540 | 39 | } | 39 | } |
3541 | 40 | 40 | ||
3542 | 41 | static int set_swapinterval_static(MirMesaEGLNativeSurface* surface, int interval) | 41 | static int set_swapinterval_static(MirMesaEGLNativeSurface* surface, int interval) |
3543 | 42 | { | 42 | { |
3545 | 43 | auto s = static_cast<mclg::GBMNativeSurface*>(surface); | 43 | auto s = static_cast<mclm::NativeSurface*>(surface); |
3546 | 44 | return s->set_swapinterval(interval); | 44 | return s->set_swapinterval(interval); |
3548 | 45 | } | 45 | } |
3549 | 46 | 46 | ||
3550 | 47 | static void buffer_advanced_callback(MirSurface* /* surface */, | 47 | static void buffer_advanced_callback(MirSurface* /* surface */, |
3551 | 48 | void* /* context */) | 48 | void* /* context */) |
3552 | @@ -50,15 +50,15 @@ | |||
3553 | 50 | } | 50 | } |
3554 | 51 | } | 51 | } |
3555 | 52 | 52 | ||
3557 | 53 | mclg::GBMNativeSurface::GBMNativeSurface(ClientSurface& surface) | 53 | mclm::NativeSurface::NativeSurface(ClientSurface& surface) |
3558 | 54 | : surface(surface) | 54 | : surface(surface) |
3559 | 55 | { | 55 | { |
3563 | 56 | surface_advance_buffer = advance_buffer_static; | 56 | surface_advance_buffer = advance_buffer_static; |
3564 | 57 | surface_get_parameters = get_parameters_static; | 57 | surface_get_parameters = get_parameters_static; |
3565 | 58 | surface_set_swapinterval = set_swapinterval_static; | 58 | surface_set_swapinterval = set_swapinterval_static; |
3566 | 59 | } | 59 | } |
3567 | 60 | 60 | ||
3569 | 61 | int mclg::GBMNativeSurface::advance_buffer(MirBufferPackage* buffer_package) | 61 | int mclm::NativeSurface::advance_buffer(MirBufferPackage* buffer_package) |
3570 | 62 | { | 62 | { |
3571 | 63 | mir_wait_for(surface.next_buffer(buffer_advanced_callback, NULL)); | 63 | mir_wait_for(surface.next_buffer(buffer_advanced_callback, NULL)); |
3572 | 64 | auto buffer = surface.get_current_buffer(); | 64 | auto buffer = surface.get_current_buffer(); |
3573 | @@ -68,18 +68,18 @@ | |||
3574 | 68 | return MIR_MESA_TRUE; | 68 | return MIR_MESA_TRUE; |
3575 | 69 | } | 69 | } |
3576 | 70 | 70 | ||
3578 | 71 | int mclg::GBMNativeSurface::get_parameters(MirSurfaceParameters* surface_parameters) | 71 | int mclm::NativeSurface::get_parameters(MirSurfaceParameters* surface_parameters) |
3579 | 72 | { | 72 | { |
3580 | 73 | auto params = surface.get_parameters(); | 73 | auto params = surface.get_parameters(); |
3581 | 74 | memcpy(surface_parameters, ¶ms, sizeof(MirSurfaceParameters)); | 74 | memcpy(surface_parameters, ¶ms, sizeof(MirSurfaceParameters)); |
3582 | 75 | return MIR_MESA_TRUE; | 75 | return MIR_MESA_TRUE; |
3583 | 76 | } | 76 | } |
3584 | 77 | 77 | ||
3586 | 78 | int mclg::GBMNativeSurface::set_swapinterval(int interval) | 78 | int mclm::NativeSurface::set_swapinterval(int interval) |
3587 | 79 | { | 79 | { |
3588 | 80 | if ((interval < 0) || (interval > 1)) | 80 | if ((interval < 0) || (interval > 1)) |
3589 | 81 | return MIR_MESA_FALSE; | 81 | return MIR_MESA_FALSE; |
3590 | 82 | 82 | ||
3592 | 83 | mir_wait_for(surface.configure(mir_surface_attrib_swapinterval, interval)); | 83 | mir_wait_for(surface.configure(mir_surface_attrib_swapinterval, interval)); |
3593 | 84 | return MIR_MESA_TRUE; | 84 | return MIR_MESA_TRUE; |
3594 | 85 | } | 85 | } |
3595 | 86 | 86 | ||
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 | 16 | * Authored by: Kevin DuBois <kevin.dubois@canonical.com> | 16 | * Authored by: Kevin DuBois <kevin.dubois@canonical.com> |
3601 | 17 | */ | 17 | */ |
3602 | 18 | 18 | ||
3603 | 19 | #ifndef MIR_CLIENT_MESA_NATIVE_SURFACES_H_ | ||
3604 | 20 | #define MIR_CLIENT_MESA_NATIVE_SURFACES_H_ | ||
3605 | 21 | |||
3606 | 19 | #include "mir_toolkit/mesa/native_display.h" | 22 | #include "mir_toolkit/mesa/native_display.h" |
3607 | 20 | #include "../mir_client_surface.h" | 23 | #include "../mir_client_surface.h" |
3608 | 21 | 24 | ||
3609 | @@ -23,13 +26,13 @@ | |||
3610 | 23 | { | 26 | { |
3611 | 24 | namespace client | 27 | namespace client |
3612 | 25 | { | 28 | { |
3614 | 26 | namespace gbm | 29 | namespace mesa |
3615 | 27 | { | 30 | { |
3616 | 28 | 31 | ||
3618 | 29 | class GBMNativeSurface : public MirMesaEGLNativeSurface | 32 | class NativeSurface : public MirMesaEGLNativeSurface |
3619 | 30 | { | 33 | { |
3620 | 31 | public: | 34 | public: |
3622 | 32 | explicit GBMNativeSurface(ClientSurface&); | 35 | explicit NativeSurface(ClientSurface&); |
3623 | 33 | 36 | ||
3624 | 34 | int advance_buffer(MirBufferPackage* buffer_package); | 37 | int advance_buffer(MirBufferPackage* buffer_package); |
3625 | 35 | int get_parameters(MirSurfaceParameters* surface_parameters); | 38 | int get_parameters(MirSurfaceParameters* surface_parameters); |
3626 | @@ -42,3 +45,5 @@ | |||
3627 | 42 | } | 45 | } |
3628 | 43 | } | 46 | } |
3629 | 44 | } | 47 | } |
3630 | 48 | |||
3631 | 49 | #endif /* MIR_CLIENT_MESA_NATIVE_SURFACE_H_ */ | ||
3632 | 45 | 50 | ||
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 | 176 | return conn; | 176 | return conn; |
3638 | 177 | } | 177 | } |
3639 | 178 | 178 | ||
3641 | 179 | int mir_connection_is_valid(MirConnection * connection) | 179 | MirBool mir_connection_is_valid(MirConnection * connection) |
3642 | 180 | { | 180 | { |
3644 | 181 | return MirConnection::is_valid(connection); | 181 | return MirConnection::is_valid(connection) ? mir_true : mir_false; |
3645 | 182 | } | 182 | } |
3646 | 183 | 183 | ||
3647 | 184 | char const * mir_connection_get_error_message(MirConnection * connection) | 184 | char const * mir_connection_get_error_message(MirConnection * connection) |
3648 | @@ -266,12 +266,12 @@ | |||
3649 | 266 | 266 | ||
3650 | 267 | int mir_debug_surface_id(MirSurface * surface) | 267 | int mir_debug_surface_id(MirSurface * surface) |
3651 | 268 | { | 268 | { |
3653 | 269 | return surface->id(); | 269 | return surface->id(); |
3654 | 270 | } | 270 | } |
3655 | 271 | 271 | ||
3657 | 272 | int mir_surface_is_valid(MirSurface* surface) | 272 | MirBool mir_surface_is_valid(MirSurface* surface) |
3658 | 273 | { | 273 | { |
3660 | 274 | return surface->is_valid(); | 274 | return surface->is_valid() ? mir_true : mir_false; |
3661 | 275 | } | 275 | } |
3662 | 276 | 276 | ||
3663 | 277 | char const * mir_surface_get_error_message(MirSurface * surface) | 277 | char const * mir_surface_get_error_message(MirSurface * surface) |
3664 | 278 | 278 | ||
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 | 370 | for (auto i = 0u; i < valid_formats; i++) | 370 | for (auto i = 0u; i < valid_formats; i++) |
3670 | 371 | { | 371 | { |
3671 | 372 | formats[i] = static_cast<MirPixelFormat>(connect_result.surface_pixel_format(i)); | 372 | formats[i] = static_cast<MirPixelFormat>(connect_result.surface_pixel_format(i)); |
3673 | 373 | } | 373 | } |
3674 | 374 | } | 374 | } |
3675 | 375 | } | 375 | } |
3676 | 376 | 376 | ||
3677 | @@ -458,11 +458,11 @@ | |||
3678 | 458 | { | 458 | { |
3679 | 459 | auto output = config->outputs[i]; | 459 | auto output = config->outputs[i]; |
3680 | 460 | auto display_request = request.add_display_output(); | 460 | auto display_request = request.add_display_output(); |
3686 | 461 | display_request->set_output_id(output.output_id); | 461 | display_request->set_output_id(output.output_id); |
3687 | 462 | display_request->set_used(output.used); | 462 | display_request->set_used(output.used); |
3688 | 463 | display_request->set_current_mode(output.current_mode); | 463 | display_request->set_current_mode(output.current_mode); |
3689 | 464 | display_request->set_position_x(output.position_x); | 464 | display_request->set_position_x(output.position_x); |
3690 | 465 | display_request->set_position_y(output.position_y); | 465 | display_request->set_position_y(output.position_y); |
3691 | 466 | display_request->set_power_mode(output.power_mode); | 466 | display_request->set_power_mode(output.power_mode); |
3692 | 467 | } | 467 | } |
3693 | 468 | 468 | ||
3694 | 469 | 469 | ||
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 | 105 | void register_display_change_callback(mir_display_config_callback callback, void* context); | 105 | void register_display_change_callback(mir_display_config_callback callback, void* context); |
3700 | 106 | 106 | ||
3701 | 107 | void populate(MirPlatformPackage& platform_package); | 107 | void populate(MirPlatformPackage& platform_package); |
3703 | 108 | MirDisplayConfiguration* create_copy_of_display_config(); | 108 | MirDisplayConfiguration* create_copy_of_display_config(); |
3704 | 109 | void available_surface_formats(MirPixelFormat* formats, | 109 | void available_surface_formats(MirPixelFormat* formats, |
3705 | 110 | unsigned int formats_size, unsigned int& valid_formats); | 110 | unsigned int formats_size, unsigned int& valid_formats); |
3706 | 111 | 111 | ||
3707 | 112 | 112 | ||
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 | 52 | message.set_pixel_format(params.pixel_format); | 52 | message.set_pixel_format(params.pixel_format); |
3713 | 53 | message.set_buffer_usage(params.buffer_usage); | 53 | message.set_buffer_usage(params.buffer_usage); |
3714 | 54 | message.set_output_id(params.output_id); | 54 | message.set_output_id(params.output_id); |
3716 | 55 | 55 | ||
3717 | 56 | server.create_surface(0, &message, &surface, gp::NewCallback(this, &MirSurface::created, callback, context)); | 56 | server.create_surface(0, &message, &surface, gp::NewCallback(this, &MirSurface::created, callback, context)); |
3718 | 57 | 57 | ||
3719 | 58 | for (int i = 0; i < mir_surface_attribs; i++) | 58 | for (int i = 0; i < mir_surface_attribs; i++) |
3720 | @@ -159,10 +159,10 @@ | |||
3721 | 159 | } | 159 | } |
3722 | 160 | 160 | ||
3723 | 161 | /* todo: all these conversion functions are a bit of a kludge, probably | 161 | /* todo: all these conversion functions are a bit of a kludge, probably |
3726 | 162 | better to have a more developed geometry::PixelFormat that can handle this */ | 162 | better to have a more developed MirPixelFormat that can handle this */ |
3727 | 163 | geom::PixelFormat MirSurface::convert_ipc_pf_to_geometry(gp::int32 pf) | 163 | MirPixelFormat MirSurface::convert_ipc_pf_to_geometry(gp::int32 pf) |
3728 | 164 | { | 164 | { |
3730 | 165 | return static_cast<geom::PixelFormat>(pf); | 165 | return static_cast<MirPixelFormat>(pf); |
3731 | 166 | } | 166 | } |
3732 | 167 | 167 | ||
3733 | 168 | void MirSurface::process_incoming_buffer() | 168 | void MirSurface::process_incoming_buffer() |
3734 | @@ -254,7 +254,7 @@ | |||
3735 | 254 | { | 254 | { |
3736 | 255 | std::lock_guard<std::recursive_mutex> lock(mutex); | 255 | std::lock_guard<std::recursive_mutex> lock(mutex); |
3737 | 256 | 256 | ||
3739 | 257 | return buffer_depository->current_buffer_id(); | 257 | return buffer_depository->current_buffer_id(); |
3740 | 258 | } | 258 | } |
3741 | 259 | 259 | ||
3742 | 260 | void MirSurface::populate(MirBufferPackage& buffer_package) | 260 | void MirSurface::populate(MirBufferPackage& buffer_package) |
3743 | 261 | 261 | ||
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 | 20 | 20 | ||
3749 | 21 | #include "mir_protobuf.pb.h" | 21 | #include "mir_protobuf.pb.h" |
3750 | 22 | 22 | ||
3751 | 23 | #include "mir/geometry/pixel_format.h" | ||
3752 | 24 | #include "mir/geometry/dimensions.h" | 23 | #include "mir/geometry/dimensions.h" |
3753 | 25 | #include "mir_toolkit/mir_client_library.h" | 24 | #include "mir_toolkit/mir_client_library.h" |
3754 | 26 | #include "mir_toolkit/common.h" | 25 | #include "mir_toolkit/common.h" |
3755 | @@ -101,7 +100,7 @@ | |||
3756 | 101 | void populate(MirBufferPackage& buffer_package); | 100 | void populate(MirBufferPackage& buffer_package); |
3757 | 102 | void created(mir_surface_callback callback, void * context); | 101 | void created(mir_surface_callback callback, void * context); |
3758 | 103 | void new_buffer(mir_surface_callback callback, void * context); | 102 | void new_buffer(mir_surface_callback callback, void * context); |
3760 | 104 | mir::geometry::PixelFormat convert_ipc_pf_to_geometry(google::protobuf::int32 pf); | 103 | MirPixelFormat convert_ipc_pf_to_geometry(google::protobuf::int32 pf); |
3761 | 105 | 104 | ||
3762 | 106 | /* todo: race condition. protobuf does not guarantee that callbacks will be synchronized. potential | 105 | /* todo: race condition. protobuf does not guarantee that callbacks will be synchronized. potential |
3763 | 107 | race in surface, last_buffer_id */ | 106 | race in surface, last_buffer_id */ |
3764 | 108 | 107 | ||
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 | 415 | { | 415 | { |
3770 | 416 | rpc_report->event_parsing_failed(event); | 416 | rpc_report->event_parsing_failed(event); |
3771 | 417 | } | 417 | } |
3773 | 418 | } | 418 | } |
3774 | 419 | } | 419 | } |
3775 | 420 | } | 420 | } |
3776 | 421 | 421 | ||
3777 | 422 | 422 | ||
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 | 42 | ss << __PRETTY_FUNCTION__ | 42 | ss << __PRETTY_FUNCTION__ |
3783 | 43 | << "executed with non-existent surface ID " | 43 | << "executed with non-existent surface ID " |
3784 | 44 | << surface_id << ".\n"; | 44 | << surface_id << ".\n"; |
3786 | 45 | 45 | ||
3787 | 46 | BOOST_THROW_EXCEPTION(std::runtime_error(ss.str())); | 46 | BOOST_THROW_EXCEPTION(std::runtime_error(ss.str())); |
3788 | 47 | } | 47 | } |
3789 | 48 | } | 48 | } |
3790 | @@ -50,11 +50,11 @@ | |||
3791 | 50 | void mcl::ConnectionSurfaceMap::insert(int const& surface_id, MirSurface* surface) | 50 | void mcl::ConnectionSurfaceMap::insert(int const& surface_id, MirSurface* surface) |
3792 | 51 | { | 51 | { |
3793 | 52 | std::unique_lock<std::mutex> lk(guard); | 52 | std::unique_lock<std::mutex> lk(guard); |
3795 | 53 | surfaces[surface_id] = surface; | 53 | surfaces[surface_id] = surface; |
3796 | 54 | } | 54 | } |
3797 | 55 | 55 | ||
3798 | 56 | void mcl::ConnectionSurfaceMap::erase(int surface_id) | 56 | void mcl::ConnectionSurfaceMap::erase(int surface_id) |
3799 | 57 | { | 57 | { |
3800 | 58 | std::unique_lock<std::mutex> lk(guard); | 58 | std::unique_lock<std::mutex> lk(guard); |
3802 | 59 | surfaces.erase(surface_id); | 59 | surfaces.erase(surface_id); |
3803 | 60 | } | 60 | } |
3804 | 61 | 61 | ||
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 | 26 | ) | 26 | ) |
3810 | 27 | 27 | ||
3811 | 28 | install(TARGETS mirplatform LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) | 28 | install(TARGETS mirplatform LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) |
3812 | 29 | |||
3813 | 30 | if (MIR_PLATFORM STREQUAL "android") | ||
3814 | 31 | include_directories(${LIBHARDWARE_INCLUDE_DIRS}) | ||
3815 | 32 | add_subdirectory(android/) | ||
3816 | 33 | endif() | ||
3817 | 34 | |||
3818 | 35 | if (MIR_PLATFORM STREQUAL "mesa") | ||
3819 | 36 | add_subdirectory(mesa/) | ||
3820 | 37 | endif() | ||
3821 | 38 | |||
3822 | 29 | 39 | ||
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 | 2 | * Copyright © 2012 Canonical Ltd. | 2 | * Copyright © 2012 Canonical Ltd. |
3829 | 3 | * | 3 | * |
3830 | 4 | * This program is free software: you can redistribute it and/or modify it | 4 | * This program is free software: you can redistribute it and/or modify it |
3832 | 5 | * under the terms of the GNU General Public License version 3, | 5 | * under the terms of the GNU Lesser General Public License version 3, |
3833 | 6 | * as published by the Free Software Foundation. | 6 | * as published by the Free Software Foundation. |
3834 | 7 | * | 7 | * |
3835 | 8 | * This program is distributed in the hope that it will be useful, | 8 | * This program is distributed in the hope that it will be useful, |
3836 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
3837 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3839 | 11 | * GNU General Public License for more details. | 11 | * GNU Lesser General Public License for more details. |
3840 | 12 | * | 12 | * |
3842 | 13 | * You should have received a copy of the GNU General Public License | 13 | * You should have received a copy of the GNU Lesser General Public License |
3843 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
3844 | 15 | * | 15 | * |
3845 | 16 | * Authored by: | 16 | * Authored by: |
3846 | @@ -52,7 +52,7 @@ | |||
3847 | 52 | } | 52 | } |
3848 | 53 | 53 | ||
3849 | 54 | std::shared_ptr<mg::NativeBuffer> mga::AndroidAllocAdaptor::alloc_buffer( | 54 | std::shared_ptr<mg::NativeBuffer> mga::AndroidAllocAdaptor::alloc_buffer( |
3851 | 55 | geometry::Size size, geometry::PixelFormat pf, BufferUsage usage) | 55 | geometry::Size size, MirPixelFormat pf, BufferUsage usage) |
3852 | 56 | { | 56 | { |
3853 | 57 | buffer_handle_t buf_handle = NULL; | 57 | buffer_handle_t buf_handle = NULL; |
3854 | 58 | auto stride = 0; | 58 | auto stride = 0; |
3855 | 59 | 59 | ||
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 | 2 | * Copyright © 2012 Canonical Ltd. | 2 | * Copyright © 2012 Canonical Ltd. |
3861 | 3 | * | 3 | * |
3862 | 4 | * This program is free software: you can redistribute it and/or modify it | 4 | * This program is free software: you can redistribute it and/or modify it |
3864 | 5 | * under the terms of the GNU General Public License version 3, | 5 | * under the terms of the GNU Lesser General Public License version 3, |
3865 | 6 | * as published by the Free Software Foundation. | 6 | * as published by the Free Software Foundation. |
3866 | 7 | * | 7 | * |
3867 | 8 | * This program is distributed in the hope that it will be useful, | 8 | * This program is distributed in the hope that it will be useful, |
3868 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
3869 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3871 | 11 | * GNU General Public License for more details. | 11 | * GNU Lesser General Public License for more details. |
3872 | 12 | * | 12 | * |
3874 | 13 | * You should have received a copy of the GNU General Public License | 13 | * You should have received a copy of the GNU Lesser General Public License |
3875 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
3876 | 15 | * | 15 | * |
3877 | 16 | * Authored by: Kevin DuBois <kevin.dubois@canonical.com> | 16 | * Authored by: Kevin DuBois <kevin.dubois@canonical.com> |
3878 | @@ -36,7 +36,7 @@ | |||
3879 | 36 | public: | 36 | public: |
3880 | 37 | explicit AndroidAllocAdaptor(const std::shared_ptr<struct alloc_device_t>& alloc_device); | 37 | explicit AndroidAllocAdaptor(const std::shared_ptr<struct alloc_device_t>& alloc_device); |
3881 | 38 | std::shared_ptr<NativeBuffer> alloc_buffer(geometry::Size, | 38 | std::shared_ptr<NativeBuffer> alloc_buffer(geometry::Size, |
3883 | 39 | geometry::PixelFormat, BufferUsage usage); | 39 | MirPixelFormat, BufferUsage usage); |
3884 | 40 | 40 | ||
3885 | 41 | /* note: alloc_device_t has a third method (dump) that isn't needed by us. it can be used to check buffer contents */ | 41 | /* note: alloc_device_t has a third method (dump) that isn't needed by us. it can be used to check buffer contents */ |
3886 | 42 | 42 | ||
3887 | 43 | 43 | ||
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 | 2 | * Copyright © 2012 Canonical Ltd. | 2 | * Copyright © 2012 Canonical Ltd. |
3893 | 3 | * | 3 | * |
3894 | 4 | * This program is free software: you can redistribute it and/or modify it | 4 | * This program is free software: you can redistribute it and/or modify it |
3896 | 5 | * under the terms of the GNU General Public License version 3, | 5 | * under the terms of the GNU Lesser General Public License version 3, |
3897 | 6 | * as published by the Free Software Foundation. | 6 | * as published by the Free Software Foundation. |
3898 | 7 | * | 7 | * |
3899 | 8 | * This program is distributed in the hope that it will be useful, | 8 | * This program is distributed in the hope that it will be useful, |
3900 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
3901 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3903 | 11 | * GNU General Public License for more details. | 11 | * GNU Lesser General Public License for more details. |
3904 | 12 | * | 12 | * |
3906 | 13 | * You should have received a copy of the GNU General Public License | 13 | * You should have received a copy of the GNU Lesser General Public License |
3907 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
3908 | 15 | * | 15 | * |
3909 | 16 | * Authored by: | 16 | * Authored by: |
3910 | @@ -78,7 +78,7 @@ | |||
3911 | 78 | } | 78 | } |
3912 | 79 | 79 | ||
3913 | 80 | std::shared_ptr<mg::Buffer> mga::AndroidGraphicBufferAllocator::alloc_buffer_platform( | 80 | std::shared_ptr<mg::Buffer> mga::AndroidGraphicBufferAllocator::alloc_buffer_platform( |
3915 | 81 | geom::Size sz, geom::PixelFormat pf, mga::BufferUsage use) | 81 | geom::Size sz, MirPixelFormat pf, mga::BufferUsage use) |
3916 | 82 | { | 82 | { |
3917 | 83 | auto native_handle = alloc_device->alloc_buffer(sz, pf, use); | 83 | auto native_handle = alloc_device->alloc_buffer(sz, pf, use); |
3918 | 84 | auto buffer = std::make_shared<Buffer>(native_handle, egl_extensions); | 84 | auto buffer = std::make_shared<Buffer>(native_handle, egl_extensions); |
3919 | @@ -86,12 +86,12 @@ | |||
3920 | 86 | return buffer; | 86 | return buffer; |
3921 | 87 | } | 87 | } |
3922 | 88 | 88 | ||
3924 | 89 | std::vector<geom::PixelFormat> mga::AndroidGraphicBufferAllocator::supported_pixel_formats() | 89 | std::vector<MirPixelFormat> mga::AndroidGraphicBufferAllocator::supported_pixel_formats() |
3925 | 90 | { | 90 | { |
3930 | 91 | static std::vector<geom::PixelFormat> const pixel_formats{ | 91 | static std::vector<MirPixelFormat> const pixel_formats{ |
3931 | 92 | geom::PixelFormat::abgr_8888, | 92 | mir_pixel_format_abgr_8888, |
3932 | 93 | geom::PixelFormat::xbgr_8888, | 93 | mir_pixel_format_xbgr_8888, |
3933 | 94 | geom::PixelFormat::bgr_888 | 94 | mir_pixel_format_bgr_888 |
3934 | 95 | }; | 95 | }; |
3935 | 96 | 96 | ||
3936 | 97 | return pixel_formats; | 97 | return pixel_formats; |
3937 | @@ -106,5 +106,5 @@ | |||
3938 | 106 | case mg::BufferUsage::hardware: | 106 | case mg::BufferUsage::hardware: |
3939 | 107 | default: | 107 | default: |
3940 | 108 | return mga::BufferUsage::use_hardware; | 108 | return mga::BufferUsage::use_hardware; |
3942 | 109 | } | 109 | } |
3943 | 110 | } | 110 | } |
3944 | 111 | 111 | ||
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 | 2 | * Copyright © 2012 Canonical Ltd. | 2 | * Copyright © 2012 Canonical Ltd. |
3950 | 3 | * | 3 | * |
3951 | 4 | * This program is free software: you can redistribute it and/or modify it | 4 | * This program is free software: you can redistribute it and/or modify it |
3953 | 5 | * under the terms of the GNU General Public License version 3, | 5 | * under the terms of the GNU Lesser General Public License version 3, |
3954 | 6 | * as published by the Free Software Foundation. | 6 | * as published by the Free Software Foundation. |
3955 | 7 | * | 7 | * |
3956 | 8 | * This program is distributed in the hope that it will be useful, | 8 | * This program is distributed in the hope that it will be useful, |
3957 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
3958 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3960 | 11 | * GNU General Public License for more details. | 11 | * GNU Lesser General Public License for more details. |
3961 | 12 | * | 12 | * |
3963 | 13 | * You should have received a copy of the GNU General Public License | 13 | * You should have received a copy of the GNU Lesser General Public License |
3964 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
3965 | 15 | * | 15 | * |
3966 | 16 | * Authored by: Kevin DuBois <kevin.dubois@canonical.com> | 16 | * Authored by: Kevin DuBois <kevin.dubois@canonical.com> |
3967 | 17 | 17 | ||
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 | 2 | * Copyright © 2012 Canonical Ltd. | 2 | * Copyright © 2012 Canonical Ltd. |
3973 | 3 | * | 3 | * |
3974 | 4 | * This program is free software: you can redistribute it and/or modify it | 4 | * This program is free software: you can redistribute it and/or modify it |
3976 | 5 | * under the terms of the GNU General Public License version 3, | 5 | * under the terms of the GNU Lesser General Public License version 3, |
3977 | 6 | * as published by the Free Software Foundation. | 6 | * as published by the Free Software Foundation. |
3978 | 7 | * | 7 | * |
3979 | 8 | * This program is distributed in the hope that it will be useful, | 8 | * This program is distributed in the hope that it will be useful, |
3980 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
3981 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3983 | 11 | * GNU General Public License for more details. | 11 | * GNU Lesser General Public License for more details. |
3984 | 12 | * | 12 | * |
3986 | 13 | * You should have received a copy of the GNU General Public License | 13 | * You should have received a copy of the GNU Lesser General Public License |
3987 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
3988 | 15 | * | 15 | * |
3989 | 16 | * Authored by: Kevin DuBois <kevin.dubois@canonical.com> | 16 | * Authored by: Kevin DuBois <kevin.dubois@canonical.com> |
3990 | @@ -71,7 +71,7 @@ | |||
3991 | 71 | GLContext gl_context; | 71 | GLContext gl_context; |
3992 | 72 | std::shared_ptr<DisplayDevice> const display_device; | 72 | std::shared_ptr<DisplayDevice> const display_device; |
3993 | 73 | //we only have a primary display at the moment | 73 | //we only have a primary display at the moment |
3995 | 74 | std::unique_ptr<graphics::DisplayBuffer> const display_buffer; | 74 | std::unique_ptr<graphics::DisplayBuffer> const display_buffer; |
3996 | 75 | AndroidDisplayConfiguration current_configuration; | 75 | AndroidDisplayConfiguration current_configuration; |
3997 | 76 | }; | 76 | }; |
3998 | 77 | 77 | ||
3999 | 78 | 78 | ||
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 | 2 | * Copyright © 2013 Canonical Ltd. | 2 | * Copyright © 2013 Canonical Ltd. |
4005 | 3 | * | 3 | * |
4006 | 4 | * This program is free software: you can redistribute it and/or modify it | 4 | * This program is free software: you can redistribute it and/or modify it |
4008 | 5 | * under the terms of the GNU General Public License version 3, | 5 | * under the terms of the GNU Lesser General Public License version 3, |
4009 | 6 | * as published by the Free Software Foundation. | 6 | * as published by the Free Software Foundation. |
4010 | 7 | * | 7 | * |
4011 | 8 | * This program is distributed in the hope that it will be useful, | 8 | * This program is distributed in the hope that it will be useful, |
4012 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
4013 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
4015 | 11 | * GNU General Public License for more details. | 11 | * GNU Lesser General Public License for more details. |
4016 | 12 | * | 12 | * |
4018 | 13 | * You should have received a copy of the GNU General Public License | 13 | * You should have received a copy of the GNU Lesser General Public License |
4019 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
4020 | 15 | */ | 15 | */ |
4021 | 16 | 16 | ||
4022 | @@ -24,7 +24,7 @@ | |||
4023 | 24 | : configuration{mg::DisplayConfigurationOutputId{1}, | 24 | : configuration{mg::DisplayConfigurationOutputId{1}, |
4024 | 25 | mg::DisplayConfigurationCardId{0}, | 25 | mg::DisplayConfigurationCardId{0}, |
4025 | 26 | mg::DisplayConfigurationOutputType::lvds, | 26 | mg::DisplayConfigurationOutputType::lvds, |
4027 | 27 | {geom::PixelFormat::abgr_8888}, | 27 | {mir_pixel_format_abgr_8888}, |
4028 | 28 | {mg::DisplayConfigurationMode{display_size,0.0f}}, | 28 | {mg::DisplayConfigurationMode{display_size,0.0f}}, |
4029 | 29 | 0, | 29 | 0, |
4030 | 30 | geom::Size{0,0}, | 30 | geom::Size{0,0}, |
4031 | 31 | 31 | ||
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 | 2 | * Copyright © 2013 Canonical Ltd. | 2 | * Copyright © 2013 Canonical Ltd. |
4037 | 3 | * | 3 | * |
4038 | 4 | * This program is free software: you can redistribute it and/or modify it | 4 | * This program is free software: you can redistribute it and/or modify it |
4040 | 5 | * under the terms of the GNU General Public License version 3, | 5 | * under the terms of the GNU Lesser General Public License version 3, |
4041 | 6 | * as published by the Free Software Foundation. | 6 | * as published by the Free Software Foundation. |
4042 | 7 | * | 7 | * |
4043 | 8 | * This program is distributed in the hope that it will be useful, | 8 | * This program is distributed in the hope that it will be useful, |
4044 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
4045 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
4047 | 11 | * GNU General Public License for more details. | 11 | * GNU Lesser General Public License for more details. |
4048 | 12 | * | 12 | * |
4050 | 13 | * You should have received a copy of the GNU General Public License | 13 | * You should have received a copy of the GNU Lesser General Public License |
4051 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
4052 | 15 | */ | 15 | */ |
4053 | 16 | 16 | ||
4054 | @@ -32,7 +32,7 @@ | |||
4055 | 32 | AndroidDisplayConfiguration(geometry::Size const& display_size); | 32 | AndroidDisplayConfiguration(geometry::Size const& display_size); |
4056 | 33 | AndroidDisplayConfiguration(AndroidDisplayConfiguration const& other); | 33 | AndroidDisplayConfiguration(AndroidDisplayConfiguration const& other); |
4057 | 34 | AndroidDisplayConfiguration& operator=(AndroidDisplayConfiguration const& other); | 34 | AndroidDisplayConfiguration& operator=(AndroidDisplayConfiguration const& other); |
4059 | 35 | 35 | ||
4060 | 36 | virtual ~AndroidDisplayConfiguration() = default; | 36 | virtual ~AndroidDisplayConfiguration() = default; |
4061 | 37 | 37 | ||
4062 | 38 | void for_each_card(std::function<void(DisplayConfigurationCard const&)> f) const; | 38 | void for_each_card(std::function<void(DisplayConfigurationCard const&)> f) const; |
4063 | 39 | 39 | ||
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 | 2 | * Copyright © 2013 Canonical Ltd. | 2 | * Copyright © 2013 Canonical Ltd. |
4069 | 3 | * | 3 | * |
4070 | 4 | * This program is free software: you can redistribute it and/or modify it | 4 | * This program is free software: you can redistribute it and/or modify it |
4072 | 5 | * under the terms of the GNU General Public License version 3, | 5 | * under the terms of the GNU Lesser General Public License version 3, |
4073 | 6 | * as published by the Free Software Foundation. | 6 | * as published by the Free Software Foundation. |
4074 | 7 | * | 7 | * |
4075 | 8 | * This program is distributed in the hope that it will be useful, | 8 | * This program is distributed in the hope that it will be useful, |
4076 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
4077 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
4079 | 11 | * GNU General Public License for more details. | 11 | * GNU Lesser General Public License for more details. |
4080 | 12 | * | 12 | * |
4082 | 13 | * You should have received a copy of the GNU General Public License | 13 | * You should have received a copy of the GNU Lesser General Public License |
4083 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
4084 | 15 | * | 15 | * |
4085 | 16 | * Authored by: Kevin DuBois <kevin.dubois@canonical.com> | 16 | * Authored by: Kevin DuBois <kevin.dubois@canonical.com> |
4086 | @@ -19,7 +19,7 @@ | |||
4087 | 19 | #ifndef MIR_GRAPHICS_ANDROID_ANDROID_FORMAT_CONVERSION_INL_H_ | 19 | #ifndef MIR_GRAPHICS_ANDROID_ANDROID_FORMAT_CONVERSION_INL_H_ |
4088 | 20 | #define MIR_GRAPHICS_ANDROID_ANDROID_FORMAT_CONVERSION_INL_H_ | 20 | #define MIR_GRAPHICS_ANDROID_ANDROID_FORMAT_CONVERSION_INL_H_ |
4089 | 21 | 21 | ||
4091 | 22 | #include "mir/geometry/pixel_format.h" | 22 | #include "mir_toolkit/common.h" |
4092 | 23 | #include <system/graphics.h> | 23 | #include <system/graphics.h> |
4093 | 24 | 24 | ||
4094 | 25 | namespace mir | 25 | namespace mir |
4095 | @@ -29,39 +29,39 @@ | |||
4096 | 29 | namespace android | 29 | namespace android |
4097 | 30 | { | 30 | { |
4098 | 31 | 31 | ||
4100 | 32 | inline static int to_android_format(geometry::PixelFormat format) | 32 | inline static int to_android_format(MirPixelFormat format) |
4101 | 33 | { | 33 | { |
4102 | 34 | switch(format) | 34 | switch(format) |
4103 | 35 | { | 35 | { |
4105 | 36 | case geometry::PixelFormat::abgr_8888: | 36 | case mir_pixel_format_abgr_8888: |
4106 | 37 | return HAL_PIXEL_FORMAT_RGBA_8888; | 37 | return HAL_PIXEL_FORMAT_RGBA_8888; |
4108 | 38 | case geometry::PixelFormat::xbgr_8888: | 38 | case mir_pixel_format_xbgr_8888: |
4109 | 39 | return HAL_PIXEL_FORMAT_RGBX_8888; | 39 | return HAL_PIXEL_FORMAT_RGBX_8888; |
4115 | 40 | case geometry::PixelFormat::argb_8888: | 40 | case mir_pixel_format_argb_8888: |
4116 | 41 | return HAL_PIXEL_FORMAT_BGRA_8888; | 41 | return HAL_PIXEL_FORMAT_BGRA_8888; |
4117 | 42 | case geometry::PixelFormat::xrgb_8888: | 42 | case mir_pixel_format_xrgb_8888: |
4118 | 43 | return HAL_PIXEL_FORMAT_BGRA_8888; | 43 | return HAL_PIXEL_FORMAT_BGRA_8888; |
4119 | 44 | case geometry::PixelFormat::bgr_888: | 44 | case mir_pixel_format_bgr_888: |
4120 | 45 | return HAL_PIXEL_FORMAT_RGB_888; | 45 | return HAL_PIXEL_FORMAT_RGB_888; |
4121 | 46 | default: | 46 | default: |
4122 | 47 | return 0; | 47 | return 0; |
4123 | 48 | } | 48 | } |
4124 | 49 | } | 49 | } |
4125 | 50 | 50 | ||
4127 | 51 | inline static mir::geometry::PixelFormat to_mir_format(int format) | 51 | inline static MirPixelFormat to_mir_format(int format) |
4128 | 52 | { | 52 | { |
4129 | 53 | switch(format) | 53 | switch(format) |
4130 | 54 | { | 54 | { |
4131 | 55 | case HAL_PIXEL_FORMAT_RGBA_8888: | 55 | case HAL_PIXEL_FORMAT_RGBA_8888: |
4133 | 56 | return geometry::PixelFormat::abgr_8888; | 56 | return mir_pixel_format_abgr_8888; |
4134 | 57 | case HAL_PIXEL_FORMAT_RGBX_8888: | 57 | case HAL_PIXEL_FORMAT_RGBX_8888: |
4136 | 58 | return geometry::PixelFormat::xbgr_8888; | 58 | return mir_pixel_format_xbgr_8888; |
4137 | 59 | case HAL_PIXEL_FORMAT_BGRA_8888: | 59 | case HAL_PIXEL_FORMAT_BGRA_8888: |
4139 | 60 | return geometry::PixelFormat::argb_8888; | 60 | return mir_pixel_format_argb_8888; |
4140 | 61 | case HAL_PIXEL_FORMAT_RGB_888: | 61 | case HAL_PIXEL_FORMAT_RGB_888: |
4142 | 62 | return geometry::PixelFormat::bgr_888; | 62 | return mir_pixel_format_bgr_888; |
4143 | 63 | default: | 63 | default: |
4145 | 64 | return geometry::PixelFormat::invalid; | 64 | return mir_pixel_format_invalid; |
4146 | 65 | } | 65 | } |
4147 | 66 | } | 66 | } |
4148 | 67 | 67 | ||
4149 | 68 | 68 | ||
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 | 2 | * Copyright © 2012 Canonical Ltd. | 2 | * Copyright © 2012 Canonical Ltd. |
4155 | 3 | * | 3 | * |
4156 | 4 | * This program is free software: you can redistribute it and/or modify it | 4 | * This program is free software: you can redistribute it and/or modify it |
4158 | 5 | * under the terms of the GNU General Public License version 3, | 5 | * under the terms of the GNU Lesser General Public License version 3, |
4159 | 6 | * as published by the Free Software Foundation. | 6 | * as published by the Free Software Foundation. |
4160 | 7 | * | 7 | * |
4161 | 8 | * This program is distributed in the hope that it will be useful, | 8 | * This program is distributed in the hope that it will be useful, |
4162 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
4163 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
4165 | 11 | * GNU General Public License for more details. | 11 | * GNU Lesser General Public License for more details. |
4166 | 12 | * | 12 | * |
4168 | 13 | * You should have received a copy of the GNU General Public License | 13 | * You should have received a copy of the GNU Lesser General Public License |
4169 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
4170 | 15 | * | 15 | * |
4171 | 16 | * Authored by: | 16 | * Authored by: |
4172 | @@ -49,9 +49,9 @@ | |||
4173 | 49 | graphics::BufferProperties const& buffer_properties); | 49 | graphics::BufferProperties const& buffer_properties); |
4174 | 50 | 50 | ||
4175 | 51 | std::shared_ptr<graphics::Buffer> alloc_buffer_platform( | 51 | std::shared_ptr<graphics::Buffer> alloc_buffer_platform( |
4177 | 52 | geometry::Size sz, geometry::PixelFormat pf, BufferUsage use); | 52 | geometry::Size sz, MirPixelFormat pf, BufferUsage use); |
4178 | 53 | 53 | ||
4180 | 54 | std::vector<geometry::PixelFormat> supported_pixel_formats(); | 54 | std::vector<MirPixelFormat> supported_pixel_formats(); |
4181 | 55 | 55 | ||
4182 | 56 | static BufferUsage convert_from_compositor_usage(graphics::BufferUsage usage); | 56 | static BufferUsage convert_from_compositor_usage(graphics::BufferUsage usage); |
4183 | 57 | 57 | ||
4184 | 58 | 58 | ||
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 | 2 | * Copyright © 2012 Canonical Ltd. | 2 | * Copyright © 2012 Canonical Ltd. |
4190 | 3 | * | 3 | * |
4191 | 4 | * This program is free software: you can redistribute it and/or modify it | 4 | * This program is free software: you can redistribute it and/or modify it |
4193 | 5 | * under the terms of the GNU General Public License version 3, | 5 | * under the terms of the GNU Lesser General Public License version 3, |
4194 | 6 | * as published by the Free Software Foundation. | 6 | * as published by the Free Software Foundation. |
4195 | 7 | * | 7 | * |
4196 | 8 | * This program is distributed in the hope that it will be useful, | 8 | * This program is distributed in the hope that it will be useful, |
4197 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
4198 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
4200 | 11 | * GNU General Public License for more details. | 11 | * GNU Lesser General Public License for more details. |
4201 | 12 | * | 12 | * |
4203 | 13 | * You should have received a copy of the GNU General Public License | 13 | * You should have received a copy of the GNU Lesser General Public License |
4204 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
4205 | 15 | * | 15 | * |
4206 | 16 | * Authored by: | 16 | * Authored by: |
4207 | @@ -77,7 +77,7 @@ | |||
4208 | 77 | auto buffer_handle = native_buffer->handle(); | 77 | auto buffer_handle = native_buffer->handle(); |
4209 | 78 | 78 | ||
4210 | 79 | int offset = 0; | 79 | int offset = 0; |
4212 | 80 | 80 | ||
4213 | 81 | for(auto i=0; i<buffer_handle->numFds; i++) | 81 | for(auto i=0; i<buffer_handle->numFds; i++) |
4214 | 82 | { | 82 | { |
4215 | 83 | packer->pack_fd(buffer_handle->data[offset++]); | 83 | packer->pack_fd(buffer_handle->data[offset++]); |
4216 | @@ -119,11 +119,7 @@ | |||
4217 | 119 | 119 | ||
4218 | 120 | extern "C" std::shared_ptr<mg::NativePlatform> create_native_platform(std::shared_ptr<mg::DisplayReport> const& display_report) | 120 | extern "C" std::shared_ptr<mg::NativePlatform> create_native_platform(std::shared_ptr<mg::DisplayReport> const& display_report) |
4219 | 121 | { | 121 | { |
4227 | 122 | auto should_use_fb_fallback = false; | 122 | //TODO: remove nullptr parameter once platform classes are sorted. |
4228 | 123 | auto buffer_initializer = std::make_shared<mg::NullBufferInitializer>(); | 123 | // mg::NativePlatform cannot create a display anyways, so it doesnt need a display builder |
4229 | 124 | auto fb_allocator = std::make_shared<mga::AndroidGraphicBufferAllocator>(buffer_initializer); | 124 | return std::make_shared<mga::AndroidPlatform>(nullptr, display_report); |
4223 | 125 | auto display_resource_factory = std::make_shared<mga::ResourceFactory>(); | ||
4224 | 126 | auto display_builder = std::make_shared<mga::OutputBuilder>( | ||
4225 | 127 | fb_allocator, display_resource_factory, display_report, should_use_fb_fallback); | ||
4226 | 128 | return std::make_shared<mga::AndroidPlatform>(display_builder, display_report); | ||
4230 | 129 | } | 125 | } |
4231 | 130 | 126 | ||
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 | 2 | * Copyright © 2012 Canonical Ltd. | 2 | * Copyright © 2012 Canonical Ltd. |
4237 | 3 | * | 3 | * |
4238 | 4 | * This program is free software: you can redistribute it and/or modify it | 4 | * This program is free software: you can redistribute it and/or modify it |
4240 | 5 | * under the terms of the GNU General Public License version 3, | 5 | * under the terms of the GNU Lesser General Public License version 3, |
4241 | 6 | * as published by the Free Software Foundation. | 6 | * as published by the Free Software Foundation. |
4242 | 7 | * | 7 | * |
4243 | 8 | * This program is distributed in the hope that it will be useful, | 8 | * This program is distributed in the hope that it will be useful, |
4244 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
4245 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
4247 | 11 | * GNU General Public License for more details. | 11 | * GNU Lesser General Public License for more details. |
4248 | 12 | * | 12 | * |
4250 | 13 | * You should have received a copy of the GNU General Public License | 13 | * You should have received a copy of the GNU Lesser General Public License |
4251 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
4252 | 15 | * | 15 | * |
4253 | 16 | * Authored by: Alexandros Frantzis <alexandros.frantzis@canonical.com> | 16 | * Authored by: Alexandros Frantzis <alexandros.frantzis@canonical.com> |
4254 | 17 | 17 | ||
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 | 2 | * Copyright © 2012 Canonical Ltd. | 2 | * Copyright © 2012 Canonical Ltd. |
4260 | 3 | * | 3 | * |
4261 | 4 | * This program is free software: you can redistribute it and/or modify it | 4 | * This program is free software: you can redistribute it and/or modify it |
4263 | 5 | * under the terms of the GNU General Public License version 3, | 5 | * under the terms of the GNU Lesser General Public License version 3, |
4264 | 6 | * as published by the Free Software Foundation. | 6 | * as published by the Free Software Foundation. |
4265 | 7 | * | 7 | * |
4266 | 8 | * This program is distributed in the hope that it will be useful, | 8 | * This program is distributed in the hope that it will be useful, |
4267 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
4268 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
4270 | 11 | * GNU General Public License for more details. | 11 | * GNU Lesser General Public License for more details. |
4271 | 12 | * | 12 | * |
4273 | 13 | * You should have received a copy of the GNU General Public License | 13 | * You should have received a copy of the GNU Lesser General Public License |
4274 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
4275 | 15 | * | 15 | * |
4276 | 16 | * Authored by: | 16 | * Authored by: |
4277 | @@ -60,10 +60,10 @@ | |||
4278 | 60 | { | 60 | { |
4279 | 61 | ANativeWindowBuffer *anwb = native_buffer->anwb(); | 61 | ANativeWindowBuffer *anwb = native_buffer->anwb(); |
4280 | 62 | return geom::Stride{anwb->stride * | 62 | return geom::Stride{anwb->stride * |
4282 | 63 | geom::bytes_per_pixel(pixel_format())}; | 63 | MIR_BYTES_PER_PIXEL(pixel_format())}; |
4283 | 64 | } | 64 | } |
4284 | 65 | 65 | ||
4286 | 66 | geom::PixelFormat mga::Buffer::pixel_format() const | 66 | MirPixelFormat mga::Buffer::pixel_format() const |
4287 | 67 | { | 67 | { |
4288 | 68 | ANativeWindowBuffer *anwb = native_buffer->anwb(); | 68 | ANativeWindowBuffer *anwb = native_buffer->anwb(); |
4289 | 69 | return mga::to_mir_format(anwb->format); | 69 | return mga::to_mir_format(anwb->format); |
4290 | @@ -123,7 +123,7 @@ | |||
4291 | 123 | content_lock.unlock(); | 123 | content_lock.unlock(); |
4292 | 124 | }); | 124 | }); |
4293 | 125 | 125 | ||
4295 | 126 | //lock remains in effect until the native handle is released | 126 | //lock remains in effect until the native handle is released |
4296 | 127 | lk.release(); | 127 | lk.release(); |
4297 | 128 | return native_resource; | 128 | return native_resource; |
4298 | 129 | } | 129 | } |
4299 | 130 | 130 | ||
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 | 2 | * Copyright © 2012,2013 Canonical Ltd. | 2 | * Copyright © 2012,2013 Canonical Ltd. |
4305 | 3 | * | 3 | * |
4306 | 4 | * This program is free software: you can redistribute it and/or modify it | 4 | * This program is free software: you can redistribute it and/or modify it |
4308 | 5 | * under the terms of the GNU General Public License version 3, | 5 | * under the terms of the GNU Lesser General Public License version 3, |
4309 | 6 | * as published by the Free Software Foundation. | 6 | * as published by the Free Software Foundation. |
4310 | 7 | * | 7 | * |
4311 | 8 | * This program is distributed in the hope that it will be useful, | 8 | * This program is distributed in the hope that it will be useful, |
4312 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
4313 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
4315 | 11 | * GNU General Public License for more details. | 11 | * GNU Lesser General Public License for more details. |
4316 | 12 | * | 12 | * |
4318 | 13 | * You should have received a copy of the GNU General Public License | 13 | * You should have received a copy of the GNU Lesser General Public License |
4319 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
4320 | 15 | * | 15 | * |
4321 | 16 | * Authored by: | 16 | * Authored by: |
4322 | @@ -49,7 +49,7 @@ | |||
4323 | 49 | 49 | ||
4324 | 50 | geometry::Size size() const; | 50 | geometry::Size size() const; |
4325 | 51 | geometry::Stride stride() const; | 51 | geometry::Stride stride() const; |
4327 | 52 | geometry::PixelFormat pixel_format() const; | 52 | MirPixelFormat pixel_format() const; |
4328 | 53 | void bind_to_texture(); | 53 | void bind_to_texture(); |
4329 | 54 | bool can_bypass() const override; | 54 | bool can_bypass() const override; |
4330 | 55 | 55 | ||
4331 | 56 | 56 | ||
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 | 2 | * Copyright © 2013 Canonical Ltd. | 2 | * Copyright © 2013 Canonical Ltd. |
4337 | 3 | * | 3 | * |
4338 | 4 | * This program is free software: you can redistribute it and/or modify it | 4 | * This program is free software: you can redistribute it and/or modify it |
4340 | 5 | * under the terms of the GNU General Public License version 3, | 5 | * under the terms of the GNU Lesser General Public License version 3, |
4341 | 6 | * as published by the Free Software Foundation. | 6 | * as published by the Free Software Foundation. |
4342 | 7 | * | 7 | * |
4343 | 8 | * This program is distributed in the hope that it will be useful, | 8 | * This program is distributed in the hope that it will be useful, |
4344 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
4345 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
4347 | 11 | * GNU General Public License for more details. | 11 | * GNU Lesser General Public License for more details. |
4348 | 12 | * | 12 | * |
4350 | 13 | * You should have received a copy of the GNU General Public License | 13 | * You should have received a copy of the GNU Lesser General Public License |
4351 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
4352 | 15 | * | 15 | * |
4353 | 16 | * Authored by: Kevin DuBois <kevin.dubois@canonical.com> | 16 | * Authored by: Kevin DuBois <kevin.dubois@canonical.com> |
4354 | 17 | 17 | ||
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 | 2 | * Copyright © 2013 Canonical Ltd. | 2 | * Copyright © 2013 Canonical Ltd. |
4360 | 3 | * | 3 | * |
4361 | 4 | * This program is free software: you can redistribute it and/or modify it | 4 | * This program is free software: you can redistribute it and/or modify it |
4363 | 5 | * under the terms of the GNU General Public License version 3, | 5 | * under the terms of the GNU Lesser General Public License version 3, |
4364 | 6 | * as published by the Free Software Foundation. | 6 | * as published by the Free Software Foundation. |
4365 | 7 | * | 7 | * |
4366 | 8 | * This program is distributed in the hope that it will be useful, | 8 | * This program is distributed in the hope that it will be useful, |
4367 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
4368 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
4370 | 11 | * GNU General Public License for more details. | 11 | * GNU Lesser General Public License for more details. |
4371 | 12 | * | 12 | * |
4373 | 13 | * You should have received a copy of the GNU General Public License | 13 | * You should have received a copy of the GNU Lesser General Public License |
4374 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
4375 | 15 | * | 15 | * |
4376 | 16 | * Authored by: Kevin DuBois <kevin.dubois@canonical.com> | 16 | * Authored by: Kevin DuBois <kevin.dubois@canonical.com> |
4377 | 17 | 17 | ||
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 | 2 | * Copyright © 2013 Canonical Ltd. | 2 | * Copyright © 2013 Canonical Ltd. |
4383 | 3 | * | 3 | * |
4384 | 4 | * This program is free software: you can redistribute it and/or modify it | 4 | * This program is free software: you can redistribute it and/or modify it |
4386 | 5 | * under the terms of the GNU General Public License version 3, | 5 | * under the terms of the GNU Lesser General Public License version 3, |
4387 | 6 | * as published by the Free Software Foundation. | 6 | * as published by the Free Software Foundation. |
4388 | 7 | * | 7 | * |
4389 | 8 | * This program is distributed in the hope that it will be useful, | 8 | * This program is distributed in the hope that it will be useful, |
4390 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
4391 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
4393 | 11 | * GNU General Public License for more details. | 11 | * GNU Lesser General Public License for more details. |
4394 | 12 | * | 12 | * |
4396 | 13 | * You should have received a copy of the GNU General Public License | 13 | * You should have received a copy of the GNU Lesser General Public License |
4397 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
4398 | 15 | * | 15 | * |
4399 | 16 | * Authored by: Kevin DuBois <kevin.dubois@canonical.com> | 16 | * Authored by: Kevin DuBois <kevin.dubois@canonical.com> |
4400 | @@ -46,7 +46,7 @@ | |||
4401 | 46 | void release_current(); | 46 | void release_current(); |
4402 | 47 | void post_update(); | 47 | void post_update(); |
4403 | 48 | bool can_bypass() const override; | 48 | bool can_bypass() const override; |
4405 | 49 | 49 | ||
4406 | 50 | private: | 50 | private: |
4407 | 51 | std::shared_ptr<FramebufferBundle> const fb_bundle; | 51 | std::shared_ptr<FramebufferBundle> const fb_bundle; |
4408 | 52 | std::shared_ptr<DisplayDevice> const display_device; | 52 | std::shared_ptr<DisplayDevice> const display_device; |
4409 | 53 | 53 | ||
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 | 2 | * Copyright © 2013 Canonical Ltd. | 2 | * Copyright © 2013 Canonical Ltd. |
4415 | 3 | * | 3 | * |
4416 | 4 | * This program is free software: you can redistribute it and/or modify it | 4 | * This program is free software: you can redistribute it and/or modify it |
4418 | 5 | * under the terms of the GNU General Public License version 3, | 5 | * under the terms of the GNU Lesser General Public License version 3, |
4419 | 6 | * as published by the Free Software Foundation. | 6 | * as published by the Free Software Foundation. |
4420 | 7 | * | 7 | * |
4421 | 8 | * This program is distributed in the hope that it will be useful, | 8 | * This program is distributed in the hope that it will be useful, |
4422 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
4423 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
4425 | 11 | * GNU General Public License for more details. | 11 | * GNU Lesser General Public License for more details. |
4426 | 12 | * | 12 | * |
4428 | 13 | * You should have received a copy of the GNU General Public License | 13 | * You should have received a copy of the GNU Lesser General Public License |
4429 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
4430 | 15 | * | 15 | * |
4431 | 16 | * Authored by: Alexandros Frantzis <alexandros.frantzis@canonical.com> | 16 | * Authored by: Alexandros Frantzis <alexandros.frantzis@canonical.com> |
4432 | @@ -20,7 +20,7 @@ | |||
4433 | 20 | #define MIR_GRAPHICS_ANDROID_DISPLAY_BUILDER_H_ | 20 | #define MIR_GRAPHICS_ANDROID_DISPLAY_BUILDER_H_ |
4434 | 21 | 21 | ||
4435 | 22 | #include "mir/graphics/display_buffer.h" | 22 | #include "mir/graphics/display_buffer.h" |
4437 | 23 | #include "mir/geometry/pixel_format.h" | 23 | #include "mir_toolkit/common.h" |
4438 | 24 | #include <memory> | 24 | #include <memory> |
4439 | 25 | 25 | ||
4440 | 26 | namespace mir | 26 | namespace mir |
4441 | @@ -37,7 +37,7 @@ | |||
4442 | 37 | public: | 37 | public: |
4443 | 38 | virtual ~DisplayBuilder() = default; | 38 | virtual ~DisplayBuilder() = default; |
4444 | 39 | 39 | ||
4446 | 40 | virtual geometry::PixelFormat display_format() = 0; | 40 | virtual MirPixelFormat display_format() = 0; |
4447 | 41 | virtual std::shared_ptr<DisplayDevice> create_display_device() = 0; | 41 | virtual std::shared_ptr<DisplayDevice> create_display_device() = 0; |
4448 | 42 | virtual std::unique_ptr<graphics::DisplayBuffer> create_display_buffer( | 42 | virtual std::unique_ptr<graphics::DisplayBuffer> create_display_buffer( |
4449 | 43 | std::shared_ptr<DisplayDevice> const& display_device, | 43 | std::shared_ptr<DisplayDevice> const& display_device, |
4450 | 44 | 44 | ||
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 | 2 | * Copyright © 2013 Canonical Ltd. | 2 | * Copyright © 2013 Canonical Ltd. |
4456 | 3 | * | 3 | * |
4457 | 4 | * This program is free software: you can redistribute it and/or modify | 4 | * This program is free software: you can redistribute it and/or modify |
4459 | 5 | * it under the terms of the GNU General Public License version 3 as | 5 | * it under the terms of the GNU Lesser General Public License version 3 as |
4460 | 6 | * published by the Free Software Foundation. | 6 | * published by the Free Software Foundation. |
4461 | 7 | * | 7 | * |
4462 | 8 | * This program is distributed in the hope that it will be useful, | 8 | * This program is distributed in the hope that it will be useful, |
4463 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
4464 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
4466 | 11 | * GNU General Public License for more details. | 11 | * GNU Lesser General Public License for more details. |
4467 | 12 | * | 12 | * |
4469 | 13 | * You should have received a copy of the GNU General Public License | 13 | * You should have received a copy of the GNU Lesser General Public License |
4470 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
4471 | 15 | * | 15 | * |
4472 | 16 | * Authored by: Kevin DuBois <kevin.dubois@canonical.com> | 16 | * Authored by: Kevin DuBois <kevin.dubois@canonical.com> |
4473 | @@ -38,7 +38,7 @@ | |||
4474 | 38 | 38 | ||
4475 | 39 | virtual void mode(MirPowerMode mode) = 0; | 39 | virtual void mode(MirPowerMode mode) = 0; |
4476 | 40 | virtual void prepare_composition() = 0; | 40 | virtual void prepare_composition() = 0; |
4478 | 41 | virtual void gpu_render(EGLDisplay dpy, EGLSurface sur) = 0; | 41 | virtual void gpu_render(EGLDisplay dpy, EGLSurface sur) = 0; |
4479 | 42 | virtual void post(Buffer const& buffer) = 0; | 42 | virtual void post(Buffer const& buffer) = 0; |
4480 | 43 | 43 | ||
4481 | 44 | protected: | 44 | protected: |
4482 | 45 | 45 | ||
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 | 2 | * Copyright © 2013 Canonical Ltd. | 2 | * Copyright © 2013 Canonical Ltd. |
4488 | 3 | * | 3 | * |
4489 | 4 | * This program is free software: you can redistribute it and/or modify | 4 | * This program is free software: you can redistribute it and/or modify |
4491 | 5 | * it under the terms of the GNU General Public License version 3 as | 5 | * it under the terms of the GNU Lesser General Public License version 3 as |
4492 | 6 | * published by the Free Software Foundation. | 6 | * published by the Free Software Foundation. |
4493 | 7 | * | 7 | * |
4494 | 8 | * This program is distributed in the hope that it will be useful, | 8 | * This program is distributed in the hope that it will be useful, |
4495 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
4496 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
4498 | 11 | * GNU General Public License for more details. | 11 | * GNU Lesser General Public License for more details. |
4499 | 12 | * | 12 | * |
4501 | 13 | * You should have received a copy of the GNU General Public License | 13 | * You should have received a copy of the GNU Lesser General Public License |
4502 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
4503 | 15 | * | 15 | * |
4504 | 16 | * Authored by: Kevin DuBois <kevin.dubois@canonical.com> | 16 | * Authored by: Kevin DuBois <kevin.dubois@canonical.com> |
4505 | 17 | 17 | ||
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 | 2 | * Copyright © 2013 Canonical Ltd. | 2 | * Copyright © 2013 Canonical Ltd. |
4511 | 3 | * | 3 | * |
4512 | 4 | * This program is free software: you can redistribute it and/or modify it | 4 | * This program is free software: you can redistribute it and/or modify it |
4514 | 5 | * under the terms of the GNU General Public License version 3, | 5 | * under the terms of the GNU Lesser General Public License version 3, |
4515 | 6 | * as published by the Free Software Foundation. | 6 | * as published by the Free Software Foundation. |
4516 | 7 | * | 7 | * |
4517 | 8 | * This program is distributed in the hope that it will be useful, | 8 | * This program is distributed in the hope that it will be useful, |
4518 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
4519 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
4521 | 11 | * GNU General Public License for more details. | 11 | * GNU Lesser General Public License for more details. |
4522 | 12 | * | 12 | * |
4524 | 13 | * You should have received a copy of the GNU General Public License | 13 | * You should have received a copy of the GNU Lesser General Public License |
4525 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
4526 | 15 | * | 15 | * |
4527 | 16 | * Authored by: Kevin DuBois <kevin.dubois@canonical.com> | 16 | * Authored by: Kevin DuBois <kevin.dubois@canonical.com> |
4528 | @@ -39,6 +39,8 @@ | |||
4529 | 39 | { | 39 | { |
4530 | 40 | fb_device->setSwapInterval(fb_device.get(), 1); | 40 | fb_device->setSwapInterval(fb_device.get(), 1); |
4531 | 41 | } | 41 | } |
4532 | 42 | |||
4533 | 43 | mode(mir_power_mode_on); | ||
4534 | 42 | } | 44 | } |
4535 | 43 | 45 | ||
4536 | 44 | void mga::FBDevice::prepare_composition() | 46 | void mga::FBDevice::prepare_composition() |
4537 | @@ -65,6 +67,14 @@ | |||
4538 | 65 | 67 | ||
4539 | 66 | void mga::FBDevice::mode(MirPowerMode mode) | 68 | void mga::FBDevice::mode(MirPowerMode mode) |
4540 | 67 | { | 69 | { |
4543 | 68 | // TODO: Implement | 70 | int enable = 0; |
4544 | 69 | (void) mode; | 71 | if (mode == mir_power_mode_on) |
4545 | 72 | { | ||
4546 | 73 | enable = 1; | ||
4547 | 74 | } | ||
4548 | 75 | |||
4549 | 76 | if (fb_device->enableScreen) | ||
4550 | 77 | { | ||
4551 | 78 | fb_device->enableScreen(fb_device.get(), enable); | ||
4552 | 79 | } | ||
4553 | 70 | } | 80 | } |
4554 | 71 | 81 | ||
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 | 2 | * Copyright © 2013 Canonical Ltd. | 2 | * Copyright © 2013 Canonical Ltd. |
4560 | 3 | * | 3 | * |
4561 | 4 | * This program is free software: you can redistribute it and/or modify it | 4 | * This program is free software: you can redistribute it and/or modify it |
4563 | 5 | * under the terms of the GNU General Public License version 3, | 5 | * under the terms of the GNU Lesser General Public License version 3, |
4564 | 6 | * as published by the Free Software Foundation. | 6 | * as published by the Free Software Foundation. |
4565 | 7 | * | 7 | * |
4566 | 8 | * This program is distributed in the hope that it will be useful, | 8 | * This program is distributed in the hope that it will be useful, |
4567 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
4568 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
4570 | 11 | * GNU General Public License for more details. | 11 | * GNU Lesser General Public License for more details. |
4571 | 12 | * | 12 | * |
4573 | 13 | * You should have received a copy of the GNU General Public License | 13 | * You should have received a copy of the GNU Lesser General Public License |
4574 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
4575 | 15 | * | 15 | * |
4576 | 16 | * Authored by: Kevin DuBois <kevin.dubois@canonical.com> | 16 | * Authored by: Kevin DuBois <kevin.dubois@canonical.com> |
4577 | @@ -22,7 +22,7 @@ | |||
4578 | 22 | #include "display_device.h" | 22 | #include "display_device.h" |
4579 | 23 | #include <hardware/gralloc.h> | 23 | #include <hardware/gralloc.h> |
4580 | 24 | #include <hardware/fb.h> | 24 | #include <hardware/fb.h> |
4582 | 25 | 25 | ||
4583 | 26 | namespace mir | 26 | namespace mir |
4584 | 27 | { | 27 | { |
4585 | 28 | namespace graphics | 28 | namespace graphics |
4586 | @@ -30,14 +30,14 @@ | |||
4587 | 30 | namespace android | 30 | namespace android |
4588 | 31 | { | 31 | { |
4589 | 32 | 32 | ||
4591 | 33 | class FBDevice : public DisplayDevice | 33 | class FBDevice : public DisplayDevice |
4592 | 34 | { | 34 | { |
4593 | 35 | public: | 35 | public: |
4594 | 36 | FBDevice(std::shared_ptr<framebuffer_device_t> const& fbdev); | 36 | FBDevice(std::shared_ptr<framebuffer_device_t> const& fbdev); |
4595 | 37 | 37 | ||
4596 | 38 | void mode(MirPowerMode mode); | 38 | void mode(MirPowerMode mode); |
4597 | 39 | void prepare_composition(); | 39 | void prepare_composition(); |
4599 | 40 | void gpu_render(EGLDisplay dpy, EGLSurface sur); | 40 | void gpu_render(EGLDisplay dpy, EGLSurface sur); |
4600 | 41 | void post(Buffer const& buffer); | 41 | void post(Buffer const& buffer); |
4601 | 42 | 42 | ||
4602 | 43 | private: | 43 | private: |
4603 | 44 | 44 | ||
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 | 2 | * Copyright © 2013 Canonical Ltd. | 2 | * Copyright © 2013 Canonical Ltd. |
4609 | 3 | * | 3 | * |
4610 | 4 | * This program is free software: you can redistribute it and/or modify it | 4 | * This program is free software: you can redistribute it and/or modify it |
4612 | 5 | * under the terms of the GNU General Public License version 3, | 5 | * under the terms of the GNU Lesser General Public License version 3, |
4613 | 6 | * as published by the Free Software Foundation. | 6 | * as published by the Free Software Foundation. |
4614 | 7 | * | 7 | * |
4615 | 8 | * This program is distributed in the hope that it will be useful, | 8 | * This program is distributed in the hope that it will be useful, |
4616 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
4617 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
4619 | 11 | * GNU General Public License for more details. | 11 | * GNU Lesser General Public License for more details. |
4620 | 12 | * | 12 | * |
4622 | 13 | * You should have received a copy of the GNU General Public License | 13 | * You should have received a copy of the GNU Lesser General Public License |
4623 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
4624 | 15 | * | 15 | * |
4625 | 16 | * Authored by: | 16 | * Authored by: |
4626 | @@ -20,7 +20,7 @@ | |||
4627 | 20 | #ifndef MIR_GRAPHICS_ANDROID_FRAMEBUFFER_BUNDLE_H_ | 20 | #ifndef MIR_GRAPHICS_ANDROID_FRAMEBUFFER_BUNDLE_H_ |
4628 | 21 | #define MIR_GRAPHICS_ANDROID_FRAMEBUFFER_BUNDLE_H_ | 21 | #define MIR_GRAPHICS_ANDROID_FRAMEBUFFER_BUNDLE_H_ |
4629 | 22 | 22 | ||
4631 | 23 | #include "mir/geometry/pixel_format.h" | 23 | #include "mir_toolkit/common.h" |
4632 | 24 | #include "mir/geometry/size.h" | 24 | #include "mir/geometry/size.h" |
4633 | 25 | #include <memory> | 25 | #include <memory> |
4634 | 26 | 26 | ||
4635 | @@ -37,7 +37,7 @@ | |||
4636 | 37 | public: | 37 | public: |
4637 | 38 | virtual ~FramebufferBundle() = default; | 38 | virtual ~FramebufferBundle() = default; |
4638 | 39 | 39 | ||
4640 | 40 | virtual geometry::PixelFormat fb_format() = 0; | 40 | virtual MirPixelFormat fb_format() = 0; |
4641 | 41 | virtual geometry::Size fb_size() = 0; | 41 | virtual geometry::Size fb_size() = 0; |
4642 | 42 | virtual std::shared_ptr<Buffer> buffer_for_render() = 0; | 42 | virtual std::shared_ptr<Buffer> buffer_for_render() = 0; |
4643 | 43 | virtual std::shared_ptr<Buffer> last_rendered_buffer() = 0; | 43 | virtual std::shared_ptr<Buffer> last_rendered_buffer() = 0; |
4644 | 44 | 44 | ||
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 | 2 | * Copyright © 2013 Canonical Ltd. | 2 | * Copyright © 2013 Canonical Ltd. |
4650 | 3 | * | 3 | * |
4651 | 4 | * This program is free software: you can redistribute it and/or modify it | 4 | * This program is free software: you can redistribute it and/or modify it |
4653 | 5 | * under the terms of the GNU General Public License version 3, | 5 | * under the terms of the GNU Lesser General Public License version 3, |
4654 | 6 | * as published by the Free Software Foundation. | 6 | * as published by the Free Software Foundation. |
4655 | 7 | * | 7 | * |
4656 | 8 | * This program is distributed in the hope that it will be useful, | 8 | * This program is distributed in the hope that it will be useful, |
4657 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
4658 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
4660 | 11 | * GNU General Public License for more details. | 11 | * GNU Lesser General Public License for more details. |
4661 | 12 | * | 12 | * |
4663 | 13 | * You should have received a copy of the GNU General Public License | 13 | * You should have received a copy of the GNU Lesser General Public License |
4664 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
4665 | 15 | * | 15 | * |
4666 | 16 | * Authored by: | 16 | * Authored by: |
4667 | @@ -33,7 +33,7 @@ | |||
4668 | 33 | 33 | ||
4669 | 34 | namespace | 34 | namespace |
4670 | 35 | { | 35 | { |
4672 | 36 | geom::PixelFormat determine_hwc11_fb_format() | 36 | MirPixelFormat determine_hwc11_fb_format() |
4673 | 37 | { | 37 | { |
4674 | 38 | static EGLint const fb_egl_config_attr [] = | 38 | static EGLint const fb_egl_config_attr [] = |
4675 | 39 | { | 39 | { |
4676 | @@ -50,18 +50,18 @@ | |||
4677 | 50 | eglInitialize(egl_display, &major, &minor); | 50 | eglInitialize(egl_display, &major, &minor); |
4678 | 51 | eglChooseConfig(egl_display, fb_egl_config_attr, &fb_egl_config, 1, &matching_configs); | 51 | eglChooseConfig(egl_display, fb_egl_config_attr, &fb_egl_config, 1, &matching_configs); |
4679 | 52 | 52 | ||
4681 | 53 | geom::PixelFormat fb_format; | 53 | MirPixelFormat fb_format; |
4682 | 54 | if (matching_configs) | 54 | if (matching_configs) |
4683 | 55 | { | 55 | { |
4684 | 56 | int visual_id; | 56 | int visual_id; |
4685 | 57 | eglGetConfigAttrib(egl_display, fb_egl_config, EGL_NATIVE_VISUAL_ID, &visual_id); | 57 | eglGetConfigAttrib(egl_display, fb_egl_config, EGL_NATIVE_VISUAL_ID, &visual_id); |
4687 | 58 | fb_format = mga::to_mir_format(visual_id); | 58 | fb_format = mga::to_mir_format(visual_id); |
4688 | 59 | } | 59 | } |
4689 | 60 | else | 60 | else |
4690 | 61 | { | 61 | { |
4691 | 62 | //we couldn't figure out the fb format via egl. In this case, we | 62 | //we couldn't figure out the fb format via egl. In this case, we |
4692 | 63 | //assume abgr_8888. HWC api really should provide this information directly. | 63 | //assume abgr_8888. HWC api really should provide this information directly. |
4694 | 64 | fb_format = geom::PixelFormat::abgr_8888; | 64 | fb_format = mir_pixel_format_abgr_8888; |
4695 | 65 | } | 65 | } |
4696 | 66 | 66 | ||
4697 | 67 | eglTerminate(egl_display); | 67 | eglTerminate(egl_display); |
4698 | @@ -76,7 +76,7 @@ | |||
4699 | 76 | auto rc = hwc_device->getDisplayConfigs(hwc_device.get(), HWC_DISPLAY_PRIMARY, &primary_display_config, &num_configs); | 76 | auto rc = hwc_device->getDisplayConfigs(hwc_device.get(), HWC_DISPLAY_PRIMARY, &primary_display_config, &num_configs); |
4700 | 77 | if (rc != 0) | 77 | if (rc != 0) |
4701 | 78 | { | 78 | { |
4703 | 79 | BOOST_THROW_EXCEPTION(std::runtime_error("could not determine hwc display config")); | 79 | BOOST_THROW_EXCEPTION(std::runtime_error("could not determine hwc display config")); |
4704 | 80 | } | 80 | } |
4705 | 81 | static uint32_t size_request[3] = { HWC_DISPLAY_WIDTH, | 81 | static uint32_t size_request[3] = { HWC_DISPLAY_WIDTH, |
4706 | 82 | HWC_DISPLAY_HEIGHT, | 82 | HWC_DISPLAY_HEIGHT, |
4707 | @@ -94,7 +94,7 @@ | |||
4708 | 94 | std::shared_ptr<mga::GraphicBufferAllocator> const& buffer_allocator, | 94 | std::shared_ptr<mga::GraphicBufferAllocator> const& buffer_allocator, |
4709 | 95 | std::shared_ptr<hwc_composer_device_1> const& hwc) | 95 | std::shared_ptr<hwc_composer_device_1> const& hwc) |
4710 | 96 | : format(determine_hwc11_fb_format()), | 96 | : format(determine_hwc11_fb_format()), |
4712 | 97 | size(determine_hwc11_size(hwc)) | 97 | size(determine_hwc11_size(hwc)) |
4713 | 98 | { | 98 | { |
4714 | 99 | for(auto i = 0u; i < 2; i++) | 99 | for(auto i = 0u; i < 2; i++) |
4715 | 100 | { | 100 | { |
4716 | @@ -106,7 +106,7 @@ | |||
4717 | 106 | std::shared_ptr<mga::GraphicBufferAllocator> const& buffer_allocator, | 106 | std::shared_ptr<mga::GraphicBufferAllocator> const& buffer_allocator, |
4718 | 107 | std::shared_ptr<framebuffer_device_t> const& fb) | 107 | std::shared_ptr<framebuffer_device_t> const& fb) |
4719 | 108 | : format{mga::to_mir_format(fb->format)}, | 108 | : format{mga::to_mir_format(fb->format)}, |
4721 | 109 | size({fb->width, fb->height}) | 109 | size({fb->width, fb->height}) |
4722 | 110 | { | 110 | { |
4723 | 111 | //guarantee always 2 fb's allocated | 111 | //guarantee always 2 fb's allocated |
4724 | 112 | auto fb_num = static_cast<unsigned int>(fb->numFramebuffers); | 112 | auto fb_num = static_cast<unsigned int>(fb->numFramebuffers); |
4725 | @@ -117,7 +117,7 @@ | |||
4726 | 117 | } | 117 | } |
4727 | 118 | } | 118 | } |
4728 | 119 | 119 | ||
4730 | 120 | geom::PixelFormat mga::Framebuffers::fb_format() | 120 | MirPixelFormat mga::Framebuffers::fb_format() |
4731 | 121 | { | 121 | { |
4732 | 122 | return format; | 122 | return format; |
4733 | 123 | } | 123 | } |
4734 | @@ -154,5 +154,5 @@ | |||
4735 | 154 | 154 | ||
4736 | 155 | void mga::Framebuffers::wait_for_consumed_buffer(bool) | 155 | void mga::Framebuffers::wait_for_consumed_buffer(bool) |
4737 | 156 | { | 156 | { |
4739 | 157 | //TODO: change swapping so buffer_for_render() does not wait | 157 | //TODO: change swapping so buffer_for_render() does not wait |
4740 | 158 | } | 158 | } |
4741 | 159 | 159 | ||
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 | 2 | * Copyright © 2013 Canonical Ltd. | 2 | * Copyright © 2013 Canonical Ltd. |
4747 | 3 | * | 3 | * |
4748 | 4 | * This program is free software: you can redistribute it and/or modify it | 4 | * This program is free software: you can redistribute it and/or modify it |
4750 | 5 | * under the terms of the GNU General Public License version 3, | 5 | * under the terms of the GNU Lesser General Public License version 3, |
4751 | 6 | * as published by the Free Software Foundation. | 6 | * as published by the Free Software Foundation. |
4752 | 7 | * | 7 | * |
4753 | 8 | * This program is distributed in the hope that it will be useful, | 8 | * This program is distributed in the hope that it will be useful, |
4754 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
4755 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
4757 | 11 | * GNU General Public License for more details. | 11 | * GNU Lesser General Public License for more details. |
4758 | 12 | * | 12 | * |
4760 | 13 | * You should have received a copy of the GNU General Public License | 13 | * You should have received a copy of the GNU Lesser General Public License |
4761 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
4762 | 15 | * | 15 | * |
4763 | 16 | * Authored by: | 16 | * Authored by: |
4764 | @@ -46,14 +46,14 @@ | |||
4765 | 46 | Framebuffers(std::shared_ptr<GraphicBufferAllocator> const& buffer_allocator, | 46 | Framebuffers(std::shared_ptr<GraphicBufferAllocator> const& buffer_allocator, |
4766 | 47 | std::shared_ptr<framebuffer_device_t> const& fb); | 47 | std::shared_ptr<framebuffer_device_t> const& fb); |
4767 | 48 | 48 | ||
4769 | 49 | geometry::PixelFormat fb_format(); | 49 | MirPixelFormat fb_format(); |
4770 | 50 | geometry::Size fb_size(); | 50 | geometry::Size fb_size(); |
4771 | 51 | std::shared_ptr<Buffer> buffer_for_render(); | 51 | std::shared_ptr<Buffer> buffer_for_render(); |
4772 | 52 | std::shared_ptr<Buffer> last_rendered_buffer(); | 52 | std::shared_ptr<Buffer> last_rendered_buffer(); |
4773 | 53 | void wait_for_consumed_buffer(bool); | 53 | void wait_for_consumed_buffer(bool); |
4774 | 54 | 54 | ||
4775 | 55 | private: | 55 | private: |
4777 | 56 | geometry::PixelFormat const format; | 56 | MirPixelFormat const format; |
4778 | 57 | geometry::Size const size; | 57 | geometry::Size const size; |
4779 | 58 | 58 | ||
4780 | 59 | std::mutex queue_lock; | 59 | std::mutex queue_lock; |
4781 | 60 | 60 | ||
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 | 2 | * Copyright © 2013 Canonical Ltd. | 2 | * Copyright © 2013 Canonical Ltd. |
4787 | 3 | * | 3 | * |
4788 | 4 | * This program is free software: you can redistribute it and/or modify it | 4 | * This program is free software: you can redistribute it and/or modify it |
4790 | 5 | * under the terms of the GNU General Public License version 3, | 5 | * under the terms of the GNU Lesser General Public License version 3, |
4791 | 6 | * as published by the Free Software Foundation. | 6 | * as published by the Free Software Foundation. |
4792 | 7 | * | 7 | * |
4793 | 8 | * This program is distributed in the hope that it will be useful, | 8 | * This program is distributed in the hope that it will be useful, |
4794 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
4795 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
4797 | 11 | * GNU General Public License for more details. | 11 | * GNU Lesser General Public License for more details. |
4798 | 12 | * | 12 | * |
4800 | 13 | * You should have received a copy of the GNU General Public License | 13 | * You should have received a copy of the GNU Lesser General Public License |
4801 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
4802 | 15 | * | 15 | * |
4803 | 16 | * Authored by: Kevin DuBois <kevin.dubois@canonical.com> | 16 | * Authored by: Kevin DuBois <kevin.dubois@canonical.com> |
4804 | @@ -26,7 +26,6 @@ | |||
4805 | 26 | 26 | ||
4806 | 27 | namespace mg=mir::graphics; | 27 | namespace mg=mir::graphics; |
4807 | 28 | namespace mga=mir::graphics::android; | 28 | namespace mga=mir::graphics::android; |
4808 | 29 | namespace geom=mir::geometry; | ||
4809 | 30 | 29 | ||
4810 | 31 | namespace | 30 | namespace |
4811 | 32 | { | 31 | { |
4812 | @@ -69,7 +68,7 @@ | |||
4813 | 69 | 68 | ||
4814 | 70 | /* the minimum requirement is to have EGL_WINDOW_BIT and EGL_OPENGL_ES2_BIT, and to select a config | 69 | /* the minimum requirement is to have EGL_WINDOW_BIT and EGL_OPENGL_ES2_BIT, and to select a config |
4815 | 71 | whose pixel format matches that of the framebuffer. */ | 70 | whose pixel format matches that of the framebuffer. */ |
4817 | 72 | static EGLConfig select_egl_config_with_format(EGLDisplay egl_display, geom::PixelFormat display_format) | 71 | static EGLConfig select_egl_config_with_format(EGLDisplay egl_display, MirPixelFormat display_format) |
4818 | 73 | { | 72 | { |
4819 | 74 | int required_visual_id = mga::to_android_format(display_format); | 73 | int required_visual_id = mga::to_android_format(display_format); |
4820 | 75 | int num_potential_configs; | 74 | int num_potential_configs; |
4821 | @@ -107,7 +106,7 @@ | |||
4822 | 107 | return eglCreateWindowSurface(disp, config, native, NULL); | 106 | return eglCreateWindowSurface(disp, config, native, NULL); |
4823 | 108 | } | 107 | } |
4824 | 109 | 108 | ||
4826 | 110 | mga::GLContext::GLContext(geom::PixelFormat display_format, mg::DisplayReport& report) | 109 | mga::GLContext::GLContext(MirPixelFormat display_format, mg::DisplayReport& report) |
4827 | 111 | : egl_display(create_and_initialize_display()), | 110 | : egl_display(create_and_initialize_display()), |
4828 | 112 | own_display(true), | 111 | own_display(true), |
4829 | 113 | egl_config(select_egl_config_with_format(egl_display, display_format)), | 112 | egl_config(select_egl_config_with_format(egl_display, display_format)), |
4830 | @@ -115,7 +114,7 @@ | |||
4831 | 115 | eglCreateContext(egl_display, egl_config, EGL_NO_CONTEXT, default_egl_context_attr)}, | 114 | eglCreateContext(egl_display, egl_config, EGL_NO_CONTEXT, default_egl_context_attr)}, |
4832 | 116 | egl_surface{egl_display, | 115 | egl_surface{egl_display, |
4833 | 117 | eglCreatePbufferSurface(egl_display, egl_config, dummy_pbuffer_attribs)} | 116 | eglCreatePbufferSurface(egl_display, egl_config, dummy_pbuffer_attribs)} |
4835 | 118 | { | 117 | { |
4836 | 119 | report.report_egl_configuration(egl_display, egl_config); | 118 | report.report_egl_configuration(egl_display, egl_config); |
4837 | 120 | } | 119 | } |
4838 | 121 | 120 | ||
4839 | 122 | 121 | ||
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 | 2 | * Copyright © 2013 Canonical Ltd. | 2 | * Copyright © 2013 Canonical Ltd. |
4845 | 3 | * | 3 | * |
4846 | 4 | * This program is free software: you can redistribute it and/or modify it | 4 | * This program is free software: you can redistribute it and/or modify it |
4848 | 5 | * under the terms of the GNU General Public License version 3, | 5 | * under the terms of the GNU Lesser General Public License version 3, |
4849 | 6 | * as published by the Free Software Foundation. | 6 | * as published by the Free Software Foundation. |
4850 | 7 | * | 7 | * |
4851 | 8 | * This program is distributed in the hope that it will be useful, | 8 | * This program is distributed in the hope that it will be useful, |
4852 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
4853 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
4855 | 11 | * GNU General Public License for more details. | 11 | * GNU Lesser General Public License for more details. |
4856 | 12 | * | 12 | * |
4858 | 13 | * You should have received a copy of the GNU General Public License | 13 | * You should have received a copy of the GNU Lesser General Public License |
4859 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
4860 | 15 | * | 15 | * |
4861 | 16 | * Authored by: Kevin DuBois <kevin.dubois@canonical.com> | 16 | * Authored by: Kevin DuBois <kevin.dubois@canonical.com> |
4862 | @@ -21,7 +21,7 @@ | |||
4863 | 21 | 21 | ||
4864 | 22 | #include "mir/graphics/gl_context.h" | 22 | #include "mir/graphics/gl_context.h" |
4865 | 23 | #include "mir/graphics/egl_resources.h" | 23 | #include "mir/graphics/egl_resources.h" |
4867 | 24 | #include "mir/geometry/pixel_format.h" | 24 | #include "mir_toolkit/common.h" |
4868 | 25 | #include <functional> | 25 | #include <functional> |
4869 | 26 | 26 | ||
4870 | 27 | namespace mir | 27 | namespace mir |
4871 | @@ -40,7 +40,7 @@ | |||
4872 | 40 | { | 40 | { |
4873 | 41 | public: | 41 | public: |
4874 | 42 | //For creating a gl context | 42 | //For creating a gl context |
4876 | 43 | GLContext(geometry::PixelFormat display_format, DisplayReport& report); | 43 | GLContext(MirPixelFormat display_format, DisplayReport& report); |
4877 | 44 | 44 | ||
4878 | 45 | //For creating a gl context shared with another GLContext | 45 | //For creating a gl context shared with another GLContext |
4879 | 46 | GLContext(GLContext const& shared_gl_context, | 46 | GLContext(GLContext const& shared_gl_context, |
4880 | 47 | 47 | ||
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 | 2 | * Copyright © 2012 Canonical Ltd. | 2 | * Copyright © 2012 Canonical Ltd. |
4886 | 3 | * | 3 | * |
4887 | 4 | * This program is free software: you can redistribute it and/or modify it | 4 | * This program is free software: you can redistribute it and/or modify it |
4889 | 5 | * under the terms of the GNU General Public License version 3, | 5 | * under the terms of the GNU Lesser General Public License version 3, |
4890 | 6 | * as published by the Free Software Foundation. | 6 | * as published by the Free Software Foundation. |
4891 | 7 | * | 7 | * |
4892 | 8 | * This program is distributed in the hope that it will be useful, | 8 | * This program is distributed in the hope that it will be useful, |
4893 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
4894 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
4896 | 11 | * GNU General Public License for more details. | 11 | * GNU Lesser General Public License for more details. |
4897 | 12 | * | 12 | * |
4899 | 13 | * You should have received a copy of the GNU General Public License | 13 | * You should have received a copy of the GNU Lesser General Public License |
4900 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
4901 | 15 | * | 15 | * |
4902 | 16 | * Authored by: Kevin DuBois <kevin.dubois@canonical.com> | 16 | * Authored by: Kevin DuBois <kevin.dubois@canonical.com> |
4903 | @@ -20,7 +20,7 @@ | |||
4904 | 20 | #define MIR_GRAPHICS_ANDROID_GRAPHIC_ALLOC_ADAPTOR_H_ | 20 | #define MIR_GRAPHICS_ANDROID_GRAPHIC_ALLOC_ADAPTOR_H_ |
4905 | 21 | 21 | ||
4906 | 22 | #include "mir/geometry/size.h" | 22 | #include "mir/geometry/size.h" |
4908 | 23 | #include "mir/geometry/pixel_format.h" | 23 | #include "mir_toolkit/common.h" |
4909 | 24 | #include "buffer_usage.h" | 24 | #include "buffer_usage.h" |
4910 | 25 | #include <memory> | 25 | #include <memory> |
4911 | 26 | 26 | ||
4912 | @@ -37,7 +37,7 @@ | |||
4913 | 37 | { | 37 | { |
4914 | 38 | public: | 38 | public: |
4915 | 39 | virtual std::shared_ptr<NativeBuffer> alloc_buffer(geometry::Size size, | 39 | virtual std::shared_ptr<NativeBuffer> alloc_buffer(geometry::Size size, |
4917 | 40 | geometry::PixelFormat, BufferUsage usage) = 0; | 40 | MirPixelFormat, BufferUsage usage) = 0; |
4918 | 41 | protected: | 41 | protected: |
4919 | 42 | GraphicAllocAdaptor() = default; | 42 | GraphicAllocAdaptor() = default; |
4920 | 43 | virtual ~GraphicAllocAdaptor() {} | 43 | virtual ~GraphicAllocAdaptor() {} |
4921 | 44 | 44 | ||
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 | 2 | * Copyright © 2013 Canonical Ltd. | 2 | * Copyright © 2013 Canonical Ltd. |
4927 | 3 | * | 3 | * |
4928 | 4 | * This program is free software: you can redistribute it and/or modify it | 4 | * This program is free software: you can redistribute it and/or modify it |
4930 | 5 | * under the terms of the GNU General Public License version 3, | 5 | * under the terms of the GNU Lesser General Public License version 3, |
4931 | 6 | * as published by the Free Software Foundation. | 6 | * as published by the Free Software Foundation. |
4932 | 7 | * | 7 | * |
4933 | 8 | * This program is distributed in the hope that it will be useful, | 8 | * This program is distributed in the hope that it will be useful, |
4934 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
4935 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
4937 | 11 | * GNU General Public License for more details. | 11 | * GNU Lesser General Public License for more details. |
4938 | 12 | * | 12 | * |
4940 | 13 | * You should have received a copy of the GNU General Public License | 13 | * You should have received a copy of the GNU Lesser General Public License |
4941 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
4942 | 15 | * | 15 | * |
4943 | 16 | * Authored by: | 16 | * Authored by: |
4944 | @@ -23,7 +23,7 @@ | |||
4945 | 23 | #include "buffer_usage.h" | 23 | #include "buffer_usage.h" |
4946 | 24 | 24 | ||
4947 | 25 | #include "mir/geometry/size.h" | 25 | #include "mir/geometry/size.h" |
4949 | 26 | #include "mir/geometry/pixel_format.h" | 26 | #include "mir_toolkit/common.h" |
4950 | 27 | 27 | ||
4951 | 28 | #include <memory> | 28 | #include <memory> |
4952 | 29 | 29 | ||
4953 | @@ -39,7 +39,7 @@ | |||
4954 | 39 | { | 39 | { |
4955 | 40 | public: | 40 | public: |
4956 | 41 | virtual std::shared_ptr<graphics::Buffer> alloc_buffer_platform( | 41 | virtual std::shared_ptr<graphics::Buffer> alloc_buffer_platform( |
4958 | 42 | geometry::Size sz, geometry::PixelFormat pf, BufferUsage use) = 0; | 42 | geometry::Size sz, MirPixelFormat pf, BufferUsage use) = 0; |
4959 | 43 | 43 | ||
4960 | 44 | protected: | 44 | protected: |
4961 | 45 | GraphicBufferAllocator() = default; | 45 | GraphicBufferAllocator() = default; |
4962 | 46 | 46 | ||
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 | 2 | * Copyright © 2013 Canonical Ltd. | 2 | * Copyright © 2013 Canonical Ltd. |
4968 | 3 | * | 3 | * |
4969 | 4 | * This program is free software: you can redistribute it and/or modify it | 4 | * This program is free software: you can redistribute it and/or modify it |
4971 | 5 | * under the terms of the GNU General Public License version 3, | 5 | * under the terms of the GNU Lesser General Public License version 3, |
4972 | 6 | * as published by the Free Software Foundation. | 6 | * as published by the Free Software Foundation. |
4973 | 7 | * | 7 | * |
4974 | 8 | * This program is distributed in the hope that it will be useful, | 8 | * This program is distributed in the hope that it will be useful, |
4975 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
4976 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
4978 | 11 | * GNU General Public License for more details. | 11 | * GNU Lesser General Public License for more details. |
4979 | 12 | * | 12 | * |
4981 | 13 | * You should have received a copy of the GNU General Public License | 13 | * You should have received a copy of the GNU Lesser General Public License |
4982 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
4983 | 15 | * | 15 | * |
4984 | 16 | * Authored by: | 16 | * Authored by: |
4985 | 17 | 17 | ||
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 | 2 | * Copyright © 2013 Canonical Ltd. | 2 | * Copyright © 2013 Canonical Ltd. |
4991 | 3 | * | 3 | * |
4992 | 4 | * This program is free software: you can redistribute it and/or modify it | 4 | * This program is free software: you can redistribute it and/or modify it |
4994 | 5 | * under the terms of the GNU General Public License version 3, | 5 | * under the terms of the GNU Lesser General Public License version 3, |
4995 | 6 | * as published by the Free Software Foundation. | 6 | * as published by the Free Software Foundation. |
4996 | 7 | * | 7 | * |
4997 | 8 | * This program is distributed in the hope that it will be useful, | 8 | * This program is distributed in the hope that it will be useful, |
4998 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
4999 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
5000 | 11 | * GNU General Public License for more details. |
The diff has been truncated for viewing.