Merge lp:~kdub/mir/unit-test-cleanup into lp:mir/0.1
- unit-test-cleanup
- Merge into trusty
Proposed by
Kevin DuBois
Status: | Superseded | ||||||||
---|---|---|---|---|---|---|---|---|---|
Proposed branch: | lp:~kdub/mir/unit-test-cleanup | ||||||||
Merge into: | lp:mir/0.1 | ||||||||
Diff against target: |
26370 lines (+11033/-4123) (has conflicts) 348 files modified
3rd_party/android-input/android/CMakeLists.txt (+1/-0) 3rd_party/android-input/android/frameworks/base/include/androidfw/Input.h (+5/-2) 3rd_party/android-input/android/frameworks/base/include/androidfw/InputTransport.h (+10/-7) 3rd_party/android-input/android/frameworks/base/include/androidfw/IntSet.h (+104/-0) 3rd_party/android-input/android/frameworks/base/include/androidfw/VelocityControl.h (+2/-0) 3rd_party/android-input/android/frameworks/base/include/androidfw/VelocityTracker.h (+24/-22) 3rd_party/android-input/android/frameworks/base/services/input/InputDevice.cpp (+6/-3) 3rd_party/android-input/android/frameworks/base/services/input/InputDispatcher.cpp (+40/-33) 3rd_party/android-input/android/frameworks/base/services/input/InputDispatcher.h (+6/-6) 3rd_party/android-input/android/frameworks/base/services/input/InputEventPrinter.h (+138/-0) 3rd_party/android-input/android/frameworks/base/services/input/InputListener.h (+1/-1) 3rd_party/android-input/android/frameworks/base/services/input/InputReader.cpp (+409/-354) 3rd_party/android-input/android/frameworks/base/services/input/InputReader.h (+68/-40) 3rd_party/android-input/android/frameworks/base/services/input/InputTransport.cpp (+8/-8) 3rd_party/android-input/android/frameworks/base/services/input/IntSet.cpp (+123/-0) 3rd_party/android-input/android/frameworks/base/services/input/PointerController.cpp (+5/-8) 3rd_party/android-input/android/frameworks/base/services/input/PointerController.h (+2/-5) 3rd_party/android-input/android/frameworks/base/services/input/VelocityControl.cpp (+2/-2) 3rd_party/android-input/android/frameworks/base/services/input/VelocityTracker.cpp (+80/-83) debian/changelog (+130/-0) debian/control (+8/-0) debian/libmirserver11.install (+4/-0) doc/Doxyfile.in (+192/-82) doc/component_reports.md (+1/-0) doc/installing_prebuilt_on_pc.md (+6/-1) doc/using_mir_on_pc.md (+14/-0) examples/CMakeLists.txt (+1/-0) examples/buffer_render_target.cpp (+3/-1) examples/buffer_render_target.h (+1/-0) examples/demo-inprocess-surface-client/inprocess_egl_client.cpp (+5/-1) examples/demo-shell/demo_shell.cpp (+3/-0) examples/demo-shell/window_manager.cpp (+102/-14) examples/demo-shell/window_manager.h (+6/-2) examples/demo_input_filter.cpp (+25/-3) examples/eglapp.c (+16/-8) examples/progressbar.c (+9/-4) examples/render_surfaces.cpp (+19/-17) include/client/mir_toolkit/mir_client_library.h (+1/-1) include/platform/mir/graphics/basic_platform.h (+45/-0) include/platform/mir/graphics/buffer_ipc_packer.h (+2/-0) include/platform/mir/graphics/egl_resources.h (+10/-4) include/platform/mir/graphics/native_platform.h (+1/-1) include/platform/mir/graphics/platform.h (+4/-3) include/server/mir/compositor/buffer_stream.h (+1/-0) include/server/mir/compositor/scene.h (+1/-1) include/server/mir/default_configuration_options.h (+6/-1) include/server/mir/default_server_configuration.h (+54/-34) include/server/mir/frontend/shell.h (+2/-2) include/server/mir/frontend/surface.h (+4/-21) include/server/mir/shell/snapshot.h (+3/-3) include/server/mir/shell/surface.h (+21/-68) include/server/mir/shell/surface_controller.h (+2/-2) include/server/mir/surfaces/surfaces_report.h (+63/-0) include/shared/mir/geometry/dimensions.h (+1/-0) include/shared/mir/geometry/displacement.h (+2/-6) include/shared/mir/geometry/point.h (+2/-7) include/shared/mir/geometry/rectangle.h (+2/-7) include/shared/mir/geometry/size.h (+2/-7) include/shared/mir/graphics/android/mir_native_window.h (+2/-0) include/shared/mir/input/input_platform.h (+3/-1) include/shared/mir/input/input_receiver_report.h (+48/-0) include/shared/mir/input/null_input_receiver_report.h (+46/-0) include/shared/mir_toolkit/client_types.h (+2/-1) include/shared/mir_toolkit/common.h (+4/-5) include/shared/mir_toolkit/event.h (+9/-1) include/shared/mir_toolkit/mir_native_buffer.h (+6/-2) include/test/mir_test/client_event_matchers.h (+119/-0) include/test/mir_test/draw/draw_pattern_checkered-inl.h (+10/-5) include/test/mir_test_doubles/mock_buffer_packer.h (+1/-0) include/test/mir_test_doubles/mock_buffer_stream.h (+1/-0) include/test/mir_test_doubles/mock_display_device.h (+1/-2) include/test/mir_test_doubles/mock_egl.h (+17/-1) include/test/mir_test_doubles/mock_framebuffer_bundle.h (+50/-0) include/test/mir_test_doubles/mock_frontend_surface.h (+1/-1) include/test/mir_test_doubles/mock_gl.h (+2/-0) include/test/mir_test_doubles/mock_hwc_composer_device_1.h (+28/-4) include/test/mir_test_doubles/mock_surface.h (+4/-4) include/test/mir_test_doubles/mock_surface_controller.h (+1/-1) include/test/mir_test_doubles/mock_surface_state.h (+1/-0) include/test/mir_test_doubles/null_platform.h (+7/-3) include/test/mir_test_doubles/null_session_event_sink.h (+5/-1) include/test/mir_test_doubles/null_snapshot_strategy.h (+5/-1) include/test/mir_test_doubles/stub_buffer_stream.h (+4/-0) include/test/mir_test_doubles/stub_display_buffer_factory.h (+75/-0) include/test/mir_test_doubles/stub_display_configuration.h (+11/-4) include/test/mir_test_doubles/stub_display_device.h (+13/-1) include/test/mir_test_doubles/stub_surface.h (+1/-1) include/test/mir_test_doubles/stub_surface_builder.h (+16/-3) include/test/mir_test_doubles/stub_surface_controller.h (+1/-1) include/test/mir_test_framework/input_testing_server_configuration.h (+2/-10) include/test/mir_test_framework/udev_environment.h (+12/-1) src/client/CMakeLists.txt (+1/-0) src/client/android/android_client_buffer.cpp (+2/-0) src/client/android/android_client_buffer_factory.cpp (+7/-1) src/client/android/client_surface_interpreter.cpp (+1/-1) src/client/default_connection_configuration.cpp (+20/-2) src/client/default_connection_configuration.h (+9/-0) src/client/gbm/gbm_client_buffer_factory.cpp (+6/-1) src/client/logging/input_receiver_report.cpp (+125/-0) src/client/logging/input_receiver_report.h (+54/-0) src/client/lttng/rpc_report_tp.h (+14/-0) src/client/mir_client_library.cpp (+1/-1) src/client/mir_connection.cpp (+6/-8) src/client/mir_connection.h (+2/-2) src/client/mir_surface.cpp (+16/-5) src/client/mir_surface.h (+1/-1) src/platform/graphics/egl_resources.cpp (+30/-6) src/server/CMakeLists.txt (+12/-1) src/server/compositor/buffer_stream_surfaces.cpp (+5/-0) src/server/compositor/buffer_stream_surfaces.h (+1/-0) src/server/default_configuration_options.cpp (+15/-3) src/server/frontend/CMakeLists.txt (+0/-1) src/server/frontend/default_configuration.cpp (+98/-10) src/server/frontend/protobuf_buffer_packer.cpp (+6/-0) src/server/frontend/protobuf_buffer_packer.h (+1/-0) src/server/frontend/published_socket_connector.cpp (+5/-5) src/server/frontend/published_socket_connector.h (+3/-3) src/server/frontend/session_mediator.cpp (+68/-34) src/server/frontend/session_mediator.h (+8/-4) src/server/frontend/surface.cpp (+1/-16) src/server/graphics/CMakeLists.txt (+1/-0) src/server/graphics/android/CMakeLists.txt (+3/-1) src/server/graphics/android/android_buffer_allocator.cpp (+1/-1) src/server/graphics/android/android_display.cpp (+18/-12) src/server/graphics/android/android_display.h (+21/-1) src/server/graphics/android/android_display_buffer_factory.h (+14/-6) src/server/graphics/android/android_graphic_buffer_allocator.h (+1/-1) src/server/graphics/android/android_platform.cpp (+42/-3) src/server/graphics/android/android_platform.h (+17/-2) src/server/graphics/android/display_buffer.cpp (+62/-0) src/server/graphics/android/display_buffer.h (+58/-0) src/server/graphics/android/display_buffer_factory.cpp (+79/-1) src/server/graphics/android/display_buffer_factory.h (+26/-3) src/server/graphics/android/display_device.h (+9/-0) src/server/graphics/android/display_resource_factory.h (+16/-0) src/server/graphics/android/fb_device.cpp (+23/-13) src/server/graphics/android/fb_device.h (+5/-1) src/server/graphics/android/framebuffer_bundle.h (+16/-11) src/server/graphics/android/framebuffers.cpp (+116/-10) src/server/graphics/android/framebuffers.h (+18/-13) src/server/graphics/android/gl_context.cpp (+155/-0) src/server/graphics/android/gl_context.h (+78/-0) src/server/graphics/android/graphic_buffer_allocator.h (+1/-1) src/server/graphics/android/hwc10_device.cpp (+36/-28) src/server/graphics/android/hwc10_device.h (+27/-1) src/server/graphics/android/hwc11_device.cpp (+34/-40) src/server/graphics/android/hwc11_device.h (+22/-2) src/server/graphics/android/hwc_common_device.cpp (+1/-7) src/server/graphics/android/hwc_layerlist.cpp (+91/-102) src/server/graphics/android/hwc_layerlist.h (+38/-59) src/server/graphics/android/resource_factory.cpp (+66/-2) src/server/graphics/android/resource_factory.h (+28/-0) src/server/graphics/android/server_render_window.cpp (+13/-4) src/server/graphics/android/server_render_window.h (+12/-0) src/server/graphics/default_configuration.cpp (+160/-0) src/server/graphics/gbm/CMakeLists.txt (+1/-1) src/server/graphics/gbm/gbm_buffer.cpp (+4/-0) src/server/graphics/gbm/gbm_display.cpp (+14/-6) src/server/graphics/gbm/gbm_display.h (+1/-3) src/server/graphics/gbm/gbm_display_helpers.cpp (+26/-76) src/server/graphics/gbm/gbm_display_helpers.h (+4/-20) src/server/graphics/gbm/gbm_platform.cpp (+9/-5) src/server/graphics/gbm/gbm_platform.h (+4/-3) src/server/graphics/gbm/linux_virtual_terminal.cpp (+11/-1) src/server/graphics/gbm/native_gbm_platform.cpp (+1/-3) src/server/graphics/gbm/native_gbm_platform.h (+1/-1) src/server/graphics/gbm/udev_video_devices.cpp (+0/-58) src/server/graphics/gbm/udev_video_devices.h (+0/-50) src/server/graphics/gbm/udev_wrapper.cpp (+275/-0) src/server/graphics/gbm/udev_wrapper.h (+149/-0) src/server/graphics/gbm/video_devices.h (+0/-52) src/server/graphics/nested/nested_display.cpp (+25/-3) src/server/graphics/nested/nested_platform.cpp (+7/-2) src/server/graphics/nested/nested_platform.h (+2/-2) src/server/graphics/offscreen/CMakeLists.txt (+13/-0) src/server/graphics/offscreen/display.cpp (+197/-0) src/server/graphics/offscreen/display.h (+105/-0) src/server/graphics/offscreen/display_buffer.cpp (+156/-0) src/server/graphics/offscreen/display_buffer.h (+82/-0) src/server/graphics/offscreen/display_configuration.cpp (+72/-0) src/server/graphics/offscreen/display_configuration.h (+51/-0) src/server/graphics/offscreen/gl_extensions_base.cpp (+51/-0) src/server/graphics/offscreen/gl_extensions_base.h (+47/-0) src/server/graphics/offscreen/surfaceless_egl_context.cpp (+132/-0) src/server/graphics/offscreen/surfaceless_egl_context.h (+59/-0) src/server/input/android/dummy_android_pointer_controller.h (+2/-4) src/server/logging/default_configuration.cpp (+91/-0) src/server/logging/display_report.cpp (+3/-2) src/server/lttng/input_report_tp.h (+13/-0) src/server/lttng/message_processor_report_tp.h (+14/-0) src/server/shell/CMakeLists.txt (+4/-8) src/server/shell/default_configuration.cpp (+76/-0) src/server/shell/focus_sequence.h (+0/-51) src/server/surfaces/CMakeLists.txt (+20/-2) src/server/surfaces/application_session.cpp (+19/-18) src/server/surfaces/application_session.h (+19/-11) src/server/surfaces/basic_surface.h (+47/-3) src/server/surfaces/broadcasting_session_event_sink.cpp (+13/-12) src/server/surfaces/broadcasting_session_event_sink.h (+10/-13) src/server/surfaces/default_configuration.cpp (+282/-0) src/server/surfaces/default_session_container.cpp (+31/-3) src/server/surfaces/default_session_container.h (+11/-11) src/server/surfaces/gl_pixel_buffer.cpp (+9/-9) src/server/surfaces/gl_pixel_buffer.h (+4/-4) src/server/surfaces/global_event_sender.cpp (+10/-5) src/server/surfaces/global_event_sender.h (+8/-10) src/server/surfaces/mediating_display_changer.cpp (+17/-11) src/server/surfaces/mediating_display_changer.h (+6/-8) src/server/surfaces/mutable_surface_state.h (+1/-0) src/server/surfaces/pixel_buffer.h (+4/-5) src/server/surfaces/session_container.h (+14/-11) src/server/surfaces/session_event_handler_register.h (+8/-9) src/server/surfaces/session_event_sink.h (+8/-9) src/server/surfaces/session_manager.cpp (+29/-29) src/server/surfaces/session_manager.h (+22/-29) src/server/surfaces/snapshot_strategy.h (+8/-6) src/server/surfaces/surface.cpp (+33/-1) src/server/surfaces/surface.h (+81/-0) src/server/surfaces/surface_allocator.cpp (+7/-3) src/server/surfaces/surface_allocator.h (+1/-1) src/server/surfaces/surface_builder.h (+11/-8) src/server/surfaces/surface_controller.cpp (+8/-3) src/server/surfaces/surface_controller.h (+11/-2) src/server/surfaces/surface_data.cpp (+10/-0) src/server/surfaces/surface_data.h (+1/-0) src/server/surfaces/surface_factory.h (+2/-2) src/server/surfaces/surface_impl.cpp (+49/-31) src/server/surfaces/surface_impl.h (+114/-0) src/server/surfaces/surface_source.cpp (+9/-4) src/server/surfaces/surface_source.h (+13/-9) src/server/surfaces/surface_stack.cpp (+25/-7) src/server/surfaces/surface_stack.h (+9/-5) src/server/surfaces/surface_stack_model.h (+4/-4) src/server/surfaces/surfaces_report.cpp (+129/-0) src/server/surfaces/surfaces_report.h (+59/-0) src/server/surfaces/threaded_snapshot_strategy.cpp (+10/-9) src/server/surfaces/threaded_snapshot_strategy.h (+6/-7) src/shared/geometry/CMakeLists.txt (+1/-0) src/shared/geometry/ostream.cpp (+60/-0) src/shared/geometry/rectangles.cpp (+0/-9) src/shared/graphics/android/mir_native_window.cpp (+22/-9) src/shared/input/android/android_input_lexicon.cpp (+3/-0) src/shared/input/android/android_input_platform.cpp (+11/-3) src/shared/input/android/android_input_platform.h (+4/-1) src/shared/input/android/android_input_receiver.cpp (+9/-2) src/shared/input/android/android_input_receiver.h (+7/-2) src/shared/protobuf/mir_protobuf.proto (+8/-32) tests/acceptance-tests/test_client_authorization.cpp (+9/-57) tests/acceptance-tests/test_client_focus_notification.cpp (+13/-46) tests/acceptance-tests/test_client_input.cpp (+393/-617) tests/acceptance-tests/test_client_library.cpp (+75/-0) tests/acceptance-tests/test_display_configuration.cpp (+6/-16) tests/acceptance-tests/test_focus_selection.cpp (+14/-51) tests/acceptance-tests/test_server_shutdown.cpp (+1/-1) tests/acceptance-tests/test_surfaceloop.cpp (+0/-1) tests/draw/android_graphics.cpp (+2/-1) tests/draw/patterns.cpp (+12/-10) tests/integration-tests/CMakeLists.txt (+2/-0) tests/integration-tests/client/test_client_render.cpp (+76/-37) tests/integration-tests/compositor/test_buffer_stream.cpp (+73/-0) tests/integration-tests/graphics/android/test_display_integration.cpp (+58/-10) tests/integration-tests/graphics/android/test_internal_client.cpp (+21/-4) tests/integration-tests/graphics/gbm/test_buffer_integration.cpp (+5/-9) tests/integration-tests/shell/CMakeLists.txt (+0/-2) tests/integration-tests/shell/test_session_lifecycle_event.cpp (+4/-3) tests/integration-tests/test_display_info.cpp (+20/-16) tests/integration-tests/test_drm_auth_magic.cpp (+2/-17) tests/integration-tests/test_session.cpp (+18/-18) tests/integration-tests/test_session_manager.cpp (+16/-7) tests/integration-tests/test_surfaceloop.cpp (+9/-20) tests/integration-tests/test_swapinterval.cpp (+1/-0) tests/mir_test_doubles/mock_egl.cpp (+1/-40) tests/mir_test_doubles/mock_gl.cpp (+12/-0) tests/mir_test_framework/input_testing_server_options.cpp (+0/-112) tests/mir_test_framework/testing_server_options.cpp (+20/-20) tests/mir_test_framework/udev_environment.cpp (+45/-0) tests/unit-tests/android_input/CMakeLists.txt (+1/-0) tests/unit-tests/android_input/input_reader.cpp (+156/-98) tests/unit-tests/android_input/int_set.cpp (+133/-0) tests/unit-tests/client/android/test_android_native_window.cpp (+22/-4) tests/unit-tests/client/android/test_client_android_registrar.cpp (+1/-1) tests/unit-tests/client/android/test_client_surface_interpreter.cpp (+16/-0) tests/unit-tests/client/gbm/test_gbm_client_buffer.cpp (+21/-0) tests/unit-tests/client/input/test_android_input_receiver.cpp (+8/-5) tests/unit-tests/client/input/test_android_input_receiver_thread.cpp (+5/-2) tests/unit-tests/client/test_android_client_buffer_factory.cpp (+5/-5) tests/unit-tests/client/test_client_mir_surface.cpp (+48/-1) tests/unit-tests/client/test_mir_connection.cpp (+15/-4) tests/unit-tests/compositor/test_buffer_stream.cpp (+12/-0) tests/unit-tests/compositor/test_default_display_buffer_compositor.cpp (+1/-1) tests/unit-tests/compositor/test_gl_renderer.cpp (+1/-4) tests/unit-tests/draw/test_draw_patterns.cpp (+10/-11) tests/unit-tests/frontend/CMakeLists.txt (+4/-0) tests/unit-tests/frontend/test_protobuf_buffer_packer.cpp (+3/-0) tests/unit-tests/frontend/test_session_mediator.cpp (+24/-20) tests/unit-tests/frontend/test_session_mediator_android.cpp (+10/-18) tests/unit-tests/frontend/test_session_mediator_gbm.cpp (+10/-19) tests/unit-tests/graphics/CMakeLists.txt (+1/-0) tests/unit-tests/graphics/android/CMakeLists.txt (+1/-0) tests/unit-tests/graphics/android/test_android_buffer_allocator.cpp (+1/-1) tests/unit-tests/graphics/android/test_android_fb.cpp (+214/-2) tests/unit-tests/graphics/android/test_android_platform.cpp (+43/-6) tests/unit-tests/graphics/android/test_buffer.cpp (+1/-1) tests/unit-tests/graphics/android/test_buffer_tex_bind.cpp (+2/-9) tests/unit-tests/graphics/android/test_display_buffer_factory.cpp (+215/-0) tests/unit-tests/graphics/android/test_fb_device.cpp (+59/-16) tests/unit-tests/graphics/android/test_fb_simple_swapper.cpp (+179/-106) tests/unit-tests/graphics/android/test_hwc10_device.cpp (+75/-33) tests/unit-tests/graphics/android/test_hwc11_device.cpp (+89/-34) tests/unit-tests/graphics/android/test_hwc_device.cpp (+59/-49) tests/unit-tests/graphics/android/test_hwc_display.cpp (+134/-21) tests/unit-tests/graphics/android/test_hwc_layerlist.cpp (+119/-136) tests/unit-tests/graphics/android/test_internal_client_interpreter.cpp (+3/-3) tests/unit-tests/graphics/android/test_interpreter_buffer_cache.cpp (+1/-1) tests/unit-tests/graphics/android/test_resource_factory.cpp (+69/-28) tests/unit-tests/graphics/android/test_server_interpreter.cpp (+49/-14) tests/unit-tests/graphics/android/test_sync_fence.cpp (+1/-1) tests/unit-tests/graphics/gbm/CMakeLists.txt (+1/-1) tests/unit-tests/graphics/gbm/test_gbm_display.cpp (+57/-20) tests/unit-tests/graphics/gbm/test_gbm_platform.cpp (+20/-10) tests/unit-tests/graphics/gbm/test_linux_virtual_terminal.cpp (+58/-5) tests/unit-tests/graphics/gbm/test_udev_helper.cpp (+467/-0) tests/unit-tests/graphics/gbm/test_udev_video_devices.cpp (+0/-76) tests/unit-tests/graphics/nested/CMakeLists.txt (+1/-0) tests/unit-tests/graphics/nested/test_nested_platform.cpp (+27/-0) tests/unit-tests/graphics/offscreen/CMakeLists.txt (+6/-0) tests/unit-tests/graphics/offscreen/test_offscreen_display.cpp (+147/-0) tests/unit-tests/graphics/test_display.cpp (+21/-4) tests/unit-tests/input/android/test_android_communication_package.cpp (+2/-2) tests/unit-tests/input/android/test_android_input_lexicon.cpp (+55/-14) tests/unit-tests/input/android/test_android_input_manager.cpp (+2/-2) tests/unit-tests/logging/test_display_report.cpp (+2/-1) tests/unit-tests/shell/CMakeLists.txt (+3/-8) tests/unit-tests/shell/test_mediating_display_changer.cpp (+5/-0) tests/unit-tests/surfaces/CMakeLists.txt (+10/-0) tests/unit-tests/surfaces/test_application_session.cpp (+11/-11) tests/unit-tests/surfaces/test_broadcasting_session_event_sink.cpp (+8/-3) tests/unit-tests/surfaces/test_default_focus_mechanism.cpp (+11/-6) tests/unit-tests/surfaces/test_gl_pixel_buffer.cpp (+8/-4) tests/unit-tests/surfaces/test_global_event_sender.cpp (+9/-3) tests/unit-tests/surfaces/test_session_manager.cpp (+29/-29) tests/unit-tests/surfaces/test_surface.cpp (+55/-1) tests/unit-tests/surfaces/test_surface_controller.cpp (+10/-5) tests/unit-tests/surfaces/test_surface_data.cpp (+19/-1) tests/unit-tests/surfaces/test_surface_impl.cpp (+46/-30) tests/unit-tests/surfaces/test_surface_stack.cpp (+2/-2) tests/unit-tests/surfaces/test_the_session_container_implementation.cpp (+43/-32) tests/unit-tests/surfaces/test_threaded_snapshot_strategy.cpp (+8/-2) Text conflict in debian/changelog Text conflict in debian/control Path conflict: debian/libmirserver10.install / debian/libmirserver11.install Text conflict in debian/libmirserver11.install Text conflict in doc/using_mir_on_pc.md Text conflict in examples/demo-inprocess-surface-client/inprocess_egl_client.cpp Text conflict in examples/demo-shell/demo_shell.cpp Text conflict in include/server/mir/default_configuration_options.h Text conflict in include/server/mir/default_server_configuration.h Text conflict in include/server/mir/surfaces/surfaces_report.h Text conflict in include/test/mir_test_doubles/null_session_event_sink.h Text conflict in include/test/mir_test_doubles/null_snapshot_strategy.h Text conflict in include/test/mir_test_doubles/stub_display_device.h Text conflict in include/test/mir_test_doubles/stub_surface_builder.h Text conflict in src/server/CMakeLists.txt Text conflict in src/server/default_configuration_options.cpp Text conflict in src/server/frontend/default_configuration.cpp Path conflict: src/server/frontend/global_event_sender.h / src/server/surfaces/global_event_sender.h Text conflict in src/server/frontend/session_mediator.cpp Text conflict in src/server/graphics/android/android_display.cpp Text conflict in src/server/graphics/android/android_display.h Text conflict in src/server/graphics/android/android_display_buffer_factory.h Text conflict in src/server/graphics/android/android_platform.cpp Text conflict in src/server/graphics/android/android_platform.h Text conflict in src/server/graphics/android/display_buffer_factory.cpp Text conflict in src/server/graphics/android/display_buffer_factory.h Text conflict in src/server/graphics/android/display_device.h Text conflict in src/server/graphics/android/display_resource_factory.h Text conflict in src/server/graphics/android/fb_device.cpp Text conflict in src/server/graphics/android/hwc10_device.cpp Text conflict in src/server/graphics/android/hwc10_device.h Text conflict in src/server/graphics/android/hwc11_device.cpp Text conflict in src/server/graphics/android/hwc11_device.h Text conflict in src/server/graphics/android/resource_factory.cpp Text conflict in src/server/graphics/android/resource_factory.h Text conflict in src/server/graphics/android/server_render_window.cpp Text conflict in src/server/graphics/android/server_render_window.h Text conflict in src/server/graphics/default_configuration.cpp Text conflict in src/server/logging/default_configuration.cpp Path conflict: src/server/logging/surfaces_report.h / src/server/surfaces/surfaces_report.h Text conflict in src/server/shell/CMakeLists.txt Path conflict: src/server/shell/broadcasting_session_event_sink.h / src/server/surfaces/broadcasting_session_event_sink.h Text conflict in src/server/shell/default_configuration.cpp Path conflict: src/server/shell/default_session_container.h / src/server/surfaces/default_session_container.h Path conflict: src/server/shell/focus_sequence.h / <deleted> Path conflict: src/server/shell/gl_pixel_buffer.h / src/server/surfaces/gl_pixel_buffer.h Path conflict: src/server/shell/mediating_display_changer.h / src/server/surfaces/mediating_display_changer.h Path conflict: src/server/shell/pixel_buffer.h / src/server/surfaces/pixel_buffer.h Contents conflict in src/server/shell/registration_order_focus_sequence.cpp Contents conflict in src/server/shell/registration_order_focus_sequence.h Path conflict: src/server/shell/session_event_handler_register.h / src/server/surfaces/session_event_handler_register.h Path conflict: src/server/shell/session_event_sink.h / src/server/surfaces/session_event_sink.h Path conflict: src/server/shell/snapshot_strategy.h / src/server/surfaces/snapshot_strategy.h Path conflict: src/server/shell/surface_source.h / src/server/surfaces/surface_source.h Path conflict: src/server/shell/threaded_snapshot_strategy.h / src/server/surfaces/threaded_snapshot_strategy.h Text conflict in src/server/surfaces/CMakeLists.txt Text conflict in src/server/surfaces/application_session.h Text conflict in src/server/surfaces/basic_surface.h Text conflict in src/server/surfaces/default_configuration.cpp Text conflict in src/server/surfaces/default_session_container.cpp Text conflict in src/server/surfaces/global_event_sender.cpp Text conflict in src/server/surfaces/mediating_display_changer.cpp Text conflict in src/server/surfaces/session_manager.cpp Text conflict in src/server/surfaces/surface.cpp Text conflict in src/server/surfaces/surface_allocator.cpp Text conflict in src/server/surfaces/surface_controller.cpp Text conflict in src/server/surfaces/surface_controller.h Text conflict in src/server/surfaces/surface_source.cpp Text conflict in src/server/surfaces/surface_stack.cpp Text conflict in src/server/surfaces/surface_stack.h Text conflict in src/server/surfaces/surfaces_report.cpp Text conflict in src/server/surfaces/surfaces_report.h Text conflict in tests/acceptance-tests/test_client_input.cpp Text conflict in tests/acceptance-tests/test_display_configuration.cpp Text conflict in tests/acceptance-tests/test_focus_selection.cpp Text conflict in tests/integration-tests/graphics/android/test_display_integration.cpp Text conflict in tests/integration-tests/graphics/android/test_internal_client.cpp Text conflict in tests/integration-tests/test_display_info.cpp Text conflict in tests/integration-tests/test_session.cpp Text conflict in tests/integration-tests/test_session_manager.cpp Text conflict in tests/unit-tests/frontend/CMakeLists.txt Text conflict in tests/unit-tests/frontend/test_session_mediator.cpp Text conflict in tests/unit-tests/frontend/test_session_mediator_android.cpp Text conflict in tests/unit-tests/frontend/test_session_mediator_gbm.cpp Text conflict in tests/unit-tests/graphics/android/test_android_fb.cpp Text conflict in tests/unit-tests/graphics/android/test_android_platform.cpp Text conflict in tests/unit-tests/graphics/android/test_fb_device.cpp Text conflict in tests/unit-tests/graphics/android/test_hwc10_device.cpp Text conflict in tests/unit-tests/graphics/android/test_hwc11_device.cpp Text conflict in tests/unit-tests/graphics/android/test_hwc_device.cpp Text conflict in tests/unit-tests/graphics/android/test_hwc_display.cpp Text conflict in tests/unit-tests/graphics/android/test_resource_factory.cpp Text conflict in tests/unit-tests/graphics/android/test_server_interpreter.cpp Text conflict in tests/unit-tests/graphics/test_display.cpp Text conflict in tests/unit-tests/input/android/test_android_input_lexicon.cpp Text conflict in tests/unit-tests/shell/CMakeLists.txt Text conflict in tests/unit-tests/shell/test_mediating_display_changer.cpp Contents conflict in tests/unit-tests/shell/test_registration_order_focus_sequence.cpp Text conflict in tests/unit-tests/surfaces/test_broadcasting_session_event_sink.cpp Text conflict in tests/unit-tests/surfaces/test_default_focus_mechanism.cpp Text conflict in tests/unit-tests/surfaces/test_gl_pixel_buffer.cpp Text conflict in tests/unit-tests/surfaces/test_global_event_sender.cpp Text conflict in tests/unit-tests/surfaces/test_session_manager.cpp Text conflict in tests/unit-tests/surfaces/test_surface.cpp Text conflict in tests/unit-tests/surfaces/test_surface_controller.cpp Text conflict in tests/unit-tests/surfaces/test_surface_impl.cpp Text conflict in tests/unit-tests/surfaces/test_the_session_container_implementation.cpp Text conflict in tests/unit-tests/surfaces/test_threaded_snapshot_strategy.cpp |
||||||||
To merge this branch: | bzr merge lp:~kdub/mir/unit-test-cleanup | ||||||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Mir development team | Pending | ||
Review via email: mp+196191@code.launchpad.net |
Commit message
clean up unit tests (ran under android) so there's no uninitialized value errors for the unit-tests/
Description of the change
clean up unit tests (ran under android) so there's no uninitialized value errors for the unit-tests/
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file '3rd_party/android-input/android/CMakeLists.txt' | |||
2 | --- 3rd_party/android-input/android/CMakeLists.txt 2013-10-15 08:53:10 +0000 | |||
3 | +++ 3rd_party/android-input/android/CMakeLists.txt 2013-11-21 20:19:28 +0000 | |||
4 | @@ -33,6 +33,7 @@ | |||
5 | 33 | frameworks/base/services/input/InputReader.cpp | 33 | frameworks/base/services/input/InputReader.cpp |
6 | 34 | frameworks/base/services/input/InputTransport.cpp | 34 | frameworks/base/services/input/InputTransport.cpp |
7 | 35 | frameworks/base/services/input/InputWindow.cpp | 35 | frameworks/base/services/input/InputWindow.cpp |
8 | 36 | frameworks/base/services/input/IntSet.cpp | ||
9 | 36 | frameworks/base/services/input/PointerController.cpp | 37 | frameworks/base/services/input/PointerController.cpp |
10 | 37 | # Keyboard/keymap handling | 38 | # Keyboard/keymap handling |
11 | 38 | frameworks/base/services/input/GenericKeyMap.cpp | 39 | frameworks/base/services/input/GenericKeyMap.cpp |
12 | 39 | 40 | ||
13 | === modified file '3rd_party/android-input/android/frameworks/base/include/androidfw/Input.h' | |||
14 | --- 3rd_party/android-input/android/frameworks/base/include/androidfw/Input.h 2013-05-03 16:38:07 +0000 | |||
15 | +++ 3rd_party/android-input/android/frameworks/base/include/androidfw/Input.h 2013-11-21 20:19:28 +0000 | |||
16 | @@ -77,9 +77,12 @@ | |||
17 | 77 | /* | 77 | /* |
18 | 78 | * Maximum pointer id value supported in a motion event. | 78 | * Maximum pointer id value supported in a motion event. |
19 | 79 | * Smallest pointer id is 0. | 79 | * Smallest pointer id is 0. |
21 | 80 | * (This is limited by our use of BitSet32 to track pointer assignments.) | 80 | * Any reasonably large value that fits in a int32_t is fine. |
22 | 81 | * A "reasonably large" number is one that guarantees uniqueness of a touch id for some 30 seconds | ||
23 | 82 | * after its corresponding touch point has physically ended, under very heavy usage (many | ||
24 | 83 | * simultaneous taps ongoing). | ||
25 | 81 | */ | 84 | */ |
27 | 82 | #define MAX_POINTER_ID 31 | 85 | #define MAX_POINTER_ID 100000000 |
28 | 83 | 86 | ||
29 | 84 | /* | 87 | /* |
30 | 85 | * Declare a concrete type for the NDK's input event forward declaration. | 88 | * Declare a concrete type for the NDK's input event forward declaration. |
31 | 86 | 89 | ||
32 | === modified file '3rd_party/android-input/android/frameworks/base/include/androidfw/InputTransport.h' | |||
33 | --- 3rd_party/android-input/android/frameworks/base/include/androidfw/InputTransport.h 2013-05-31 16:06:07 +0000 | |||
34 | +++ 3rd_party/android-input/android/frameworks/base/include/androidfw/InputTransport.h 2013-11-21 20:19:28 +0000 | |||
35 | @@ -29,12 +29,15 @@ | |||
36 | 29 | */ | 29 | */ |
37 | 30 | 30 | ||
38 | 31 | #include <androidfw/Input.h> | 31 | #include <androidfw/Input.h> |
39 | 32 | #include <androidfw/IntSet.h> | ||
40 | 32 | #include <std/Errors.h> | 33 | #include <std/Errors.h> |
41 | 33 | #include <std/Timers.h> | 34 | #include <std/Timers.h> |
42 | 34 | #include <std/RefBase.h> | 35 | #include <std/RefBase.h> |
43 | 35 | #include <std/String8.h> | 36 | #include <std/String8.h> |
44 | 36 | #include <std/Vector.h> | 37 | #include <std/Vector.h> |
46 | 37 | #include <std/BitSet.h> | 38 | |
47 | 39 | // C++ std lib | ||
48 | 40 | #include <unordered_map> | ||
49 | 38 | 41 | ||
50 | 39 | namespace android { | 42 | namespace android { |
51 | 40 | 43 | ||
52 | @@ -352,23 +355,23 @@ | |||
53 | 352 | // Touch state per device and source, only for sources of class pointer. | 355 | // Touch state per device and source, only for sources of class pointer. |
54 | 353 | struct History { | 356 | struct History { |
55 | 354 | nsecs_t eventTime; | 357 | nsecs_t eventTime; |
58 | 355 | BitSet32 idBits; | 358 | IntSet ids; |
59 | 356 | int32_t idToIndex[MAX_POINTER_ID + 1]; | 359 | std::unordered_map<int32_t, size_t> idToIndex; |
60 | 357 | PointerCoords pointers[MAX_POINTERS]; | 360 | PointerCoords pointers[MAX_POINTERS]; |
61 | 358 | 361 | ||
62 | 359 | void initializeFrom(const InputMessage* msg) { | 362 | void initializeFrom(const InputMessage* msg) { |
63 | 360 | eventTime = msg->body.motion.eventTime; | 363 | eventTime = msg->body.motion.eventTime; |
65 | 361 | idBits.clear(); | 364 | ids.clear(); |
66 | 362 | for (size_t i = 0; i < msg->body.motion.pointerCount; i++) { | 365 | for (size_t i = 0; i < msg->body.motion.pointerCount; i++) { |
67 | 363 | uint32_t id = msg->body.motion.pointers[i].properties.id; | 366 | uint32_t id = msg->body.motion.pointers[i].properties.id; |
69 | 364 | idBits.markBit(id); | 367 | ids.insert(id); |
70 | 365 | idToIndex[id] = i; | 368 | idToIndex[id] = i; |
71 | 366 | pointers[i].copyFrom(msg->body.motion.pointers[i].coords); | 369 | pointers[i].copyFrom(msg->body.motion.pointers[i].coords); |
72 | 367 | } | 370 | } |
73 | 368 | } | 371 | } |
74 | 369 | 372 | ||
75 | 370 | const PointerCoords& getPointerById(uint32_t id) const { | 373 | const PointerCoords& getPointerById(uint32_t id) const { |
77 | 371 | return pointers[idToIndex[id]]; | 374 | return pointers[idToIndex.at(id)]; |
78 | 372 | } | 375 | } |
79 | 373 | }; | 376 | }; |
80 | 374 | struct TouchState { | 377 | struct TouchState { |
81 | @@ -385,7 +388,7 @@ | |||
82 | 385 | historyCurrent = 0; | 388 | historyCurrent = 0; |
83 | 386 | historySize = 0; | 389 | historySize = 0; |
84 | 387 | lastResample.eventTime = 0; | 390 | lastResample.eventTime = 0; |
86 | 388 | lastResample.idBits.clear(); | 391 | lastResample.ids.clear(); |
87 | 389 | } | 392 | } |
88 | 390 | 393 | ||
89 | 391 | void addHistory(const InputMessage* msg) { | 394 | void addHistory(const InputMessage* msg) { |
90 | 392 | 395 | ||
91 | === added file '3rd_party/android-input/android/frameworks/base/include/androidfw/IntSet.h' | |||
92 | --- 3rd_party/android-input/android/frameworks/base/include/androidfw/IntSet.h 1970-01-01 00:00:00 +0000 | |||
93 | +++ 3rd_party/android-input/android/frameworks/base/include/androidfw/IntSet.h 2013-11-21 20:19:28 +0000 | |||
94 | @@ -0,0 +1,104 @@ | |||
95 | 1 | /* | ||
96 | 2 | * Copyright © 2013 Canonical Ltd. | ||
97 | 3 | * | ||
98 | 4 | * This program is free software: you can redistribute it and/or modify it | ||
99 | 5 | * under the terms of the GNU Lesser General Public License version 3, | ||
100 | 6 | * as published by the Free Software Foundation. | ||
101 | 7 | * | ||
102 | 8 | * This program is distributed in the hope that it will be useful, | ||
103 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
104 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
105 | 11 | * GNU Lesser General Public License for more details. | ||
106 | 12 | * | ||
107 | 13 | * You should have received a copy of the GNU Lesser General Public License | ||
108 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
109 | 15 | * | ||
110 | 16 | * Author: Daniel d'Andrada <daniel.dandrada@canonical.com> | ||
111 | 17 | */ | ||
112 | 18 | |||
113 | 19 | #ifndef ANDROID_INTSET_H | ||
114 | 20 | #define ANDROID_INTSET_H | ||
115 | 21 | |||
116 | 22 | #include <assert.h> | ||
117 | 23 | |||
118 | 24 | // C++ std lib | ||
119 | 25 | #include <algorithm> | ||
120 | 26 | #include <sstream> | ||
121 | 27 | #include <set> | ||
122 | 28 | |||
123 | 29 | #ifdef ANDROID_INPUT_INTSET_TEST | ||
124 | 30 | namespace test { | ||
125 | 31 | #endif | ||
126 | 32 | |||
127 | 33 | namespace android { | ||
128 | 34 | |||
129 | 35 | /* | ||
130 | 36 | A set of integers | ||
131 | 37 | |||
132 | 38 | It serves two purposes: | ||
133 | 39 | - Provide a convenience wrapper for std::set<int32_t>. Because the std API is cumbersome. | ||
134 | 40 | - Provide an API similar to the BitSet32 class that it's replacing. | ||
135 | 41 | */ | ||
136 | 42 | class IntSet { | ||
137 | 43 | public: | ||
138 | 44 | |||
139 | 45 | #ifdef ANDROID_INPUT_INTSET_TEST | ||
140 | 46 | static int constructionCount; | ||
141 | 47 | static int destructionCount; | ||
142 | 48 | #endif | ||
143 | 49 | |||
144 | 50 | IntSet(); | ||
145 | 51 | IntSet(std::initializer_list<int32_t> list); | ||
146 | 52 | virtual ~IntSet(); | ||
147 | 53 | |||
148 | 54 | IntSet operator -(const IntSet &other) const; | ||
149 | 55 | IntSet operator &(const IntSet &other) const; | ||
150 | 56 | bool operator ==(const IntSet &other) const; | ||
151 | 57 | |||
152 | 58 | std::set<int32_t>::iterator begin() { return stdSet.begin(); } | ||
153 | 59 | std::set<int32_t>::const_iterator begin() const { return stdSet.begin(); } | ||
154 | 60 | std::set<int32_t>::iterator end() { return stdSet.end(); } | ||
155 | 61 | std::set<int32_t>::const_iterator end() const { return stdSet.end(); } | ||
156 | 62 | std::set<int32_t>::const_iterator cbegin() const { return stdSet.cbegin(); } | ||
157 | 63 | std::set<int32_t>::const_iterator cend() const { return stdSet.cend(); } | ||
158 | 64 | |||
159 | 65 | void clear() { stdSet.clear(); } | ||
160 | 66 | void insert(int32_t value) { stdSet.insert(value); } | ||
161 | 67 | |||
162 | 68 | template<typename Func> | ||
163 | 69 | void forEach(Func func) { std::for_each(stdSet.begin(), stdSet.end(), func); } | ||
164 | 70 | |||
165 | 71 | template<typename Func> | ||
166 | 72 | void forEach(Func func) const { std::for_each(stdSet.begin(), stdSet.end(), func); } | ||
167 | 73 | |||
168 | 74 | void remove(int32_t value) { stdSet.erase(value); } | ||
169 | 75 | void remove(const IntSet &values); | ||
170 | 76 | |||
171 | 77 | size_t size() const { return stdSet.size(); } | ||
172 | 78 | size_t count() const { return stdSet.size(); } | ||
173 | 79 | |||
174 | 80 | bool isEmpty() const { return stdSet.empty(); } | ||
175 | 81 | |||
176 | 82 | bool contains(int32_t value) const; | ||
177 | 83 | |||
178 | 84 | int32_t first() const { return *stdSet.cbegin(); } | ||
179 | 85 | |||
180 | 86 | // It's assumed that the given value does exist in the set | ||
181 | 87 | size_t indexOf(int32_t value) const; | ||
182 | 88 | |||
183 | 89 | std::string toString() const; | ||
184 | 90 | |||
185 | 91 | private: | ||
186 | 92 | void remove(std::set<int32_t>::iterator selfIterator, | ||
187 | 93 | std::set<int32_t>::const_iterator otherIterator, | ||
188 | 94 | std::set<int32_t>::const_iterator otherEnd); | ||
189 | 95 | std::set<int32_t> stdSet; | ||
190 | 96 | }; | ||
191 | 97 | |||
192 | 98 | } // namespace android | ||
193 | 99 | |||
194 | 100 | #ifdef ANDROID_INPUT_INTSET_TEST | ||
195 | 101 | } // namespace test | ||
196 | 102 | #endif | ||
197 | 103 | |||
198 | 104 | #endif | ||
199 | 0 | 105 | ||
200 | === modified file '3rd_party/android-input/android/frameworks/base/include/androidfw/VelocityControl.h' | |||
201 | --- 3rd_party/android-input/android/frameworks/base/include/androidfw/VelocityControl.h 2013-05-03 16:38:07 +0000 | |||
202 | +++ 3rd_party/android-input/android/frameworks/base/include/androidfw/VelocityControl.h 2013-11-21 20:19:28 +0000 | |||
203 | @@ -19,6 +19,7 @@ | |||
204 | 19 | 19 | ||
205 | 20 | 20 | ||
206 | 21 | #include <androidfw/Input.h> | 21 | #include <androidfw/Input.h> |
207 | 22 | #include <androidfw/IntSet.h> | ||
208 | 22 | #include <androidfw/VelocityTracker.h> | 23 | #include <androidfw/VelocityTracker.h> |
209 | 23 | #include <std/Timers.h> | 24 | #include <std/Timers.h> |
210 | 24 | 25 | ||
211 | @@ -101,6 +102,7 @@ | |||
212 | 101 | nsecs_t mLastMovementTime; | 102 | nsecs_t mLastMovementTime; |
213 | 102 | VelocityTracker::Position mRawPosition; | 103 | VelocityTracker::Position mRawPosition; |
214 | 103 | VelocityTracker mVelocityTracker; | 104 | VelocityTracker mVelocityTracker; |
215 | 105 | IntSet mIds; | ||
216 | 104 | }; | 106 | }; |
217 | 105 | 107 | ||
218 | 106 | } // namespace android | 108 | } // namespace android |
219 | 107 | 109 | ||
220 | === modified file '3rd_party/android-input/android/frameworks/base/include/androidfw/VelocityTracker.h' | |||
221 | --- 3rd_party/android-input/android/frameworks/base/include/androidfw/VelocityTracker.h 2013-05-03 16:38:07 +0000 | |||
222 | +++ 3rd_party/android-input/android/frameworks/base/include/androidfw/VelocityTracker.h 2013-11-21 20:19:28 +0000 | |||
223 | @@ -17,10 +17,12 @@ | |||
224 | 17 | #ifndef _ANDROIDFW_VELOCITY_TRACKER_H | 17 | #ifndef _ANDROIDFW_VELOCITY_TRACKER_H |
225 | 18 | #define _ANDROIDFW_VELOCITY_TRACKER_H | 18 | #define _ANDROIDFW_VELOCITY_TRACKER_H |
226 | 19 | 19 | ||
227 | 20 | |||
228 | 21 | #include <androidfw/Input.h> | 20 | #include <androidfw/Input.h> |
229 | 21 | #include <androidfw/IntSet.h> | ||
230 | 22 | #include <std/Timers.h> | 22 | #include <std/Timers.h> |
232 | 23 | #include <std/BitSet.h> | 23 | |
233 | 24 | // C++ std lib | ||
234 | 25 | #include <unordered_map> | ||
235 | 24 | 26 | ||
236 | 25 | namespace android { | 27 | namespace android { |
237 | 26 | 28 | ||
238 | @@ -74,14 +76,14 @@ | |||
239 | 74 | // Resets the velocity tracker state for specific pointers. | 76 | // Resets the velocity tracker state for specific pointers. |
240 | 75 | // Call this method when some pointers have changed and may be reusing | 77 | // Call this method when some pointers have changed and may be reusing |
241 | 76 | // an id that was assigned to a different pointer earlier. | 78 | // an id that was assigned to a different pointer earlier. |
243 | 77 | void clearPointers(BitSet32 idBits); | 79 | void clearPointers(const IntSet &ids); |
244 | 78 | 80 | ||
245 | 79 | // Adds movement information for a set of pointers. | 81 | // Adds movement information for a set of pointers. |
247 | 80 | // The idBits bitfield specifies the pointer ids of the pointers whose positions | 82 | // The ids set specifies the pointer ids of the pointers whose positions |
248 | 81 | // are included in the movement. | 83 | // are included in the movement. |
249 | 82 | // The positions array contains position information for each pointer in order by | 84 | // The positions array contains position information for each pointer in order by |
252 | 83 | // increasing id. Its size should be equal to the number of one bits in idBits. | 85 | // increasing id. Its size should be equal to the size of ids. |
253 | 84 | void addMovement(nsecs_t eventTime, BitSet32 idBits, const Position* positions); | 86 | void addMovement(nsecs_t eventTime, const IntSet &ids, const Position* positions); |
254 | 85 | 87 | ||
255 | 86 | // Adds movement information for all pointers in a MotionEvent, including historical samples. | 88 | // Adds movement information for all pointers in a MotionEvent, including historical samples. |
256 | 87 | void addMovement(const MotionEvent* event); | 89 | void addMovement(const MotionEvent* event); |
257 | @@ -100,13 +102,13 @@ | |||
258 | 100 | inline int32_t getActivePointerId() const { return mActivePointerId; } | 102 | inline int32_t getActivePointerId() const { return mActivePointerId; } |
259 | 101 | 103 | ||
260 | 102 | // Gets a bitset containing all pointer ids from the most recent movement. | 104 | // Gets a bitset containing all pointer ids from the most recent movement. |
262 | 103 | inline BitSet32 getCurrentPointerIdBits() const { return mCurrentPointerIdBits; } | 105 | inline const IntSet &getCurrentPointerIds() const { return mCurrentPointerIds; } |
263 | 104 | 106 | ||
264 | 105 | private: | 107 | private: |
265 | 106 | static const char* DEFAULT_STRATEGY; | 108 | static const char* DEFAULT_STRATEGY; |
266 | 107 | 109 | ||
267 | 108 | nsecs_t mLastEventTime; | 110 | nsecs_t mLastEventTime; |
269 | 109 | BitSet32 mCurrentPointerIdBits; | 111 | IntSet mCurrentPointerIds; |
270 | 110 | int32_t mActivePointerId; | 112 | int32_t mActivePointerId; |
271 | 111 | VelocityTrackerStrategy* mStrategy; | 113 | VelocityTrackerStrategy* mStrategy; |
272 | 112 | 114 | ||
273 | @@ -127,8 +129,8 @@ | |||
274 | 127 | virtual ~VelocityTrackerStrategy() { } | 129 | virtual ~VelocityTrackerStrategy() { } |
275 | 128 | 130 | ||
276 | 129 | virtual void clear() = 0; | 131 | virtual void clear() = 0; |
279 | 130 | virtual void clearPointers(BitSet32 idBits) = 0; | 132 | virtual void clearPointers(const IntSet &ids) = 0; |
280 | 131 | virtual void addMovement(nsecs_t eventTime, BitSet32 idBits, | 133 | virtual void addMovement(nsecs_t eventTime, const IntSet &ids, |
281 | 132 | const VelocityTracker::Position* positions) = 0; | 134 | const VelocityTracker::Position* positions) = 0; |
282 | 133 | virtual bool getEstimator(uint32_t id, VelocityTracker::Estimator* outEstimator) const = 0; | 135 | virtual bool getEstimator(uint32_t id, VelocityTracker::Estimator* outEstimator) const = 0; |
283 | 134 | }; | 136 | }; |
284 | @@ -159,8 +161,8 @@ | |||
285 | 159 | virtual ~LeastSquaresVelocityTrackerStrategy(); | 161 | virtual ~LeastSquaresVelocityTrackerStrategy(); |
286 | 160 | 162 | ||
287 | 161 | virtual void clear(); | 163 | virtual void clear(); |
290 | 162 | virtual void clearPointers(BitSet32 idBits); | 164 | virtual void clearPointers(const IntSet &ids); |
291 | 163 | virtual void addMovement(nsecs_t eventTime, BitSet32 idBits, | 165 | virtual void addMovement(nsecs_t eventTime, const IntSet &ids, |
292 | 164 | const VelocityTracker::Position* positions); | 166 | const VelocityTracker::Position* positions); |
293 | 165 | virtual bool getEstimator(uint32_t id, VelocityTracker::Estimator* outEstimator) const; | 167 | virtual bool getEstimator(uint32_t id, VelocityTracker::Estimator* outEstimator) const; |
294 | 166 | 168 | ||
295 | @@ -175,11 +177,11 @@ | |||
296 | 175 | 177 | ||
297 | 176 | struct Movement { | 178 | struct Movement { |
298 | 177 | nsecs_t eventTime; | 179 | nsecs_t eventTime; |
300 | 178 | BitSet32 idBits; | 180 | IntSet ids; |
301 | 179 | VelocityTracker::Position positions[MAX_POINTERS]; | 181 | VelocityTracker::Position positions[MAX_POINTERS]; |
302 | 180 | 182 | ||
303 | 181 | inline const VelocityTracker::Position& getPosition(uint32_t id) const { | 183 | inline const VelocityTracker::Position& getPosition(uint32_t id) const { |
305 | 182 | return positions[idBits.getIndexOfBit(id)]; | 184 | return positions[ids.indexOf(id)]; |
306 | 183 | } | 185 | } |
307 | 184 | }; | 186 | }; |
308 | 185 | 187 | ||
309 | @@ -202,8 +204,8 @@ | |||
310 | 202 | ~IntegratingVelocityTrackerStrategy(); | 204 | ~IntegratingVelocityTrackerStrategy(); |
311 | 203 | 205 | ||
312 | 204 | virtual void clear(); | 206 | virtual void clear(); |
315 | 205 | virtual void clearPointers(BitSet32 idBits); | 207 | virtual void clearPointers(const IntSet &ids); |
316 | 206 | virtual void addMovement(nsecs_t eventTime, BitSet32 idBits, | 208 | virtual void addMovement(nsecs_t eventTime, const IntSet &ids, |
317 | 207 | const VelocityTracker::Position* positions); | 209 | const VelocityTracker::Position* positions); |
318 | 208 | virtual bool getEstimator(uint32_t id, VelocityTracker::Estimator* outEstimator) const; | 210 | virtual bool getEstimator(uint32_t id, VelocityTracker::Estimator* outEstimator) const; |
319 | 209 | 211 | ||
320 | @@ -218,8 +220,8 @@ | |||
321 | 218 | }; | 220 | }; |
322 | 219 | 221 | ||
323 | 220 | const uint32_t mDegree; | 222 | const uint32_t mDegree; |
326 | 221 | BitSet32 mPointerIdBits; | 223 | IntSet mPointerIds; |
327 | 222 | State mPointerState[MAX_POINTER_ID + 1]; | 224 | std::unordered_map<int32_t, State> mPointerState; // maps the id of a pointer to its state |
328 | 223 | 225 | ||
329 | 224 | void initState(State& state, nsecs_t eventTime, float xpos, float ypos) const; | 226 | void initState(State& state, nsecs_t eventTime, float xpos, float ypos) const; |
330 | 225 | void updateState(State& state, nsecs_t eventTime, float xpos, float ypos) const; | 227 | void updateState(State& state, nsecs_t eventTime, float xpos, float ypos) const; |
331 | @@ -236,8 +238,8 @@ | |||
332 | 236 | virtual ~LegacyVelocityTrackerStrategy(); | 238 | virtual ~LegacyVelocityTrackerStrategy(); |
333 | 237 | 239 | ||
334 | 238 | virtual void clear(); | 240 | virtual void clear(); |
337 | 239 | virtual void clearPointers(BitSet32 idBits); | 241 | virtual void clearPointers(const IntSet &ids); |
338 | 240 | virtual void addMovement(nsecs_t eventTime, BitSet32 idBits, | 242 | virtual void addMovement(nsecs_t eventTime, const IntSet &ids, |
339 | 241 | const VelocityTracker::Position* positions); | 243 | const VelocityTracker::Position* positions); |
340 | 242 | virtual bool getEstimator(uint32_t id, VelocityTracker::Estimator* outEstimator) const; | 244 | virtual bool getEstimator(uint32_t id, VelocityTracker::Estimator* outEstimator) const; |
341 | 243 | 245 | ||
342 | @@ -253,11 +255,11 @@ | |||
343 | 253 | 255 | ||
344 | 254 | struct Movement { | 256 | struct Movement { |
345 | 255 | nsecs_t eventTime; | 257 | nsecs_t eventTime; |
347 | 256 | BitSet32 idBits; | 258 | IntSet ids; |
348 | 257 | VelocityTracker::Position positions[MAX_POINTERS]; | 259 | VelocityTracker::Position positions[MAX_POINTERS]; |
349 | 258 | 260 | ||
350 | 259 | inline const VelocityTracker::Position& getPosition(uint32_t id) const { | 261 | inline const VelocityTracker::Position& getPosition(uint32_t id) const { |
352 | 260 | return positions[idBits.getIndexOfBit(id)]; | 262 | return positions[ids.indexOf(id)]; |
353 | 261 | } | 263 | } |
354 | 262 | }; | 264 | }; |
355 | 263 | 265 | ||
356 | 264 | 266 | ||
357 | === modified file '3rd_party/android-input/android/frameworks/base/services/input/InputDevice.cpp' | |||
358 | --- 3rd_party/android-input/android/frameworks/base/services/input/InputDevice.cpp 2013-02-05 17:19:57 +0000 | |||
359 | +++ 3rd_party/android-input/android/frameworks/base/services/input/InputDevice.cpp 2013-11-21 20:19:28 +0000 | |||
360 | @@ -16,6 +16,9 @@ | |||
361 | 16 | 16 | ||
362 | 17 | #define LOG_TAG "InputDevice" | 17 | #define LOG_TAG "InputDevice" |
363 | 18 | 18 | ||
364 | 19 | #include <cutils/log.h> | ||
365 | 20 | #define DEBUG_PROBE 0 | ||
366 | 21 | |||
367 | 19 | #include <stdlib.h> | 22 | #include <stdlib.h> |
368 | 20 | #include <unistd.h> | 23 | #include <unistd.h> |
369 | 21 | #include <ctype.h> | 24 | #include <ctype.h> |
370 | @@ -97,7 +100,7 @@ | |||
371 | 97 | path.append("/usr/"); | 100 | path.append("/usr/"); |
372 | 98 | appendInputDeviceConfigurationFileRelativePath(path, name, type); | 101 | appendInputDeviceConfigurationFileRelativePath(path, name, type); |
373 | 99 | #if DEBUG_PROBE | 102 | #if DEBUG_PROBE |
375 | 100 | ALOGD("Probing for system provided input device configuration file: path='%s'", path.string()); | 103 | ALOGD("Probing for system provided input device configuration file: path='%s'", path.c_str()); |
376 | 101 | #endif | 104 | #endif |
377 | 102 | if (!access(c_str(path), R_OK)) { | 105 | if (!access(c_str(path), R_OK)) { |
378 | 103 | #if DEBUG_PROBE | 106 | #if DEBUG_PROBE |
379 | @@ -119,7 +122,7 @@ | |||
380 | 119 | path.append("/system/devices/"); | 122 | path.append("/system/devices/"); |
381 | 120 | appendInputDeviceConfigurationFileRelativePath(path, name, type); | 123 | appendInputDeviceConfigurationFileRelativePath(path, name, type); |
382 | 121 | #if DEBUG_PROBE | 124 | #if DEBUG_PROBE |
384 | 122 | ALOGD("Probing for system user input device configuration file: path='%s'", path.string()); | 125 | ALOGD("Probing for system user input device configuration file: path='%s'", path.c_str()); |
385 | 123 | #endif | 126 | #endif |
386 | 124 | if (!access(c_str(path), R_OK)) { | 127 | if (!access(c_str(path), R_OK)) { |
387 | 125 | #if DEBUG_PROBE | 128 | #if DEBUG_PROBE |
388 | @@ -131,7 +134,7 @@ | |||
389 | 131 | // Not found. | 134 | // Not found. |
390 | 132 | #if DEBUG_PROBE | 135 | #if DEBUG_PROBE |
391 | 133 | ALOGD("Probe failed to find input device configuration file: name='%s', type=%d", | 136 | ALOGD("Probe failed to find input device configuration file: name='%s', type=%d", |
393 | 134 | name.string(), type); | 137 | name.c_str(), type); |
394 | 135 | #endif | 138 | #endif |
395 | 136 | return String8(); | 139 | return String8(); |
396 | 137 | } | 140 | } |
397 | 138 | 141 | ||
398 | === modified file '3rd_party/android-input/android/frameworks/base/services/input/InputDispatcher.cpp' | |||
399 | --- 3rd_party/android-input/android/frameworks/base/services/input/InputDispatcher.cpp 2013-08-28 03:41:48 +0000 | |||
400 | +++ 3rd_party/android-input/android/frameworks/base/services/input/InputDispatcher.cpp 2013-11-21 20:19:28 +0000 | |||
401 | @@ -152,7 +152,7 @@ | |||
402 | 152 | pointerCount, MAX_POINTERS); | 152 | pointerCount, MAX_POINTERS); |
403 | 153 | return false; | 153 | return false; |
404 | 154 | } | 154 | } |
406 | 155 | BitSet32 pointerIdBits; | 155 | IntSet pointerIds; |
407 | 156 | for (size_t i = 0; i < pointerCount; i++) { | 156 | for (size_t i = 0; i < pointerCount; i++) { |
408 | 157 | int32_t id = pointerProperties[i].id; | 157 | int32_t id = pointerProperties[i].id; |
409 | 158 | if (id < 0 || id > MAX_POINTER_ID) { | 158 | if (id < 0 || id > MAX_POINTER_ID) { |
410 | @@ -160,11 +160,11 @@ | |||
411 | 160 | id, MAX_POINTER_ID); | 160 | id, MAX_POINTER_ID); |
412 | 161 | return false; | 161 | return false; |
413 | 162 | } | 162 | } |
415 | 163 | if (pointerIdBits.hasBit(id)) { | 163 | if (pointerIds.contains(id)) { |
416 | 164 | ALOGE("Motion event has duplicate pointer id %d", id); | 164 | ALOGE("Motion event has duplicate pointer id %d", id); |
417 | 165 | return false; | 165 | return false; |
418 | 166 | } | 166 | } |
420 | 167 | pointerIdBits.markBit(id); | 167 | pointerIds.insert(id); |
421 | 168 | } | 168 | } |
422 | 169 | return true; | 169 | return true; |
423 | 170 | } | 170 | } |
424 | @@ -1043,7 +1043,7 @@ | |||
425 | 1043 | // Success! Output targets. | 1043 | // Success! Output targets. |
426 | 1044 | injectionResult = INPUT_EVENT_INJECTION_SUCCEEDED; | 1044 | injectionResult = INPUT_EVENT_INJECTION_SUCCEEDED; |
427 | 1045 | addWindowTargetLocked(mFocusedWindowHandle, | 1045 | addWindowTargetLocked(mFocusedWindowHandle, |
429 | 1046 | InputTarget::FLAG_FOREGROUND | InputTarget::FLAG_DISPATCH_AS_IS, BitSet32(0), | 1046 | InputTarget::FLAG_FOREGROUND | InputTarget::FLAG_DISPATCH_AS_IS, IntSet(), |
430 | 1047 | inputTargets); | 1047 | inputTargets); |
431 | 1048 | 1048 | ||
432 | 1049 | // Done. | 1049 | // Done. |
433 | @@ -1181,7 +1181,7 @@ | |||
434 | 1181 | } | 1181 | } |
435 | 1182 | 1182 | ||
436 | 1183 | mTempTouchState.addOrUpdateWindow( | 1183 | mTempTouchState.addOrUpdateWindow( |
438 | 1184 | windowHandle, outsideTargetFlags, BitSet32(0)); | 1184 | windowHandle, outsideTargetFlags, IntSet()); |
439 | 1185 | } | 1185 | } |
440 | 1186 | } | 1186 | } |
441 | 1187 | }); | 1187 | }); |
442 | @@ -1250,10 +1250,10 @@ | |||
443 | 1250 | } | 1250 | } |
444 | 1251 | 1251 | ||
445 | 1252 | // Update the temporary touch state. | 1252 | // Update the temporary touch state. |
447 | 1253 | BitSet32 pointerIds; | 1253 | IntSet pointerIds; |
448 | 1254 | if (isSplit) { | 1254 | if (isSplit) { |
451 | 1255 | uint32_t pointerId = entry->pointerProperties[pointerIndex].id; | 1255 | int32_t pointerId = entry->pointerProperties[pointerIndex].id; |
452 | 1256 | pointerIds.markBit(pointerId); | 1256 | pointerIds.insert(pointerId); |
453 | 1257 | } | 1257 | } |
454 | 1258 | mTempTouchState.addOrUpdateWindow(newTouchedWindowHandle, targetFlags, pointerIds); | 1258 | mTempTouchState.addOrUpdateWindow(newTouchedWindowHandle, targetFlags, pointerIds); |
455 | 1259 | } else { | 1259 | } else { |
456 | @@ -1288,7 +1288,7 @@ | |||
457 | 1288 | #endif | 1288 | #endif |
458 | 1289 | // Make a slippery exit from the old window. | 1289 | // Make a slippery exit from the old window. |
459 | 1290 | mTempTouchState.addOrUpdateWindow(oldTouchedWindowHandle, | 1290 | mTempTouchState.addOrUpdateWindow(oldTouchedWindowHandle, |
461 | 1291 | InputTarget::FLAG_DISPATCH_AS_SLIPPERY_EXIT, BitSet32(0)); | 1291 | InputTarget::FLAG_DISPATCH_AS_SLIPPERY_EXIT, IntSet()); |
462 | 1292 | 1292 | ||
463 | 1293 | // Make a slippery entrance into the new window. | 1293 | // Make a slippery entrance into the new window. |
464 | 1294 | if (newTouchedWindowHandle->getInfo()->supportsSplitTouch()) { | 1294 | if (newTouchedWindowHandle->getInfo()->supportsSplitTouch()) { |
465 | @@ -1304,9 +1304,9 @@ | |||
466 | 1304 | targetFlags |= InputTarget::FLAG_WINDOW_IS_OBSCURED; | 1304 | targetFlags |= InputTarget::FLAG_WINDOW_IS_OBSCURED; |
467 | 1305 | } | 1305 | } |
468 | 1306 | 1306 | ||
470 | 1307 | BitSet32 pointerIds; | 1307 | IntSet pointerIds; |
471 | 1308 | if (isSplit) { | 1308 | if (isSplit) { |
473 | 1309 | pointerIds.markBit(entry->pointerProperties[0].id); | 1309 | pointerIds.insert(entry->pointerProperties[0].id); |
474 | 1310 | } | 1310 | } |
475 | 1311 | mTempTouchState.addOrUpdateWindow(newTouchedWindowHandle, targetFlags, pointerIds); | 1311 | mTempTouchState.addOrUpdateWindow(newTouchedWindowHandle, targetFlags, pointerIds); |
476 | 1312 | } | 1312 | } |
477 | @@ -1321,7 +1321,7 @@ | |||
478 | 1321 | c_str(mLastHoverWindowHandle->getName())); | 1321 | c_str(mLastHoverWindowHandle->getName())); |
479 | 1322 | #endif | 1322 | #endif |
480 | 1323 | mTempTouchState.addOrUpdateWindow(mLastHoverWindowHandle, | 1323 | mTempTouchState.addOrUpdateWindow(mLastHoverWindowHandle, |
482 | 1324 | InputTarget::FLAG_DISPATCH_AS_HOVER_EXIT, BitSet32(0)); | 1324 | InputTarget::FLAG_DISPATCH_AS_HOVER_EXIT, IntSet()); |
483 | 1325 | } | 1325 | } |
484 | 1326 | 1326 | ||
485 | 1327 | // Let the new window know that the hover sequence is starting. | 1327 | // Let the new window know that the hover sequence is starting. |
486 | @@ -1331,7 +1331,7 @@ | |||
487 | 1331 | c_str(newHoverWindowHandle->getName())); | 1331 | c_str(newHoverWindowHandle->getName())); |
488 | 1332 | #endif | 1332 | #endif |
489 | 1333 | mTempTouchState.addOrUpdateWindow(newHoverWindowHandle, | 1333 | mTempTouchState.addOrUpdateWindow(newHoverWindowHandle, |
491 | 1334 | InputTarget::FLAG_DISPATCH_AS_HOVER_ENTER, BitSet32(0)); | 1334 | InputTarget::FLAG_DISPATCH_AS_HOVER_ENTER, IntSet()); |
492 | 1335 | } | 1335 | } |
493 | 1336 | } | 1336 | } |
494 | 1337 | 1337 | ||
495 | @@ -1375,7 +1375,7 @@ | |||
496 | 1375 | sp<InputWindowHandle> inputWindowHandle = touchedWindow.windowHandle; | 1375 | sp<InputWindowHandle> inputWindowHandle = touchedWindow.windowHandle; |
497 | 1376 | if (inputWindowHandle->getInfo()->ownerUid != foregroundWindowUid) { | 1376 | if (inputWindowHandle->getInfo()->ownerUid != foregroundWindowUid) { |
498 | 1377 | mTempTouchState.addOrUpdateWindow(inputWindowHandle, | 1377 | mTempTouchState.addOrUpdateWindow(inputWindowHandle, |
500 | 1378 | InputTarget::FLAG_ZERO_COORDS, BitSet32(0)); | 1378 | InputTarget::FLAG_ZERO_COORDS, IntSet()); |
501 | 1379 | } | 1379 | } |
502 | 1380 | } | 1380 | } |
503 | 1381 | } | 1381 | } |
504 | @@ -1421,7 +1421,7 @@ | |||
505 | 1421 | mTempTouchState.addOrUpdateWindow(windowHandle, | 1421 | mTempTouchState.addOrUpdateWindow(windowHandle, |
506 | 1422 | InputTarget::FLAG_WINDOW_IS_OBSCURED | 1422 | InputTarget::FLAG_WINDOW_IS_OBSCURED |
507 | 1423 | | InputTarget::FLAG_DISPATCH_AS_IS, | 1423 | | InputTarget::FLAG_DISPATCH_AS_IS, |
509 | 1424 | BitSet32(0)); | 1424 | IntSet()); |
510 | 1425 | } | 1425 | } |
511 | 1426 | }); | 1426 | }); |
512 | 1427 | } | 1427 | } |
513 | @@ -1491,12 +1491,12 @@ | |||
514 | 1491 | // One pointer went up. | 1491 | // One pointer went up. |
515 | 1492 | if (isSplit) { | 1492 | if (isSplit) { |
516 | 1493 | int32_t pointerIndex = getMotionEventActionPointerIndex(action); | 1493 | int32_t pointerIndex = getMotionEventActionPointerIndex(action); |
518 | 1494 | uint32_t pointerId = entry->pointerProperties[pointerIndex].id; | 1494 | int32_t pointerId = entry->pointerProperties[pointerIndex].id; |
519 | 1495 | 1495 | ||
520 | 1496 | for (size_t i = 0; i < mTempTouchState.windows.size(); ) { | 1496 | for (size_t i = 0; i < mTempTouchState.windows.size(); ) { |
521 | 1497 | TouchedWindow& touchedWindow = mTempTouchState.windows.editItemAt(i); | 1497 | TouchedWindow& touchedWindow = mTempTouchState.windows.editItemAt(i); |
522 | 1498 | if (touchedWindow.targetFlags & InputTarget::FLAG_SPLIT) { | 1498 | if (touchedWindow.targetFlags & InputTarget::FLAG_SPLIT) { |
524 | 1499 | touchedWindow.pointerIds.clearBit(pointerId); | 1499 | touchedWindow.pointerIds.remove(pointerId); |
525 | 1500 | if (touchedWindow.pointerIds.isEmpty()) { | 1500 | if (touchedWindow.pointerIds.isEmpty()) { |
526 | 1501 | mTempTouchState.windows.removeAt(i); | 1501 | mTempTouchState.windows.removeAt(i); |
527 | 1502 | continue; | 1502 | continue; |
528 | @@ -1538,7 +1538,7 @@ | |||
529 | 1538 | } | 1538 | } |
530 | 1539 | 1539 | ||
531 | 1540 | void InputDispatcher::addWindowTargetLocked(const sp<InputWindowHandle>& windowHandle, | 1540 | void InputDispatcher::addWindowTargetLocked(const sp<InputWindowHandle>& windowHandle, |
533 | 1541 | int32_t targetFlags, BitSet32 pointerIds, Vector<InputTarget>& inputTargets) { | 1541 | int32_t targetFlags, const IntSet &pointerIds, Vector<InputTarget>& inputTargets) { |
534 | 1542 | inputTargets.push(); | 1542 | inputTargets.push(); |
535 | 1543 | 1543 | ||
536 | 1544 | const InputWindowInfo* windowInfo = windowHandle->getInfo(); | 1544 | const InputWindowInfo* windowInfo = windowHandle->getInfo(); |
537 | @@ -1693,12 +1693,13 @@ | |||
538 | 1693 | void InputDispatcher::prepareDispatchCycleLocked(nsecs_t currentTime, | 1693 | void InputDispatcher::prepareDispatchCycleLocked(nsecs_t currentTime, |
539 | 1694 | const sp<Connection>& connection, EventEntry* eventEntry, const InputTarget* inputTarget) { | 1694 | const sp<Connection>& connection, EventEntry* eventEntry, const InputTarget* inputTarget) { |
540 | 1695 | #if DEBUG_DISPATCH_CYCLE | 1695 | #if DEBUG_DISPATCH_CYCLE |
541 | 1696 | std::string pointerIdsString = inputTarget->pointerIds.toString(); | ||
542 | 1696 | ALOGD("channel '%s' ~ prepareDispatchCycle - flags=0x%08x, " | 1697 | ALOGD("channel '%s' ~ prepareDispatchCycle - flags=0x%08x, " |
543 | 1697 | "xOffset=%f, yOffset=%f, scaleFactor=%f, " | 1698 | "xOffset=%f, yOffset=%f, scaleFactor=%f, " |
545 | 1698 | "pointerIds=0x%x", | 1699 | "pointerIds=%s", |
546 | 1699 | connection->getInputChannelName(), inputTarget->flags, | 1700 | connection->getInputChannelName(), inputTarget->flags, |
547 | 1700 | inputTarget->xOffset, inputTarget->yOffset, | 1701 | inputTarget->xOffset, inputTarget->yOffset, |
549 | 1701 | inputTarget->scaleFactor, inputTarget->pointerIds.value); | 1702 | inputTarget->scaleFactor, pointerIdsString.c_str()); |
550 | 1702 | #endif | 1703 | #endif |
551 | 1703 | 1704 | ||
552 | 1704 | // Skip this event if the connection status is not normal. | 1705 | // Skip this event if the connection status is not normal. |
553 | @@ -2163,8 +2164,8 @@ | |||
554 | 2163 | } | 2164 | } |
555 | 2164 | 2165 | ||
556 | 2165 | InputDispatcher::MotionEntry* | 2166 | InputDispatcher::MotionEntry* |
559 | 2166 | InputDispatcher::splitMotionEvent(const MotionEntry* originalMotionEntry, BitSet32 pointerIds) { | 2167 | InputDispatcher::splitMotionEvent(const MotionEntry* originalMotionEntry, const IntSet &pointerIds) { |
560 | 2167 | ALOG_ASSERT(pointerIds.value != 0); | 2168 | ALOG_ASSERT(!pointerIds.isEmpty()); |
561 | 2168 | 2169 | ||
562 | 2169 | uint32_t splitPointerIndexMap[MAX_POINTERS]; | 2170 | uint32_t splitPointerIndexMap[MAX_POINTERS]; |
563 | 2170 | PointerProperties splitPointerProperties[MAX_POINTERS]; | 2171 | PointerProperties splitPointerProperties[MAX_POINTERS]; |
564 | @@ -2178,7 +2179,7 @@ | |||
565 | 2178 | const PointerProperties& pointerProperties = | 2179 | const PointerProperties& pointerProperties = |
566 | 2179 | originalMotionEntry->pointerProperties[originalPointerIndex]; | 2180 | originalMotionEntry->pointerProperties[originalPointerIndex]; |
567 | 2180 | uint32_t pointerId = uint32_t(pointerProperties.id); | 2181 | uint32_t pointerId = uint32_t(pointerProperties.id); |
569 | 2181 | if (pointerIds.hasBit(pointerId)) { | 2182 | if (pointerIds.contains(pointerId)) { |
570 | 2182 | splitPointerIndexMap[splitPointerCount] = originalPointerIndex; | 2183 | splitPointerIndexMap[splitPointerCount] = originalPointerIndex; |
571 | 2183 | splitPointerProperties[splitPointerCount].copyFrom(pointerProperties); | 2184 | splitPointerProperties[splitPointerCount].copyFrom(pointerProperties); |
572 | 2184 | splitPointerCoords[splitPointerCount].copyFrom( | 2185 | splitPointerCoords[splitPointerCount].copyFrom( |
573 | @@ -2207,8 +2208,8 @@ | |||
574 | 2207 | int32_t originalPointerIndex = getMotionEventActionPointerIndex(action); | 2208 | int32_t originalPointerIndex = getMotionEventActionPointerIndex(action); |
575 | 2208 | const PointerProperties& pointerProperties = | 2209 | const PointerProperties& pointerProperties = |
576 | 2209 | originalMotionEntry->pointerProperties[originalPointerIndex]; | 2210 | originalMotionEntry->pointerProperties[originalPointerIndex]; |
579 | 2210 | uint32_t pointerId = uint32_t(pointerProperties.id); | 2211 | int32_t pointerId = pointerProperties.id; |
580 | 2211 | if (pointerIds.hasBit(pointerId)) { | 2212 | if (pointerIds.contains(pointerId)) { |
581 | 2212 | if (pointerIds.count() == 1) { | 2213 | if (pointerIds.count() == 1) { |
582 | 2213 | // The first/last pointer went down/up. | 2214 | // The first/last pointer went down/up. |
583 | 2214 | action = maskedAction == AMOTION_EVENT_ACTION_POINTER_DOWN | 2215 | action = maskedAction == AMOTION_EVENT_ACTION_POINTER_DOWN |
584 | @@ -2216,7 +2217,7 @@ | |||
585 | 2216 | } else { | 2217 | } else { |
586 | 2217 | // A secondary pointer went down/up. | 2218 | // A secondary pointer went down/up. |
587 | 2218 | uint32_t splitPointerIndex = 0; | 2219 | uint32_t splitPointerIndex = 0; |
589 | 2219 | while (pointerId != uint32_t(splitPointerProperties[splitPointerIndex].id)) { | 2220 | while (pointerId != splitPointerProperties[splitPointerIndex].id) { |
590 | 2220 | splitPointerIndex += 1; | 2221 | splitPointerIndex += 1; |
591 | 2221 | } | 2222 | } |
592 | 2222 | action = maskedAction | (splitPointerIndex | 2223 | action = maskedAction | (splitPointerIndex |
593 | @@ -2901,7 +2902,7 @@ | |||
594 | 2901 | const TouchedWindow& touchedWindow = mTouchState.windows[i]; | 2902 | const TouchedWindow& touchedWindow = mTouchState.windows[i]; |
595 | 2902 | if (touchedWindow.windowHandle == fromWindowHandle) { | 2903 | if (touchedWindow.windowHandle == fromWindowHandle) { |
596 | 2903 | int32_t oldTargetFlags = touchedWindow.targetFlags; | 2904 | int32_t oldTargetFlags = touchedWindow.targetFlags; |
598 | 2904 | BitSet32 pointerIds = touchedWindow.pointerIds; | 2905 | IntSet pointerIds = touchedWindow.pointerIds; |
599 | 2905 | 2906 | ||
600 | 2906 | mTouchState.windows.removeAt(i); | 2907 | mTouchState.windows.removeAt(i); |
601 | 2907 | 2908 | ||
602 | @@ -3000,10 +3001,14 @@ | |||
603 | 3000 | dump.append(INDENT "TouchedWindows:\n"); | 3001 | dump.append(INDENT "TouchedWindows:\n"); |
604 | 3001 | for (size_t i = 0; i < mTouchState.windows.size(); i++) { | 3002 | for (size_t i = 0; i < mTouchState.windows.size(); i++) { |
605 | 3002 | const TouchedWindow& touchedWindow = mTouchState.windows[i]; | 3003 | const TouchedWindow& touchedWindow = mTouchState.windows[i]; |
610 | 3003 | appendFormat(dump, INDENT2 "%d: name='%s', pointerIds=0x%0x, targetFlags=0x%x\n", | 3004 | appendFormat(dump, INDENT2 "%d: name='%s'", |
611 | 3004 | i, c_str(touchedWindow.windowHandle->getName()), | 3005 | i, c_str(touchedWindow.windowHandle->getName())); |
612 | 3005 | touchedWindow.pointerIds.value, | 3006 | |
613 | 3006 | touchedWindow.targetFlags); | 3007 | dump.append(", pointerIds=("); |
614 | 3008 | touchedWindow.pointerIds.forEach([&](int32_t id) {appendFormat(dump, ", %d", id);}); | ||
615 | 3009 | dump.append(")"); | ||
616 | 3010 | |||
617 | 3011 | appendFormat(dump, ", targetFlags=0x%x\n", touchedWindow.targetFlags); | ||
618 | 3007 | } | 3012 | } |
619 | 3008 | } else { | 3013 | } else { |
620 | 3009 | dump.append(INDENT "TouchedWindows: <none>\n"); | 3014 | dump.append(INDENT "TouchedWindows: <none>\n"); |
621 | @@ -4191,7 +4196,7 @@ | |||
622 | 4191 | } | 4196 | } |
623 | 4192 | 4197 | ||
624 | 4193 | void InputDispatcher::TouchState::addOrUpdateWindow(const sp<InputWindowHandle>& windowHandle, | 4198 | void InputDispatcher::TouchState::addOrUpdateWindow(const sp<InputWindowHandle>& windowHandle, |
626 | 4194 | int32_t targetFlags, BitSet32 pointerIds) { | 4199 | int32_t targetFlags, const IntSet &pointerIds) { |
627 | 4195 | if (targetFlags & InputTarget::FLAG_SPLIT) { | 4200 | if (targetFlags & InputTarget::FLAG_SPLIT) { |
628 | 4196 | split = true; | 4201 | split = true; |
629 | 4197 | } | 4202 | } |
630 | @@ -4203,7 +4208,9 @@ | |||
631 | 4203 | if (targetFlags & InputTarget::FLAG_DISPATCH_AS_SLIPPERY_EXIT) { | 4208 | if (targetFlags & InputTarget::FLAG_DISPATCH_AS_SLIPPERY_EXIT) { |
632 | 4204 | touchedWindow.targetFlags &= ~InputTarget::FLAG_DISPATCH_AS_IS; | 4209 | touchedWindow.targetFlags &= ~InputTarget::FLAG_DISPATCH_AS_IS; |
633 | 4205 | } | 4210 | } |
635 | 4206 | touchedWindow.pointerIds.value |= pointerIds.value; | 4211 | pointerIds.forEach([&](int32_t id) { |
636 | 4212 | touchedWindow.pointerIds.insert(id); | ||
637 | 4213 | }); | ||
638 | 4207 | return; | 4214 | return; |
639 | 4208 | } | 4215 | } |
640 | 4209 | } | 4216 | } |
641 | 4210 | 4217 | ||
642 | === modified file '3rd_party/android-input/android/frameworks/base/services/input/InputDispatcher.h' | |||
643 | --- 3rd_party/android-input/android/frameworks/base/services/input/InputDispatcher.h 2013-05-30 19:24:29 +0000 | |||
644 | +++ 3rd_party/android-input/android/frameworks/base/services/input/InputDispatcher.h 2013-11-21 20:19:28 +0000 | |||
645 | @@ -19,13 +19,13 @@ | |||
646 | 19 | 19 | ||
647 | 20 | #include <androidfw/Input.h> | 20 | #include <androidfw/Input.h> |
648 | 21 | #include <androidfw/InputTransport.h> | 21 | #include <androidfw/InputTransport.h> |
649 | 22 | #include <androidfw/IntSet.h> | ||
650 | 22 | #include <std/KeyedVector.h> | 23 | #include <std/KeyedVector.h> |
651 | 23 | #include <std/Vector.h> | 24 | #include <std/Vector.h> |
652 | 24 | #include <std/Timers.h> | 25 | #include <std/Timers.h> |
653 | 25 | #include <std/RefBase.h> | 26 | #include <std/RefBase.h> |
654 | 26 | #include <std/String8.h> | 27 | #include <std/String8.h> |
655 | 27 | #include <std/Looper.h> | 28 | #include <std/Looper.h> |
656 | 28 | #include <std/BitSet.h> | ||
657 | 29 | #include <std/atomic.h> | 29 | #include <std/atomic.h> |
658 | 30 | #include <std/Condition.h> | 30 | #include <std/Condition.h> |
659 | 31 | #include <std/Thread.h> | 31 | #include <std/Thread.h> |
660 | @@ -169,7 +169,7 @@ | |||
661 | 169 | 169 | ||
662 | 170 | // The subset of pointer ids to include in motion events dispatched to this input target | 170 | // The subset of pointer ids to include in motion events dispatched to this input target |
663 | 171 | // if FLAG_SPLIT is set. | 171 | // if FLAG_SPLIT is set. |
665 | 172 | BitSet32 pointerIds; | 172 | IntSet pointerIds; |
666 | 173 | }; | 173 | }; |
667 | 174 | 174 | ||
668 | 175 | 175 | ||
669 | @@ -953,7 +953,7 @@ | |||
670 | 953 | struct TouchedWindow { | 953 | struct TouchedWindow { |
671 | 954 | sp<InputWindowHandle> windowHandle; | 954 | sp<InputWindowHandle> windowHandle; |
672 | 955 | int32_t targetFlags; | 955 | int32_t targetFlags; |
674 | 956 | BitSet32 pointerIds; // zero unless target flag FLAG_SPLIT is set | 956 | IntSet pointerIds; // empty unless target flag FLAG_SPLIT is set |
675 | 957 | }; | 957 | }; |
676 | 958 | struct TouchState { | 958 | struct TouchState { |
677 | 959 | bool down; | 959 | bool down; |
678 | @@ -967,7 +967,7 @@ | |||
679 | 967 | void reset(); | 967 | void reset(); |
680 | 968 | void copyFrom(const TouchState& other); | 968 | void copyFrom(const TouchState& other); |
681 | 969 | void addOrUpdateWindow(const sp<InputWindowHandle>& windowHandle, | 969 | void addOrUpdateWindow(const sp<InputWindowHandle>& windowHandle, |
683 | 970 | int32_t targetFlags, BitSet32 pointerIds); | 970 | int32_t targetFlags, const IntSet &pointerIds); |
684 | 971 | void removeWindow(const sp<InputWindowHandle>& windowHandle); | 971 | void removeWindow(const sp<InputWindowHandle>& windowHandle); |
685 | 972 | void filterNonAsIsTouchWindows(); | 972 | void filterNonAsIsTouchWindows(); |
686 | 973 | sp<InputWindowHandle> getFirstForegroundWindowHandle() const; | 973 | sp<InputWindowHandle> getFirstForegroundWindowHandle() const; |
687 | @@ -1033,7 +1033,7 @@ | |||
688 | 1033 | bool* outConflictingPointerActions); | 1033 | bool* outConflictingPointerActions); |
689 | 1034 | 1034 | ||
690 | 1035 | void addWindowTargetLocked(const sp<InputWindowHandle>& windowHandle, | 1035 | void addWindowTargetLocked(const sp<InputWindowHandle>& windowHandle, |
692 | 1036 | int32_t targetFlags, BitSet32 pointerIds, Vector<InputTarget>& inputTargets); | 1036 | int32_t targetFlags, const IntSet &pointerIds, Vector<InputTarget>& inputTargets); |
693 | 1037 | void addMonitoringTargetsLocked(Vector<InputTarget>& inputTargets); | 1037 | void addMonitoringTargetsLocked(Vector<InputTarget>& inputTargets); |
694 | 1038 | 1038 | ||
695 | 1039 | bool checkInjectionPermission(const sp<InputWindowHandle>& windowHandle, | 1039 | bool checkInjectionPermission(const sp<InputWindowHandle>& windowHandle, |
696 | @@ -1072,7 +1072,7 @@ | |||
697 | 1072 | const CancelationOptions& options); | 1072 | const CancelationOptions& options); |
698 | 1073 | 1073 | ||
699 | 1074 | // Splitting motion events across windows. | 1074 | // Splitting motion events across windows. |
701 | 1075 | MotionEntry* splitMotionEvent(const MotionEntry* originalMotionEntry, BitSet32 pointerIds); | 1075 | MotionEntry* splitMotionEvent(const MotionEntry* originalMotionEntry, const IntSet &pointerIds); |
702 | 1076 | 1076 | ||
703 | 1077 | // Reset and drop everything the dispatcher is doing. | 1077 | // Reset and drop everything the dispatcher is doing. |
704 | 1078 | void resetAndDropEverythingLocked(const char* reason); | 1078 | void resetAndDropEverythingLocked(const char* reason); |
705 | 1079 | 1079 | ||
706 | === added file '3rd_party/android-input/android/frameworks/base/services/input/InputEventPrinter.h' | |||
707 | --- 3rd_party/android-input/android/frameworks/base/services/input/InputEventPrinter.h 1970-01-01 00:00:00 +0000 | |||
708 | +++ 3rd_party/android-input/android/frameworks/base/services/input/InputEventPrinter.h 2013-11-21 20:19:28 +0000 | |||
709 | @@ -0,0 +1,138 @@ | |||
710 | 1 | /* | ||
711 | 2 | * Copyright © 2013 Canonical Ltd. | ||
712 | 3 | * | ||
713 | 4 | * This program is free software: you can redistribute it and/or modify it | ||
714 | 5 | * under the terms of the GNU Lesser General Public License version 3, | ||
715 | 6 | * as published by the Free Software Foundation. | ||
716 | 7 | * | ||
717 | 8 | * This program is distributed in the hope that it will be useful, | ||
718 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
719 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
720 | 11 | * GNU Lesser General Public License for more details. | ||
721 | 12 | * | ||
722 | 13 | * You should have received a copy of the GNU Lesser General Public License | ||
723 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
724 | 15 | * | ||
725 | 16 | * Author: Daniel d'Andrada <daniel.dandrada@canonical.com> | ||
726 | 17 | */ | ||
727 | 18 | |||
728 | 19 | #ifndef INPUT_EVENT_PRINTER_H | ||
729 | 20 | #define INPUT_EVENT_PRINTER_H | ||
730 | 21 | |||
731 | 22 | #include <stdio.h> | ||
732 | 23 | |||
733 | 24 | void synEvCodeToStr(char *codeStr, int code) { | ||
734 | 25 | switch(code) { | ||
735 | 26 | case SYN_REPORT: | ||
736 | 27 | sprintf(codeStr, "SYN_REPORT"); | ||
737 | 28 | break; | ||
738 | 29 | case SYN_CONFIG: | ||
739 | 30 | sprintf(codeStr, "SYN_CONFIG"); | ||
740 | 31 | break; | ||
741 | 32 | case SYN_MT_REPORT: | ||
742 | 33 | sprintf(codeStr, "SYN_MT_REPORT"); | ||
743 | 34 | break; | ||
744 | 35 | case SYN_DROPPED: | ||
745 | 36 | sprintf(codeStr, "SYN_DROPPED"); | ||
746 | 37 | break; | ||
747 | 38 | default: | ||
748 | 39 | sprintf(codeStr, "0x%08x", code); | ||
749 | 40 | break; | ||
750 | 41 | } | ||
751 | 42 | } | ||
752 | 43 | |||
753 | 44 | void absEvCodeToStr(char *codeStr, int code) { | ||
754 | 45 | switch(code) { | ||
755 | 46 | case ABS_X: | ||
756 | 47 | sprintf(codeStr, "ABS_X"); | ||
757 | 48 | break; | ||
758 | 49 | case ABS_Y: | ||
759 | 50 | sprintf(codeStr, "ABS_Y"); | ||
760 | 51 | break; | ||
761 | 52 | case ABS_MT_TOUCH_MAJOR: | ||
762 | 53 | sprintf(codeStr, "ABS_MT_TOUCH_MAJOR"); | ||
763 | 54 | break; | ||
764 | 55 | case ABS_MT_TOUCH_MINOR: | ||
765 | 56 | sprintf(codeStr, "ABS_MT_TOUCH_MINOR"); | ||
766 | 57 | break; | ||
767 | 58 | case ABS_MT_ORIENTATION: | ||
768 | 59 | sprintf(codeStr, "ABS_MT_ORIENTATION"); | ||
769 | 60 | break; | ||
770 | 61 | case ABS_MT_POSITION_X: | ||
771 | 62 | sprintf(codeStr, "ABS_MT_POSITION_X"); | ||
772 | 63 | break; | ||
773 | 64 | case ABS_MT_POSITION_Y: | ||
774 | 65 | sprintf(codeStr, "ABS_MT_POSITION_Y"); | ||
775 | 66 | break; | ||
776 | 67 | case ABS_MT_TOOL_TYPE: | ||
777 | 68 | sprintf(codeStr, "ABS_MT_TOOL_TYPE"); | ||
778 | 69 | break; | ||
779 | 70 | default: | ||
780 | 71 | sprintf(codeStr, "0x%08x", code); | ||
781 | 72 | break; | ||
782 | 73 | } | ||
783 | 74 | } | ||
784 | 75 | |||
785 | 76 | void keyEvCodeToStr(char *codeStr, int code) { | ||
786 | 77 | switch(code) { | ||
787 | 78 | case BTN_TOUCH: | ||
788 | 79 | sprintf(codeStr, "BTN_TOUCH"); | ||
789 | 80 | break; | ||
790 | 81 | case BTN_STYLUS: | ||
791 | 82 | sprintf(codeStr, "BTN_STYLUS"); | ||
792 | 83 | break; | ||
793 | 84 | default: | ||
794 | 85 | sprintf(codeStr, "0x%08x", code); | ||
795 | 86 | break; | ||
796 | 87 | } | ||
797 | 88 | } | ||
798 | 89 | |||
799 | 90 | void inputEvToStr(char *buffer, int type, int code, int value) { | ||
800 | 91 | char codeStr[100]; | ||
801 | 92 | switch (type) { | ||
802 | 93 | case EV_SYN: | ||
803 | 94 | synEvCodeToStr(codeStr, code); | ||
804 | 95 | sprintf(buffer, "EV_SYN, %s, 0x%08x", codeStr, value); | ||
805 | 96 | break; | ||
806 | 97 | case EV_KEY: | ||
807 | 98 | keyEvCodeToStr(codeStr, code); | ||
808 | 99 | sprintf(buffer, "EV_KEY, %s, 0x%08x", codeStr, value); | ||
809 | 100 | break; | ||
810 | 101 | case EV_REL: | ||
811 | 102 | sprintf(buffer, "EV_REL, 0x%08x, 0x%08x", code, value); | ||
812 | 103 | break; | ||
813 | 104 | case EV_ABS: | ||
814 | 105 | absEvCodeToStr(codeStr, code); | ||
815 | 106 | sprintf(buffer, "EV_ABS, %s, 0x%08x", codeStr, value); | ||
816 | 107 | break; | ||
817 | 108 | case EV_MSC: | ||
818 | 109 | sprintf(buffer, "EV_MSC, 0x%08x, 0x%08x", code, value); | ||
819 | 110 | break; | ||
820 | 111 | case EV_SW: | ||
821 | 112 | sprintf(buffer, "EV_SW, 0x%08x, 0x%08x", code, value); | ||
822 | 113 | break; | ||
823 | 114 | case EV_LED: | ||
824 | 115 | sprintf(buffer, "EV_LED, 0x%08x, 0x%08x", code, value); | ||
825 | 116 | break; | ||
826 | 117 | case EV_SND: | ||
827 | 118 | sprintf(buffer, "EV_SND, 0x%08x, 0x%08x", code, value); | ||
828 | 119 | break; | ||
829 | 120 | case EV_REP: | ||
830 | 121 | sprintf(buffer, "EV_REP, 0x%08x, 0x%08x", code, value); | ||
831 | 122 | break; | ||
832 | 123 | case EV_FF: | ||
833 | 124 | sprintf(buffer, "EV_FF, 0x%08x, 0x%08x", code, value); | ||
834 | 125 | break; | ||
835 | 126 | case EV_PWR: | ||
836 | 127 | sprintf(buffer, "EV_PWR, 0x%08x, 0x%08x", code, value); | ||
837 | 128 | break; | ||
838 | 129 | case EV_FF_STATUS: | ||
839 | 130 | sprintf(buffer, "EV_FF_STATUS, 0x%08x, 0x%08x", code, value); | ||
840 | 131 | break; | ||
841 | 132 | default: | ||
842 | 133 | sprintf(buffer, "0x%08x, 0x%08x, 0x%08x", type, code, value); | ||
843 | 134 | break; | ||
844 | 135 | } | ||
845 | 136 | } | ||
846 | 137 | |||
847 | 138 | #endif // INPUT_EVENT_PRINTER_H | ||
848 | 0 | 139 | ||
849 | === modified file '3rd_party/android-input/android/frameworks/base/services/input/InputListener.h' | |||
850 | --- 3rd_party/android-input/android/frameworks/base/services/input/InputListener.h 2013-05-03 16:38:07 +0000 | |||
851 | +++ 3rd_party/android-input/android/frameworks/base/services/input/InputListener.h 2013-11-21 20:19:28 +0000 | |||
852 | @@ -38,7 +38,7 @@ | |||
853 | 38 | struct NotifyConfigurationChangedArgs : public NotifyArgs { | 38 | struct NotifyConfigurationChangedArgs : public NotifyArgs { |
854 | 39 | nsecs_t eventTime; | 39 | nsecs_t eventTime; |
855 | 40 | 40 | ||
857 | 41 | inline NotifyConfigurationChangedArgs() { } | 41 | inline NotifyConfigurationChangedArgs() : eventTime{0} { } |
858 | 42 | 42 | ||
859 | 43 | NotifyConfigurationChangedArgs(nsecs_t eventTime); | 43 | NotifyConfigurationChangedArgs(nsecs_t eventTime); |
860 | 44 | 44 | ||
861 | 45 | 45 | ||
862 | === modified file '3rd_party/android-input/android/frameworks/base/services/input/InputReader.cpp' | |||
863 | --- 3rd_party/android-input/android/frameworks/base/services/input/InputReader.cpp 2013-10-15 08:53:10 +0000 | |||
864 | +++ 3rd_party/android-input/android/frameworks/base/services/input/InputReader.cpp 2013-11-21 20:19:28 +0000 | |||
865 | @@ -47,6 +47,8 @@ | |||
866 | 47 | 47 | ||
867 | 48 | #include <android/keycodes.h> | 48 | #include <android/keycodes.h> |
868 | 49 | 49 | ||
869 | 50 | #include <std/BitSet.h> | ||
870 | 51 | |||
871 | 50 | #include <stddef.h> | 52 | #include <stddef.h> |
872 | 51 | #include <stdlib.h> | 53 | #include <stdlib.h> |
873 | 52 | #include <unistd.h> | 54 | #include <unistd.h> |
874 | @@ -54,6 +56,10 @@ | |||
875 | 54 | #include <limits.h> | 56 | #include <limits.h> |
876 | 55 | #include <math.h> | 57 | #include <math.h> |
877 | 56 | 58 | ||
878 | 59 | #if DEBUG_RAW_EVENTS | ||
879 | 60 | #include "InputEventPrinter.h" | ||
880 | 61 | #endif | ||
881 | 62 | |||
882 | 57 | #define INDENT " " | 63 | #define INDENT " " |
883 | 58 | #define INDENT2 " " | 64 | #define INDENT2 " " |
884 | 59 | #define INDENT3 " " | 65 | #define INDENT3 " " |
885 | @@ -339,7 +345,7 @@ | |||
886 | 339 | batchSize += 1; | 345 | batchSize += 1; |
887 | 340 | } | 346 | } |
888 | 341 | #if DEBUG_RAW_EVENTS | 347 | #if DEBUG_RAW_EVENTS |
890 | 342 | ALOGD("BatchSize: %d Count: %d", batchSize, count); | 348 | ALOGD("BatchSize: %zu Count: %zu", batchSize, count); |
891 | 343 | #endif | 349 | #endif |
892 | 344 | processEventsForDeviceLocked(deviceId, rawEvent, batchSize); | 350 | processEventsForDeviceLocked(deviceId, rawEvent, batchSize); |
893 | 345 | } else { | 351 | } else { |
894 | @@ -974,8 +980,9 @@ | |||
895 | 974 | size_t numMappers = mMappers.size(); | 980 | size_t numMappers = mMappers.size(); |
896 | 975 | for (const RawEvent* rawEvent = rawEvents; count--; rawEvent++) { | 981 | for (const RawEvent* rawEvent = rawEvents; count--; rawEvent++) { |
897 | 976 | #if DEBUG_RAW_EVENTS | 982 | #if DEBUG_RAW_EVENTS |
900 | 977 | ALOGD("Input event: device=%d type=0x%04x code=0x%04x value=0x%08x", | 983 | char inputStr[200]; |
901 | 978 | rawEvent->deviceId, rawEvent->type, rawEvent->code, rawEvent->value); | 984 | inputEvToStr(inputStr, rawEvent->type, rawEvent->code, rawEvent->value); |
902 | 985 | ALOGD("Input event: device=%d %s", rawEvent->deviceId, inputStr); | ||
903 | 979 | #endif | 986 | #endif |
904 | 980 | 987 | ||
905 | 981 | if (mDropUntilNextSync) { | 988 | if (mDropUntilNextSync) { |
906 | @@ -1434,32 +1441,31 @@ | |||
907 | 1434 | 1441 | ||
908 | 1435 | void RawPointerData::clear() { | 1442 | void RawPointerData::clear() { |
909 | 1436 | pointerCount = 0; | 1443 | pointerCount = 0; |
911 | 1437 | clearIdBits(); | 1444 | clearIds(); |
912 | 1438 | } | 1445 | } |
913 | 1439 | 1446 | ||
914 | 1440 | void RawPointerData::copyFrom(const RawPointerData& other) { | 1447 | void RawPointerData::copyFrom(const RawPointerData& other) { |
915 | 1441 | pointerCount = other.pointerCount; | 1448 | pointerCount = other.pointerCount; |
918 | 1442 | hoveringIdBits = other.hoveringIdBits; | 1449 | hoveringIds = other.hoveringIds; |
919 | 1443 | touchingIdBits = other.touchingIdBits; | 1450 | touchingIds = other.touchingIds; |
920 | 1444 | 1451 | ||
921 | 1445 | for (uint32_t i = 0; i < pointerCount; i++) { | 1452 | for (uint32_t i = 0; i < pointerCount; i++) { |
922 | 1446 | pointers[i] = other.pointers[i]; | 1453 | pointers[i] = other.pointers[i]; |
923 | 1447 | 1454 | ||
924 | 1448 | int id = pointers[i].id; | 1455 | int id = pointers[i].id; |
925 | 1449 | idToIndex[id] = other.idToIndex[id]; | ||
926 | 1450 | } | 1456 | } |
927 | 1451 | } | 1457 | } |
928 | 1452 | 1458 | ||
929 | 1453 | void RawPointerData::getCentroidOfTouchingPointers(float* outX, float* outY) const { | 1459 | void RawPointerData::getCentroidOfTouchingPointers(float* outX, float* outY) const { |
930 | 1454 | float x = 0, y = 0; | 1460 | float x = 0, y = 0; |
932 | 1455 | uint32_t count = touchingIdBits.count(); | 1461 | |
933 | 1462 | uint32_t count = touchingIds.count(); | ||
934 | 1456 | if (count) { | 1463 | if (count) { |
937 | 1457 | for (BitSet32 idBits(touchingIdBits); !idBits.isEmpty(); ) { | 1464 | touchingIds.forEach([&](int32_t id) { |
936 | 1458 | uint32_t id = idBits.clearFirstMarkedBit(); | ||
938 | 1459 | const Pointer& pointer = pointerForId(id); | 1465 | const Pointer& pointer = pointerForId(id); |
939 | 1460 | x += pointer.x; | 1466 | x += pointer.x; |
940 | 1461 | y += pointer.y; | 1467 | y += pointer.y; |
942 | 1462 | } | 1468 | }); |
943 | 1463 | x /= count; | 1469 | x /= count; |
944 | 1464 | y /= count; | 1470 | y /= count; |
945 | 1465 | } | 1471 | } |
946 | @@ -1476,21 +1482,18 @@ | |||
947 | 1476 | 1482 | ||
948 | 1477 | void CookedPointerData::clear() { | 1483 | void CookedPointerData::clear() { |
949 | 1478 | pointerCount = 0; | 1484 | pointerCount = 0; |
952 | 1479 | hoveringIdBits.clear(); | 1485 | hoveringIds.clear(); |
953 | 1480 | touchingIdBits.clear(); | 1486 | touchingIds.clear(); |
954 | 1481 | } | 1487 | } |
955 | 1482 | 1488 | ||
956 | 1483 | void CookedPointerData::copyFrom(const CookedPointerData& other) { | 1489 | void CookedPointerData::copyFrom(const CookedPointerData& other) { |
957 | 1484 | pointerCount = other.pointerCount; | 1490 | pointerCount = other.pointerCount; |
960 | 1485 | hoveringIdBits = other.hoveringIdBits; | 1491 | hoveringIds = other.hoveringIds; |
961 | 1486 | touchingIdBits = other.touchingIdBits; | 1492 | touchingIds = other.touchingIds; |
962 | 1487 | 1493 | ||
963 | 1488 | for (uint32_t i = 0; i < pointerCount; i++) { | 1494 | for (uint32_t i = 0; i < pointerCount; i++) { |
964 | 1489 | pointerProperties[i].copyFrom(other.pointerProperties[i]); | 1495 | pointerProperties[i].copyFrom(other.pointerProperties[i]); |
965 | 1490 | pointerCoords[i].copyFrom(other.pointerCoords[i]); | 1496 | pointerCoords[i].copyFrom(other.pointerCoords[i]); |
966 | 1491 | |||
967 | 1492 | int id = pointerProperties[i].id; | ||
968 | 1493 | idToIndex[id] = other.idToIndex[id]; | ||
969 | 1494 | } | 1497 | } |
970 | 1495 | } | 1498 | } |
971 | 1496 | 1499 | ||
972 | @@ -2554,7 +2557,8 @@ | |||
973 | 2554 | InputMapper(device), | 2557 | InputMapper(device), |
974 | 2555 | mSource(0), mDeviceMode(DEVICE_MODE_DISABLED), | 2558 | mSource(0), mDeviceMode(DEVICE_MODE_DISABLED), |
975 | 2556 | mSurfaceOrientation(-1), mSurfaceWidth(-1), mSurfaceHeight(-1), | 2559 | mSurfaceOrientation(-1), mSurfaceWidth(-1), mSurfaceHeight(-1), |
977 | 2557 | mPointerUsage(POINTER_USAGE_NONE) { | 2560 | mPointerUsage(POINTER_USAGE_NONE), |
978 | 2561 | mNextNewPointerId(0) { | ||
979 | 2558 | } | 2562 | } |
980 | 2559 | 2563 | ||
981 | 2560 | TouchInputMapper::~TouchInputMapper() { | 2564 | TouchInputMapper::~TouchInputMapper() { |
982 | @@ -3499,12 +3503,12 @@ | |||
983 | 3499 | mLastButtonState = 0; | 3503 | mLastButtonState = 0; |
984 | 3500 | mCurrentRawVScroll = 0; | 3504 | mCurrentRawVScroll = 0; |
985 | 3501 | mCurrentRawHScroll = 0; | 3505 | mCurrentRawHScroll = 0; |
992 | 3502 | mCurrentFingerIdBits.clear(); | 3506 | mCurrentFingerIds.clear(); |
993 | 3503 | mLastFingerIdBits.clear(); | 3507 | mLastFingerIds.clear(); |
994 | 3504 | mCurrentStylusIdBits.clear(); | 3508 | mCurrentStylusIds.clear(); |
995 | 3505 | mLastStylusIdBits.clear(); | 3509 | mLastStylusIds.clear(); |
996 | 3506 | mCurrentMouseIdBits.clear(); | 3510 | mCurrentMouseIds.clear(); |
997 | 3507 | mLastMouseIdBits.clear(); | 3511 | mLastMouseIds.clear(); |
998 | 3508 | mPointerUsage = POINTER_USAGE_NONE; | 3512 | mPointerUsage = POINTER_USAGE_NONE; |
999 | 3509 | mSentHoverEnter = false; | 3513 | mSentHoverEnter = false; |
1000 | 3510 | mDownTime = 0; | 3514 | mDownTime = 0; |
1001 | @@ -3553,21 +3557,25 @@ | |||
1002 | 3553 | mLastRawPointerData.pointerCount, | 3557 | mLastRawPointerData.pointerCount, |
1003 | 3554 | mCurrentRawPointerData.pointerCount); | 3558 | mCurrentRawPointerData.pointerCount); |
1004 | 3555 | } else { | 3559 | } else { |
1007 | 3556 | ALOGD("syncTouch: pointerCount %d -> %d, touching ids 0x%08x -> 0x%08x, " | 3560 | std::string lastTouchingIdsString = mLastRawPointerData.touchingIds.toString(); |
1008 | 3557 | "hovering ids 0x%08x -> 0x%08x", | 3561 | std::string currentTouchingIdsString = mCurrentRawPointerData.touchingIds.toString(); |
1009 | 3562 | std::string lastHoveringIdsString = mLastRawPointerData.hoveringIds.toString(); | ||
1010 | 3563 | std::string currentHoveringIdsString = mCurrentRawPointerData.hoveringIds.toString(); | ||
1011 | 3564 | ALOGD("syncTouch: pointerCount %u -> %u, touching ids (%s) -> (%s), " | ||
1012 | 3565 | "hovering ids (%s) -> (%s)", | ||
1013 | 3558 | mLastRawPointerData.pointerCount, | 3566 | mLastRawPointerData.pointerCount, |
1014 | 3559 | mCurrentRawPointerData.pointerCount, | 3567 | mCurrentRawPointerData.pointerCount, |
1019 | 3560 | mLastRawPointerData.touchingIdBits.value, | 3568 | lastTouchingIdsString.c_str(), |
1020 | 3561 | mCurrentRawPointerData.touchingIdBits.value, | 3569 | currentTouchingIdsString.c_str(), |
1021 | 3562 | mLastRawPointerData.hoveringIdBits.value, | 3570 | lastHoveringIdsString.c_str(), |
1022 | 3563 | mCurrentRawPointerData.hoveringIdBits.value); | 3571 | currentHoveringIdsString.c_str()); |
1023 | 3564 | } | 3572 | } |
1024 | 3565 | #endif | 3573 | #endif |
1025 | 3566 | 3574 | ||
1026 | 3567 | // Reset state that we will compute below. | 3575 | // Reset state that we will compute below. |
1030 | 3568 | mCurrentFingerIdBits.clear(); | 3576 | mCurrentFingerIds.clear(); |
1031 | 3569 | mCurrentStylusIdBits.clear(); | 3577 | mCurrentStylusIds.clear(); |
1032 | 3570 | mCurrentMouseIdBits.clear(); | 3578 | mCurrentMouseIds.clear(); |
1033 | 3571 | mCurrentCookedPointerData.clear(); | 3579 | mCurrentCookedPointerData.clear(); |
1034 | 3572 | 3580 | ||
1035 | 3573 | if (mDeviceMode == DEVICE_MODE_DISABLED) { | 3581 | if (mDeviceMode == DEVICE_MODE_DISABLED) { |
1036 | @@ -3617,38 +3625,36 @@ | |||
1037 | 3617 | 3625 | ||
1038 | 3618 | // Dispatch the touches either directly or by translation through a pointer on screen. | 3626 | // Dispatch the touches either directly or by translation through a pointer on screen. |
1039 | 3619 | if (mDeviceMode == DEVICE_MODE_POINTER) { | 3627 | if (mDeviceMode == DEVICE_MODE_POINTER) { |
1043 | 3620 | for (BitSet32 idBits(mCurrentRawPointerData.touchingIdBits); !idBits.isEmpty(); ) { | 3628 | for (uint32_t i = 0; i < mCurrentRawPointerData.pointerCount; ++i) { |
1044 | 3621 | uint32_t id = idBits.clearFirstMarkedBit(); | 3629 | const RawPointerData::Pointer& pointer = mCurrentRawPointerData.pointers[i]; |
1042 | 3622 | const RawPointerData::Pointer& pointer = mCurrentRawPointerData.pointerForId(id); | ||
1045 | 3623 | if (pointer.toolType == AMOTION_EVENT_TOOL_TYPE_STYLUS | 3630 | if (pointer.toolType == AMOTION_EVENT_TOOL_TYPE_STYLUS |
1046 | 3624 | || pointer.toolType == AMOTION_EVENT_TOOL_TYPE_ERASER) { | 3631 | || pointer.toolType == AMOTION_EVENT_TOOL_TYPE_ERASER) { |
1048 | 3625 | mCurrentStylusIdBits.markBit(id); | 3632 | mCurrentStylusIds.insert(pointer.id); |
1049 | 3626 | } else if (pointer.toolType == AMOTION_EVENT_TOOL_TYPE_FINGER | 3633 | } else if (pointer.toolType == AMOTION_EVENT_TOOL_TYPE_FINGER |
1050 | 3627 | || pointer.toolType == AMOTION_EVENT_TOOL_TYPE_UNKNOWN) { | 3634 | || pointer.toolType == AMOTION_EVENT_TOOL_TYPE_UNKNOWN) { |
1052 | 3628 | mCurrentFingerIdBits.markBit(id); | 3635 | mCurrentFingerIds.insert(pointer.id); |
1053 | 3629 | } else if (pointer.toolType == AMOTION_EVENT_TOOL_TYPE_MOUSE) { | 3636 | } else if (pointer.toolType == AMOTION_EVENT_TOOL_TYPE_MOUSE) { |
1055 | 3630 | mCurrentMouseIdBits.markBit(id); | 3637 | mCurrentMouseIds.insert(pointer.id); |
1056 | 3631 | } | 3638 | } |
1057 | 3632 | } | 3639 | } |
1060 | 3633 | for (BitSet32 idBits(mCurrentRawPointerData.hoveringIdBits); !idBits.isEmpty(); ) { | 3640 | mCurrentRawPointerData.hoveringIds.forEach([&](int32_t id) { |
1059 | 3634 | uint32_t id = idBits.clearFirstMarkedBit(); | ||
1061 | 3635 | const RawPointerData::Pointer& pointer = mCurrentRawPointerData.pointerForId(id); | 3641 | const RawPointerData::Pointer& pointer = mCurrentRawPointerData.pointerForId(id); |
1062 | 3636 | if (pointer.toolType == AMOTION_EVENT_TOOL_TYPE_STYLUS | 3642 | if (pointer.toolType == AMOTION_EVENT_TOOL_TYPE_STYLUS |
1063 | 3637 | || pointer.toolType == AMOTION_EVENT_TOOL_TYPE_ERASER) { | 3643 | || pointer.toolType == AMOTION_EVENT_TOOL_TYPE_ERASER) { |
1065 | 3638 | mCurrentStylusIdBits.markBit(id); | 3644 | mCurrentStylusIds.insert(id); |
1066 | 3639 | } | 3645 | } |
1068 | 3640 | } | 3646 | }); |
1069 | 3641 | 3647 | ||
1070 | 3642 | // Stylus takes precedence over all tools, then mouse, then finger. | 3648 | // Stylus takes precedence over all tools, then mouse, then finger. |
1071 | 3643 | PointerUsage pointerUsage = mPointerUsage; | 3649 | PointerUsage pointerUsage = mPointerUsage; |
1075 | 3644 | if (!mCurrentStylusIdBits.isEmpty()) { | 3650 | if (!mCurrentStylusIds.isEmpty()) { |
1076 | 3645 | mCurrentMouseIdBits.clear(); | 3651 | mCurrentMouseIds.clear(); |
1077 | 3646 | mCurrentFingerIdBits.clear(); | 3652 | mCurrentFingerIds.clear(); |
1078 | 3647 | pointerUsage = POINTER_USAGE_STYLUS; | 3653 | pointerUsage = POINTER_USAGE_STYLUS; |
1081 | 3648 | } else if (!mCurrentMouseIdBits.isEmpty()) { | 3654 | } else if (!mCurrentMouseIds.isEmpty()) { |
1082 | 3649 | mCurrentFingerIdBits.clear(); | 3655 | mCurrentFingerIds.clear(); |
1083 | 3650 | pointerUsage = POINTER_USAGE_MOUSE; | 3656 | pointerUsage = POINTER_USAGE_MOUSE; |
1085 | 3651 | } else if (!mCurrentFingerIdBits.isEmpty() || isPointerDown(mCurrentButtonState)) { | 3657 | } else if (!mCurrentFingerIds.isEmpty() || isPointerDown(mCurrentButtonState)) { |
1086 | 3652 | pointerUsage = POINTER_USAGE_GESTURES; | 3658 | pointerUsage = POINTER_USAGE_GESTURES; |
1087 | 3653 | } | 3659 | } |
1088 | 3654 | 3660 | ||
1089 | @@ -3661,8 +3667,7 @@ | |||
1090 | 3661 | 3667 | ||
1091 | 3662 | mPointerController->setButtonState(mCurrentButtonState); | 3668 | mPointerController->setButtonState(mCurrentButtonState); |
1092 | 3663 | mPointerController->setSpots(mCurrentCookedPointerData.pointerCoords, | 3669 | mPointerController->setSpots(mCurrentCookedPointerData.pointerCoords, |
1095 | 3664 | mCurrentCookedPointerData.idToIndex, | 3670 | mCurrentCookedPointerData.pointerCount); |
1094 | 3665 | mCurrentCookedPointerData.touchingIdBits); | ||
1096 | 3666 | } | 3671 | } |
1097 | 3667 | 3672 | ||
1098 | 3668 | dispatchHoverExit(when, policyFlags); | 3673 | dispatchHoverExit(when, policyFlags); |
1099 | @@ -3679,9 +3684,9 @@ | |||
1100 | 3679 | mLastRawPointerData.copyFrom(mCurrentRawPointerData); | 3684 | mLastRawPointerData.copyFrom(mCurrentRawPointerData); |
1101 | 3680 | mLastCookedPointerData.copyFrom(mCurrentCookedPointerData); | 3685 | mLastCookedPointerData.copyFrom(mCurrentCookedPointerData); |
1102 | 3681 | mLastButtonState = mCurrentButtonState; | 3686 | mLastButtonState = mCurrentButtonState; |
1106 | 3682 | mLastFingerIdBits = mCurrentFingerIdBits; | 3687 | mLastFingerIds = mCurrentFingerIds; |
1107 | 3683 | mLastStylusIdBits = mCurrentStylusIdBits; | 3688 | mLastStylusIds = mCurrentStylusIds; |
1108 | 3684 | mLastMouseIdBits = mCurrentMouseIdBits; | 3689 | mLastMouseIds = mCurrentMouseIds; |
1109 | 3685 | 3690 | ||
1110 | 3686 | // Clear some transient state. | 3691 | // Clear some transient state. |
1111 | 3687 | mCurrentRawVScroll = 0; | 3692 | mCurrentRawVScroll = 0; |
1112 | @@ -3699,7 +3704,7 @@ | |||
1113 | 3699 | bool TouchInputMapper::consumeRawTouches(nsecs_t when, uint32_t policyFlags) { | 3704 | bool TouchInputMapper::consumeRawTouches(nsecs_t when, uint32_t policyFlags) { |
1114 | 3700 | // Check for release of a virtual key. | 3705 | // Check for release of a virtual key. |
1115 | 3701 | if (mCurrentVirtualKey.down) { | 3706 | if (mCurrentVirtualKey.down) { |
1117 | 3702 | if (mCurrentRawPointerData.touchingIdBits.isEmpty()) { | 3707 | if (mCurrentRawPointerData.touchingIds.isEmpty()) { |
1118 | 3703 | // Pointer went up while virtual key was down. | 3708 | // Pointer went up while virtual key was down. |
1119 | 3704 | mCurrentVirtualKey.down = false; | 3709 | mCurrentVirtualKey.down = false; |
1120 | 3705 | if (!mCurrentVirtualKey.ignored) { | 3710 | if (!mCurrentVirtualKey.ignored) { |
1121 | @@ -3714,8 +3719,8 @@ | |||
1122 | 3714 | return true; | 3719 | return true; |
1123 | 3715 | } | 3720 | } |
1124 | 3716 | 3721 | ||
1127 | 3717 | if (mCurrentRawPointerData.touchingIdBits.count() == 1) { | 3722 | if (mCurrentRawPointerData.touchingIds.count() == 1) { |
1128 | 3718 | uint32_t id = mCurrentRawPointerData.touchingIdBits.firstMarkedBit(); | 3723 | int32_t id = mCurrentRawPointerData.touchingIds.first(); |
1129 | 3719 | const RawPointerData::Pointer& pointer = mCurrentRawPointerData.pointerForId(id); | 3724 | const RawPointerData::Pointer& pointer = mCurrentRawPointerData.pointerForId(id); |
1130 | 3720 | const VirtualKey* virtualKey = findVirtualKeyHit(pointer.x, pointer.y); | 3725 | const VirtualKey* virtualKey = findVirtualKeyHit(pointer.x, pointer.y); |
1131 | 3721 | if (virtualKey && virtualKey->keyCode == mCurrentVirtualKey.keyCode) { | 3726 | if (virtualKey && virtualKey->keyCode == mCurrentVirtualKey.keyCode) { |
1132 | @@ -3741,15 +3746,15 @@ | |||
1133 | 3741 | } | 3746 | } |
1134 | 3742 | } | 3747 | } |
1135 | 3743 | 3748 | ||
1138 | 3744 | if (mLastRawPointerData.touchingIdBits.isEmpty() | 3749 | if (mLastRawPointerData.touchingIds.isEmpty() |
1139 | 3745 | && !mCurrentRawPointerData.touchingIdBits.isEmpty()) { | 3750 | && !mCurrentRawPointerData.touchingIds.isEmpty()) { |
1140 | 3746 | // Pointer just went down. Check for virtual key press or off-screen touches. | 3751 | // Pointer just went down. Check for virtual key press or off-screen touches. |
1142 | 3747 | uint32_t id = mCurrentRawPointerData.touchingIdBits.firstMarkedBit(); | 3752 | int32_t id = mCurrentRawPointerData.touchingIds.first(); |
1143 | 3748 | const RawPointerData::Pointer& pointer = mCurrentRawPointerData.pointerForId(id); | 3753 | const RawPointerData::Pointer& pointer = mCurrentRawPointerData.pointerForId(id); |
1144 | 3749 | if (!isPointInsideSurface(pointer.x, pointer.y)) { | 3754 | if (!isPointInsideSurface(pointer.x, pointer.y)) { |
1145 | 3750 | // If exactly one pointer went down, check for virtual key hit. | 3755 | // If exactly one pointer went down, check for virtual key hit. |
1146 | 3751 | // Otherwise we will drop the entire stroke. | 3756 | // Otherwise we will drop the entire stroke. |
1148 | 3752 | if (mCurrentRawPointerData.touchingIdBits.count() == 1) { | 3757 | if (mCurrentRawPointerData.touchingIds.count() == 1) { |
1149 | 3753 | const VirtualKey* virtualKey = findVirtualKeyHit(pointer.x, pointer.y); | 3758 | const VirtualKey* virtualKey = findVirtualKeyHit(pointer.x, pointer.y); |
1150 | 3754 | if (virtualKey) { | 3759 | if (virtualKey) { |
1151 | 3755 | mCurrentVirtualKey.down = true; | 3760 | mCurrentVirtualKey.down = true; |
1152 | @@ -3789,7 +3794,7 @@ | |||
1153 | 3789 | // area and accidentally triggers a virtual key. This often happens when virtual keys | 3794 | // area and accidentally triggers a virtual key. This often happens when virtual keys |
1154 | 3790 | // are layed out below the screen near to where the on screen keyboard's space bar | 3795 | // are layed out below the screen near to where the on screen keyboard's space bar |
1155 | 3791 | // is displayed. | 3796 | // is displayed. |
1157 | 3792 | if (mConfig.virtualKeyQuietTime > 0 && !mCurrentRawPointerData.touchingIdBits.isEmpty()) { | 3797 | if (mConfig.virtualKeyQuietTime > 0 && !mCurrentRawPointerData.touchingIds.isEmpty()) { |
1158 | 3793 | mContext->disableVirtualKeysUntil(when + mConfig.virtualKeyQuietTime); | 3798 | mContext->disableVirtualKeysUntil(when + mConfig.virtualKeyQuietTime); |
1159 | 3794 | } | 3799 | } |
1160 | 3795 | return false; | 3800 | return false; |
1161 | @@ -3809,13 +3814,13 @@ | |||
1162 | 3809 | } | 3814 | } |
1163 | 3810 | 3815 | ||
1164 | 3811 | void TouchInputMapper::dispatchTouches(nsecs_t when, uint32_t policyFlags) { | 3816 | void TouchInputMapper::dispatchTouches(nsecs_t when, uint32_t policyFlags) { |
1167 | 3812 | BitSet32 currentIdBits = mCurrentCookedPointerData.touchingIdBits; | 3817 | IntSet ¤tIds = mCurrentCookedPointerData.touchingIds; |
1168 | 3813 | BitSet32 lastIdBits = mLastCookedPointerData.touchingIdBits; | 3818 | IntSet &lastIds = mLastCookedPointerData.touchingIds; |
1169 | 3814 | int32_t metaState = getContext()->getGlobalMetaState(); | 3819 | int32_t metaState = getContext()->getGlobalMetaState(); |
1170 | 3815 | int32_t buttonState = mCurrentButtonState; | 3820 | int32_t buttonState = mCurrentButtonState; |
1171 | 3816 | 3821 | ||
1174 | 3817 | if (currentIdBits == lastIdBits) { | 3822 | if (currentIds == lastIds) { |
1175 | 3818 | if (!currentIdBits.isEmpty()) { | 3823 | if (!currentIds.isEmpty()) { |
1176 | 3819 | // No pointer id changes so this is a move event. | 3824 | // No pointer id changes so this is a move event. |
1177 | 3820 | // The listener takes care of batching moves so we don't have to deal with that here. | 3825 | // The listener takes care of batching moves so we don't have to deal with that here. |
1178 | 3821 | dispatchMotion(when, policyFlags, mSource, | 3826 | dispatchMotion(when, policyFlags, mSource, |
1179 | @@ -3823,66 +3828,63 @@ | |||
1180 | 3823 | AMOTION_EVENT_EDGE_FLAG_NONE, | 3828 | AMOTION_EVENT_EDGE_FLAG_NONE, |
1181 | 3824 | mCurrentCookedPointerData.pointerProperties, | 3829 | mCurrentCookedPointerData.pointerProperties, |
1182 | 3825 | mCurrentCookedPointerData.pointerCoords, | 3830 | mCurrentCookedPointerData.pointerCoords, |
1185 | 3826 | mCurrentCookedPointerData.idToIndex, | 3831 | mCurrentCookedPointerData.pointerCount, |
1186 | 3827 | currentIdBits, -1, | 3832 | currentIds, -1, |
1187 | 3828 | mOrientedXPrecision, mOrientedYPrecision, mDownTime); | 3833 | mOrientedXPrecision, mOrientedYPrecision, mDownTime); |
1188 | 3829 | } | 3834 | } |
1189 | 3830 | } else { | 3835 | } else { |
1190 | 3831 | // There may be pointers going up and pointers going down and pointers moving | 3836 | // There may be pointers going up and pointers going down and pointers moving |
1191 | 3832 | // all at the same time. | 3837 | // all at the same time. |
1196 | 3833 | BitSet32 upIdBits(lastIdBits.value & ~currentIdBits.value); | 3838 | IntSet upIds = lastIds - currentIds; |
1197 | 3834 | BitSet32 downIdBits(currentIdBits.value & ~lastIdBits.value); | 3839 | IntSet downIds = currentIds - lastIds; |
1198 | 3835 | BitSet32 moveIdBits(lastIdBits.value & currentIdBits.value); | 3840 | IntSet moveIds = lastIds & currentIds; |
1199 | 3836 | BitSet32 dispatchedIdBits(lastIdBits.value); | 3841 | IntSet dispatchedIds = lastIds; |
1200 | 3837 | 3842 | ||
1201 | 3838 | // Update last coordinates of pointers that have moved so that we observe the new | 3843 | // Update last coordinates of pointers that have moved so that we observe the new |
1202 | 3839 | // pointer positions at the same time as other pointers that have just gone up. | 3844 | // pointer positions at the same time as other pointers that have just gone up. |
1203 | 3840 | bool moveNeeded = updateMovedPointers( | 3845 | bool moveNeeded = updateMovedPointers( |
1204 | 3841 | mCurrentCookedPointerData.pointerProperties, | 3846 | mCurrentCookedPointerData.pointerProperties, |
1205 | 3842 | mCurrentCookedPointerData.pointerCoords, | 3847 | mCurrentCookedPointerData.pointerCoords, |
1207 | 3843 | mCurrentCookedPointerData.idToIndex, | 3848 | mCurrentCookedPointerData.pointerCount, |
1208 | 3844 | mLastCookedPointerData.pointerProperties, | 3849 | mLastCookedPointerData.pointerProperties, |
1209 | 3845 | mLastCookedPointerData.pointerCoords, | 3850 | mLastCookedPointerData.pointerCoords, |
1212 | 3846 | mLastCookedPointerData.idToIndex, | 3851 | mLastCookedPointerData.pointerCount, |
1213 | 3847 | moveIdBits); | 3852 | moveIds); |
1214 | 3848 | if (buttonState != mLastButtonState) { | 3853 | if (buttonState != mLastButtonState) { |
1215 | 3849 | moveNeeded = true; | 3854 | moveNeeded = true; |
1216 | 3850 | } | 3855 | } |
1217 | 3851 | 3856 | ||
1218 | 3852 | // Dispatch pointer up events. | 3857 | // Dispatch pointer up events. |
1222 | 3853 | while (!upIdBits.isEmpty()) { | 3858 | upIds.forEach([&](int32_t upId) { |
1220 | 3854 | uint32_t upId = upIdBits.clearFirstMarkedBit(); | ||
1221 | 3855 | |||
1223 | 3856 | dispatchMotion(when, policyFlags, mSource, | 3859 | dispatchMotion(when, policyFlags, mSource, |
1224 | 3857 | AMOTION_EVENT_ACTION_POINTER_UP, 0, metaState, buttonState, 0, | 3860 | AMOTION_EVENT_ACTION_POINTER_UP, 0, metaState, buttonState, 0, |
1225 | 3858 | mLastCookedPointerData.pointerProperties, | 3861 | mLastCookedPointerData.pointerProperties, |
1226 | 3859 | mLastCookedPointerData.pointerCoords, | 3862 | mLastCookedPointerData.pointerCoords, |
1229 | 3860 | mLastCookedPointerData.idToIndex, | 3863 | mLastCookedPointerData.pointerCount, |
1230 | 3861 | dispatchedIdBits, upId, | 3864 | dispatchedIds, upId, |
1231 | 3862 | mOrientedXPrecision, mOrientedYPrecision, mDownTime); | 3865 | mOrientedXPrecision, mOrientedYPrecision, mDownTime); |
1234 | 3863 | dispatchedIdBits.clearBit(upId); | 3866 | dispatchedIds.remove(upId); |
1235 | 3864 | } | 3867 | }); |
1236 | 3865 | 3868 | ||
1237 | 3866 | // Dispatch move events if any of the remaining pointers moved from their old locations. | 3869 | // Dispatch move events if any of the remaining pointers moved from their old locations. |
1238 | 3867 | // Although applications receive new locations as part of individual pointer up | 3870 | // Although applications receive new locations as part of individual pointer up |
1239 | 3868 | // events, they do not generally handle them except when presented in a move event. | 3871 | // events, they do not generally handle them except when presented in a move event. |
1240 | 3869 | if (moveNeeded) { | 3872 | if (moveNeeded) { |
1242 | 3870 | ALOG_ASSERT(moveIdBits.value == dispatchedIdBits.value); | 3873 | ALOG_ASSERT(moveIds == dispatchedIds); |
1243 | 3871 | dispatchMotion(when, policyFlags, mSource, | 3874 | dispatchMotion(when, policyFlags, mSource, |
1244 | 3872 | AMOTION_EVENT_ACTION_MOVE, 0, metaState, buttonState, 0, | 3875 | AMOTION_EVENT_ACTION_MOVE, 0, metaState, buttonState, 0, |
1245 | 3873 | mCurrentCookedPointerData.pointerProperties, | 3876 | mCurrentCookedPointerData.pointerProperties, |
1246 | 3874 | mCurrentCookedPointerData.pointerCoords, | 3877 | mCurrentCookedPointerData.pointerCoords, |
1249 | 3875 | mCurrentCookedPointerData.idToIndex, | 3878 | mCurrentCookedPointerData.pointerCount, |
1250 | 3876 | dispatchedIdBits, -1, | 3879 | dispatchedIds, -1, |
1251 | 3877 | mOrientedXPrecision, mOrientedYPrecision, mDownTime); | 3880 | mOrientedXPrecision, mOrientedYPrecision, mDownTime); |
1252 | 3878 | } | 3881 | } |
1253 | 3879 | 3882 | ||
1254 | 3880 | // Dispatch pointer down events using the new pointer locations. | 3883 | // Dispatch pointer down events using the new pointer locations. |
1258 | 3881 | while (!downIdBits.isEmpty()) { | 3884 | downIds.forEach([&](int32_t downId) { |
1259 | 3882 | uint32_t downId = downIdBits.clearFirstMarkedBit(); | 3885 | dispatchedIds.insert(downId); |
1257 | 3883 | dispatchedIdBits.markBit(downId); | ||
1260 | 3884 | 3886 | ||
1262 | 3885 | if (dispatchedIdBits.count() == 1) { | 3887 | if (dispatchedIds.count() == 1) { |
1263 | 3886 | // First pointer is going down. Set down time. | 3888 | // First pointer is going down. Set down time. |
1264 | 3887 | mDownTime = when; | 3889 | mDownTime = when; |
1265 | 3888 | } | 3890 | } |
1266 | @@ -3891,40 +3893,40 @@ | |||
1267 | 3891 | AMOTION_EVENT_ACTION_POINTER_DOWN, 0, metaState, buttonState, 0, | 3893 | AMOTION_EVENT_ACTION_POINTER_DOWN, 0, metaState, buttonState, 0, |
1268 | 3892 | mCurrentCookedPointerData.pointerProperties, | 3894 | mCurrentCookedPointerData.pointerProperties, |
1269 | 3893 | mCurrentCookedPointerData.pointerCoords, | 3895 | mCurrentCookedPointerData.pointerCoords, |
1272 | 3894 | mCurrentCookedPointerData.idToIndex, | 3896 | mCurrentCookedPointerData.pointerCount, |
1273 | 3895 | dispatchedIdBits, downId, | 3897 | dispatchedIds, downId, |
1274 | 3896 | mOrientedXPrecision, mOrientedYPrecision, mDownTime); | 3898 | mOrientedXPrecision, mOrientedYPrecision, mDownTime); |
1276 | 3897 | } | 3899 | }); |
1277 | 3898 | } | 3900 | } |
1278 | 3899 | } | 3901 | } |
1279 | 3900 | 3902 | ||
1280 | 3901 | void TouchInputMapper::dispatchHoverExit(nsecs_t when, uint32_t policyFlags) { | 3903 | void TouchInputMapper::dispatchHoverExit(nsecs_t when, uint32_t policyFlags) { |
1281 | 3902 | if (mSentHoverEnter && | 3904 | if (mSentHoverEnter && |
1284 | 3903 | (mCurrentCookedPointerData.hoveringIdBits.isEmpty() | 3905 | (mCurrentCookedPointerData.hoveringIds.isEmpty() |
1285 | 3904 | || !mCurrentCookedPointerData.touchingIdBits.isEmpty())) { | 3906 | || !mCurrentCookedPointerData.touchingIds.isEmpty())) { |
1286 | 3905 | int32_t metaState = getContext()->getGlobalMetaState(); | 3907 | int32_t metaState = getContext()->getGlobalMetaState(); |
1287 | 3906 | dispatchMotion(when, policyFlags, mSource, | 3908 | dispatchMotion(when, policyFlags, mSource, |
1288 | 3907 | AMOTION_EVENT_ACTION_HOVER_EXIT, 0, metaState, mLastButtonState, 0, | 3909 | AMOTION_EVENT_ACTION_HOVER_EXIT, 0, metaState, mLastButtonState, 0, |
1289 | 3908 | mLastCookedPointerData.pointerProperties, | 3910 | mLastCookedPointerData.pointerProperties, |
1290 | 3909 | mLastCookedPointerData.pointerCoords, | 3911 | mLastCookedPointerData.pointerCoords, |
1293 | 3910 | mLastCookedPointerData.idToIndex, | 3912 | mLastCookedPointerData.pointerCount, |
1294 | 3911 | mLastCookedPointerData.hoveringIdBits, -1, | 3913 | mLastCookedPointerData.hoveringIds, -1, |
1295 | 3912 | mOrientedXPrecision, mOrientedYPrecision, mDownTime); | 3914 | mOrientedXPrecision, mOrientedYPrecision, mDownTime); |
1296 | 3913 | mSentHoverEnter = false; | 3915 | mSentHoverEnter = false; |
1297 | 3914 | } | 3916 | } |
1298 | 3915 | } | 3917 | } |
1299 | 3916 | 3918 | ||
1300 | 3917 | void TouchInputMapper::dispatchHoverEnterAndMove(nsecs_t when, uint32_t policyFlags) { | 3919 | void TouchInputMapper::dispatchHoverEnterAndMove(nsecs_t when, uint32_t policyFlags) { |
1303 | 3918 | if (mCurrentCookedPointerData.touchingIdBits.isEmpty() | 3920 | if (mCurrentCookedPointerData.touchingIds.isEmpty() |
1304 | 3919 | && !mCurrentCookedPointerData.hoveringIdBits.isEmpty()) { | 3921 | && !mCurrentCookedPointerData.hoveringIds.isEmpty()) { |
1305 | 3920 | int32_t metaState = getContext()->getGlobalMetaState(); | 3922 | int32_t metaState = getContext()->getGlobalMetaState(); |
1306 | 3921 | if (!mSentHoverEnter) { | 3923 | if (!mSentHoverEnter) { |
1307 | 3922 | dispatchMotion(when, policyFlags, mSource, | 3924 | dispatchMotion(when, policyFlags, mSource, |
1308 | 3923 | AMOTION_EVENT_ACTION_HOVER_ENTER, 0, metaState, mCurrentButtonState, 0, | 3925 | AMOTION_EVENT_ACTION_HOVER_ENTER, 0, metaState, mCurrentButtonState, 0, |
1309 | 3924 | mCurrentCookedPointerData.pointerProperties, | 3926 | mCurrentCookedPointerData.pointerProperties, |
1310 | 3925 | mCurrentCookedPointerData.pointerCoords, | 3927 | mCurrentCookedPointerData.pointerCoords, |
1313 | 3926 | mCurrentCookedPointerData.idToIndex, | 3928 | mCurrentCookedPointerData.pointerCount, |
1314 | 3927 | mCurrentCookedPointerData.hoveringIdBits, -1, | 3929 | mCurrentCookedPointerData.hoveringIds, -1, |
1315 | 3928 | mOrientedXPrecision, mOrientedYPrecision, mDownTime); | 3930 | mOrientedXPrecision, mOrientedYPrecision, mDownTime); |
1316 | 3929 | mSentHoverEnter = true; | 3931 | mSentHoverEnter = true; |
1317 | 3930 | } | 3932 | } |
1318 | @@ -3933,8 +3935,8 @@ | |||
1319 | 3933 | AMOTION_EVENT_ACTION_HOVER_MOVE, 0, metaState, mCurrentButtonState, 0, | 3935 | AMOTION_EVENT_ACTION_HOVER_MOVE, 0, metaState, mCurrentButtonState, 0, |
1320 | 3934 | mCurrentCookedPointerData.pointerProperties, | 3936 | mCurrentCookedPointerData.pointerProperties, |
1321 | 3935 | mCurrentCookedPointerData.pointerCoords, | 3937 | mCurrentCookedPointerData.pointerCoords, |
1324 | 3936 | mCurrentCookedPointerData.idToIndex, | 3938 | mCurrentCookedPointerData.pointerCount, |
1325 | 3937 | mCurrentCookedPointerData.hoveringIdBits, -1, | 3939 | mCurrentCookedPointerData.hoveringIds, -1, |
1326 | 3938 | mOrientedXPrecision, mOrientedYPrecision, mDownTime); | 3940 | mOrientedXPrecision, mOrientedYPrecision, mDownTime); |
1327 | 3939 | } | 3941 | } |
1328 | 3940 | } | 3942 | } |
1329 | @@ -3944,8 +3946,8 @@ | |||
1330 | 3944 | 3946 | ||
1331 | 3945 | mCurrentCookedPointerData.clear(); | 3947 | mCurrentCookedPointerData.clear(); |
1332 | 3946 | mCurrentCookedPointerData.pointerCount = currentPointerCount; | 3948 | mCurrentCookedPointerData.pointerCount = currentPointerCount; |
1335 | 3947 | mCurrentCookedPointerData.hoveringIdBits = mCurrentRawPointerData.hoveringIdBits; | 3949 | mCurrentCookedPointerData.hoveringIds = mCurrentRawPointerData.hoveringIds; |
1336 | 3948 | mCurrentCookedPointerData.touchingIdBits = mCurrentRawPointerData.touchingIdBits; | 3950 | mCurrentCookedPointerData.touchingIds = mCurrentRawPointerData.touchingIds; |
1337 | 3949 | 3951 | ||
1338 | 3950 | // Walk through the the active pointers and map device coordinates onto | 3952 | // Walk through the the active pointers and map device coordinates onto |
1339 | 3951 | // surface coordinates and adjust for display orientation. | 3953 | // surface coordinates and adjust for display orientation. |
1340 | @@ -3988,7 +3990,7 @@ | |||
1341 | 3988 | } | 3990 | } |
1342 | 3989 | 3991 | ||
1343 | 3990 | if (mCalibration.haveSizeIsSummed && mCalibration.sizeIsSummed) { | 3992 | if (mCalibration.haveSizeIsSummed && mCalibration.sizeIsSummed) { |
1345 | 3991 | uint32_t touchingCount = mCurrentRawPointerData.touchingIdBits.count(); | 3993 | uint32_t touchingCount = mCurrentRawPointerData.touchingIds.count(); |
1346 | 3992 | if (touchingCount > 1) { | 3994 | if (touchingCount > 1) { |
1347 | 3993 | touchMajor /= touchingCount; | 3995 | touchMajor /= touchingCount; |
1348 | 3994 | touchMinor /= touchingCount; | 3996 | touchMinor /= touchingCount; |
1349 | @@ -4137,9 +4139,6 @@ | |||
1350 | 4137 | properties.clear(); | 4139 | properties.clear(); |
1351 | 4138 | properties.id = id; | 4140 | properties.id = id; |
1352 | 4139 | properties.toolType = in.toolType; | 4141 | properties.toolType = in.toolType; |
1353 | 4140 | |||
1354 | 4141 | // Write id index. | ||
1355 | 4142 | mCurrentCookedPointerData.idToIndex[id] = i; | ||
1356 | 4143 | } | 4142 | } |
1357 | 4144 | } | 4143 | } |
1358 | 4145 | 4144 | ||
1359 | @@ -4203,8 +4202,7 @@ | |||
1360 | 4203 | mPointerController->clearSpots(); | 4202 | mPointerController->clearSpots(); |
1361 | 4204 | } | 4203 | } |
1362 | 4205 | mPointerController->setSpots(mPointerGesture.currentGestureCoords, | 4204 | mPointerController->setSpots(mPointerGesture.currentGestureCoords, |
1365 | 4206 | mPointerGesture.currentGestureIdToIndex, | 4205 | mPointerGesture.currentGestureIds.count()); |
1364 | 4207 | mPointerGesture.currentGestureIdBits); | ||
1366 | 4208 | } else { | 4206 | } else { |
1367 | 4209 | mPointerController->setPresentation(PointerControllerInterface::PRESENTATION_POINTER); | 4207 | mPointerController->setPresentation(PointerControllerInterface::PRESENTATION_POINTER); |
1368 | 4210 | } | 4208 | } |
1369 | @@ -4255,54 +4253,52 @@ | |||
1370 | 4255 | || mPointerGesture.currentGestureMode == PointerGesture::FREEFORM; | 4253 | || mPointerGesture.currentGestureMode == PointerGesture::FREEFORM; |
1371 | 4256 | bool moveNeeded = false; | 4254 | bool moveNeeded = false; |
1372 | 4257 | if (down && !cancelPreviousGesture && !finishPreviousGesture | 4255 | if (down && !cancelPreviousGesture && !finishPreviousGesture |
1377 | 4258 | && !mPointerGesture.lastGestureIdBits.isEmpty() | 4256 | && !(mPointerGesture.lastGestureIds.isEmpty()) |
1378 | 4259 | && !mPointerGesture.currentGestureIdBits.isEmpty()) { | 4257 | && !(mPointerGesture.currentGestureIds.isEmpty())) { |
1379 | 4260 | BitSet32 movedGestureIdBits(mPointerGesture.currentGestureIdBits.value | 4258 | IntSet movedGestureIds = mPointerGesture.currentGestureIds & mPointerGesture.lastGestureIds; |
1376 | 4261 | & mPointerGesture.lastGestureIdBits.value); | ||
1380 | 4262 | moveNeeded = updateMovedPointers(mPointerGesture.currentGestureProperties, | 4259 | moveNeeded = updateMovedPointers(mPointerGesture.currentGestureProperties, |
1382 | 4263 | mPointerGesture.currentGestureCoords, mPointerGesture.currentGestureIdToIndex, | 4260 | mPointerGesture.currentGestureCoords, mPointerGesture.currentGestureIds.count(), |
1383 | 4264 | mPointerGesture.lastGestureProperties, | 4261 | mPointerGesture.lastGestureProperties, |
1386 | 4265 | mPointerGesture.lastGestureCoords, mPointerGesture.lastGestureIdToIndex, | 4262 | mPointerGesture.lastGestureCoords, mPointerGesture.lastGestureIds.count(), |
1387 | 4266 | movedGestureIdBits); | 4263 | movedGestureIds); |
1388 | 4267 | if (buttonState != mLastButtonState) { | 4264 | if (buttonState != mLastButtonState) { |
1389 | 4268 | moveNeeded = true; | 4265 | moveNeeded = true; |
1390 | 4269 | } | 4266 | } |
1391 | 4270 | } | 4267 | } |
1392 | 4271 | 4268 | ||
1393 | 4272 | // Send motion events for all pointers that went up or were canceled. | 4269 | // Send motion events for all pointers that went up or were canceled. |
1396 | 4273 | BitSet32 dispatchedGestureIdBits(mPointerGesture.lastGestureIdBits); | 4270 | IntSet dispatchedGestureIds = mPointerGesture.lastGestureIds; |
1397 | 4274 | if (!dispatchedGestureIdBits.isEmpty()) { | 4271 | if (!dispatchedGestureIds.isEmpty()) { |
1398 | 4275 | if (cancelPreviousGesture) { | 4272 | if (cancelPreviousGesture) { |
1399 | 4276 | dispatchMotion(when, policyFlags, mSource, | 4273 | dispatchMotion(when, policyFlags, mSource, |
1400 | 4277 | AMOTION_EVENT_ACTION_CANCEL, 0, metaState, buttonState, | 4274 | AMOTION_EVENT_ACTION_CANCEL, 0, metaState, buttonState, |
1401 | 4278 | AMOTION_EVENT_EDGE_FLAG_NONE, | 4275 | AMOTION_EVENT_EDGE_FLAG_NONE, |
1402 | 4279 | mPointerGesture.lastGestureProperties, | 4276 | mPointerGesture.lastGestureProperties, |
1405 | 4280 | mPointerGesture.lastGestureCoords, mPointerGesture.lastGestureIdToIndex, | 4277 | mPointerGesture.lastGestureCoords, mPointerGesture.lastGestureIds.count(), |
1406 | 4281 | dispatchedGestureIdBits, -1, | 4278 | dispatchedGestureIds, -1, |
1407 | 4282 | 0, 0, mPointerGesture.downTime); | 4279 | 0, 0, mPointerGesture.downTime); |
1408 | 4283 | 4280 | ||
1410 | 4284 | dispatchedGestureIdBits.clear(); | 4281 | dispatchedGestureIds.clear(); |
1411 | 4285 | } else { | 4282 | } else { |
1413 | 4286 | BitSet32 upGestureIdBits; | 4283 | IntSet upGestureIds; |
1414 | 4287 | if (finishPreviousGesture) { | 4284 | if (finishPreviousGesture) { |
1416 | 4288 | upGestureIdBits = dispatchedGestureIdBits; | 4285 | upGestureIds = dispatchedGestureIds; |
1417 | 4289 | } else { | 4286 | } else { |
1420 | 4290 | upGestureIdBits.value = dispatchedGestureIdBits.value | 4287 | upGestureIds = dispatchedGestureIds - mPointerGesture.currentGestureIds; |
1419 | 4291 | & ~mPointerGesture.currentGestureIdBits.value; | ||
1421 | 4292 | } | 4288 | } |
1424 | 4293 | while (!upGestureIdBits.isEmpty()) { | 4289 | |
1425 | 4294 | uint32_t id = upGestureIdBits.clearFirstMarkedBit(); | 4290 | upGestureIds.forEach([&](int32_t upId) { |
1426 | 4295 | 4291 | ||
1427 | 4296 | dispatchMotion(when, policyFlags, mSource, | 4292 | dispatchMotion(when, policyFlags, mSource, |
1428 | 4297 | AMOTION_EVENT_ACTION_POINTER_UP, 0, | 4293 | AMOTION_EVENT_ACTION_POINTER_UP, 0, |
1429 | 4298 | metaState, buttonState, AMOTION_EVENT_EDGE_FLAG_NONE, | 4294 | metaState, buttonState, AMOTION_EVENT_EDGE_FLAG_NONE, |
1430 | 4299 | mPointerGesture.lastGestureProperties, | 4295 | mPointerGesture.lastGestureProperties, |
1433 | 4300 | mPointerGesture.lastGestureCoords, mPointerGesture.lastGestureIdToIndex, | 4296 | mPointerGesture.lastGestureCoords, mPointerGesture.lastGestureIds.count(), |
1434 | 4301 | dispatchedGestureIdBits, id, | 4297 | dispatchedGestureIds, upId, |
1435 | 4302 | 0, 0, mPointerGesture.downTime); | 4298 | 0, 0, mPointerGesture.downTime); |
1436 | 4303 | 4299 | ||
1439 | 4304 | dispatchedGestureIdBits.clearBit(id); | 4300 | dispatchedGestureIds.remove(upId); |
1440 | 4305 | } | 4301 | }); |
1441 | 4306 | } | 4302 | } |
1442 | 4307 | } | 4303 | } |
1443 | 4308 | 4304 | ||
1444 | @@ -4311,30 +4307,29 @@ | |||
1445 | 4311 | dispatchMotion(when, policyFlags, mSource, | 4307 | dispatchMotion(when, policyFlags, mSource, |
1446 | 4312 | AMOTION_EVENT_ACTION_MOVE, 0, metaState, buttonState, AMOTION_EVENT_EDGE_FLAG_NONE, | 4308 | AMOTION_EVENT_ACTION_MOVE, 0, metaState, buttonState, AMOTION_EVENT_EDGE_FLAG_NONE, |
1447 | 4313 | mPointerGesture.currentGestureProperties, | 4309 | mPointerGesture.currentGestureProperties, |
1450 | 4314 | mPointerGesture.currentGestureCoords, mPointerGesture.currentGestureIdToIndex, | 4310 | mPointerGesture.currentGestureCoords, mPointerGesture.currentGestureIds.count(), |
1451 | 4315 | dispatchedGestureIdBits, -1, | 4311 | dispatchedGestureIds, -1, |
1452 | 4316 | 0, 0, mPointerGesture.downTime); | 4312 | 0, 0, mPointerGesture.downTime); |
1453 | 4317 | } | 4313 | } |
1454 | 4318 | 4314 | ||
1455 | 4319 | // Send motion events for all pointers that went down. | 4315 | // Send motion events for all pointers that went down. |
1456 | 4320 | if (down) { | 4316 | if (down) { |
1464 | 4321 | BitSet32 downGestureIdBits(mPointerGesture.currentGestureIdBits.value | 4317 | IntSet downGestureIds = mPointerGesture.currentGestureIds - dispatchedGestureIds; |
1465 | 4322 | & ~dispatchedGestureIdBits.value); | 4318 | |
1466 | 4323 | while (!downGestureIdBits.isEmpty()) { | 4319 | downGestureIds.forEach([&](int32_t downId) { |
1467 | 4324 | uint32_t id = downGestureIdBits.clearFirstMarkedBit(); | 4320 | dispatchedGestureIds.insert(downId); |
1468 | 4325 | dispatchedGestureIdBits.markBit(id); | 4321 | |
1469 | 4326 | 4322 | if (dispatchedGestureIds.size() == 1) { | |
1463 | 4327 | if (dispatchedGestureIdBits.count() == 1) { | ||
1470 | 4328 | mPointerGesture.downTime = when; | 4323 | mPointerGesture.downTime = when; |
1471 | 4329 | } | 4324 | } |
1472 | 4330 | 4325 | ||
1473 | 4331 | dispatchMotion(when, policyFlags, mSource, | 4326 | dispatchMotion(when, policyFlags, mSource, |
1474 | 4332 | AMOTION_EVENT_ACTION_POINTER_DOWN, 0, metaState, buttonState, 0, | 4327 | AMOTION_EVENT_ACTION_POINTER_DOWN, 0, metaState, buttonState, 0, |
1475 | 4333 | mPointerGesture.currentGestureProperties, | 4328 | mPointerGesture.currentGestureProperties, |
1478 | 4334 | mPointerGesture.currentGestureCoords, mPointerGesture.currentGestureIdToIndex, | 4329 | mPointerGesture.currentGestureCoords, mPointerGesture.currentGestureIds.count(), |
1479 | 4335 | dispatchedGestureIdBits, id, | 4330 | dispatchedGestureIds, downId, |
1480 | 4336 | 0, 0, mPointerGesture.downTime); | 4331 | 0, 0, mPointerGesture.downTime); |
1482 | 4337 | } | 4332 | }); |
1483 | 4338 | } | 4333 | } |
1484 | 4339 | 4334 | ||
1485 | 4340 | // Send motion events for hover. | 4335 | // Send motion events for hover. |
1486 | @@ -4343,11 +4338,11 @@ | |||
1487 | 4343 | AMOTION_EVENT_ACTION_HOVER_MOVE, 0, | 4338 | AMOTION_EVENT_ACTION_HOVER_MOVE, 0, |
1488 | 4344 | metaState, buttonState, AMOTION_EVENT_EDGE_FLAG_NONE, | 4339 | metaState, buttonState, AMOTION_EVENT_EDGE_FLAG_NONE, |
1489 | 4345 | mPointerGesture.currentGestureProperties, | 4340 | mPointerGesture.currentGestureProperties, |
1492 | 4346 | mPointerGesture.currentGestureCoords, mPointerGesture.currentGestureIdToIndex, | 4341 | mPointerGesture.currentGestureCoords, |
1493 | 4347 | mPointerGesture.currentGestureIdBits, -1, | 4342 | mPointerGesture.currentGestureIds.count(), -1, |
1494 | 4348 | 0, 0, mPointerGesture.downTime); | 4343 | 0, 0, mPointerGesture.downTime); |
1497 | 4349 | } else if (dispatchedGestureIdBits.isEmpty() | 4344 | } else if (dispatchedGestureIds.isEmpty() |
1498 | 4350 | && !mPointerGesture.lastGestureIdBits.isEmpty()) { | 4345 | && !mPointerGesture.lastGestureIds.isEmpty()) { |
1499 | 4351 | // Synthesize a hover move event after all pointers go up to indicate that | 4346 | // Synthesize a hover move event after all pointers go up to indicate that |
1500 | 4352 | // the pointer is hovering again even if the user is not currently touching | 4347 | // the pointer is hovering again even if the user is not currently touching |
1501 | 4353 | // the touch pad. This ensures that a view will receive a fresh hover enter | 4348 | // the touch pad. This ensures that a view will receive a fresh hover enter |
1502 | @@ -4375,32 +4370,29 @@ | |||
1503 | 4375 | // Update state. | 4370 | // Update state. |
1504 | 4376 | mPointerGesture.lastGestureMode = mPointerGesture.currentGestureMode; | 4371 | mPointerGesture.lastGestureMode = mPointerGesture.currentGestureMode; |
1505 | 4377 | if (!down) { | 4372 | if (!down) { |
1507 | 4378 | mPointerGesture.lastGestureIdBits.clear(); | 4373 | mPointerGesture.lastGestureIds.clear(); |
1508 | 4379 | } else { | 4374 | } else { |
1513 | 4380 | mPointerGesture.lastGestureIdBits = mPointerGesture.currentGestureIdBits; | 4375 | mPointerGesture.lastGestureIds = mPointerGesture.currentGestureIds; |
1514 | 4381 | for (BitSet32 idBits(mPointerGesture.currentGestureIdBits); !idBits.isEmpty(); ) { | 4376 | mPointerGesture.lastGestureIdToIndex = mPointerGesture.currentGestureIdToIndex; |
1515 | 4382 | uint32_t id = idBits.clearFirstMarkedBit(); | 4377 | for (uint32_t index = 0; index < mPointerGesture.currentGestureIds.count(); ++index) { |
1512 | 4383 | uint32_t index = mPointerGesture.currentGestureIdToIndex[id]; | ||
1516 | 4384 | mPointerGesture.lastGestureProperties[index].copyFrom( | 4378 | mPointerGesture.lastGestureProperties[index].copyFrom( |
1517 | 4385 | mPointerGesture.currentGestureProperties[index]); | 4379 | mPointerGesture.currentGestureProperties[index]); |
1518 | 4386 | mPointerGesture.lastGestureCoords[index].copyFrom( | 4380 | mPointerGesture.lastGestureCoords[index].copyFrom( |
1519 | 4387 | mPointerGesture.currentGestureCoords[index]); | 4381 | mPointerGesture.currentGestureCoords[index]); |
1520 | 4388 | mPointerGesture.lastGestureIdToIndex[id] = index; | ||
1521 | 4389 | } | 4382 | } |
1522 | 4390 | } | 4383 | } |
1523 | 4391 | } | 4384 | } |
1524 | 4392 | 4385 | ||
1525 | 4393 | void TouchInputMapper::abortPointerGestures(nsecs_t when, uint32_t policyFlags) { | 4386 | void TouchInputMapper::abortPointerGestures(nsecs_t when, uint32_t policyFlags) { |
1526 | 4394 | // Cancel previously dispatches pointers. | 4387 | // Cancel previously dispatches pointers. |
1528 | 4395 | if (!mPointerGesture.lastGestureIdBits.isEmpty()) { | 4388 | if (!mPointerGesture.lastGestureIds.isEmpty()) { |
1529 | 4396 | int32_t metaState = getContext()->getGlobalMetaState(); | 4389 | int32_t metaState = getContext()->getGlobalMetaState(); |
1530 | 4397 | int32_t buttonState = mCurrentButtonState; | 4390 | int32_t buttonState = mCurrentButtonState; |
1531 | 4398 | dispatchMotion(when, policyFlags, mSource, | 4391 | dispatchMotion(when, policyFlags, mSource, |
1532 | 4399 | AMOTION_EVENT_ACTION_CANCEL, 0, metaState, buttonState, | 4392 | AMOTION_EVENT_ACTION_CANCEL, 0, metaState, buttonState, |
1533 | 4400 | AMOTION_EVENT_EDGE_FLAG_NONE, | 4393 | AMOTION_EVENT_EDGE_FLAG_NONE, |
1534 | 4401 | mPointerGesture.lastGestureProperties, | 4394 | mPointerGesture.lastGestureProperties, |
1537 | 4402 | mPointerGesture.lastGestureCoords, mPointerGesture.lastGestureIdToIndex, | 4395 | mPointerGesture.lastGestureCoords, mPointerGesture.lastGestureIds.count(), -1, |
1536 | 4403 | mPointerGesture.lastGestureIdBits, -1, | ||
1538 | 4404 | 0, 0, mPointerGesture.downTime); | 4396 | 0, 0, mPointerGesture.downTime); |
1539 | 4405 | } | 4397 | } |
1540 | 4406 | 4398 | ||
1541 | @@ -4440,7 +4432,7 @@ | |||
1542 | 4440 | 4432 | ||
1543 | 4441 | mPointerGesture.activeGestureId = -1; | 4433 | mPointerGesture.activeGestureId = -1; |
1544 | 4442 | mPointerGesture.currentGestureMode = PointerGesture::NEUTRAL; | 4434 | mPointerGesture.currentGestureMode = PointerGesture::NEUTRAL; |
1546 | 4443 | mPointerGesture.currentGestureIdBits.clear(); | 4435 | mPointerGesture.currentGestureIds.clear(); |
1547 | 4444 | 4436 | ||
1548 | 4445 | mPointerVelocityControl.reset(); | 4437 | mPointerVelocityControl.reset(); |
1549 | 4446 | return true; | 4438 | return true; |
1550 | @@ -4451,21 +4443,20 @@ | |||
1551 | 4451 | return false; | 4443 | return false; |
1552 | 4452 | } | 4444 | } |
1553 | 4453 | 4445 | ||
1556 | 4454 | const uint32_t currentFingerCount = mCurrentFingerIdBits.count(); | 4446 | const uint32_t currentFingerCount = mCurrentFingerIds.size(); |
1557 | 4455 | const uint32_t lastFingerCount = mLastFingerIdBits.count(); | 4447 | const uint32_t lastFingerCount = mLastFingerIds.size(); |
1558 | 4456 | 4448 | ||
1559 | 4457 | // Update the velocity tracker. | 4449 | // Update the velocity tracker. |
1560 | 4458 | { | 4450 | { |
1561 | 4459 | VelocityTracker::Position positions[MAX_POINTERS]; | 4451 | VelocityTracker::Position positions[MAX_POINTERS]; |
1562 | 4460 | uint32_t count = 0; | 4452 | uint32_t count = 0; |
1565 | 4461 | for (BitSet32 idBits(mCurrentFingerIdBits); !idBits.isEmpty(); count++) { | 4453 | mCurrentFingerIds.forEach([&](int32_t id) { |
1564 | 4462 | uint32_t id = idBits.clearFirstMarkedBit(); | ||
1566 | 4463 | const RawPointerData::Pointer& pointer = mCurrentRawPointerData.pointerForId(id); | 4454 | const RawPointerData::Pointer& pointer = mCurrentRawPointerData.pointerForId(id); |
1567 | 4464 | positions[count].x = pointer.x * mPointerXMovementScale; | 4455 | positions[count].x = pointer.x * mPointerXMovementScale; |
1568 | 4465 | positions[count].y = pointer.y * mPointerYMovementScale; | 4456 | positions[count].y = pointer.y * mPointerYMovementScale; |
1572 | 4466 | } | 4457 | count++; |
1573 | 4467 | mPointerGesture.velocityTracker.addMovement(when, | 4458 | }); |
1574 | 4468 | mCurrentFingerIdBits, positions); | 4459 | mPointerGesture.velocityTracker.addMovement(when, mCurrentFingerIds, positions); |
1575 | 4469 | } | 4460 | } |
1576 | 4470 | 4461 | ||
1577 | 4471 | // Pick a new active touch id if needed. | 4462 | // Pick a new active touch id if needed. |
1578 | @@ -4477,17 +4468,17 @@ | |||
1579 | 4477 | int32_t lastActiveTouchId = mPointerGesture.activeTouchId; | 4468 | int32_t lastActiveTouchId = mPointerGesture.activeTouchId; |
1580 | 4478 | int32_t activeTouchId = lastActiveTouchId; | 4469 | int32_t activeTouchId = lastActiveTouchId; |
1581 | 4479 | if (activeTouchId < 0) { | 4470 | if (activeTouchId < 0) { |
1583 | 4480 | if (!mCurrentFingerIdBits.isEmpty()) { | 4471 | if (!mCurrentFingerIds.isEmpty()) { |
1584 | 4481 | activeTouchChanged = true; | 4472 | activeTouchChanged = true; |
1585 | 4482 | activeTouchId = mPointerGesture.activeTouchId = | 4473 | activeTouchId = mPointerGesture.activeTouchId = |
1587 | 4483 | mCurrentFingerIdBits.firstMarkedBit(); | 4474 | mCurrentFingerIds.first(); |
1588 | 4484 | mPointerGesture.firstTouchTime = when; | 4475 | mPointerGesture.firstTouchTime = when; |
1589 | 4485 | } | 4476 | } |
1591 | 4486 | } else if (!mCurrentFingerIdBits.hasBit(activeTouchId)) { | 4477 | } else if (!mCurrentFingerIds.contains(activeTouchId)) { |
1592 | 4487 | activeTouchChanged = true; | 4478 | activeTouchChanged = true; |
1594 | 4488 | if (!mCurrentFingerIdBits.isEmpty()) { | 4479 | if (!mCurrentFingerIds.isEmpty()) { |
1595 | 4489 | activeTouchId = mPointerGesture.activeTouchId = | 4480 | activeTouchId = mPointerGesture.activeTouchId = |
1597 | 4490 | mCurrentFingerIdBits.firstMarkedBit(); | 4481 | mCurrentFingerIds.first(); |
1598 | 4491 | } else { | 4482 | } else { |
1599 | 4492 | activeTouchId = mPointerGesture.activeTouchId = -1; | 4483 | activeTouchId = mPointerGesture.activeTouchId = -1; |
1600 | 4493 | } | 4484 | } |
1601 | @@ -4535,7 +4526,7 @@ | |||
1602 | 4535 | 4526 | ||
1603 | 4536 | mPointerGesture.activeGestureId = -1; | 4527 | mPointerGesture.activeGestureId = -1; |
1604 | 4537 | mPointerGesture.currentGestureMode = PointerGesture::QUIET; | 4528 | mPointerGesture.currentGestureMode = PointerGesture::QUIET; |
1606 | 4538 | mPointerGesture.currentGestureIdBits.clear(); | 4529 | mPointerGesture.currentGestureIds.clear(); |
1607 | 4539 | 4530 | ||
1608 | 4540 | mPointerVelocityControl.reset(); | 4531 | mPointerVelocityControl.reset(); |
1609 | 4541 | } else if (isPointerDown(mCurrentButtonState)) { | 4532 | } else if (isPointerDown(mCurrentButtonState)) { |
1610 | @@ -4567,8 +4558,7 @@ | |||
1611 | 4567 | if (activeTouchId >= 0 && currentFingerCount > 1) { | 4558 | if (activeTouchId >= 0 && currentFingerCount > 1) { |
1612 | 4568 | int32_t bestId = -1; | 4559 | int32_t bestId = -1; |
1613 | 4569 | float bestSpeed = mConfig.pointerGestureDragMinSwitchSpeed; | 4560 | float bestSpeed = mConfig.pointerGestureDragMinSwitchSpeed; |
1616 | 4570 | for (BitSet32 idBits(mCurrentFingerIdBits); !idBits.isEmpty(); ) { | 4561 | mCurrentFingerIds.forEach([&](int32_t id) { |
1615 | 4571 | uint32_t id = idBits.clearFirstMarkedBit(); | ||
1617 | 4572 | float vx, vy; | 4562 | float vx, vy; |
1618 | 4573 | if (mPointerGesture.velocityTracker.getVelocity(id, &vx, &vy)) { | 4563 | if (mPointerGesture.velocityTracker.getVelocity(id, &vx, &vy)) { |
1619 | 4574 | float speed = hypotf(vx, vy); | 4564 | float speed = hypotf(vx, vy); |
1620 | @@ -4577,7 +4567,7 @@ | |||
1621 | 4577 | bestSpeed = speed; | 4567 | bestSpeed = speed; |
1622 | 4578 | } | 4568 | } |
1623 | 4579 | } | 4569 | } |
1625 | 4580 | } | 4570 | }); |
1626 | 4581 | if (bestId >= 0 && bestId != activeTouchId) { | 4571 | if (bestId >= 0 && bestId != activeTouchId) { |
1627 | 4582 | mPointerGesture.activeTouchId = activeTouchId = bestId; | 4572 | mPointerGesture.activeTouchId = activeTouchId = bestId; |
1628 | 4583 | activeTouchChanged = true; | 4573 | activeTouchChanged = true; |
1629 | @@ -4588,7 +4578,7 @@ | |||
1630 | 4588 | } | 4578 | } |
1631 | 4589 | } | 4579 | } |
1632 | 4590 | 4580 | ||
1634 | 4591 | if (activeTouchId >= 0 && mLastFingerIdBits.hasBit(activeTouchId)) { | 4581 | if (activeTouchId >= 0 && mLastFingerIds.contains(activeTouchId)) { |
1635 | 4592 | const RawPointerData::Pointer& currentPointer = | 4582 | const RawPointerData::Pointer& currentPointer = |
1636 | 4593 | mCurrentRawPointerData.pointerForId(activeTouchId); | 4583 | mCurrentRawPointerData.pointerForId(activeTouchId); |
1637 | 4594 | const RawPointerData::Pointer& lastPointer = | 4584 | const RawPointerData::Pointer& lastPointer = |
1638 | @@ -4611,9 +4601,8 @@ | |||
1639 | 4611 | mPointerController->getPosition(&x, &y); | 4601 | mPointerController->getPosition(&x, &y); |
1640 | 4612 | 4602 | ||
1641 | 4613 | mPointerGesture.currentGestureMode = PointerGesture::BUTTON_CLICK_OR_DRAG; | 4603 | mPointerGesture.currentGestureMode = PointerGesture::BUTTON_CLICK_OR_DRAG; |
1645 | 4614 | mPointerGesture.currentGestureIdBits.clear(); | 4604 | mPointerGesture.currentGestureIds.clear(); |
1646 | 4615 | mPointerGesture.currentGestureIdBits.markBit(mPointerGesture.activeGestureId); | 4605 | mPointerGesture.currentGestureIds.insert(mPointerGesture.activeGestureId); |
1644 | 4616 | mPointerGesture.currentGestureIdToIndex[mPointerGesture.activeGestureId] = 0; | ||
1647 | 4617 | mPointerGesture.currentGestureProperties[0].clear(); | 4606 | mPointerGesture.currentGestureProperties[0].clear(); |
1648 | 4618 | mPointerGesture.currentGestureProperties[0].id = mPointerGesture.activeGestureId; | 4607 | mPointerGesture.currentGestureProperties[0].id = mPointerGesture.activeGestureId; |
1649 | 4619 | mPointerGesture.currentGestureProperties[0].toolType = AMOTION_EVENT_TOOL_TYPE_FINGER; | 4608 | mPointerGesture.currentGestureProperties[0].toolType = AMOTION_EVENT_TOOL_TYPE_FINGER; |
1650 | @@ -4648,11 +4637,9 @@ | |||
1651 | 4648 | 4637 | ||
1652 | 4649 | mPointerGesture.activeGestureId = 0; | 4638 | mPointerGesture.activeGestureId = 0; |
1653 | 4650 | mPointerGesture.currentGestureMode = PointerGesture::TAP; | 4639 | mPointerGesture.currentGestureMode = PointerGesture::TAP; |
1656 | 4651 | mPointerGesture.currentGestureIdBits.clear(); | 4640 | mPointerGesture.currentGestureIds.clear(); |
1657 | 4652 | mPointerGesture.currentGestureIdBits.markBit( | 4641 | mPointerGesture.currentGestureIds.insert( |
1658 | 4653 | mPointerGesture.activeGestureId); | 4642 | mPointerGesture.activeGestureId); |
1659 | 4654 | mPointerGesture.currentGestureIdToIndex[ | ||
1660 | 4655 | mPointerGesture.activeGestureId] = 0; | ||
1661 | 4656 | mPointerGesture.currentGestureProperties[0].clear(); | 4643 | mPointerGesture.currentGestureProperties[0].clear(); |
1662 | 4657 | mPointerGesture.currentGestureProperties[0].id = | 4644 | mPointerGesture.currentGestureProperties[0].id = |
1663 | 4658 | mPointerGesture.activeGestureId; | 4645 | mPointerGesture.activeGestureId; |
1664 | @@ -4690,7 +4677,7 @@ | |||
1665 | 4690 | #endif | 4677 | #endif |
1666 | 4691 | mPointerGesture.activeGestureId = -1; | 4678 | mPointerGesture.activeGestureId = -1; |
1667 | 4692 | mPointerGesture.currentGestureMode = PointerGesture::NEUTRAL; | 4679 | mPointerGesture.currentGestureMode = PointerGesture::NEUTRAL; |
1669 | 4693 | mPointerGesture.currentGestureIdBits.clear(); | 4680 | mPointerGesture.currentGestureIds.clear(); |
1670 | 4694 | } | 4681 | } |
1671 | 4695 | } else if (currentFingerCount == 1) { | 4682 | } else if (currentFingerCount == 1) { |
1672 | 4696 | // Case 4. Exactly one finger down, button is not pressed. (HOVER or TAP_DRAG) | 4683 | // Case 4. Exactly one finger down, button is not pressed. (HOVER or TAP_DRAG) |
1673 | @@ -4724,7 +4711,7 @@ | |||
1674 | 4724 | mPointerGesture.currentGestureMode = PointerGesture::TAP_DRAG; | 4711 | mPointerGesture.currentGestureMode = PointerGesture::TAP_DRAG; |
1675 | 4725 | } | 4712 | } |
1676 | 4726 | 4713 | ||
1678 | 4727 | if (mLastFingerIdBits.hasBit(activeTouchId)) { | 4714 | if (mLastFingerIds.contains(activeTouchId)) { |
1679 | 4728 | const RawPointerData::Pointer& currentPointer = | 4715 | const RawPointerData::Pointer& currentPointer = |
1680 | 4729 | mCurrentRawPointerData.pointerForId(activeTouchId); | 4716 | mCurrentRawPointerData.pointerForId(activeTouchId); |
1681 | 4730 | const RawPointerData::Pointer& lastPointer = | 4717 | const RawPointerData::Pointer& lastPointer = |
1682 | @@ -4764,9 +4751,8 @@ | |||
1683 | 4764 | float x, y; | 4751 | float x, y; |
1684 | 4765 | mPointerController->getPosition(&x, &y); | 4752 | mPointerController->getPosition(&x, &y); |
1685 | 4766 | 4753 | ||
1689 | 4767 | mPointerGesture.currentGestureIdBits.clear(); | 4754 | mPointerGesture.currentGestureIds.clear(); |
1690 | 4768 | mPointerGesture.currentGestureIdBits.markBit(mPointerGesture.activeGestureId); | 4755 | mPointerGesture.currentGestureIds.insert(mPointerGesture.activeGestureId); |
1688 | 4769 | mPointerGesture.currentGestureIdToIndex[mPointerGesture.activeGestureId] = 0; | ||
1691 | 4770 | mPointerGesture.currentGestureProperties[0].clear(); | 4756 | mPointerGesture.currentGestureProperties[0].clear(); |
1692 | 4771 | mPointerGesture.currentGestureProperties[0].id = mPointerGesture.activeGestureId; | 4757 | mPointerGesture.currentGestureProperties[0].id = mPointerGesture.activeGestureId; |
1693 | 4772 | mPointerGesture.currentGestureProperties[0].toolType = | 4758 | mPointerGesture.currentGestureProperties[0].toolType = |
1694 | @@ -4823,7 +4809,7 @@ | |||
1695 | 4823 | if (*outFinishPreviousGesture || *outCancelPreviousGesture) { | 4809 | if (*outFinishPreviousGesture || *outCancelPreviousGesture) { |
1696 | 4824 | mPointerGesture.currentGestureMode = PointerGesture::PRESS; | 4810 | mPointerGesture.currentGestureMode = PointerGesture::PRESS; |
1697 | 4825 | mPointerGesture.activeGestureId = 0; | 4811 | mPointerGesture.activeGestureId = 0; |
1699 | 4826 | mPointerGesture.referenceIdBits.clear(); | 4812 | mPointerGesture.referenceIds.clear(); |
1700 | 4827 | mPointerVelocityControl.reset(); | 4813 | mPointerVelocityControl.reset(); |
1701 | 4828 | 4814 | ||
1702 | 4829 | // Use the centroid and pointer location as the reference points for the gesture. | 4815 | // Use the centroid and pointer location as the reference points for the gesture. |
1703 | @@ -4841,21 +4827,18 @@ | |||
1704 | 4841 | } | 4827 | } |
1705 | 4842 | 4828 | ||
1706 | 4843 | // Clear the reference deltas for fingers not yet included in the reference calculation. | 4829 | // Clear the reference deltas for fingers not yet included in the reference calculation. |
1710 | 4844 | for (BitSet32 idBits(mCurrentFingerIdBits.value | 4830 | (mCurrentFingerIds - mPointerGesture.referenceIds).forEach([&](int32_t id) { |
1708 | 4845 | & ~mPointerGesture.referenceIdBits.value); !idBits.isEmpty(); ) { | ||
1709 | 4846 | uint32_t id = idBits.clearFirstMarkedBit(); | ||
1711 | 4847 | mPointerGesture.referenceDeltas[id].dx = 0; | 4831 | mPointerGesture.referenceDeltas[id].dx = 0; |
1712 | 4848 | mPointerGesture.referenceDeltas[id].dy = 0; | 4832 | mPointerGesture.referenceDeltas[id].dy = 0; |
1715 | 4849 | } | 4833 | }); |
1716 | 4850 | mPointerGesture.referenceIdBits = mCurrentFingerIdBits; | 4834 | mPointerGesture.referenceIds = mCurrentFingerIds; |
1717 | 4851 | 4835 | ||
1718 | 4852 | // Add delta for all fingers and calculate a common movement delta. | 4836 | // Add delta for all fingers and calculate a common movement delta. |
1719 | 4853 | float commonDeltaX = 0, commonDeltaY = 0; | 4837 | float commonDeltaX = 0, commonDeltaY = 0; |
1725 | 4854 | BitSet32 commonIdBits(mLastFingerIdBits.value | 4838 | IntSet commonIds = mLastFingerIds & mCurrentFingerIds; |
1726 | 4855 | & mCurrentFingerIdBits.value); | 4839 | |
1727 | 4856 | for (BitSet32 idBits(commonIdBits); !idBits.isEmpty(); ) { | 4840 | bool first = true; |
1728 | 4857 | bool first = (idBits == commonIdBits); | 4841 | commonIds.forEach([&](int32_t id) { |
1724 | 4858 | uint32_t id = idBits.clearFirstMarkedBit(); | ||
1729 | 4859 | const RawPointerData::Pointer& cpd = mCurrentRawPointerData.pointerForId(id); | 4842 | const RawPointerData::Pointer& cpd = mCurrentRawPointerData.pointerForId(id); |
1730 | 4860 | const RawPointerData::Pointer& lpd = mLastRawPointerData.pointerForId(id); | 4843 | const RawPointerData::Pointer& lpd = mLastRawPointerData.pointerForId(id); |
1731 | 4861 | PointerGesture::Delta& delta = mPointerGesture.referenceDeltas[id]; | 4844 | PointerGesture::Delta& delta = mPointerGesture.referenceDeltas[id]; |
1732 | @@ -4865,25 +4848,25 @@ | |||
1733 | 4865 | if (first) { | 4848 | if (first) { |
1734 | 4866 | commonDeltaX = delta.dx; | 4849 | commonDeltaX = delta.dx; |
1735 | 4867 | commonDeltaY = delta.dy; | 4850 | commonDeltaY = delta.dy; |
1736 | 4851 | first = false; | ||
1737 | 4868 | } else { | 4852 | } else { |
1738 | 4869 | commonDeltaX = calculateCommonVector(commonDeltaX, delta.dx); | 4853 | commonDeltaX = calculateCommonVector(commonDeltaX, delta.dx); |
1739 | 4870 | commonDeltaY = calculateCommonVector(commonDeltaY, delta.dy); | 4854 | commonDeltaY = calculateCommonVector(commonDeltaY, delta.dy); |
1740 | 4871 | } | 4855 | } |
1742 | 4872 | } | 4856 | }); |
1743 | 4873 | 4857 | ||
1744 | 4874 | // Consider transitions from PRESS to SWIPE or MULTITOUCH. | 4858 | // Consider transitions from PRESS to SWIPE or MULTITOUCH. |
1745 | 4875 | if (mPointerGesture.currentGestureMode == PointerGesture::PRESS) { | 4859 | if (mPointerGesture.currentGestureMode == PointerGesture::PRESS) { |
1747 | 4876 | float dist[MAX_POINTER_ID + 1]; | 4860 | std::unordered_map<int32_t, float> dist; |
1748 | 4877 | int32_t distOverThreshold = 0; | 4861 | int32_t distOverThreshold = 0; |
1751 | 4878 | for (BitSet32 idBits(mPointerGesture.referenceIdBits); !idBits.isEmpty(); ) { | 4862 | mPointerGesture.referenceIds.forEach([&](int32_t id) { |
1750 | 4879 | uint32_t id = idBits.clearFirstMarkedBit(); | ||
1752 | 4880 | PointerGesture::Delta& delta = mPointerGesture.referenceDeltas[id]; | 4863 | PointerGesture::Delta& delta = mPointerGesture.referenceDeltas[id]; |
1753 | 4881 | dist[id] = hypotf(delta.dx * mPointerXZoomScale, | 4864 | dist[id] = hypotf(delta.dx * mPointerXZoomScale, |
1754 | 4882 | delta.dy * mPointerYZoomScale); | 4865 | delta.dy * mPointerYZoomScale); |
1755 | 4883 | if (dist[id] > mConfig.pointerGestureMultitouchMinDistance) { | 4866 | if (dist[id] > mConfig.pointerGestureMultitouchMinDistance) { |
1756 | 4884 | distOverThreshold += 1; | 4867 | distOverThreshold += 1; |
1757 | 4885 | } | 4868 | } |
1759 | 4886 | } | 4869 | }); |
1760 | 4887 | 4870 | ||
1761 | 4888 | // Only transition when at least two pointers have moved further than | 4871 | // Only transition when at least two pointers have moved further than |
1762 | 4889 | // the minimum distance threshold. | 4872 | // the minimum distance threshold. |
1763 | @@ -4898,9 +4881,14 @@ | |||
1764 | 4898 | mPointerGesture.currentGestureMode = PointerGesture::FREEFORM; | 4881 | mPointerGesture.currentGestureMode = PointerGesture::FREEFORM; |
1765 | 4899 | } else { | 4882 | } else { |
1766 | 4900 | // There are exactly two pointers. | 4883 | // There are exactly two pointers. |
1770 | 4901 | BitSet32 idBits(mCurrentFingerIdBits); | 4884 | int32_t id1; |
1771 | 4902 | uint32_t id1 = idBits.clearFirstMarkedBit(); | 4885 | int32_t id2; |
1772 | 4903 | uint32_t id2 = idBits.firstMarkedBit(); | 4886 | { |
1773 | 4887 | auto currentFingerIdsIt = mCurrentFingerIds.cbegin(); | ||
1774 | 4888 | id1 = *currentFingerIdsIt; | ||
1775 | 4889 | ++currentFingerIdsIt; | ||
1776 | 4890 | id2 = *currentFingerIdsIt; | ||
1777 | 4891 | } | ||
1778 | 4904 | const RawPointerData::Pointer& p1 = mCurrentRawPointerData.pointerForId(id1); | 4892 | const RawPointerData::Pointer& p1 = mCurrentRawPointerData.pointerForId(id1); |
1779 | 4905 | const RawPointerData::Pointer& p2 = mCurrentRawPointerData.pointerForId(id2); | 4893 | const RawPointerData::Pointer& p2 = mCurrentRawPointerData.pointerForId(id2); |
1780 | 4906 | float mutualDistance = distance(p1.x, p1.y, p2.x, p2.y); | 4894 | float mutualDistance = distance(p1.x, p1.y, p2.x, p2.y); |
1781 | @@ -4977,12 +4965,11 @@ | |||
1782 | 4977 | // except in PRESS mode while waiting for a transition to occur. | 4965 | // except in PRESS mode while waiting for a transition to occur. |
1783 | 4978 | if (mPointerGesture.currentGestureMode != PointerGesture::PRESS | 4966 | if (mPointerGesture.currentGestureMode != PointerGesture::PRESS |
1784 | 4979 | && (commonDeltaX || commonDeltaY)) { | 4967 | && (commonDeltaX || commonDeltaY)) { |
1787 | 4980 | for (BitSet32 idBits(mPointerGesture.referenceIdBits); !idBits.isEmpty(); ) { | 4968 | mPointerGesture.referenceIds.forEach([&](int32_t id) { |
1786 | 4981 | uint32_t id = idBits.clearFirstMarkedBit(); | ||
1788 | 4982 | PointerGesture::Delta& delta = mPointerGesture.referenceDeltas[id]; | 4969 | PointerGesture::Delta& delta = mPointerGesture.referenceDeltas[id]; |
1789 | 4983 | delta.dx = 0; | 4970 | delta.dx = 0; |
1790 | 4984 | delta.dy = 0; | 4971 | delta.dy = 0; |
1792 | 4985 | } | 4972 | }); |
1793 | 4986 | 4973 | ||
1794 | 4987 | mPointerGesture.referenceTouchX += commonDeltaX; | 4974 | mPointerGesture.referenceTouchX += commonDeltaX; |
1795 | 4988 | mPointerGesture.referenceTouchY += commonDeltaY; | 4975 | mPointerGesture.referenceTouchY += commonDeltaY; |
1796 | @@ -5008,9 +4995,8 @@ | |||
1797 | 5008 | #endif | 4995 | #endif |
1798 | 5009 | ALOG_ASSERT(mPointerGesture.activeGestureId >= 0); | 4996 | ALOG_ASSERT(mPointerGesture.activeGestureId >= 0); |
1799 | 5010 | 4997 | ||
1803 | 5011 | mPointerGesture.currentGestureIdBits.clear(); | 4998 | mPointerGesture.currentGestureIds.clear(); |
1804 | 5012 | mPointerGesture.currentGestureIdBits.markBit(mPointerGesture.activeGestureId); | 4999 | mPointerGesture.currentGestureIds.insert(mPointerGesture.activeGestureId); |
1802 | 5013 | mPointerGesture.currentGestureIdToIndex[mPointerGesture.activeGestureId] = 0; | ||
1805 | 5014 | mPointerGesture.currentGestureProperties[0].clear(); | 5000 | mPointerGesture.currentGestureProperties[0].clear(); |
1806 | 5015 | mPointerGesture.currentGestureProperties[0].id = mPointerGesture.activeGestureId; | 5001 | mPointerGesture.currentGestureProperties[0].id = mPointerGesture.activeGestureId; |
1807 | 5016 | mPointerGesture.currentGestureProperties[0].toolType = | 5002 | mPointerGesture.currentGestureProperties[0].toolType = |
1808 | @@ -5030,16 +5016,16 @@ | |||
1809 | 5030 | #endif | 5016 | #endif |
1810 | 5031 | ALOG_ASSERT(mPointerGesture.activeGestureId >= 0); | 5017 | ALOG_ASSERT(mPointerGesture.activeGestureId >= 0); |
1811 | 5032 | 5018 | ||
1813 | 5033 | mPointerGesture.currentGestureIdBits.clear(); | 5019 | mPointerGesture.currentGestureIds.clear(); |
1814 | 5034 | 5020 | ||
1817 | 5035 | BitSet32 mappedTouchIdBits; | 5021 | IntSet mappedTouchIds; |
1818 | 5036 | BitSet32 usedGestureIdBits; | 5022 | IntSet usedGestureIds; |
1819 | 5037 | if (mPointerGesture.lastGestureMode != PointerGesture::FREEFORM) { | 5023 | if (mPointerGesture.lastGestureMode != PointerGesture::FREEFORM) { |
1820 | 5038 | // Initially, assign the active gesture id to the active touch point | 5024 | // Initially, assign the active gesture id to the active touch point |
1821 | 5039 | // if there is one. No other touch id bits are mapped yet. | 5025 | // if there is one. No other touch id bits are mapped yet. |
1822 | 5040 | if (!*outCancelPreviousGesture) { | 5026 | if (!*outCancelPreviousGesture) { |
1825 | 5041 | mappedTouchIdBits.markBit(activeTouchId); | 5027 | mappedTouchIds.insert(activeTouchId); |
1826 | 5042 | usedGestureIdBits.markBit(mPointerGesture.activeGestureId); | 5028 | usedGestureIds.insert(mPointerGesture.activeGestureId); |
1827 | 5043 | mPointerGesture.freeformTouchToGestureIdMap[activeTouchId] = | 5029 | mPointerGesture.freeformTouchToGestureIdMap[activeTouchId] = |
1828 | 5044 | mPointerGesture.activeGestureId; | 5030 | mPointerGesture.activeGestureId; |
1829 | 5045 | } else { | 5031 | } else { |
1830 | @@ -5048,38 +5034,41 @@ | |||
1831 | 5048 | } else { | 5034 | } else { |
1832 | 5049 | // Otherwise, assume we mapped all touches from the previous frame. | 5035 | // Otherwise, assume we mapped all touches from the previous frame. |
1833 | 5050 | // Reuse all mappings that are still applicable. | 5036 | // Reuse all mappings that are still applicable. |
1837 | 5051 | mappedTouchIdBits.value = mLastFingerIdBits.value | 5037 | mappedTouchIds = mLastFingerIds & mCurrentFingerIds; |
1838 | 5052 | & mCurrentFingerIdBits.value; | 5038 | usedGestureIds = mPointerGesture.lastGestureIds; |
1836 | 5053 | usedGestureIdBits = mPointerGesture.lastGestureIdBits; | ||
1839 | 5054 | 5039 | ||
1840 | 5055 | // Check whether we need to choose a new active gesture id because the | 5040 | // Check whether we need to choose a new active gesture id because the |
1841 | 5056 | // current went went up. | 5041 | // current went went up. |
1850 | 5057 | for (BitSet32 upTouchIdBits(mLastFingerIdBits.value | 5042 | auto it = mLastFingerIds.cbegin(); |
1851 | 5058 | & ~mCurrentFingerIdBits.value); | 5043 | while (it != mLastFingerIds.cend()) { |
1852 | 5059 | !upTouchIdBits.isEmpty(); ) { | 5044 | int32_t id = *it; |
1853 | 5060 | uint32_t upTouchId = upTouchIdBits.clearFirstMarkedBit(); | 5045 | if (!mCurrentFingerIds.contains(id)) { |
1854 | 5061 | uint32_t upGestureId = mPointerGesture.freeformTouchToGestureIdMap[upTouchId]; | 5046 | int32_t upGestureId = mPointerGesture.freeformTouchToGestureIdMap[id]; |
1855 | 5062 | if (upGestureId == uint32_t(mPointerGesture.activeGestureId)) { | 5047 | if (upGestureId == mPointerGesture.activeGestureId) { |
1856 | 5063 | mPointerGesture.activeGestureId = -1; | 5048 | mPointerGesture.activeGestureId = -1; |
1857 | 5064 | break; | 5049 | break; |
1858 | 5050 | } | ||
1859 | 5065 | } | 5051 | } |
1860 | 5052 | it++; | ||
1861 | 5066 | } | 5053 | } |
1862 | 5067 | } | 5054 | } |
1863 | 5068 | 5055 | ||
1864 | 5069 | #if DEBUG_GESTURES | 5056 | #if DEBUG_GESTURES |
1870 | 5070 | ALOGD("Gestures: FREEFORM follow up " | 5057 | { |
1871 | 5071 | "mappedTouchIdBits=0x%08x, usedGestureIdBits=0x%08x, " | 5058 | std::string mappedTouchIdsString = mappedTouchIdBits.toString(); |
1872 | 5072 | "activeGestureId=%d", | 5059 | std::string usedGestureIdsString = usedGestureIdBits.toString(); |
1873 | 5073 | mappedTouchIdBits.value, usedGestureIdBits.value, | 5060 | ALOGD("Gestures: FREEFORM follow up " |
1874 | 5074 | mPointerGesture.activeGestureId); | 5061 | "mappedTouchIds=%s, usedGestureIds=%s, " |
1875 | 5062 | "activeGestureId=%d", | ||
1876 | 5063 | mappedTouchIdsString.c_str(), usedGestureIdsString.c_str(), | ||
1877 | 5064 | mPointerGesture.activeGestureId); | ||
1878 | 5065 | } | ||
1879 | 5075 | #endif | 5066 | #endif |
1887 | 5076 | 5067 | uint32_t i = 0; | |
1888 | 5077 | BitSet32 idBits(mCurrentFingerIdBits); | 5068 | mCurrentFingerIds.forEach([&](int32_t touchId) { |
1889 | 5078 | for (uint32_t i = 0; i < currentFingerCount; i++) { | 5069 | int32_t gestureId; |
1890 | 5079 | uint32_t touchId = idBits.clearFirstMarkedBit(); | 5070 | if (mappedTouchIds.contains(touchId)) { |
1891 | 5080 | uint32_t gestureId; | 5071 | gestureId = usedGestureIds.first(); |
1885 | 5081 | if (!mappedTouchIdBits.hasBit(touchId)) { | ||
1886 | 5082 | gestureId = usedGestureIdBits.markFirstUnmarkedBit(); | ||
1892 | 5083 | mPointerGesture.freeformTouchToGestureIdMap[touchId] = gestureId; | 5072 | mPointerGesture.freeformTouchToGestureIdMap[touchId] = gestureId; |
1893 | 5084 | #if DEBUG_GESTURES | 5073 | #if DEBUG_GESTURES |
1894 | 5085 | ALOGD("Gestures: FREEFORM " | 5074 | ALOGD("Gestures: FREEFORM " |
1895 | @@ -5094,8 +5083,7 @@ | |||
1896 | 5094 | touchId, gestureId); | 5083 | touchId, gestureId); |
1897 | 5095 | #endif | 5084 | #endif |
1898 | 5096 | } | 5085 | } |
1901 | 5097 | mPointerGesture.currentGestureIdBits.markBit(gestureId); | 5086 | mPointerGesture.currentGestureIds.insert(gestureId); |
1900 | 5098 | mPointerGesture.currentGestureIdToIndex[gestureId] = i; | ||
1902 | 5099 | 5087 | ||
1903 | 5100 | const RawPointerData::Pointer& pointer = | 5088 | const RawPointerData::Pointer& pointer = |
1904 | 5101 | mCurrentRawPointerData.pointerForId(touchId); | 5089 | mCurrentRawPointerData.pointerForId(touchId); |
1905 | @@ -5116,11 +5104,12 @@ | |||
1906 | 5116 | AMOTION_EVENT_AXIS_Y, mPointerGesture.referenceGestureY + deltaY); | 5104 | AMOTION_EVENT_AXIS_Y, mPointerGesture.referenceGestureY + deltaY); |
1907 | 5117 | mPointerGesture.currentGestureCoords[i].setAxisValue( | 5105 | mPointerGesture.currentGestureCoords[i].setAxisValue( |
1908 | 5118 | AMOTION_EVENT_AXIS_PRESSURE, 1.0f); | 5106 | AMOTION_EVENT_AXIS_PRESSURE, 1.0f); |
1910 | 5119 | } | 5107 | |
1911 | 5108 | ++i; | ||
1912 | 5109 | }); | ||
1913 | 5120 | 5110 | ||
1914 | 5121 | if (mPointerGesture.activeGestureId < 0) { | 5111 | if (mPointerGesture.activeGestureId < 0) { |
1917 | 5122 | mPointerGesture.activeGestureId = | 5112 | mPointerGesture.activeGestureId = mPointerGesture.currentGestureIds.first(); |
1916 | 5123 | mPointerGesture.currentGestureIdBits.firstMarkedBit(); | ||
1918 | 5124 | #if DEBUG_GESTURES | 5113 | #if DEBUG_GESTURES |
1919 | 5125 | ALOGD("Gestures: FREEFORM new " | 5114 | ALOGD("Gestures: FREEFORM new " |
1920 | 5126 | "activeGestureId=%d", mPointerGesture.activeGestureId); | 5115 | "activeGestureId=%d", mPointerGesture.activeGestureId); |
1921 | @@ -5132,35 +5121,35 @@ | |||
1922 | 5132 | mPointerController->setButtonState(mCurrentButtonState); | 5121 | mPointerController->setButtonState(mCurrentButtonState); |
1923 | 5133 | 5122 | ||
1924 | 5134 | #if DEBUG_GESTURES | 5123 | #if DEBUG_GESTURES |
1954 | 5135 | ALOGD("Gestures: finishPreviousGesture=%s, cancelPreviousGesture=%s, " | 5124 | { |
1955 | 5136 | "currentGestureMode=%d, currentGestureIdBits=0x%08x, " | 5125 | std::string lastGestureIdsString = mPointerGesture.lastGestureIds.toString(); |
1956 | 5137 | "lastGestureMode=%d, lastGestureIdBits=0x%08x", | 5126 | |
1957 | 5138 | toString(*outFinishPreviousGesture), toString(*outCancelPreviousGesture), | 5127 | ALOGD("Gestures: finishPreviousGesture=%s, cancelPreviousGesture=%s, " |
1958 | 5139 | mPointerGesture.currentGestureMode, mPointerGesture.currentGestureIdBits.value, | 5128 | "currentGestureMode=%d, currentGestureIds.count()=%u, " |
1959 | 5140 | mPointerGesture.lastGestureMode, mPointerGesture.lastGestureIdBits.value); | 5129 | "lastGestureMode=%d, lastGestureIds=%s", |
1960 | 5141 | for (BitSet32 idBits = mPointerGesture.currentGestureIdBits; !idBits.isEmpty(); ) { | 5130 | toString(*outFinishPreviousGesture), toString(*outCancelPreviousGesture), |
1961 | 5142 | uint32_t id = idBits.clearFirstMarkedBit(); | 5131 | mPointerGesture.currentGestureMode, mPointerGesture.currentGestureIds.count(), |
1962 | 5143 | uint32_t index = mPointerGesture.currentGestureIdToIndex[id]; | 5132 | mPointerGesture.lastGestureMode, lastGestureIdsString.c_str()); |
1963 | 5144 | const PointerProperties& properties = mPointerGesture.currentGestureProperties[index]; | 5133 | for (uint32_t index = 0; index < mPointerGesture.currentGestureIds.count(); ++index) { |
1964 | 5145 | const PointerCoords& coords = mPointerGesture.currentGestureCoords[index]; | 5134 | const PointerProperties& properties = mPointerGesture.currentGestureProperties[index]; |
1965 | 5146 | ALOGD(" currentGesture[%d]: index=%d, toolType=%d, " | 5135 | const PointerCoords& coords = mPointerGesture.currentGestureCoords[index]; |
1966 | 5147 | "x=%0.3f, y=%0.3f, pressure=%0.3f", | 5136 | ALOGD(" currentGesture[%d]: index=%d, toolType=%d, " |
1967 | 5148 | id, index, properties.toolType, | 5137 | "x=%0.3f, y=%0.3f, pressure=%0.3f", |
1968 | 5149 | coords.getAxisValue(AMOTION_EVENT_AXIS_X), | 5138 | id, index, properties.toolType, |
1969 | 5150 | coords.getAxisValue(AMOTION_EVENT_AXIS_Y), | 5139 | coords.getAxisValue(AMOTION_EVENT_AXIS_X), |
1970 | 5151 | coords.getAxisValue(AMOTION_EVENT_AXIS_PRESSURE)); | 5140 | coords.getAxisValue(AMOTION_EVENT_AXIS_Y), |
1971 | 5152 | } | 5141 | coords.getAxisValue(AMOTION_EVENT_AXIS_PRESSURE)); |
1972 | 5153 | for (BitSet32 idBits = mPointerGesture.lastGestureIdBits; !idBits.isEmpty(); ) { | 5142 | } |
1973 | 5154 | uint32_t id = idBits.clearFirstMarkedBit(); | 5143 | for (uint32_t index = 0; index < mPointerGesture.lastGestureIds.count(); ++index) { |
1974 | 5155 | uint32_t index = mPointerGesture.lastGestureIdToIndex[id]; | 5144 | const PointerProperties& properties = mPointerGesture.lastGestureProperties[index]; |
1975 | 5156 | const PointerProperties& properties = mPointerGesture.lastGestureProperties[index]; | 5145 | const PointerCoords& coords = mPointerGesture.lastGestureCoords[index]; |
1976 | 5157 | const PointerCoords& coords = mPointerGesture.lastGestureCoords[index]; | 5146 | ALOGD(" lastGesture[%d]: index=%d, toolType=%d, " |
1977 | 5158 | ALOGD(" lastGesture[%d]: index=%d, toolType=%d, " | 5147 | "x=%0.3f, y=%0.3f, pressure=%0.3f", |
1978 | 5159 | "x=%0.3f, y=%0.3f, pressure=%0.3f", | 5148 | id, index, properties.toolType, |
1979 | 5160 | id, index, properties.toolType, | 5149 | coords.getAxisValue(AMOTION_EVENT_AXIS_X), |
1980 | 5161 | coords.getAxisValue(AMOTION_EVENT_AXIS_X), | 5150 | coords.getAxisValue(AMOTION_EVENT_AXIS_Y), |
1981 | 5162 | coords.getAxisValue(AMOTION_EVENT_AXIS_Y), | 5151 | coords.getAxisValue(AMOTION_EVENT_AXIS_PRESSURE)); |
1982 | 5163 | coords.getAxisValue(AMOTION_EVENT_AXIS_PRESSURE)); | 5152 | } |
1983 | 5164 | } | 5153 | } |
1984 | 5165 | #endif | 5154 | #endif |
1985 | 5166 | return true; | 5155 | return true; |
1986 | @@ -5171,14 +5160,14 @@ | |||
1987 | 5171 | mPointerSimple.currentProperties.clear(); | 5160 | mPointerSimple.currentProperties.clear(); |
1988 | 5172 | 5161 | ||
1989 | 5173 | bool down, hovering; | 5162 | bool down, hovering; |
1993 | 5174 | if (!mCurrentStylusIdBits.isEmpty()) { | 5163 | if (!mCurrentStylusIds.isEmpty()) { |
1994 | 5175 | uint32_t id = mCurrentStylusIdBits.firstMarkedBit(); | 5164 | int32_t id = mCurrentStylusIds.first(); |
1995 | 5176 | uint32_t index = mCurrentCookedPointerData.idToIndex[id]; | 5165 | uint32_t index = mCurrentCookedPointerData.idToIndex(id); |
1996 | 5177 | float x = mCurrentCookedPointerData.pointerCoords[index].getX(); | 5166 | float x = mCurrentCookedPointerData.pointerCoords[index].getX(); |
1997 | 5178 | float y = mCurrentCookedPointerData.pointerCoords[index].getY(); | 5167 | float y = mCurrentCookedPointerData.pointerCoords[index].getY(); |
1998 | 5179 | mPointerController->setPosition(x, y); | 5168 | mPointerController->setPosition(x, y); |
1999 | 5180 | 5169 | ||
2001 | 5181 | hovering = mCurrentCookedPointerData.hoveringIdBits.hasBit(id); | 5170 | hovering = mCurrentCookedPointerData.hoveringIds.contains(id); |
2002 | 5182 | down = !hovering; | 5171 | down = !hovering; |
2003 | 5183 | 5172 | ||
2004 | 5184 | mPointerController->getPosition(&x, &y); | 5173 | mPointerController->getPosition(&x, &y); |
2005 | @@ -5205,11 +5194,11 @@ | |||
2006 | 5205 | mPointerSimple.currentProperties.clear(); | 5194 | mPointerSimple.currentProperties.clear(); |
2007 | 5206 | 5195 | ||
2008 | 5207 | bool down, hovering; | 5196 | bool down, hovering; |
2014 | 5208 | if (!mCurrentMouseIdBits.isEmpty()) { | 5197 | if (!mCurrentMouseIds.isEmpty()) { |
2015 | 5209 | uint32_t id = mCurrentMouseIdBits.firstMarkedBit(); | 5198 | uint32_t id = mCurrentMouseIds.first(); |
2016 | 5210 | uint32_t currentIndex = mCurrentRawPointerData.idToIndex[id]; | 5199 | uint32_t currentIndex = mCurrentRawPointerData.idToIndex(id); |
2017 | 5211 | if (mLastMouseIdBits.hasBit(id)) { | 5200 | if (mLastMouseIds.contains(id)) { |
2018 | 5212 | uint32_t lastIndex = mCurrentRawPointerData.idToIndex[id]; | 5201 | uint32_t lastIndex = mCurrentRawPointerData.idToIndex(id); |
2019 | 5213 | float deltaX = (mCurrentRawPointerData.pointers[currentIndex].x | 5202 | float deltaX = (mCurrentRawPointerData.pointers[currentIndex].x |
2020 | 5214 | - mLastRawPointerData.pointers[lastIndex].x) | 5203 | - mLastRawPointerData.pointers[lastIndex].x) |
2021 | 5215 | * mPointerXMovementScale; | 5204 | * mPointerXMovementScale; |
2022 | @@ -5377,19 +5366,17 @@ | |||
2023 | 5377 | 5366 | ||
2024 | 5378 | void TouchInputMapper::dispatchMotion(nsecs_t when, uint32_t policyFlags, uint32_t source, | 5367 | void TouchInputMapper::dispatchMotion(nsecs_t when, uint32_t policyFlags, uint32_t source, |
2025 | 5379 | int32_t action, int32_t flags, int32_t metaState, int32_t buttonState, int32_t edgeFlags, | 5368 | int32_t action, int32_t flags, int32_t metaState, int32_t buttonState, int32_t edgeFlags, |
2028 | 5380 | const PointerProperties* properties, const PointerCoords* coords, | 5369 | const PointerProperties* properties, const PointerCoords* coords, uint32_t inPointerCount, |
2027 | 5381 | const uint32_t* idToIndex, BitSet32 idBits, | ||
2029 | 5382 | int32_t changedId, float xPrecision, float yPrecision, nsecs_t downTime) { | 5370 | int32_t changedId, float xPrecision, float yPrecision, nsecs_t downTime) { |
2030 | 5383 | PointerCoords pointerCoords[MAX_POINTERS]; | 5371 | PointerCoords pointerCoords[MAX_POINTERS]; |
2031 | 5384 | PointerProperties pointerProperties[MAX_POINTERS]; | 5372 | PointerProperties pointerProperties[MAX_POINTERS]; |
2032 | 5385 | uint32_t pointerCount = 0; | 5373 | uint32_t pointerCount = 0; |
2040 | 5386 | while (!idBits.isEmpty()) { | 5374 | |
2041 | 5387 | uint32_t id = idBits.clearFirstMarkedBit(); | 5375 | while (pointerCount < inPointerCount) { |
2042 | 5388 | uint32_t index = idToIndex[id]; | 5376 | pointerProperties[pointerCount].copyFrom(properties[pointerCount]); |
2043 | 5389 | pointerProperties[pointerCount].copyFrom(properties[index]); | 5377 | pointerCoords[pointerCount].copyFrom(coords[pointerCount]); |
2044 | 5390 | pointerCoords[pointerCount].copyFrom(coords[index]); | 5378 | |
2045 | 5391 | 5379 | if (changedId >= 0 && properties[pointerCount].id == uint32_t(changedId)) { | |
2039 | 5392 | if (changedId >= 0 && id == uint32_t(changedId)) { | ||
2046 | 5393 | action |= pointerCount << AMOTION_EVENT_ACTION_POINTER_INDEX_SHIFT; | 5380 | action |= pointerCount << AMOTION_EVENT_ACTION_POINTER_INDEX_SHIFT; |
2047 | 5394 | } | 5381 | } |
2048 | 5395 | 5382 | ||
2049 | @@ -5418,31 +5405,94 @@ | |||
2050 | 5418 | getListener()->notifyMotion(&args); | 5405 | getListener()->notifyMotion(&args); |
2051 | 5419 | } | 5406 | } |
2052 | 5420 | 5407 | ||
2053 | 5408 | void TouchInputMapper::dispatchMotion(nsecs_t when, uint32_t policyFlags, uint32_t source, | ||
2054 | 5409 | int32_t action, int32_t flags, int32_t metaState, int32_t buttonState, int32_t edgeFlags, | ||
2055 | 5410 | const PointerProperties* properties, const PointerCoords* coords, | ||
2056 | 5411 | uint32_t inPointerCount, const IntSet &idsToDispatch, | ||
2057 | 5412 | int32_t changedId, float xPrecision, float yPrecision, nsecs_t downTime) { | ||
2058 | 5413 | PointerCoords pointerCoords[MAX_POINTERS]; | ||
2059 | 5414 | PointerProperties pointerProperties[MAX_POINTERS]; | ||
2060 | 5415 | uint32_t pointerCount = 0; | ||
2061 | 5416 | |||
2062 | 5417 | for (uint32_t i = 0; i < inPointerCount && pointerCount < idsToDispatch.size(); ++i) { | ||
2063 | 5418 | if (!idsToDispatch.contains(properties[i].id)) | ||
2064 | 5419 | continue; | ||
2065 | 5420 | |||
2066 | 5421 | pointerProperties[pointerCount].copyFrom(properties[i]); | ||
2067 | 5422 | pointerCoords[pointerCount].copyFrom(coords[i]); | ||
2068 | 5423 | |||
2069 | 5424 | if (changedId >= 0 && properties[i].id == uint32_t(changedId)) { | ||
2070 | 5425 | action |= i << AMOTION_EVENT_ACTION_POINTER_INDEX_SHIFT; | ||
2071 | 5426 | } | ||
2072 | 5427 | |||
2073 | 5428 | pointerCount += 1; | ||
2074 | 5429 | } | ||
2075 | 5430 | |||
2076 | 5431 | ALOG_ASSERT(pointerCount != 0); | ||
2077 | 5432 | |||
2078 | 5433 | if (changedId >= 0 && pointerCount == 1) { | ||
2079 | 5434 | // Remove the poiter index part | ||
2080 | 5435 | int actionPart = action & AMOTION_EVENT_ACTION_MASK; | ||
2081 | 5436 | |||
2082 | 5437 | // Replace initial down and final up action. | ||
2083 | 5438 | // We can compare the action without masking off the changed pointer index | ||
2084 | 5439 | // because we know the index is 0. | ||
2085 | 5440 | if (actionPart == AMOTION_EVENT_ACTION_POINTER_DOWN) { | ||
2086 | 5441 | actionPart = AMOTION_EVENT_ACTION_DOWN; | ||
2087 | 5442 | } else if (actionPart & AMOTION_EVENT_ACTION_POINTER_UP) { | ||
2088 | 5443 | actionPart = AMOTION_EVENT_ACTION_UP; | ||
2089 | 5444 | } else { | ||
2090 | 5445 | // Can't happen. | ||
2091 | 5446 | ALOG_ASSERT(false); | ||
2092 | 5447 | } | ||
2093 | 5448 | |||
2094 | 5449 | // And put it back into the action integer | ||
2095 | 5450 | action = (action & AMOTION_EVENT_ACTION_POINTER_INDEX_MASK) | actionPart; | ||
2096 | 5451 | } | ||
2097 | 5452 | |||
2098 | 5453 | NotifyMotionArgs args(when, getDeviceId(), source, policyFlags, | ||
2099 | 5454 | action, flags, metaState, buttonState, edgeFlags, | ||
2100 | 5455 | pointerCount, pointerProperties, pointerCoords, xPrecision, yPrecision, downTime); | ||
2101 | 5456 | getListener()->notifyMotion(&args); | ||
2102 | 5457 | } | ||
2103 | 5458 | |||
2104 | 5421 | bool TouchInputMapper::updateMovedPointers(const PointerProperties* inProperties, | 5459 | bool TouchInputMapper::updateMovedPointers(const PointerProperties* inProperties, |
2108 | 5422 | const PointerCoords* inCoords, const uint32_t* inIdToIndex, | 5460 | const PointerCoords* inCoords, uint32_t inPointerCount, |
2109 | 5423 | PointerProperties* outProperties, PointerCoords* outCoords, const uint32_t* outIdToIndex, | 5461 | PointerProperties* outProperties, PointerCoords* outCoords, uint32_t outPointerCount, |
2110 | 5424 | BitSet32 idBits) const { | 5462 | const IntSet &commonTouchingIds) const { |
2111 | 5425 | bool changed = false; | 5463 | bool changed = false; |
2132 | 5426 | while (!idBits.isEmpty()) { | 5464 | |
2133 | 5427 | uint32_t id = idBits.clearFirstMarkedBit(); | 5465 | if (commonTouchingIds.isEmpty()) { |
2134 | 5428 | uint32_t inIndex = inIdToIndex[id]; | 5466 | return changed; |
2135 | 5429 | uint32_t outIndex = outIdToIndex[id]; | 5467 | } |
2136 | 5430 | 5468 | ||
2137 | 5431 | const PointerProperties& curInProperties = inProperties[inIndex]; | 5469 | for (uint32_t inIndex = 0; inIndex < inPointerCount; ++inIndex) { |
2138 | 5432 | const PointerCoords& curInCoords = inCoords[inIndex]; | 5470 | int32_t inId = inProperties[inIndex].id; |
2139 | 5433 | PointerProperties& curOutProperties = outProperties[outIndex]; | 5471 | if (!commonTouchingIds.contains(inId)) { |
2140 | 5434 | PointerCoords& curOutCoords = outCoords[outIndex]; | 5472 | continue; |
2141 | 5435 | 5473 | } | |
2142 | 5436 | if (curInProperties != curOutProperties) { | 5474 | for (uint32_t outIndex = 0; outIndex < outPointerCount; ++outIndex) { |
2143 | 5437 | curOutProperties.copyFrom(curInProperties); | 5475 | int32_t outId = outProperties[outIndex].id; |
2144 | 5438 | changed = true; | 5476 | if (inId == outId) { |
2145 | 5439 | } | 5477 | // The pointer is present in both sets. Let's see if it has moved. |
2146 | 5440 | 5478 | const PointerProperties& curInProperties = inProperties[inIndex]; | |
2147 | 5441 | if (curInCoords != curOutCoords) { | 5479 | const PointerCoords& curInCoords = inCoords[inIndex]; |
2148 | 5442 | curOutCoords.copyFrom(curInCoords); | 5480 | PointerProperties& curOutProperties = outProperties[outIndex]; |
2149 | 5443 | changed = true; | 5481 | PointerCoords& curOutCoords = outCoords[outIndex]; |
2150 | 5444 | } | 5482 | |
2151 | 5445 | } | 5483 | if (curInProperties != curOutProperties) { |
2152 | 5484 | curOutProperties.copyFrom(curInProperties); | ||
2153 | 5485 | changed = true; | ||
2154 | 5486 | } | ||
2155 | 5487 | |||
2156 | 5488 | if (curInCoords != curOutCoords) { | ||
2157 | 5489 | curOutCoords.copyFrom(curInCoords); | ||
2158 | 5490 | changed = true; | ||
2159 | 5491 | } | ||
2160 | 5492 | } | ||
2161 | 5493 | } | ||
2162 | 5494 | } | ||
2163 | 5495 | |||
2164 | 5446 | return changed; | 5496 | return changed; |
2165 | 5447 | } | 5497 | } |
2166 | 5448 | 5498 | ||
2167 | @@ -5484,7 +5534,7 @@ | |||
2168 | 5484 | uint32_t currentPointerCount = mCurrentRawPointerData.pointerCount; | 5534 | uint32_t currentPointerCount = mCurrentRawPointerData.pointerCount; |
2169 | 5485 | uint32_t lastPointerCount = mLastRawPointerData.pointerCount; | 5535 | uint32_t lastPointerCount = mLastRawPointerData.pointerCount; |
2170 | 5486 | 5536 | ||
2172 | 5487 | mCurrentRawPointerData.clearIdBits(); | 5537 | mCurrentRawPointerData.clearIds(); |
2173 | 5488 | 5538 | ||
2174 | 5489 | if (currentPointerCount == 0) { | 5539 | if (currentPointerCount == 0) { |
2175 | 5490 | // No pointers to assign. | 5540 | // No pointers to assign. |
2176 | @@ -5494,10 +5544,9 @@ | |||
2177 | 5494 | if (lastPointerCount == 0) { | 5544 | if (lastPointerCount == 0) { |
2178 | 5495 | // All pointers are new. | 5545 | // All pointers are new. |
2179 | 5496 | for (uint32_t i = 0; i < currentPointerCount; i++) { | 5546 | for (uint32_t i = 0; i < currentPointerCount; i++) { |
2181 | 5497 | uint32_t id = i; | 5547 | int32_t id = fetchNewPointerId(); |
2182 | 5498 | mCurrentRawPointerData.pointers[i].id = id; | 5548 | mCurrentRawPointerData.pointers[i].id = id; |
2185 | 5499 | mCurrentRawPointerData.idToIndex[id] = i; | 5549 | mCurrentRawPointerData.insertId(id, mCurrentRawPointerData.isHovering(i)); |
2184 | 5500 | mCurrentRawPointerData.markIdBit(id, mCurrentRawPointerData.isHovering(i)); | ||
2186 | 5501 | } | 5550 | } |
2187 | 5502 | return; | 5551 | return; |
2188 | 5503 | } | 5552 | } |
2189 | @@ -5506,10 +5555,9 @@ | |||
2190 | 5506 | && mCurrentRawPointerData.pointers[0].toolType | 5555 | && mCurrentRawPointerData.pointers[0].toolType |
2191 | 5507 | == mLastRawPointerData.pointers[0].toolType) { | 5556 | == mLastRawPointerData.pointers[0].toolType) { |
2192 | 5508 | // Only one pointer and no change in count so it must have the same id as before. | 5557 | // Only one pointer and no change in count so it must have the same id as before. |
2194 | 5509 | uint32_t id = mLastRawPointerData.pointers[0].id; | 5558 | int32_t id = mLastRawPointerData.pointers[0].id; |
2195 | 5510 | mCurrentRawPointerData.pointers[0].id = id; | 5559 | mCurrentRawPointerData.pointers[0].id = id; |
2198 | 5511 | mCurrentRawPointerData.idToIndex[id] = 0; | 5560 | mCurrentRawPointerData.insertId(id, mCurrentRawPointerData.isHovering(0)); |
2197 | 5512 | mCurrentRawPointerData.markIdBit(id, mCurrentRawPointerData.isHovering(0)); | ||
2199 | 5513 | return; | 5561 | return; |
2200 | 5514 | } | 5562 | } |
2201 | 5515 | 5563 | ||
2202 | @@ -5569,9 +5617,9 @@ | |||
2203 | 5569 | } | 5617 | } |
2204 | 5570 | 5618 | ||
2205 | 5571 | #if DEBUG_POINTER_ASSIGNMENT | 5619 | #if DEBUG_POINTER_ASSIGNMENT |
2207 | 5572 | ALOGD("assignPointerIds - initial distance min-heap: size=%d", heapSize); | 5620 | ALOGD("assignPointerIds - initial distance min-heap: size=%u", heapSize); |
2208 | 5573 | for (size_t i = 0; i < heapSize; i++) { | 5621 | for (size_t i = 0; i < heapSize; i++) { |
2210 | 5574 | ALOGD(" heap[%d]: cur=%d, last=%d, distance=%lld", | 5622 | ALOGD(" heap[%d]: cur=%u, last=%u, distance=%llu", |
2211 | 5575 | i, heap[i].currentPointerIndex, heap[i].lastPointerIndex, | 5623 | i, heap[i].currentPointerIndex, heap[i].lastPointerIndex, |
2212 | 5576 | heap[i].distance); | 5624 | heap[i].distance); |
2213 | 5577 | } | 5625 | } |
2214 | @@ -5580,10 +5628,8 @@ | |||
2215 | 5580 | // Pull matches out by increasing order of distance. | 5628 | // Pull matches out by increasing order of distance. |
2216 | 5581 | // To avoid reassigning pointers that have already been matched, the loop keeps track | 5629 | // To avoid reassigning pointers that have already been matched, the loop keeps track |
2217 | 5582 | // of which last and current pointers have been matched using the matchedXXXBits variables. | 5630 | // of which last and current pointers have been matched using the matchedXXXBits variables. |
2218 | 5583 | // It also tracks the used pointer id bits. | ||
2219 | 5584 | BitSet32 matchedLastBits(0); | 5631 | BitSet32 matchedLastBits(0); |
2220 | 5585 | BitSet32 matchedCurrentBits(0); | 5632 | BitSet32 matchedCurrentBits(0); |
2221 | 5586 | BitSet32 usedIdBits(0); | ||
2222 | 5587 | bool first = true; | 5633 | bool first = true; |
2223 | 5588 | for (uint32_t i = min(currentPointerCount, lastPointerCount); heapSize > 0 && i > 0; i--) { | 5634 | for (uint32_t i = min(currentPointerCount, lastPointerCount); heapSize > 0 && i > 0; i--) { |
2224 | 5589 | while (heapSize > 0) { | 5635 | while (heapSize > 0) { |
2225 | @@ -5635,12 +5681,9 @@ | |||
2226 | 5635 | matchedCurrentBits.markBit(currentPointerIndex); | 5681 | matchedCurrentBits.markBit(currentPointerIndex); |
2227 | 5636 | matchedLastBits.markBit(lastPointerIndex); | 5682 | matchedLastBits.markBit(lastPointerIndex); |
2228 | 5637 | 5683 | ||
2230 | 5638 | uint32_t id = mLastRawPointerData.pointers[lastPointerIndex].id; | 5684 | int32_t id = mLastRawPointerData.pointers[lastPointerIndex].id; |
2231 | 5639 | mCurrentRawPointerData.pointers[currentPointerIndex].id = id; | 5685 | mCurrentRawPointerData.pointers[currentPointerIndex].id = id; |
2236 | 5640 | mCurrentRawPointerData.idToIndex[id] = currentPointerIndex; | 5686 | mCurrentRawPointerData.insertId(id, mCurrentRawPointerData.isHovering(currentPointerIndex)); |
2233 | 5641 | mCurrentRawPointerData.markIdBit(id, | ||
2234 | 5642 | mCurrentRawPointerData.isHovering(currentPointerIndex)); | ||
2235 | 5643 | usedIdBits.markBit(id); | ||
2237 | 5644 | 5687 | ||
2238 | 5645 | #if DEBUG_POINTER_ASSIGNMENT | 5688 | #if DEBUG_POINTER_ASSIGNMENT |
2239 | 5646 | ALOGD("assignPointerIds - matched: cur=%d, last=%d, id=%d, distance=%lld", | 5689 | ALOGD("assignPointerIds - matched: cur=%d, last=%d, id=%d, distance=%lld", |
2240 | @@ -5653,11 +5696,10 @@ | |||
2241 | 5653 | // Assign fresh ids to pointers that were not matched in the process. | 5696 | // Assign fresh ids to pointers that were not matched in the process. |
2242 | 5654 | for (uint32_t i = currentPointerCount - matchedCurrentBits.count(); i != 0; i--) { | 5697 | for (uint32_t i = currentPointerCount - matchedCurrentBits.count(); i != 0; i--) { |
2243 | 5655 | uint32_t currentPointerIndex = matchedCurrentBits.markFirstUnmarkedBit(); | 5698 | uint32_t currentPointerIndex = matchedCurrentBits.markFirstUnmarkedBit(); |
2245 | 5656 | uint32_t id = usedIdBits.markFirstUnmarkedBit(); | 5699 | int32_t id = fetchNewPointerId(); |
2246 | 5657 | 5700 | ||
2247 | 5658 | mCurrentRawPointerData.pointers[currentPointerIndex].id = id; | 5701 | mCurrentRawPointerData.pointers[currentPointerIndex].id = id; |
2250 | 5659 | mCurrentRawPointerData.idToIndex[id] = currentPointerIndex; | 5702 | mCurrentRawPointerData.insertId(id, |
2249 | 5660 | mCurrentRawPointerData.markIdBit(id, | ||
2251 | 5661 | mCurrentRawPointerData.isHovering(currentPointerIndex)); | 5703 | mCurrentRawPointerData.isHovering(currentPointerIndex)); |
2252 | 5662 | 5704 | ||
2253 | 5663 | #if DEBUG_POINTER_ASSIGNMENT | 5705 | #if DEBUG_POINTER_ASSIGNMENT |
2254 | @@ -5667,6 +5709,14 @@ | |||
2255 | 5667 | } | 5709 | } |
2256 | 5668 | } | 5710 | } |
2257 | 5669 | 5711 | ||
2258 | 5712 | int32_t TouchInputMapper::fetchNewPointerId() { | ||
2259 | 5713 | int32_t id = mNextNewPointerId++; | ||
2260 | 5714 | if (mNextNewPointerId > MAX_POINTER_ID) { | ||
2261 | 5715 | mNextNewPointerId = 0; | ||
2262 | 5716 | } | ||
2263 | 5717 | return id; | ||
2264 | 5718 | } | ||
2265 | 5719 | |||
2266 | 5670 | int32_t TouchInputMapper::getKeyCodeState(uint32_t sourceMask, int32_t keyCode) { | 5720 | int32_t TouchInputMapper::getKeyCodeState(uint32_t sourceMask, int32_t keyCode) { |
2267 | 5671 | if (mCurrentVirtualKey.down && mCurrentVirtualKey.keyCode == keyCode) { | 5721 | if (mCurrentVirtualKey.down && mCurrentVirtualKey.keyCode == keyCode) { |
2268 | 5672 | return AKEY_STATE_VIRTUAL; | 5722 | return AKEY_STATE_VIRTUAL; |
2269 | @@ -5740,16 +5790,21 @@ | |||
2270 | 5740 | void SingleTouchInputMapper::syncTouch(nsecs_t when, bool* outHavePointerIds) { | 5790 | void SingleTouchInputMapper::syncTouch(nsecs_t when, bool* outHavePointerIds) { |
2271 | 5741 | if (mTouchButtonAccumulator.isToolActive()) { | 5791 | if (mTouchButtonAccumulator.isToolActive()) { |
2272 | 5742 | mCurrentRawPointerData.pointerCount = 1; | 5792 | mCurrentRawPointerData.pointerCount = 1; |
2273 | 5743 | mCurrentRawPointerData.idToIndex[0] = 0; | ||
2274 | 5744 | 5793 | ||
2275 | 5745 | bool isHovering = mTouchButtonAccumulator.getToolType() != AMOTION_EVENT_TOOL_TYPE_MOUSE | 5794 | bool isHovering = mTouchButtonAccumulator.getToolType() != AMOTION_EVENT_TOOL_TYPE_MOUSE |
2276 | 5746 | && (mTouchButtonAccumulator.isHovering() | 5795 | && (mTouchButtonAccumulator.isHovering() |
2277 | 5747 | || (mRawPointerAxes.pressure.valid | 5796 | || (mRawPointerAxes.pressure.valid |
2278 | 5748 | && mSingleTouchMotionAccumulator.getAbsolutePressure() <= 0)); | 5797 | && mSingleTouchMotionAccumulator.getAbsolutePressure() <= 0)); |
2279 | 5749 | mCurrentRawPointerData.markIdBit(0, isHovering); | ||
2280 | 5750 | 5798 | ||
2281 | 5751 | RawPointerData::Pointer& outPointer = mCurrentRawPointerData.pointers[0]; | 5799 | RawPointerData::Pointer& outPointer = mCurrentRawPointerData.pointers[0]; |
2283 | 5752 | outPointer.id = 0; | 5800 | |
2284 | 5801 | if (mLastRawPointerData.pointerCount == 1) { | ||
2285 | 5802 | outPointer.id = mLastRawPointerData.pointers[0].id; | ||
2286 | 5803 | mCurrentRawPointerData.insertId(outPointer.id, isHovering); | ||
2287 | 5804 | } else { | ||
2288 | 5805 | outPointer.id = -1; | ||
2289 | 5806 | *outHavePointerIds = false; | ||
2290 | 5807 | } | ||
2291 | 5753 | outPointer.x = mSingleTouchMotionAccumulator.getAbsoluteX(); | 5808 | outPointer.x = mSingleTouchMotionAccumulator.getAbsoluteX(); |
2292 | 5754 | outPointer.y = mSingleTouchMotionAccumulator.getAbsoluteY(); | 5809 | outPointer.y = mSingleTouchMotionAccumulator.getAbsoluteY(); |
2293 | 5755 | outPointer.pressure = mSingleTouchMotionAccumulator.getAbsolutePressure(); | 5810 | outPointer.pressure = mSingleTouchMotionAccumulator.getAbsolutePressure(); |
2294 | @@ -5766,6 +5821,7 @@ | |||
2295 | 5766 | outPointer.toolType = AMOTION_EVENT_TOOL_TYPE_FINGER; | 5821 | outPointer.toolType = AMOTION_EVENT_TOOL_TYPE_FINGER; |
2296 | 5767 | } | 5822 | } |
2297 | 5768 | outPointer.isHovering = isHovering; | 5823 | outPointer.isHovering = isHovering; |
2298 | 5824 | |||
2299 | 5769 | } | 5825 | } |
2300 | 5770 | } | 5826 | } |
2301 | 5771 | 5827 | ||
2302 | @@ -5798,7 +5854,7 @@ | |||
2303 | 5798 | void MultiTouchInputMapper::reset(nsecs_t when) { | 5854 | void MultiTouchInputMapper::reset(nsecs_t when) { |
2304 | 5799 | mMultiTouchMotionAccumulator.reset(getDevice()); | 5855 | mMultiTouchMotionAccumulator.reset(getDevice()); |
2305 | 5800 | 5856 | ||
2307 | 5801 | mPointerIdBits.clear(); | 5857 | mPointerIds.clear(); |
2308 | 5802 | 5858 | ||
2309 | 5803 | TouchInputMapper::reset(when); | 5859 | TouchInputMapper::reset(when); |
2310 | 5804 | } | 5860 | } |
2311 | @@ -5812,7 +5868,7 @@ | |||
2312 | 5812 | void MultiTouchInputMapper::syncTouch(nsecs_t when, bool* outHavePointerIds) { | 5868 | void MultiTouchInputMapper::syncTouch(nsecs_t when, bool* outHavePointerIds) { |
2313 | 5813 | size_t inCount = mMultiTouchMotionAccumulator.getSlotCount(); | 5869 | size_t inCount = mMultiTouchMotionAccumulator.getSlotCount(); |
2314 | 5814 | size_t outCount = 0; | 5870 | size_t outCount = 0; |
2316 | 5815 | BitSet32 newPointerIdBits; | 5871 | IntSet newPointerIds; |
2317 | 5816 | 5872 | ||
2318 | 5817 | for (size_t inIndex = 0; inIndex < inCount; inIndex++) { | 5873 | for (size_t inIndex = 0; inIndex < inCount; inIndex++) { |
2319 | 5818 | const MultiTouchMotionAccumulator::Slot* inSlot = | 5874 | const MultiTouchMotionAccumulator::Slot* inSlot = |
2320 | @@ -5861,27 +5917,26 @@ | |||
2321 | 5861 | int32_t trackingId = inSlot->getTrackingId(); | 5917 | int32_t trackingId = inSlot->getTrackingId(); |
2322 | 5862 | int32_t id = -1; | 5918 | int32_t id = -1; |
2323 | 5863 | if (trackingId >= 0) { | 5919 | if (trackingId >= 0) { |
2326 | 5864 | for (BitSet32 idBits(mPointerIdBits); !idBits.isEmpty(); ) { | 5920 | mPointerIds.forEach([&](int32_t n) { |
2325 | 5865 | uint32_t n = idBits.clearFirstMarkedBit(); | ||
2327 | 5866 | if (mPointerTrackingIdMap[n] == trackingId) { | 5921 | if (mPointerTrackingIdMap[n] == trackingId) { |
2328 | 5867 | id = n; | 5922 | id = n; |
2329 | 5868 | } | 5923 | } |
2331 | 5869 | } | 5924 | }); |
2332 | 5870 | 5925 | ||
2335 | 5871 | if (id < 0 && !mPointerIdBits.isFull()) { | 5926 | if (id < 0) { |
2336 | 5872 | id = mPointerIdBits.markFirstUnmarkedBit(); | 5927 | id = fetchNewPointerId(); |
2337 | 5928 | mPointerIds.insert(id); | ||
2338 | 5873 | mPointerTrackingIdMap[id] = trackingId; | 5929 | mPointerTrackingIdMap[id] = trackingId; |
2339 | 5874 | } | 5930 | } |
2340 | 5875 | } | 5931 | } |
2341 | 5876 | if (id < 0) { | 5932 | if (id < 0) { |
2342 | 5877 | *outHavePointerIds = false; | 5933 | *outHavePointerIds = false; |
2345 | 5878 | mCurrentRawPointerData.clearIdBits(); | 5934 | mCurrentRawPointerData.clearIds(); |
2346 | 5879 | newPointerIdBits.clear(); | 5935 | newPointerIds.clear(); |
2347 | 5880 | } else { | 5936 | } else { |
2348 | 5881 | outPointer.id = id; | 5937 | outPointer.id = id; |
2352 | 5882 | mCurrentRawPointerData.idToIndex[id] = outCount; | 5938 | mCurrentRawPointerData.insertId(id, isHovering); |
2353 | 5883 | mCurrentRawPointerData.markIdBit(id, isHovering); | 5939 | newPointerIds.insert(id); |
2351 | 5884 | newPointerIdBits.markBit(id); | ||
2354 | 5885 | } | 5940 | } |
2355 | 5886 | } | 5941 | } |
2356 | 5887 | 5942 | ||
2357 | @@ -5889,7 +5944,7 @@ | |||
2358 | 5889 | } | 5944 | } |
2359 | 5890 | 5945 | ||
2360 | 5891 | mCurrentRawPointerData.pointerCount = outCount; | 5946 | mCurrentRawPointerData.pointerCount = outCount; |
2362 | 5892 | mPointerIdBits = newPointerIdBits; | 5947 | mPointerIds = newPointerIds; |
2363 | 5893 | 5948 | ||
2364 | 5894 | mMultiTouchMotionAccumulator.finishSync(); | 5949 | mMultiTouchMotionAccumulator.finishSync(); |
2365 | 5895 | } | 5950 | } |
2366 | @@ -5914,8 +5969,8 @@ | |||
2367 | 5914 | && mRawPointerAxes.slot.minValue == 0 && mRawPointerAxes.slot.maxValue > 0) { | 5969 | && mRawPointerAxes.slot.minValue == 0 && mRawPointerAxes.slot.maxValue > 0) { |
2368 | 5915 | size_t slotCount = mRawPointerAxes.slot.maxValue + 1; | 5970 | size_t slotCount = mRawPointerAxes.slot.maxValue + 1; |
2369 | 5916 | if (slotCount > MAX_SLOTS) { | 5971 | if (slotCount > MAX_SLOTS) { |
2372 | 5917 | ALOGW("MultiTouch Device %s reported %d slots but the framework " | 5972 | ALOGW("MultiTouch Device %s reported %lu slots but the framework " |
2373 | 5918 | "only supports a maximum of %d slots at this time.", | 5973 | "only supports a maximum of %lu slots at this time.", |
2374 | 5919 | c_str(getDeviceName()), slotCount, MAX_SLOTS); | 5974 | c_str(getDeviceName()), slotCount, MAX_SLOTS); |
2375 | 5920 | slotCount = MAX_SLOTS; | 5975 | slotCount = MAX_SLOTS; |
2376 | 5921 | } | 5976 | } |
2377 | @@ -6057,7 +6112,7 @@ | |||
2378 | 6057 | // If there are too many axes, start dropping them. | 6112 | // If there are too many axes, start dropping them. |
2379 | 6058 | // Prefer to keep explicitly mapped axes. | 6113 | // Prefer to keep explicitly mapped axes. |
2380 | 6059 | if (mAxes.size() > PointerCoords::MAX_AXES) { | 6114 | if (mAxes.size() > PointerCoords::MAX_AXES) { |
2382 | 6060 | ALOGI("Joystick '%s' has %d axes but the framework only supports a maximum of %d.", | 6115 | ALOGI("Joystick '%s' has %lu axes but the framework only supports a maximum of %d.", |
2383 | 6061 | c_str(getDeviceName()), mAxes.size(), PointerCoords::MAX_AXES); | 6116 | c_str(getDeviceName()), mAxes.size(), PointerCoords::MAX_AXES); |
2384 | 6062 | pruneAxes(true); | 6117 | pruneAxes(true); |
2385 | 6063 | pruneAxes(false); | 6118 | pruneAxes(false); |
2386 | 6064 | 6119 | ||
2387 | === modified file '3rd_party/android-input/android/frameworks/base/services/input/InputReader.h' | |||
2388 | --- 3rd_party/android-input/android/frameworks/base/services/input/InputReader.h 2013-09-20 12:18:12 +0000 | |||
2389 | +++ 3rd_party/android-input/android/frameworks/base/services/input/InputReader.h 2013-11-21 20:19:28 +0000 | |||
2390 | @@ -22,6 +22,7 @@ | |||
2391 | 22 | #include "InputListener.h" | 22 | #include "InputListener.h" |
2392 | 23 | 23 | ||
2393 | 24 | #include <androidfw/Input.h> | 24 | #include <androidfw/Input.h> |
2394 | 25 | #include <androidfw/IntSet.h> | ||
2395 | 25 | #include <androidfw/VelocityControl.h> | 26 | #include <androidfw/VelocityControl.h> |
2396 | 26 | #include <androidfw/VelocityTracker.h> | 27 | #include <androidfw/VelocityTracker.h> |
2397 | 27 | #include <std/KeyedVector.h> | 28 | #include <std/KeyedVector.h> |
2398 | @@ -30,12 +31,14 @@ | |||
2399 | 30 | #include <std/Timers.h> | 31 | #include <std/Timers.h> |
2400 | 31 | #include <std/RefBase.h> | 32 | #include <std/RefBase.h> |
2401 | 32 | #include <std/String8.h> | 33 | #include <std/String8.h> |
2402 | 33 | #include <std/BitSet.h> | ||
2403 | 34 | 34 | ||
2404 | 35 | #include <limits.h> | 35 | #include <limits.h> |
2405 | 36 | #include <stddef.h> | 36 | #include <stddef.h> |
2406 | 37 | #include <unistd.h> | 37 | #include <unistd.h> |
2407 | 38 | 38 | ||
2408 | 39 | // C++ std lib | ||
2409 | 40 | #include <unordered_map> | ||
2410 | 41 | |||
2411 | 39 | // Maximum supported size of a vibration pattern. | 42 | // Maximum supported size of a vibration pattern. |
2412 | 40 | // Must be at least 2. | 43 | // Must be at least 2. |
2413 | 41 | #define MAX_VIBRATE_PATTERN_SIZE 100 | 44 | #define MAX_VIBRATE_PATTERN_SIZE 100 |
2414 | @@ -678,7 +681,7 @@ | |||
2415 | 678 | /* Raw data for a collection of pointers including a pointer id mapping table. */ | 681 | /* Raw data for a collection of pointers including a pointer id mapping table. */ |
2416 | 679 | struct RawPointerData { | 682 | struct RawPointerData { |
2417 | 680 | struct Pointer { | 683 | struct Pointer { |
2419 | 681 | uint32_t id; | 684 | int32_t id; |
2420 | 682 | int32_t x; | 685 | int32_t x; |
2421 | 683 | int32_t y; | 686 | int32_t y; |
2422 | 684 | int32_t pressure; | 687 | int32_t pressure; |
2423 | @@ -696,29 +699,40 @@ | |||
2424 | 696 | 699 | ||
2425 | 697 | uint32_t pointerCount; | 700 | uint32_t pointerCount; |
2426 | 698 | Pointer pointers[MAX_POINTERS]; | 701 | Pointer pointers[MAX_POINTERS]; |
2429 | 699 | BitSet32 hoveringIdBits, touchingIdBits; | 702 | IntSet hoveringIds, touchingIds; |
2430 | 700 | uint32_t idToIndex[MAX_POINTER_ID + 1]; | 703 | |
2431 | 704 | uint32_t idToIndex(int32_t id) const { | ||
2432 | 705 | uint32_t i = 0; | ||
2433 | 706 | |||
2434 | 707 | while (pointers[i].id != id && i < pointerCount) { | ||
2435 | 708 | ++i; | ||
2436 | 709 | } | ||
2437 | 710 | |||
2438 | 711 | assert(pointers[i].id == id); | ||
2439 | 712 | return i; | ||
2440 | 713 | } | ||
2441 | 714 | |||
2442 | 701 | 715 | ||
2443 | 702 | RawPointerData(); | 716 | RawPointerData(); |
2444 | 703 | void clear(); | 717 | void clear(); |
2445 | 704 | void copyFrom(const RawPointerData& other); | 718 | void copyFrom(const RawPointerData& other); |
2446 | 705 | void getCentroidOfTouchingPointers(float* outX, float* outY) const; | 719 | void getCentroidOfTouchingPointers(float* outX, float* outY) const; |
2447 | 706 | 720 | ||
2449 | 707 | inline void markIdBit(uint32_t id, bool isHovering) { | 721 | inline void insertId(int32_t id, bool isHovering) { |
2450 | 708 | if (isHovering) { | 722 | if (isHovering) { |
2452 | 709 | hoveringIdBits.markBit(id); | 723 | hoveringIds.insert(id); |
2453 | 710 | } else { | 724 | } else { |
2455 | 711 | touchingIdBits.markBit(id); | 725 | touchingIds.insert(id); |
2456 | 712 | } | 726 | } |
2457 | 713 | } | 727 | } |
2458 | 714 | 728 | ||
2462 | 715 | inline void clearIdBits() { | 729 | inline void clearIds() { |
2463 | 716 | hoveringIdBits.clear(); | 730 | hoveringIds.clear(); |
2464 | 717 | touchingIdBits.clear(); | 731 | touchingIds.clear(); |
2465 | 718 | } | 732 | } |
2466 | 719 | 733 | ||
2469 | 720 | inline const Pointer& pointerForId(uint32_t id) const { | 734 | inline const Pointer& pointerForId(int32_t id) const { |
2470 | 721 | return pointers[idToIndex[id]]; | 735 | return pointers[idToIndex(id)]; |
2471 | 722 | } | 736 | } |
2472 | 723 | 737 | ||
2473 | 724 | inline bool isHovering(uint32_t pointerIndex) { | 738 | inline bool isHovering(uint32_t pointerIndex) { |
2474 | @@ -732,15 +746,22 @@ | |||
2475 | 732 | uint32_t pointerCount; | 746 | uint32_t pointerCount; |
2476 | 733 | PointerProperties pointerProperties[MAX_POINTERS]; | 747 | PointerProperties pointerProperties[MAX_POINTERS]; |
2477 | 734 | PointerCoords pointerCoords[MAX_POINTERS]; | 748 | PointerCoords pointerCoords[MAX_POINTERS]; |
2480 | 735 | BitSet32 hoveringIdBits, touchingIdBits; | 749 | IntSet hoveringIds, touchingIds; |
2481 | 736 | uint32_t idToIndex[MAX_POINTER_ID + 1]; | 750 | uint32_t idToIndex(int32_t id) const { |
2482 | 751 | uint32_t i = 0; | ||
2483 | 752 | |||
2484 | 753 | while (pointerProperties[i].id != id && i < pointerCount) { ++i; } | ||
2485 | 754 | |||
2486 | 755 | assert(pointerProperties[i].id == id); | ||
2487 | 756 | return i; | ||
2488 | 757 | } | ||
2489 | 737 | 758 | ||
2490 | 738 | CookedPointerData(); | 759 | CookedPointerData(); |
2491 | 739 | void clear(); | 760 | void clear(); |
2492 | 740 | void copyFrom(const CookedPointerData& other); | 761 | void copyFrom(const CookedPointerData& other); |
2493 | 741 | 762 | ||
2494 | 742 | inline bool isHovering(uint32_t pointerIndex) { | 763 | inline bool isHovering(uint32_t pointerIndex) { |
2496 | 743 | return hoveringIdBits.hasBit(pointerProperties[pointerIndex].id); | 764 | return hoveringIds.contains(pointerProperties[pointerIndex].id); |
2497 | 744 | } | 765 | } |
2498 | 745 | }; | 766 | }; |
2499 | 746 | 767 | ||
2500 | @@ -1233,13 +1254,13 @@ | |||
2501 | 1233 | int32_t mCurrentRawVScroll; | 1254 | int32_t mCurrentRawVScroll; |
2502 | 1234 | int32_t mCurrentRawHScroll; | 1255 | int32_t mCurrentRawHScroll; |
2503 | 1235 | 1256 | ||
2511 | 1236 | // Id bits used to differentiate fingers, stylus and mouse tools. | 1257 | // Id sets used to differentiate fingers, stylus and mouse tools. |
2512 | 1237 | BitSet32 mCurrentFingerIdBits; // finger or unknown | 1258 | IntSet mCurrentFingerIds; // finger or unknown |
2513 | 1238 | BitSet32 mLastFingerIdBits; | 1259 | IntSet mLastFingerIds; |
2514 | 1239 | BitSet32 mCurrentStylusIdBits; // stylus or eraser | 1260 | IntSet mCurrentStylusIds; // stylus or eraser |
2515 | 1240 | BitSet32 mLastStylusIdBits; | 1261 | IntSet mLastStylusIds; |
2516 | 1241 | BitSet32 mCurrentMouseIdBits; // mouse or lens | 1262 | IntSet mCurrentMouseIds; // mouse or lens |
2517 | 1242 | BitSet32 mLastMouseIdBits; | 1263 | IntSet mLastMouseIds; |
2518 | 1243 | 1264 | ||
2519 | 1244 | // True if we sent a HOVER_ENTER event. | 1265 | // True if we sent a HOVER_ENTER event. |
2520 | 1245 | bool mSentHoverEnter; | 1266 | bool mSentHoverEnter; |
2521 | @@ -1266,6 +1287,7 @@ | |||
2522 | 1266 | virtual bool hasStylus() const = 0; | 1287 | virtual bool hasStylus() const = 0; |
2523 | 1267 | 1288 | ||
2524 | 1268 | virtual void syncTouch(nsecs_t when, bool* outHavePointerIds) = 0; | 1289 | virtual void syncTouch(nsecs_t when, bool* outHavePointerIds) = 0; |
2525 | 1290 | int32_t fetchNewPointerId(); | ||
2526 | 1269 | 1291 | ||
2527 | 1270 | private: | 1292 | private: |
2528 | 1271 | // The surface orientation and width and height set by configureSurface(). | 1293 | // The surface orientation and width and height set by configureSurface(). |
2529 | @@ -1445,14 +1467,14 @@ | |||
2530 | 1445 | 1467 | ||
2531 | 1446 | // Pointer coords and ids for the current and previous pointer gesture. | 1468 | // Pointer coords and ids for the current and previous pointer gesture. |
2532 | 1447 | Mode currentGestureMode; | 1469 | Mode currentGestureMode; |
2535 | 1448 | BitSet32 currentGestureIdBits; | 1470 | IntSet currentGestureIds; |
2536 | 1449 | uint32_t currentGestureIdToIndex[MAX_POINTER_ID + 1]; | 1471 | std::unordered_map<int32_t, uint32_t> currentGestureIdToIndex; |
2537 | 1450 | PointerProperties currentGestureProperties[MAX_POINTERS]; | 1472 | PointerProperties currentGestureProperties[MAX_POINTERS]; |
2538 | 1451 | PointerCoords currentGestureCoords[MAX_POINTERS]; | 1473 | PointerCoords currentGestureCoords[MAX_POINTERS]; |
2539 | 1452 | 1474 | ||
2540 | 1453 | Mode lastGestureMode; | 1475 | Mode lastGestureMode; |
2543 | 1454 | BitSet32 lastGestureIdBits; | 1476 | IntSet lastGestureIds; |
2544 | 1455 | uint32_t lastGestureIdToIndex[MAX_POINTER_ID + 1]; | 1477 | std::unordered_map<int32_t, uint32_t> lastGestureIdToIndex; |
2545 | 1456 | PointerProperties lastGestureProperties[MAX_POINTERS]; | 1478 | PointerProperties lastGestureProperties[MAX_POINTERS]; |
2546 | 1457 | PointerCoords lastGestureCoords[MAX_POINTERS]; | 1479 | PointerCoords lastGestureCoords[MAX_POINTERS]; |
2547 | 1458 | 1480 | ||
2548 | @@ -1479,14 +1501,14 @@ | |||
2549 | 1479 | 1501 | ||
2550 | 1480 | // Distance that each pointer has traveled which has not yet been | 1502 | // Distance that each pointer has traveled which has not yet been |
2551 | 1481 | // subsumed into the reference gesture position. | 1503 | // subsumed into the reference gesture position. |
2553 | 1482 | BitSet32 referenceIdBits; | 1504 | IntSet referenceIds; |
2554 | 1483 | struct Delta { | 1505 | struct Delta { |
2555 | 1484 | float dx, dy; | 1506 | float dx, dy; |
2556 | 1485 | }; | 1507 | }; |
2558 | 1486 | Delta referenceDeltas[MAX_POINTER_ID + 1]; | 1508 | std::unordered_map<int32_t, Delta> referenceDeltas; |
2559 | 1487 | 1509 | ||
2560 | 1488 | // Describes how touch ids are mapped to gesture ids for freeform gestures. | 1510 | // Describes how touch ids are mapped to gesture ids for freeform gestures. |
2562 | 1489 | uint32_t freeformTouchToGestureIdMap[MAX_POINTER_ID + 1]; | 1511 | std::unordered_map<int32_t, int32_t> freeformTouchToGestureIdMap; |
2563 | 1490 | 1512 | ||
2564 | 1491 | // A velocity tracker for determining whether to switch active pointers during drags. | 1513 | // A velocity tracker for determining whether to switch active pointers during drags. |
2565 | 1492 | VelocityTracker velocityTracker; | 1514 | VelocityTracker velocityTracker; |
2566 | @@ -1496,9 +1518,9 @@ | |||
2567 | 1496 | activeTouchId = -1; | 1518 | activeTouchId = -1; |
2568 | 1497 | activeGestureId = -1; | 1519 | activeGestureId = -1; |
2569 | 1498 | currentGestureMode = NEUTRAL; | 1520 | currentGestureMode = NEUTRAL; |
2571 | 1499 | currentGestureIdBits.clear(); | 1521 | currentGestureIds.clear(); |
2572 | 1500 | lastGestureMode = NEUTRAL; | 1522 | lastGestureMode = NEUTRAL; |
2574 | 1501 | lastGestureIdBits.clear(); | 1523 | lastGestureIds.clear(); |
2575 | 1502 | downTime = 0; | 1524 | downTime = 0; |
2576 | 1503 | velocityTracker.clear(); | 1525 | velocityTracker.clear(); |
2577 | 1504 | resetTap(); | 1526 | resetTap(); |
2578 | @@ -1584,20 +1606,26 @@ | |||
2579 | 1584 | int32_t action, int32_t flags, int32_t metaState, int32_t buttonState, | 1606 | int32_t action, int32_t flags, int32_t metaState, int32_t buttonState, |
2580 | 1585 | int32_t edgeFlags, | 1607 | int32_t edgeFlags, |
2581 | 1586 | const PointerProperties* properties, const PointerCoords* coords, | 1608 | const PointerProperties* properties, const PointerCoords* coords, |
2583 | 1587 | const uint32_t* idToIndex, BitSet32 idBits, | 1609 | uint32_t inPointerCount, |
2584 | 1610 | int32_t changedId, float xPrecision, float yPrecision, nsecs_t downTime); | ||
2585 | 1611 | void dispatchMotion(nsecs_t when, uint32_t policyFlags, uint32_t source, | ||
2586 | 1612 | int32_t action, int32_t flags, int32_t metaState, int32_t buttonState, | ||
2587 | 1613 | int32_t edgeFlags, | ||
2588 | 1614 | const PointerProperties* properties, const PointerCoords* coords, | ||
2589 | 1615 | uint32_t inPointerCount, const IntSet &idsToDispatch, | ||
2590 | 1588 | int32_t changedId, float xPrecision, float yPrecision, nsecs_t downTime); | 1616 | int32_t changedId, float xPrecision, float yPrecision, nsecs_t downTime); |
2591 | 1589 | 1617 | ||
2593 | 1590 | // Updates pointer coords and properties for pointers with specified ids that have moved. | 1618 | // Updates pointer coords and properties for pointers that have moved. |
2594 | 1591 | // Returns true if any of them changed. | 1619 | // Returns true if any of them changed. |
2599 | 1592 | bool updateMovedPointers(const PointerProperties* inProperties, | 1620 | bool updateMovedPointers(const PointerProperties* inProperties, const PointerCoords* inCoords, |
2600 | 1593 | const PointerCoords* inCoords, const uint32_t* inIdToIndex, | 1621 | uint32_t inPointerCount, PointerProperties* outProperties, PointerCoords* outCoords, |
2601 | 1594 | PointerProperties* outProperties, PointerCoords* outCoords, | 1622 | uint32_t outPointerCount, const IntSet &commonTouchingIds) const; |
2598 | 1595 | const uint32_t* outIdToIndex, BitSet32 idBits) const; | ||
2602 | 1596 | 1623 | ||
2603 | 1597 | bool isPointInsideSurface(int32_t x, int32_t y); | 1624 | bool isPointInsideSurface(int32_t x, int32_t y); |
2604 | 1598 | const VirtualKey* findVirtualKeyHit(int32_t x, int32_t y); | 1625 | const VirtualKey* findVirtualKeyHit(int32_t x, int32_t y); |
2605 | 1599 | 1626 | ||
2606 | 1600 | void assignPointerIds(); | 1627 | void assignPointerIds(); |
2607 | 1628 | int32_t mNextNewPointerId; | ||
2608 | 1601 | }; | 1629 | }; |
2609 | 1602 | 1630 | ||
2610 | 1603 | 1631 | ||
2611 | @@ -1635,9 +1663,9 @@ | |||
2612 | 1635 | private: | 1663 | private: |
2613 | 1636 | MultiTouchMotionAccumulator mMultiTouchMotionAccumulator; | 1664 | MultiTouchMotionAccumulator mMultiTouchMotionAccumulator; |
2614 | 1637 | 1665 | ||
2618 | 1638 | // Specifies the pointer id bits that are in use, and their associated tracking id. | 1666 | // Specifies the pointer ids that are in use, and their associated tracking id. |
2619 | 1639 | BitSet32 mPointerIdBits; | 1667 | IntSet mPointerIds; |
2620 | 1640 | int32_t mPointerTrackingIdMap[MAX_POINTER_ID + 1]; | 1668 | std::unordered_map<int32_t, int32_t> mPointerTrackingIdMap; |
2621 | 1641 | }; | 1669 | }; |
2622 | 1642 | 1670 | ||
2623 | 1643 | 1671 | ||
2624 | 1644 | 1672 | ||
2625 | === modified file '3rd_party/android-input/android/frameworks/base/services/input/InputTransport.cpp' | |||
2626 | --- 3rd_party/android-input/android/frameworks/base/services/input/InputTransport.cpp 2013-05-31 16:06:07 +0000 | |||
2627 | +++ 3rd_party/android-input/android/frameworks/base/services/input/InputTransport.cpp 2013-11-21 20:19:28 +0000 | |||
2628 | @@ -593,7 +593,7 @@ | |||
2629 | 593 | if (eventTime < touchState.lastResample.eventTime) { | 593 | if (eventTime < touchState.lastResample.eventTime) { |
2630 | 594 | rewriteMessage(touchState, msg); | 594 | rewriteMessage(touchState, msg); |
2631 | 595 | } else { | 595 | } else { |
2633 | 596 | touchState.lastResample.idBits.clear(); | 596 | touchState.lastResample.ids.clear(); |
2634 | 597 | } | 597 | } |
2635 | 598 | } | 598 | } |
2636 | 599 | break; | 599 | break; |
2637 | @@ -603,7 +603,7 @@ | |||
2638 | 603 | ssize_t index = findTouchState(deviceId, source); | 603 | ssize_t index = findTouchState(deviceId, source); |
2639 | 604 | if (index >= 0) { | 604 | if (index >= 0) { |
2640 | 605 | TouchState& touchState = mTouchStates.editItemAt(index); | 605 | TouchState& touchState = mTouchStates.editItemAt(index); |
2642 | 606 | touchState.lastResample.idBits.clearBit(msg->body.motion.getActionId()); | 606 | touchState.lastResample.ids.remove(msg->body.motion.getActionId()); |
2643 | 607 | rewriteMessage(touchState, msg); | 607 | rewriteMessage(touchState, msg); |
2644 | 608 | } | 608 | } |
2645 | 609 | break; | 609 | break; |
2646 | @@ -614,7 +614,7 @@ | |||
2647 | 614 | if (index >= 0) { | 614 | if (index >= 0) { |
2648 | 615 | TouchState& touchState = mTouchStates.editItemAt(index); | 615 | TouchState& touchState = mTouchStates.editItemAt(index); |
2649 | 616 | rewriteMessage(touchState, msg); | 616 | rewriteMessage(touchState, msg); |
2651 | 617 | touchState.lastResample.idBits.clearBit(msg->body.motion.getActionId()); | 617 | touchState.lastResample.ids.remove(msg->body.motion.getActionId()); |
2652 | 618 | } | 618 | } |
2653 | 619 | break; | 619 | break; |
2654 | 620 | } | 620 | } |
2655 | @@ -644,7 +644,7 @@ | |||
2656 | 644 | void InputConsumer::rewriteMessage(const TouchState& state, InputMessage* msg) { | 644 | void InputConsumer::rewriteMessage(const TouchState& state, InputMessage* msg) { |
2657 | 645 | for (size_t i = 0; i < msg->body.motion.pointerCount; i++) { | 645 | for (size_t i = 0; i < msg->body.motion.pointerCount; i++) { |
2658 | 646 | uint32_t id = msg->body.motion.pointers[i].properties.id; | 646 | uint32_t id = msg->body.motion.pointers[i].properties.id; |
2660 | 647 | if (state.lastResample.idBits.hasBit(id)) { | 647 | if (state.lastResample.ids.contains(id)) { |
2661 | 648 | PointerCoords& msgCoords = msg->body.motion.pointers[i].coords; | 648 | PointerCoords& msgCoords = msg->body.motion.pointers[i].coords; |
2662 | 649 | const PointerCoords& resampleCoords = state.lastResample.getPointerById(id); | 649 | const PointerCoords& resampleCoords = state.lastResample.getPointerById(id); |
2663 | 650 | #if DEBUG_RESAMPLING | 650 | #if DEBUG_RESAMPLING |
2664 | @@ -689,7 +689,7 @@ | |||
2665 | 689 | size_t pointerCount = event->getPointerCount(); | 689 | size_t pointerCount = event->getPointerCount(); |
2666 | 690 | for (size_t i = 0; i < pointerCount; i++) { | 690 | for (size_t i = 0; i < pointerCount; i++) { |
2667 | 691 | uint32_t id = event->getPointerId(i); | 691 | uint32_t id = event->getPointerId(i); |
2669 | 692 | if (!current->idBits.hasBit(id)) { | 692 | if (!current->ids.contains(id)) { |
2670 | 693 | #if DEBUG_RESAMPLING | 693 | #if DEBUG_RESAMPLING |
2671 | 694 | ALOGD("Not resampled, missing id %d", id); | 694 | ALOGD("Not resampled, missing id %d", id); |
2672 | 695 | #endif | 695 | #endif |
2673 | @@ -744,14 +744,14 @@ | |||
2674 | 744 | 744 | ||
2675 | 745 | // Resample touch coordinates. | 745 | // Resample touch coordinates. |
2676 | 746 | touchState.lastResample.eventTime = sampleTime; | 746 | touchState.lastResample.eventTime = sampleTime; |
2678 | 747 | touchState.lastResample.idBits.clear(); | 747 | touchState.lastResample.ids.clear(); |
2679 | 748 | for (size_t i = 0; i < pointerCount; i++) { | 748 | for (size_t i = 0; i < pointerCount; i++) { |
2680 | 749 | uint32_t id = event->getPointerId(i); | 749 | uint32_t id = event->getPointerId(i); |
2681 | 750 | touchState.lastResample.idToIndex[id] = i; | 750 | touchState.lastResample.idToIndex[id] = i; |
2683 | 751 | touchState.lastResample.idBits.markBit(id); | 751 | touchState.lastResample.ids.insert(id); |
2684 | 752 | PointerCoords& resampledCoords = touchState.lastResample.pointers[i]; | 752 | PointerCoords& resampledCoords = touchState.lastResample.pointers[i]; |
2685 | 753 | const PointerCoords& currentCoords = current->getPointerById(id); | 753 | const PointerCoords& currentCoords = current->getPointerById(id); |
2687 | 754 | if (other->idBits.hasBit(id) | 754 | if (other->ids.contains(id) |
2688 | 755 | && shouldResampleTool(event->getToolType(i))) { | 755 | && shouldResampleTool(event->getToolType(i))) { |
2689 | 756 | const PointerCoords& otherCoords = other->getPointerById(id); | 756 | const PointerCoords& otherCoords = other->getPointerById(id); |
2690 | 757 | resampledCoords.copyFrom(currentCoords); | 757 | resampledCoords.copyFrom(currentCoords); |
2691 | 758 | 758 | ||
2692 | === added file '3rd_party/android-input/android/frameworks/base/services/input/IntSet.cpp' | |||
2693 | --- 3rd_party/android-input/android/frameworks/base/services/input/IntSet.cpp 1970-01-01 00:00:00 +0000 | |||
2694 | +++ 3rd_party/android-input/android/frameworks/base/services/input/IntSet.cpp 2013-11-21 20:19:28 +0000 | |||
2695 | @@ -0,0 +1,123 @@ | |||
2696 | 1 | /* | ||
2697 | 2 | * Copyright © 2013 Canonical Ltd. | ||
2698 | 3 | * | ||
2699 | 4 | * This program is free software: you can redistribute it and/or modify it | ||
2700 | 5 | * under the terms of the GNU Lesser General Public License version 3, | ||
2701 | 6 | * as published by the Free Software Foundation. | ||
2702 | 7 | * | ||
2703 | 8 | * This program is distributed in the hope that it will be useful, | ||
2704 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
2705 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
2706 | 11 | * GNU Lesser General Public License for more details. | ||
2707 | 12 | * | ||
2708 | 13 | * You should have received a copy of the GNU Lesser General Public License | ||
2709 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
2710 | 15 | * | ||
2711 | 16 | * Author: Daniel d'Andrada <daniel.dandrada@canonical.com> | ||
2712 | 17 | */ | ||
2713 | 18 | |||
2714 | 19 | #include <androidfw/IntSet.h> | ||
2715 | 20 | |||
2716 | 21 | #ifdef ANDROID_INPUT_INTSET_TEST | ||
2717 | 22 | using namespace test::android; | ||
2718 | 23 | #else | ||
2719 | 24 | using namespace android; | ||
2720 | 25 | #endif | ||
2721 | 26 | |||
2722 | 27 | IntSet::IntSet() { | ||
2723 | 28 | #ifdef ANDROID_INPUT_INTSET_TEST | ||
2724 | 29 | ++constructionCount; | ||
2725 | 30 | #endif | ||
2726 | 31 | } | ||
2727 | 32 | |||
2728 | 33 | IntSet::IntSet(std::initializer_list<int32_t> list) | ||
2729 | 34 | : stdSet(list) { | ||
2730 | 35 | #ifdef ANDROID_INPUT_INTSET_TEST | ||
2731 | 36 | ++constructionCount; | ||
2732 | 37 | #endif | ||
2733 | 38 | } | ||
2734 | 39 | |||
2735 | 40 | IntSet::~IntSet() { | ||
2736 | 41 | #ifdef ANDROID_INPUT_INTSET_TEST | ||
2737 | 42 | ++destructionCount; | ||
2738 | 43 | #endif | ||
2739 | 44 | } | ||
2740 | 45 | |||
2741 | 46 | IntSet IntSet::operator -(const IntSet &other) const { | ||
2742 | 47 | IntSet result; | ||
2743 | 48 | |||
2744 | 49 | std::set_difference(stdSet.cbegin(), stdSet.cend(), | ||
2745 | 50 | other.stdSet.cbegin(), other.stdSet.cend(), | ||
2746 | 51 | std::inserter(result.stdSet, result.stdSet.begin())); | ||
2747 | 52 | |||
2748 | 53 | return result; | ||
2749 | 54 | } | ||
2750 | 55 | |||
2751 | 56 | IntSet IntSet::operator &(const IntSet &other) const { | ||
2752 | 57 | IntSet result; | ||
2753 | 58 | |||
2754 | 59 | std::set_intersection(stdSet.cbegin(), stdSet.cend(), | ||
2755 | 60 | other.stdSet.cbegin(), other.stdSet.cend(), | ||
2756 | 61 | std::inserter(result.stdSet, result.stdSet.begin())); | ||
2757 | 62 | |||
2758 | 63 | return result; | ||
2759 | 64 | } | ||
2760 | 65 | |||
2761 | 66 | bool IntSet::operator ==(const IntSet &other) const { | ||
2762 | 67 | return stdSet == other.stdSet; | ||
2763 | 68 | } | ||
2764 | 69 | |||
2765 | 70 | void IntSet::remove(const IntSet &values) { | ||
2766 | 71 | remove(stdSet.begin(), values.stdSet.begin(), values.stdSet.end()); | ||
2767 | 72 | } | ||
2768 | 73 | |||
2769 | 74 | bool IntSet::contains(int32_t value) const { | ||
2770 | 75 | return stdSet.find(value) != stdSet.end(); | ||
2771 | 76 | } | ||
2772 | 77 | |||
2773 | 78 | size_t IntSet::indexOf(int32_t value) const { | ||
2774 | 79 | auto it = stdSet.begin(); | ||
2775 | 80 | size_t index = 0; | ||
2776 | 81 | while (it != stdSet.end() && *it != value) { | ||
2777 | 82 | it++; | ||
2778 | 83 | ++index; | ||
2779 | 84 | } | ||
2780 | 85 | assert(it != stdSet.end()); | ||
2781 | 86 | return index; | ||
2782 | 87 | } | ||
2783 | 88 | |||
2784 | 89 | std::string IntSet::toString() const { | ||
2785 | 90 | std::ostringstream stream; | ||
2786 | 91 | |||
2787 | 92 | bool isFirst = true; | ||
2788 | 93 | forEach([&](int32_t value) { | ||
2789 | 94 | if (isFirst) { | ||
2790 | 95 | isFirst = false; | ||
2791 | 96 | } else { | ||
2792 | 97 | stream << ", "; | ||
2793 | 98 | } | ||
2794 | 99 | stream << value; | ||
2795 | 100 | }); | ||
2796 | 101 | |||
2797 | 102 | return stream.str(); | ||
2798 | 103 | } | ||
2799 | 104 | |||
2800 | 105 | void IntSet::remove(std::set<int32_t>::iterator selfIterator, | ||
2801 | 106 | std::set<int32_t>::const_iterator otherIterator, | ||
2802 | 107 | std::set<int32_t>::const_iterator otherEnd) { | ||
2803 | 108 | |||
2804 | 109 | if (selfIterator == stdSet.end() || otherIterator == otherEnd) | ||
2805 | 110 | return; | ||
2806 | 111 | |||
2807 | 112 | if (*selfIterator < *otherIterator) { | ||
2808 | 113 | selfIterator++; | ||
2809 | 114 | remove(selfIterator, otherIterator, otherEnd); | ||
2810 | 115 | } else if (*selfIterator == *otherIterator) { | ||
2811 | 116 | selfIterator = stdSet.erase(selfIterator); | ||
2812 | 117 | otherIterator++; | ||
2813 | 118 | remove(selfIterator, otherIterator, otherEnd); | ||
2814 | 119 | } else /* *selfIterator > *otherIterator */ { | ||
2815 | 120 | otherIterator++; | ||
2816 | 121 | remove(selfIterator, otherIterator, otherEnd); | ||
2817 | 122 | } | ||
2818 | 123 | } | ||
2819 | 0 | 124 | ||
2820 | === modified file '3rd_party/android-input/android/frameworks/base/services/input/PointerController.cpp' | |||
2821 | --- 3rd_party/android-input/android/frameworks/base/services/input/PointerController.cpp 2012-11-06 18:05:11 +0000 | |||
2822 | +++ 3rd_party/android-input/android/frameworks/base/services/input/PointerController.cpp 2013-11-21 20:19:28 +0000 | |||
2823 | @@ -167,15 +167,12 @@ | |||
2824 | 167 | } | 167 | } |
2825 | 168 | } | 168 | } |
2826 | 169 | 169 | ||
2829 | 170 | void PointerController::setSpots(const PointerCoords* spotCoords, | 170 | void PointerController::setSpots(const PointerCoords* spotCoords, uint32_t spotCount) { |
2828 | 171 | const uint32_t* spotIdToIndex, BitSet32 spotIdBits) { | ||
2830 | 172 | #if DEBUG_POINTER_UPDATES | 171 | #if DEBUG_POINTER_UPDATES |
2837 | 173 | ALOGD("setSpots: idBits=%08x", spotIdBits.value); | 172 | ALOGD("setSpots: spotCount=%d", spotCount); |
2838 | 174 | for (BitSet32 idBits(spotIdBits); !idBits.isEmpty(); ) { | 173 | for (size_t i = 0; i < spotCount; ++i) { |
2839 | 175 | uint32_t id = idBits.firstMarkedBit(); | 174 | const PointerCoords& c = spotCoords[i]; |
2840 | 176 | idBits.clearBit(id); | 175 | ALOGD(" spot %d: position=(%0.3f, %0.3f), pressure=%0.3f", i, |
2835 | 177 | const PointerCoords& c = spotCoords[spotIdToIndex[id]]; | ||
2836 | 178 | ALOGD(" spot %d: position=(%0.3f, %0.3f), pressure=%0.3f", id, | ||
2841 | 179 | c.getAxisValue(AMOTION_EVENT_AXIS_X), | 176 | c.getAxisValue(AMOTION_EVENT_AXIS_X), |
2842 | 180 | c.getAxisValue(AMOTION_EVENT_AXIS_Y), | 177 | c.getAxisValue(AMOTION_EVENT_AXIS_Y), |
2843 | 181 | c.getAxisValue(AMOTION_EVENT_AXIS_PRESSURE)); | 178 | c.getAxisValue(AMOTION_EVENT_AXIS_PRESSURE)); |
2844 | 182 | 179 | ||
2845 | === modified file '3rd_party/android-input/android/frameworks/base/services/input/PointerController.h' | |||
2846 | --- 3rd_party/android-input/android/frameworks/base/services/input/PointerController.h 2013-05-03 16:38:07 +0000 | |||
2847 | +++ 3rd_party/android-input/android/frameworks/base/services/input/PointerController.h 2013-11-21 20:19:28 +0000 | |||
2848 | @@ -18,7 +18,6 @@ | |||
2849 | 18 | #define _UI_POINTER_CONTROLLER_H | 18 | #define _UI_POINTER_CONTROLLER_H |
2850 | 19 | 19 | ||
2851 | 20 | #include <androidfw/Input.h> | 20 | #include <androidfw/Input.h> |
2852 | 21 | #include <std/BitSet.h> | ||
2853 | 22 | #include <std/Mutex.h> | 21 | #include <std/Mutex.h> |
2854 | 23 | #include <std/RefBase.h> | 22 | #include <std/RefBase.h> |
2855 | 24 | #include <std/String8.h> | 23 | #include <std/String8.h> |
2856 | @@ -104,8 +103,7 @@ | |||
2857 | 104 | * For spotCoords, pressure != 0 indicates that the spot's location is being | 103 | * For spotCoords, pressure != 0 indicates that the spot's location is being |
2858 | 105 | * pressed (not hovering). | 104 | * pressed (not hovering). |
2859 | 106 | */ | 105 | */ |
2862 | 107 | virtual void setSpots(const PointerCoords* spotCoords, const uint32_t* spotIdToIndex, | 106 | virtual void setSpots(const PointerCoords* spotCoords, uint32_t spotCount) = 0; |
2861 | 108 | BitSet32 spotIdBits) = 0; | ||
2863 | 109 | 107 | ||
2864 | 110 | /* Removes all spots. */ | 108 | /* Removes all spots. */ |
2865 | 111 | virtual void clearSpots() = 0; | 109 | virtual void clearSpots() = 0; |
2866 | @@ -139,8 +137,7 @@ | |||
2867 | 139 | virtual void unfade(Transition transition); | 137 | virtual void unfade(Transition transition); |
2868 | 140 | 138 | ||
2869 | 141 | virtual void setPresentation(Presentation presentation); | 139 | virtual void setPresentation(Presentation presentation); |
2872 | 142 | virtual void setSpots(const PointerCoords* spotCoords, | 140 | virtual void setSpots(const PointerCoords* spotCoords, uint32_t spotCount); |
2871 | 143 | const uint32_t* spotIdToIndex, BitSet32 spotIdBits); | ||
2873 | 144 | virtual void clearSpots(); | 141 | virtual void clearSpots(); |
2874 | 145 | 142 | ||
2875 | 146 | void setDisplaySize(int32_t width, int32_t height); | 143 | void setDisplaySize(int32_t width, int32_t height); |
2876 | 147 | 144 | ||
2877 | === modified file '3rd_party/android-input/android/frameworks/base/services/input/VelocityControl.cpp' | |||
2878 | --- 3rd_party/android-input/android/frameworks/base/services/input/VelocityControl.cpp 2013-05-03 16:38:07 +0000 | |||
2879 | +++ 3rd_party/android-input/android/frameworks/base/services/input/VelocityControl.cpp 2013-11-21 20:19:28 +0000 | |||
2880 | @@ -24,7 +24,6 @@ | |||
2881 | 24 | #include <limits.h> | 24 | #include <limits.h> |
2882 | 25 | 25 | ||
2883 | 26 | #include <androidfw/VelocityControl.h> | 26 | #include <androidfw/VelocityControl.h> |
2884 | 27 | #include <std/BitSet.h> | ||
2885 | 28 | #include <std/Timers.h> | 27 | #include <std/Timers.h> |
2886 | 29 | 28 | ||
2887 | 30 | namespace android { | 29 | namespace android { |
2888 | @@ -35,6 +34,7 @@ | |||
2889 | 35 | 34 | ||
2890 | 36 | VelocityControl::VelocityControl() { | 35 | VelocityControl::VelocityControl() { |
2891 | 37 | reset(); | 36 | reset(); |
2892 | 37 | mIds.insert(1); | ||
2893 | 38 | } | 38 | } |
2894 | 39 | 39 | ||
2895 | 40 | void VelocityControl::setParameters(const VelocityControlParameters& parameters) { | 40 | void VelocityControl::setParameters(const VelocityControlParameters& parameters) { |
2896 | @@ -66,7 +66,7 @@ | |||
2897 | 66 | if (deltaY) { | 66 | if (deltaY) { |
2898 | 67 | mRawPosition.y += *deltaY; | 67 | mRawPosition.y += *deltaY; |
2899 | 68 | } | 68 | } |
2901 | 69 | mVelocityTracker.addMovement(eventTime, BitSet32(BitSet32::valueForBit(0)), &mRawPosition); | 69 | mVelocityTracker.addMovement(eventTime, mIds, &mRawPosition); |
2902 | 70 | 70 | ||
2903 | 71 | float vx, vy; | 71 | float vx, vy; |
2904 | 72 | float scale = mParameters.scale; | 72 | float scale = mParameters.scale; |
2905 | 73 | 73 | ||
2906 | === modified file '3rd_party/android-input/android/frameworks/base/services/input/VelocityTracker.cpp' | |||
2907 | --- 3rd_party/android-input/android/frameworks/base/services/input/VelocityTracker.cpp 2013-05-03 16:38:07 +0000 | |||
2908 | +++ 3rd_party/android-input/android/frameworks/base/services/input/VelocityTracker.cpp 2013-11-21 20:19:28 +0000 | |||
2909 | @@ -27,7 +27,7 @@ | |||
2910 | 27 | #include <limits.h> | 27 | #include <limits.h> |
2911 | 28 | 28 | ||
2912 | 29 | #include <androidfw/VelocityTracker.h> | 29 | #include <androidfw/VelocityTracker.h> |
2914 | 30 | #include <std/BitSet.h> | 30 | #include <androidfw/IntSet.h> |
2915 | 31 | #include <std/String8.h> | 31 | #include <std/String8.h> |
2916 | 32 | #include <std/Timers.h> | 32 | #include <std/Timers.h> |
2917 | 33 | #include <std/Log.h> | 33 | #include <std/Log.h> |
2918 | @@ -109,7 +109,7 @@ | |||
2919 | 109 | const char* VelocityTracker::DEFAULT_STRATEGY = "lsq2"; | 109 | const char* VelocityTracker::DEFAULT_STRATEGY = "lsq2"; |
2920 | 110 | 110 | ||
2921 | 111 | VelocityTracker::VelocityTracker(const char* strategy) : | 111 | VelocityTracker::VelocityTracker(const char* strategy) : |
2923 | 112 | mLastEventTime(0), mCurrentPointerIdBits(0), mActivePointerId(-1) { | 112 | mLastEventTime(0), mActivePointerId(-1) { |
2924 | 113 | char value[PROPERTY_VALUE_MAX]; | 113 | char value[PROPERTY_VALUE_MAX]; |
2925 | 114 | 114 | ||
2926 | 115 | // Allow the default strategy to be overridden using a system property for debugging. | 115 | // Allow the default strategy to be overridden using a system property for debugging. |
2927 | @@ -202,29 +202,24 @@ | |||
2928 | 202 | } | 202 | } |
2929 | 203 | 203 | ||
2930 | 204 | void VelocityTracker::clear() { | 204 | void VelocityTracker::clear() { |
2932 | 205 | mCurrentPointerIdBits.clear(); | 205 | mCurrentPointerIds.clear(); |
2933 | 206 | mActivePointerId = -1; | 206 | mActivePointerId = -1; |
2934 | 207 | 207 | ||
2935 | 208 | mStrategy->clear(); | 208 | mStrategy->clear(); |
2936 | 209 | } | 209 | } |
2937 | 210 | 210 | ||
2941 | 211 | void VelocityTracker::clearPointers(BitSet32 idBits) { | 211 | void VelocityTracker::clearPointers(const IntSet &ids) { |
2942 | 212 | BitSet32 remainingIdBits(mCurrentPointerIdBits.value & ~idBits.value); | 212 | mCurrentPointerIds.remove(ids); |
2940 | 213 | mCurrentPointerIdBits = remainingIdBits; | ||
2943 | 214 | 213 | ||
2946 | 215 | if (mActivePointerId >= 0 && idBits.hasBit(mActivePointerId)) { | 214 | if (mActivePointerId >= 0 && ids.contains(mActivePointerId)) { |
2947 | 216 | mActivePointerId = !remainingIdBits.isEmpty() ? remainingIdBits.firstMarkedBit() : -1; | 215 | mActivePointerId = !mCurrentPointerIds.isEmpty() ? mCurrentPointerIds.first() : -1; |
2948 | 217 | } | 216 | } |
2949 | 218 | 217 | ||
2951 | 219 | mStrategy->clearPointers(idBits); | 218 | mStrategy->clearPointers(ids); |
2952 | 220 | } | 219 | } |
2953 | 221 | 220 | ||
2960 | 222 | void VelocityTracker::addMovement(nsecs_t eventTime, BitSet32 idBits, const Position* positions) { | 221 | void VelocityTracker::addMovement(nsecs_t eventTime, const IntSet &ids, const Position* positions) { |
2961 | 223 | while (idBits.count() > MAX_POINTERS) { | 222 | if (!(mCurrentPointerIds & ids).isEmpty() |
2956 | 224 | idBits.clearLastMarkedBit(); | ||
2957 | 225 | } | ||
2958 | 226 | |||
2959 | 227 | if ((mCurrentPointerIdBits.value & idBits.value) | ||
2962 | 228 | && eventTime >= mLastEventTime + ASSUME_POINTER_STOPPED_TIME) { | 223 | && eventTime >= mLastEventTime + ASSUME_POINTER_STOPPED_TIME) { |
2963 | 229 | #if DEBUG_VELOCITY | 224 | #if DEBUG_VELOCITY |
2964 | 230 | ALOGD("VelocityTracker: stopped for %0.3f ms, clearing state.", | 225 | ALOGD("VelocityTracker: stopped for %0.3f ms, clearing state.", |
2965 | @@ -236,20 +231,18 @@ | |||
2966 | 236 | } | 231 | } |
2967 | 237 | mLastEventTime = eventTime; | 232 | mLastEventTime = eventTime; |
2968 | 238 | 233 | ||
2972 | 239 | mCurrentPointerIdBits = idBits; | 234 | mCurrentPointerIds = ids; |
2973 | 240 | if (mActivePointerId < 0 || !idBits.hasBit(mActivePointerId)) { | 235 | if (mActivePointerId < 0 || !ids.contains(mActivePointerId)) { |
2974 | 241 | mActivePointerId = idBits.isEmpty() ? -1 : idBits.firstMarkedBit(); | 236 | mActivePointerId = ids.isEmpty() ? -1 : ids.first(); |
2975 | 242 | } | 237 | } |
2976 | 243 | 238 | ||
2978 | 244 | mStrategy->addMovement(eventTime, idBits, positions); | 239 | mStrategy->addMovement(eventTime, ids, positions); |
2979 | 245 | 240 | ||
2980 | 246 | #if DEBUG_VELOCITY | 241 | #if DEBUG_VELOCITY |
2987 | 247 | ALOGD("VelocityTracker: addMovement eventTime=%lld, idBits=0x%08x, activePointerId=%d", | 242 | ALOGD("VelocityTracker: addMovement eventTime=%lld, ids.cont()=%d, activePointerId=%d", |
2988 | 248 | eventTime, idBits.value, mActivePointerId); | 243 | eventTime, ids.count(), mActivePointerId); |
2989 | 249 | for (BitSet32 iterBits(idBits); !iterBits.isEmpty(); ) { | 244 | size_t index = 0; |
2990 | 250 | uint32_t id = iterBits.firstMarkedBit(); | 245 | ids.forEach([&](int32_t id) { |
2985 | 251 | uint32_t index = idBits.getIndexOfBit(id); | ||
2986 | 252 | iterBits.clearBit(id); | ||
2991 | 253 | Estimator estimator; | 246 | Estimator estimator; |
2992 | 254 | getEstimator(id, &estimator); | 247 | getEstimator(id, &estimator); |
2993 | 255 | ALOGD(" %d: position (%0.3f, %0.3f), " | 248 | ALOGD(" %d: position (%0.3f, %0.3f), " |
2994 | @@ -259,6 +252,7 @@ | |||
2995 | 259 | vectorToString(estimator.xCoeff, estimator.degree + 1).string(), | 252 | vectorToString(estimator.xCoeff, estimator.degree + 1).string(), |
2996 | 260 | vectorToString(estimator.yCoeff, estimator.degree + 1).string(), | 253 | vectorToString(estimator.yCoeff, estimator.degree + 1).string(), |
2997 | 261 | estimator.confidence); | 254 | estimator.confidence); |
2998 | 255 | ++index; | ||
2999 | 262 | } | 256 | } |
3000 | 263 | #endif | 257 | #endif |
3001 | 264 | } | 258 | } |
3002 | @@ -276,9 +270,9 @@ | |||
3003 | 276 | // Start a new movement trace for a pointer that just went down. | 270 | // Start a new movement trace for a pointer that just went down. |
3004 | 277 | // We do this on down instead of on up because the client may want to query the | 271 | // We do this on down instead of on up because the client may want to query the |
3005 | 278 | // final velocity for a pointer that just went up. | 272 | // final velocity for a pointer that just went up. |
3009 | 279 | BitSet32 downIdBits; | 273 | IntSet downIds; |
3010 | 280 | downIdBits.markBit(event->getPointerId(event->getActionIndex())); | 274 | downIds.insert(event->getPointerId(event->getActionIndex())); |
3011 | 281 | clearPointers(downIdBits); | 275 | clearPointers(downIds); |
3012 | 282 | break; | 276 | break; |
3013 | 283 | } | 277 | } |
3014 | 284 | case AMOTION_EVENT_ACTION_MOVE: | 278 | case AMOTION_EVENT_ACTION_MOVE: |
3015 | @@ -301,14 +295,14 @@ | |||
3016 | 301 | pointerCount = MAX_POINTERS; | 295 | pointerCount = MAX_POINTERS; |
3017 | 302 | } | 296 | } |
3018 | 303 | 297 | ||
3020 | 304 | BitSet32 idBits; | 298 | IntSet ids; |
3021 | 305 | for (size_t i = 0; i < pointerCount; i++) { | 299 | for (size_t i = 0; i < pointerCount; i++) { |
3023 | 306 | idBits.markBit(event->getPointerId(i)); | 300 | ids.insert(event->getPointerId(i)); |
3024 | 307 | } | 301 | } |
3025 | 308 | 302 | ||
3026 | 309 | uint32_t pointerIndex[MAX_POINTERS]; | 303 | uint32_t pointerIndex[MAX_POINTERS]; |
3027 | 310 | for (size_t i = 0; i < pointerCount; i++) { | 304 | for (size_t i = 0; i < pointerCount; i++) { |
3029 | 311 | pointerIndex[i] = idBits.getIndexOfBit(event->getPointerId(i)); | 305 | pointerIndex[i] = ids.indexOf(event->getPointerId(i)); |
3030 | 312 | } | 306 | } |
3031 | 313 | 307 | ||
3032 | 314 | nsecs_t eventTime; | 308 | nsecs_t eventTime; |
3033 | @@ -322,7 +316,7 @@ | |||
3034 | 322 | positions[index].x = event->getHistoricalX(i, h); | 316 | positions[index].x = event->getHistoricalX(i, h); |
3035 | 323 | positions[index].y = event->getHistoricalY(i, h); | 317 | positions[index].y = event->getHistoricalY(i, h); |
3036 | 324 | } | 318 | } |
3038 | 325 | addMovement(eventTime, idBits, positions); | 319 | addMovement(eventTime, ids, positions); |
3039 | 326 | } | 320 | } |
3040 | 327 | 321 | ||
3041 | 328 | eventTime = event->getEventTime(); | 322 | eventTime = event->getEventTime(); |
3042 | @@ -331,7 +325,7 @@ | |||
3043 | 331 | positions[index].x = event->getX(i); | 325 | positions[index].x = event->getX(i); |
3044 | 332 | positions[index].y = event->getY(i); | 326 | positions[index].y = event->getY(i); |
3045 | 333 | } | 327 | } |
3047 | 334 | addMovement(eventTime, idBits, positions); | 328 | addMovement(eventTime, ids, positions); |
3048 | 335 | } | 329 | } |
3049 | 336 | 330 | ||
3050 | 337 | bool VelocityTracker::getVelocity(uint32_t id, float* outVx, float* outVy) const { | 331 | bool VelocityTracker::getVelocity(uint32_t id, float* outVx, float* outVy) const { |
3051 | @@ -367,15 +361,14 @@ | |||
3052 | 367 | 361 | ||
3053 | 368 | void LeastSquaresVelocityTrackerStrategy::clear() { | 362 | void LeastSquaresVelocityTrackerStrategy::clear() { |
3054 | 369 | mIndex = 0; | 363 | mIndex = 0; |
3064 | 370 | mMovements[0].idBits.clear(); | 364 | mMovements[0].ids.clear(); |
3065 | 371 | } | 365 | } |
3066 | 372 | 366 | ||
3067 | 373 | void LeastSquaresVelocityTrackerStrategy::clearPointers(BitSet32 idBits) { | 367 | void LeastSquaresVelocityTrackerStrategy::clearPointers(const IntSet &ids) { |
3068 | 374 | BitSet32 remainingIdBits(mMovements[mIndex].idBits.value & ~idBits.value); | 368 | mMovements[mIndex].ids.remove(ids); |
3069 | 375 | mMovements[mIndex].idBits = remainingIdBits; | 369 | } |
3070 | 376 | } | 370 | |
3071 | 377 | 371 | void LeastSquaresVelocityTrackerStrategy::addMovement(nsecs_t eventTime, const IntSet &ids, | |
3063 | 378 | void LeastSquaresVelocityTrackerStrategy::addMovement(nsecs_t eventTime, BitSet32 idBits, | ||
3072 | 379 | const VelocityTracker::Position* positions) { | 372 | const VelocityTracker::Position* positions) { |
3073 | 380 | if (++mIndex == HISTORY_SIZE) { | 373 | if (++mIndex == HISTORY_SIZE) { |
3074 | 381 | mIndex = 0; | 374 | mIndex = 0; |
3075 | @@ -383,9 +376,9 @@ | |||
3076 | 383 | 376 | ||
3077 | 384 | Movement& movement = mMovements[mIndex]; | 377 | Movement& movement = mMovements[mIndex]; |
3078 | 385 | movement.eventTime = eventTime; | 378 | movement.eventTime = eventTime; |
3082 | 386 | movement.idBits = idBits; | 379 | movement.ids = ids; |
3083 | 387 | uint32_t count = idBits.count(); | 380 | size_t count = ids.count(); |
3084 | 388 | for (uint32_t i = 0; i < count; i++) { | 381 | for (size_t i = 0; i < count; i++) { |
3085 | 389 | movement.positions[i] = positions[i]; | 382 | movement.positions[i] = positions[i]; |
3086 | 390 | } | 383 | } |
3087 | 391 | } | 384 | } |
3088 | @@ -570,7 +563,7 @@ | |||
3089 | 570 | const Movement& newestMovement = mMovements[mIndex]; | 563 | const Movement& newestMovement = mMovements[mIndex]; |
3090 | 571 | do { | 564 | do { |
3091 | 572 | const Movement& movement = mMovements[index]; | 565 | const Movement& movement = mMovements[index]; |
3093 | 573 | if (!movement.idBits.hasBit(id)) { | 566 | if (!movement.ids.contains(id)) { |
3094 | 574 | break; | 567 | break; |
3095 | 575 | } | 568 | } |
3096 | 576 | 569 | ||
3097 | @@ -702,36 +695,44 @@ | |||
3098 | 702 | } | 695 | } |
3099 | 703 | 696 | ||
3100 | 704 | void IntegratingVelocityTrackerStrategy::clear() { | 697 | void IntegratingVelocityTrackerStrategy::clear() { |
3109 | 705 | mPointerIdBits.clear(); | 698 | mPointerIds.clear(); |
3110 | 706 | } | 699 | } |
3111 | 707 | 700 | ||
3112 | 708 | void IntegratingVelocityTrackerStrategy::clearPointers(BitSet32 idBits) { | 701 | void IntegratingVelocityTrackerStrategy::clearPointers(const IntSet &ids) { |
3113 | 709 | mPointerIdBits.value &= ~idBits.value; | 702 | mPointerIds.remove(ids); |
3114 | 710 | } | 703 | } |
3115 | 711 | 704 | ||
3116 | 712 | void IntegratingVelocityTrackerStrategy::addMovement(nsecs_t eventTime, BitSet32 idBits, | 705 | void IntegratingVelocityTrackerStrategy::addMovement(nsecs_t eventTime, const IntSet &ids, |
3117 | 713 | const VelocityTracker::Position* positions) { | 706 | const VelocityTracker::Position* positions) { |
3128 | 714 | uint32_t index = 0; | 707 | |
3129 | 715 | for (BitSet32 iterIdBits(idBits); !iterIdBits.isEmpty();) { | 708 | { |
3130 | 716 | uint32_t id = iterIdBits.clearFirstMarkedBit(); | 709 | auto pointerIdsIt = mPointerIds.begin(); |
3131 | 717 | State& state = mPointerState[id]; | 710 | uint32_t index = 0; |
3132 | 718 | const VelocityTracker::Position& position = positions[index++]; | 711 | |
3133 | 719 | if (mPointerIdBits.hasBit(id)) { | 712 | for_each(ids.begin(), ids.end(), [&](int32_t id) { |
3134 | 720 | updateState(state, eventTime, position.x, position.y); | 713 | State& state = mPointerState[id]; |
3135 | 721 | } else { | 714 | const VelocityTracker::Position& position = positions[index++]; |
3136 | 722 | initState(state, eventTime, position.x, position.y); | 715 | |
3137 | 723 | } | 716 | while (*pointerIdsIt < id && pointerIdsIt != mPointerIds.end()) |
3138 | 717 | pointerIdsIt++; | ||
3139 | 718 | |||
3140 | 719 | if (pointerIdsIt != mPointerIds.end() && *pointerIdsIt == id) { | ||
3141 | 720 | updateState(state, eventTime, position.x, position.y); | ||
3142 | 721 | } else { | ||
3143 | 722 | initState(state, eventTime, position.x, position.y); | ||
3144 | 723 | } | ||
3145 | 724 | }); | ||
3146 | 724 | } | 725 | } |
3147 | 725 | 726 | ||
3149 | 726 | mPointerIdBits = idBits; | 727 | mPointerIds = ids; |
3150 | 727 | } | 728 | } |
3151 | 728 | 729 | ||
3152 | 729 | bool IntegratingVelocityTrackerStrategy::getEstimator(uint32_t id, | 730 | bool IntegratingVelocityTrackerStrategy::getEstimator(uint32_t id, |
3153 | 730 | VelocityTracker::Estimator* outEstimator) const { | 731 | VelocityTracker::Estimator* outEstimator) const { |
3154 | 731 | outEstimator->clear(); | 732 | outEstimator->clear(); |
3155 | 732 | 733 | ||
3158 | 733 | if (mPointerIdBits.hasBit(id)) { | 734 | if (mPointerIds.contains(id)) { |
3159 | 734 | const State& state = mPointerState[id]; | 735 | const State& state = mPointerState.at(id); |
3160 | 735 | populateEstimator(state, outEstimator); | 736 | populateEstimator(state, outEstimator); |
3161 | 736 | return true; | 737 | return true; |
3162 | 737 | } | 738 | } |
3163 | @@ -823,15 +824,14 @@ | |||
3164 | 823 | 824 | ||
3165 | 824 | void LegacyVelocityTrackerStrategy::clear() { | 825 | void LegacyVelocityTrackerStrategy::clear() { |
3166 | 825 | mIndex = 0; | 826 | mIndex = 0; |
3176 | 826 | mMovements[0].idBits.clear(); | 827 | mMovements[0].ids.clear(); |
3177 | 827 | } | 828 | } |
3178 | 828 | 829 | ||
3179 | 829 | void LegacyVelocityTrackerStrategy::clearPointers(BitSet32 idBits) { | 830 | void LegacyVelocityTrackerStrategy::clearPointers(const IntSet &ids) { |
3180 | 830 | BitSet32 remainingIdBits(mMovements[mIndex].idBits.value & ~idBits.value); | 831 | mMovements[mIndex].ids.remove(ids); |
3181 | 831 | mMovements[mIndex].idBits = remainingIdBits; | 832 | } |
3182 | 832 | } | 833 | |
3183 | 833 | 834 | void LegacyVelocityTrackerStrategy::addMovement(nsecs_t eventTime, const IntSet &ids, | |
3175 | 834 | void LegacyVelocityTrackerStrategy::addMovement(nsecs_t eventTime, BitSet32 idBits, | ||
3184 | 835 | const VelocityTracker::Position* positions) { | 835 | const VelocityTracker::Position* positions) { |
3185 | 836 | if (++mIndex == HISTORY_SIZE) { | 836 | if (++mIndex == HISTORY_SIZE) { |
3186 | 837 | mIndex = 0; | 837 | mIndex = 0; |
3187 | @@ -839,11 +839,8 @@ | |||
3188 | 839 | 839 | ||
3189 | 840 | Movement& movement = mMovements[mIndex]; | 840 | Movement& movement = mMovements[mIndex]; |
3190 | 841 | movement.eventTime = eventTime; | 841 | movement.eventTime = eventTime; |
3196 | 842 | movement.idBits = idBits; | 842 | movement.ids = ids; |
3197 | 843 | uint32_t count = idBits.count(); | 843 | memcpy(movement.positions, positions, sizeof(VelocityTracker::Position) * ids.count()); |
3193 | 844 | for (uint32_t i = 0; i < count; i++) { | ||
3194 | 845 | movement.positions[i] = positions[i]; | ||
3195 | 846 | } | ||
3198 | 847 | } | 844 | } |
3199 | 848 | 845 | ||
3200 | 849 | bool LegacyVelocityTrackerStrategy::getEstimator(uint32_t id, | 846 | bool LegacyVelocityTrackerStrategy::getEstimator(uint32_t id, |
3201 | @@ -851,7 +848,7 @@ | |||
3202 | 851 | outEstimator->clear(); | 848 | outEstimator->clear(); |
3203 | 852 | 849 | ||
3204 | 853 | const Movement& newestMovement = mMovements[mIndex]; | 850 | const Movement& newestMovement = mMovements[mIndex]; |
3206 | 854 | if (!newestMovement.idBits.hasBit(id)) { | 851 | if (!newestMovement.ids.contains(id)) { |
3207 | 855 | return false; // no data | 852 | return false; // no data |
3208 | 856 | } | 853 | } |
3209 | 857 | 854 | ||
3210 | @@ -862,7 +859,7 @@ | |||
3211 | 862 | do { | 859 | do { |
3212 | 863 | uint32_t nextOldestIndex = (oldestIndex == 0 ? HISTORY_SIZE : oldestIndex) - 1; | 860 | uint32_t nextOldestIndex = (oldestIndex == 0 ? HISTORY_SIZE : oldestIndex) - 1; |
3213 | 864 | const Movement& nextOldestMovement = mMovements[nextOldestIndex]; | 861 | const Movement& nextOldestMovement = mMovements[nextOldestIndex]; |
3215 | 865 | if (!nextOldestMovement.idBits.hasBit(id) | 862 | if (!nextOldestMovement.ids.contains(id) |
3216 | 866 | || nextOldestMovement.eventTime < minTime) { | 863 | || nextOldestMovement.eventTime < minTime) { |
3217 | 867 | break; | 864 | break; |
3218 | 868 | } | 865 | } |
3219 | 869 | 866 | ||
3220 | === modified file 'debian/changelog' | |||
3221 | --- debian/changelog 2013-11-20 07:36:15 +0000 | |||
3222 | +++ debian/changelog 2013-11-21 20:19:28 +0000 | |||
3223 | @@ -1,3 +1,4 @@ | |||
3224 | 1 | <<<<<<< TREE | ||
3225 | 1 | mir (0.1.1+14.04.20131120-0ubuntu1) trusty; urgency=low | 2 | mir (0.1.1+14.04.20131120-0ubuntu1) trusty; urgency=low |
3226 | 2 | 3 | ||
3227 | 3 | [ Daniel van Vugt ] | 4 | [ Daniel van Vugt ] |
3228 | @@ -75,7 +76,36 @@ | |||
3229 | 75 | mir (0.1.0+14.04.20131028-0ubuntu1) trusty; urgency=low | 76 | mir (0.1.0+14.04.20131028-0ubuntu1) trusty; urgency=low |
3230 | 76 | 77 | ||
3231 | 77 | [ Daniel van Vugt ] | 78 | [ Daniel van Vugt ] |
3232 | 79 | ======= | ||
3233 | 80 | mir (0.1.1-0ubuntu1) UNRELEASED; urgency=low | ||
3234 | 81 | |||
3235 | 82 | * Bump version to 0.1.1 | ||
3236 | 83 | |||
3237 | 84 | -- Daniel van Vugt <daniel.van.vugt@canonical.com> Wed, 30 Oct 2013 11:46:13 +0800 | ||
3238 | 85 | |||
3239 | 86 | mir (0.1.0+14.04.20131030-0ubuntu1) trusty; urgency=low | ||
3240 | 87 | |||
3241 | 88 | [ Ubuntu daily release ] | ||
3242 | 89 | * New rebuild forced | ||
3243 | 90 | |||
3244 | 91 | [ Alan Griffiths ] | ||
3245 | 92 | * client: Remove the timeout for detecting server crashes There are | ||
3246 | 93 | valid cases when the server blocks for an indeterminate amount of | ||
3247 | 94 | time during a client request, like when a next_buffer request blocks | ||
3248 | 95 | because a surface is not visible or the server is paused. In such | ||
3249 | 96 | cases, the timeout mechanism we used to detect server crashes caused | ||
3250 | 97 | the clients to fail. Furthermore, the clients seem able to detect | ||
3251 | 98 | server crashes without the timeout, rendering it needless anyway. | ||
3252 | 99 | (LP: #1245958) | ||
3253 | 100 | |||
3254 | 101 | -- Ubuntu daily release <ps-jenkins@lists.canonical.com> Wed, 30 Oct 2013 18:37:21 +0000 | ||
3255 | 102 | |||
3256 | 103 | mir (0.1.0+14.04.20131028-0ubuntu1) trusty; urgency=low | ||
3257 | 104 | |||
3258 | 105 | [ Daniel van Vugt ] | ||
3259 | 106 | >>>>>>> MERGE-SOURCE | ||
3260 | 78 | * Bump version 0.1.0 | 107 | * Bump version 0.1.0 |
3261 | 108 | <<<<<<< TREE | ||
3262 | 79 | * Add method for testing if Rectangle::contains(Rectangle), which is | 109 | * Add method for testing if Rectangle::contains(Rectangle), which is |
3263 | 80 | the basis of any occlusion detection. (LP: #1227739) | 110 | the basis of any occlusion detection. (LP: #1227739) |
3264 | 81 | * Add support for traversing the Scene from front surface to back. | 111 | * Add support for traversing the Scene from front surface to back. |
3265 | @@ -174,6 +204,106 @@ | |||
3266 | 174 | * Automatic snapshot from revision 1161 | 204 | * Automatic snapshot from revision 1161 |
3267 | 175 | 205 | ||
3268 | 176 | -- Ubuntu daily release <ps-jenkins@lists.canonical.com> Mon, 28 Oct 2013 02:04:31 +0000 | 206 | -- Ubuntu daily release <ps-jenkins@lists.canonical.com> Mon, 28 Oct 2013 02:04:31 +0000 |
3269 | 207 | ======= | ||
3270 | 208 | * Add method for testing if Rectangle::contains(Rectangle), which is | ||
3271 | 209 | the basis of any occlusion detection. (LP: #1227739) | ||
3272 | 210 | * Add support for traversing the Scene from front surface to back. | ||
3273 | 211 | This is required for occlusion detection at least (coming soon). . | ||
3274 | 212 | (LP: #1227739) | ||
3275 | 213 | * Optimization: Turn off blending for surfaces that are not blendable. | ||
3276 | 214 | On some systems this can have a noticeable performance benefit. | ||
3277 | 215 | * Avoid rendering surfaces that are fully hidden by other surfaces. | ||
3278 | 216 | This is particularly important for mobile device performance. (LP: | ||
3279 | 217 | #1227739) . (LP: #1227739) | ||
3280 | 218 | * Remove orphaned tags, which appear to have come from the Compiz | ||
3281 | 219 | project (!?) Add tags for the most recent releases up to 0.0.16. No | ||
3282 | 220 | files changed, only tags. | ||
3283 | 221 | * Fix significant performance issues LP: #1241369 / LP: #1241371, and | ||
3284 | 222 | probably more(!) Added regression test to catch such regressions and | ||
3285 | 223 | revert the offending commit r1049. (LP: #1241369, #1241371) | ||
3286 | 224 | |||
3287 | 225 | [ Brandon Schaefer ] | ||
3288 | 226 | * When Scroll events come in we don't keep around the android vscroll | ||
3289 | 227 | hscroll data. Store it now. (LP: #1233089) | ||
3290 | 228 | |||
3291 | 229 | [ Albert Astals ] | ||
3292 | 230 | * Fix mismatched free() / delete / delete [] reported by valgrind | ||
3293 | 231 | |||
3294 | 232 | [ Alexandros Frantzis ] | ||
3295 | 233 | * server: Extend server status (formerly pause/resume) listener to | ||
3296 | 234 | report "started" events This change is needed by users of | ||
3297 | 235 | libmirserver, so they can properly synchronize external interactions | ||
3298 | 236 | with the server. (LP: #1239876) | ||
3299 | 237 | * graphics,examples: Don't enable more outputs than supported when | ||
3300 | 238 | changing the display configuration. (LP: #1217877) | ||
3301 | 239 | * client: Allow clients to call API functions after a connection break | ||
3302 | 240 | has been detected When a client tries to call an API function after | ||
3303 | 241 | a connection break has been detected in a previous API call, the | ||
3304 | 242 | client blocks in the new call. This happens because in | ||
3305 | 243 | MirSocketRpcChannel::notify_disconnected() the pending RPC calls are | ||
3306 | 244 | not forced to complete, since the channel has already been marked as | ||
3307 | 245 | 'disconnected' by the failure in the previous call. Note that if the | ||
3308 | 246 | break is first detected while calling an API function, then that | ||
3309 | 247 | call doesn't block, since this is the first time we call | ||
3310 | 248 | MirSocketRpcChannel::notify_disconnected() and the pending RPC calls | ||
3311 | 249 | are forced to complete. This commit solves this problem by always | ||
3312 | 250 | forcing requests to complete when a communication failure occurs, | ||
3313 | 251 | even if a disconnection has already been handled. This is preferred | ||
3314 | 252 | over the alternative of manually calling the completion callback in | ||
3315 | 253 | a try-catch block when calling an RPC method because of: 1. | ||
3316 | 254 | Correctness: In case the communication problem first occurs in that | ||
3317 | 255 | call, the callback will be called twice, once by | ||
3318 | 256 | notify_disconnected() and once manually. 2. Consistency: The | ||
3319 | 257 | callback is called from one place regardless of whether the | ||
3320 | 258 | communication problem is first detected during that call or not. | ||
3321 | 259 | (LP: #1201436) | ||
3322 | 260 | * graphics: Improve signature of native platform initialization method | ||
3323 | 261 | Use an interface to provide the functionality needed by native | ||
3324 | 262 | platforms. | ||
3325 | 263 | |||
3326 | 264 | [ Eleni Maria Stea ] | ||
3327 | 265 | * Test GBMBufferAllocatorTest.bypass_disables_via_environment | ||
3328 | 266 | overrides the MIR_BYPASS env variable, causing other tests that use | ||
3329 | 267 | the MIR_BYPASS to fail when we run the unit-tests with -- | ||
3330 | 268 | gtest_repeat=N, N>1. Set back the MIR_BYPASS env. var. (LP: | ||
3331 | 269 | #1238000) | ||
3332 | 270 | |||
3333 | 271 | [ Kevin DuBois ] | ||
3334 | 272 | * fix: lp 1239577 TestClientIPCRender (an android-only gfx driver | ||
3335 | 273 | test) was hanging due to changes in signal handling. refactor the | ||
3336 | 274 | test, changing the cross-process sync mechanism so it doesn't use | ||
3337 | 275 | sigcont. (LP: #1239577) | ||
3338 | 276 | * graphics: android: eliminate one of the two DisplayBuffers. both | ||
3339 | 277 | hwc/gpu displays use the same displaybuffer now. . | ||
3340 | 278 | |||
3341 | 279 | [ Daniel d'Andrada ] | ||
3342 | 280 | * Add InputReader performance test. | ||
3343 | 281 | |||
3344 | 282 | [ Alan Griffiths ] | ||
3345 | 283 | * logging: correct component tag in connector report. | ||
3346 | 284 | * client: fix hang(s) in client API when server dies. (LP: #1227743) | ||
3347 | 285 | * Fix failing acceptance-test: | ||
3348 | 286 | ServerShutdown/OnSignal.removes_endpoint_on_signal (LP: #1237710) | ||
3349 | 287 | Avoid fatal_signal_cleanup getting caught in a loop restoring itself | ||
3350 | 288 | and then re-entering itself. This could happen in some permutations | ||
3351 | 289 | of acceptance-tests where run_mir is entered with | ||
3352 | 290 | fatal_signal_cleanup already set up from previous tests' server | ||
3353 | 291 | instances. (LP: #1237710) | ||
3354 | 292 | * CMake: remove creation of link to non-existent file. | ||
3355 | 293 | * shared: some utility functions to provide some consistent ways to | ||
3356 | 294 | use RAII and application of these functions to some code that has | ||
3357 | 295 | had RAII related discussions recently. | ||
3358 | 296 | * config: separate out the configuration options from the | ||
3359 | 297 | configuration builder. | ||
3360 | 298 | * config: ensure USC can access | ||
3361 | 299 | DefaultConfigurationOptions::parse_options (LP: #1244192) (LP: | ||
3362 | 300 | #1244192) | ||
3363 | 301 | |||
3364 | 302 | [ Ubuntu daily release ] | ||
3365 | 303 | * Automatic snapshot from revision 1160 | ||
3366 | 304 | |||
3367 | 305 | -- Ubuntu daily release <ps-jenkins@lists.canonical.com> Mon, 28 Oct 2013 02:04:31 +0000 | ||
3368 | 306 | >>>>>>> MERGE-SOURCE | ||
3369 | 177 | 307 | ||
3370 | 178 | mir (0.0.15+13.10.20131014-0ubuntu2) trusty; urgency=low | 308 | mir (0.0.15+13.10.20131014-0ubuntu2) trusty; urgency=low |
3371 | 179 | 309 | ||
3372 | 180 | 310 | ||
3373 | === modified file 'debian/control' | |||
3374 | --- debian/control 2013-11-06 03:17:35 +0000 | |||
3375 | +++ debian/control 2013-11-21 20:19:28 +0000 | |||
3376 | @@ -69,7 +69,11 @@ | |||
3377 | 69 | . | 69 | . |
3378 | 70 | Contains the protocol's definition files. | 70 | Contains the protocol's definition files. |
3379 | 71 | 71 | ||
3380 | 72 | <<<<<<< TREE | ||
3381 | 72 | Package: libmirserver10 | 73 | Package: libmirserver10 |
3382 | 74 | ======= | ||
3383 | 75 | Package: libmirserver11 | ||
3384 | 76 | >>>>>>> MERGE-SOURCE | ||
3385 | 73 | Section: libs | 77 | Section: libs |
3386 | 74 | Architecture: i386 amd64 armhf arm64 | 78 | Architecture: i386 amd64 armhf arm64 |
3387 | 75 | Multi-Arch: same | 79 | Multi-Arch: same |
3388 | @@ -115,7 +119,11 @@ | |||
3389 | 115 | Architecture: i386 amd64 armhf arm64 | 119 | Architecture: i386 amd64 armhf arm64 |
3390 | 116 | Multi-Arch: same | 120 | Multi-Arch: same |
3391 | 117 | Pre-Depends: ${misc:Pre-Depends} | 121 | Pre-Depends: ${misc:Pre-Depends} |
3392 | 122 | <<<<<<< TREE | ||
3393 | 118 | Depends: libmirserver10 (= ${binary:Version}), | 123 | Depends: libmirserver10 (= ${binary:Version}), |
3394 | 124 | ======= | ||
3395 | 125 | Depends: libmirserver11 (= ${binary:Version}), | ||
3396 | 126 | >>>>>>> MERGE-SOURCE | ||
3397 | 119 | libmirprotobuf-dev (= ${binary:Version}), | 127 | libmirprotobuf-dev (= ${binary:Version}), |
3398 | 120 | mircommon-dev (= ${binary:Version}), | 128 | mircommon-dev (= ${binary:Version}), |
3399 | 121 | libglm-dev, | 129 | libglm-dev, |
3400 | 122 | 130 | ||
3401 | === renamed file 'debian/libmirserver10.install' => 'debian/libmirserver11.install' | |||
3402 | --- debian/libmirserver10.install 2013-11-06 03:17:35 +0000 | |||
3403 | +++ debian/libmirserver11.install 2013-11-21 20:19:28 +0000 | |||
3404 | @@ -1,1 +1,5 @@ | |||
3405 | 1 | <<<<<<< TREE | ||
3406 | 1 | usr/lib/*/libmirserver.so.10 | 2 | usr/lib/*/libmirserver.so.10 |
3407 | 3 | ======= | ||
3408 | 4 | usr/lib/*/libmirserver.so.11 | ||
3409 | 5 | >>>>>>> MERGE-SOURCE | ||
3410 | 2 | 6 | ||
3411 | === modified file 'doc/Doxyfile.in' | |||
3412 | --- doc/Doxyfile.in 2013-07-02 11:27:33 +0000 | |||
3413 | +++ doc/Doxyfile.in 2013-11-21 20:19:28 +0000 | |||
3414 | @@ -1,14 +1,16 @@ | |||
3416 | 1 | # Doxyfile 1.8.1.2 | 1 | # Doxyfile 1.8.4 |
3417 | 2 | 2 | ||
3418 | 3 | # This file describes the settings to be used by the documentation system | 3 | # This file describes the settings to be used by the documentation system |
3420 | 4 | # doxygen (www.doxygen.org) for a project | 4 | # doxygen (www.doxygen.org) for a project. |
3421 | 5 | # | 5 | # |
3423 | 6 | # All text after a hash (#) is considered a comment and will be ignored | 6 | # All text after a double hash (##) is considered a comment and is placed |
3424 | 7 | # in front of the TAG it is preceding . | ||
3425 | 8 | # All text after a hash (#) is considered a comment and will be ignored. | ||
3426 | 7 | # The format is: | 9 | # The format is: |
3427 | 8 | # TAG = value [value, ...] | 10 | # TAG = value [value, ...] |
3428 | 9 | # For lists items can also be appended using: | 11 | # For lists items can also be appended using: |
3429 | 10 | # TAG += value [value, ...] | 12 | # TAG += value [value, ...] |
3431 | 11 | # Values that contain spaces should be placed between quotes (" ") | 13 | # Values that contain spaces should be placed between quotes (" "). |
3432 | 12 | 14 | ||
3433 | 13 | #--------------------------------------------------------------------------- | 15 | #--------------------------------------------------------------------------- |
3434 | 14 | # Project related configuration options | 16 | # Project related configuration options |
3435 | @@ -70,9 +72,9 @@ | |||
3436 | 70 | # Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, | 72 | # Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, |
3437 | 71 | # Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, | 73 | # Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, |
3438 | 72 | # Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English | 74 | # Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English |
3442 | 73 | # messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, | 75 | # messages), Korean, Korean-en, Latvian, Lithuanian, Norwegian, Macedonian, |
3443 | 74 | # Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak, | 76 | # Persian, Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrillic, |
3444 | 75 | # Slovene, Spanish, Swedish, Ukrainian, and Vietnamese. | 77 | # Slovak, Slovene, Spanish, Swedish, Ukrainian, and Vietnamese. |
3445 | 76 | 78 | ||
3446 | 77 | OUTPUT_LANGUAGE = English | 79 | OUTPUT_LANGUAGE = English |
3447 | 78 | 80 | ||
3448 | @@ -136,7 +138,9 @@ | |||
3449 | 136 | # only done if one of the specified strings matches the left-hand part of | 138 | # only done if one of the specified strings matches the left-hand part of |
3450 | 137 | # the path. The tag can be used to show relative paths in the file list. | 139 | # the path. The tag can be used to show relative paths in the file list. |
3451 | 138 | # If left blank the directory from which doxygen is run is used as the | 140 | # If left blank the directory from which doxygen is run is used as the |
3453 | 139 | # path to strip. | 141 | # path to strip. Note that you specify absolute paths here, but also |
3454 | 142 | # relative paths, which will be relative from the directory where doxygen is | ||
3455 | 143 | # started. | ||
3456 | 140 | 144 | ||
3457 | 141 | STRIP_FROM_PATH = @CMAKE_CURRENT_SOURCE_DIR@ | 145 | STRIP_FROM_PATH = @CMAKE_CURRENT_SOURCE_DIR@ |
3458 | 142 | 146 | ||
3459 | @@ -239,14 +243,15 @@ | |||
3460 | 239 | OPTIMIZE_OUTPUT_VHDL = NO | 243 | OPTIMIZE_OUTPUT_VHDL = NO |
3461 | 240 | 244 | ||
3462 | 241 | # Doxygen selects the parser to use depending on the extension of the files it | 245 | # Doxygen selects the parser to use depending on the extension of the files it |
3471 | 242 | # parses. With this tag you can assign which parser to use for a given extension. | 246 | # parses. With this tag you can assign which parser to use for a given |
3472 | 243 | # Doxygen has a built-in mapping, but you can override or extend it using this | 247 | # extension. Doxygen has a built-in mapping, but you can override or extend it |
3473 | 244 | # tag. The format is ext=language, where ext is a file extension, and language | 248 | # using this tag. The format is ext=language, where ext is a file extension, |
3474 | 245 | # is one of the parsers supported by doxygen: IDL, Java, Javascript, CSharp, C, | 249 | # and language is one of the parsers supported by doxygen: IDL, Java, |
3475 | 246 | # C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, C++. For instance to make | 250 | # Javascript, CSharp, C, C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, |
3476 | 247 | # doxygen treat .inc files as Fortran files (default is PHP), and .f files as C | 251 | # C++. For instance to make doxygen treat .inc files as Fortran files (default |
3477 | 248 | # (default is Fortran), use: inc=Fortran f=C. Note that for custom extensions | 252 | # is PHP), and .f files as C (default is Fortran), use: inc=Fortran f=C. Note |
3478 | 249 | # you also need to set FILE_PATTERNS otherwise the files are not read by doxygen. | 253 | # that for custom extensions you also need to set FILE_PATTERNS otherwise the |
3479 | 254 | # files are not read by doxygen. | ||
3480 | 250 | 255 | ||
3481 | 251 | EXTENSION_MAPPING = | 256 | EXTENSION_MAPPING = |
3482 | 252 | 257 | ||
3483 | @@ -259,6 +264,13 @@ | |||
3484 | 259 | 264 | ||
3485 | 260 | MARKDOWN_SUPPORT = YES | 265 | MARKDOWN_SUPPORT = YES |
3486 | 261 | 266 | ||
3487 | 267 | # When enabled doxygen tries to link words that correspond to documented | ||
3488 | 268 | # classes, or namespaces to their corresponding documentation. Such a link can | ||
3489 | 269 | # be prevented in individual cases by by putting a % sign in front of the word | ||
3490 | 270 | # or globally by setting AUTOLINK_SUPPORT to NO. | ||
3491 | 271 | |||
3492 | 272 | AUTOLINK_SUPPORT = YES | ||
3493 | 273 | |||
3494 | 262 | # If you use STL classes (i.e. std::string, std::vector, etc.) but do not want | 274 | # If you use STL classes (i.e. std::string, std::vector, etc.) but do not want |
3495 | 263 | # to include (a tag file for) the STL sources as input, then you should | 275 | # to include (a tag file for) the STL sources as input, then you should |
3496 | 264 | # set this tag to YES in order to let doxygen match functions declarations and | 276 | # set this tag to YES in order to let doxygen match functions declarations and |
3497 | @@ -279,10 +291,10 @@ | |||
3498 | 279 | 291 | ||
3499 | 280 | SIP_SUPPORT = NO | 292 | SIP_SUPPORT = NO |
3500 | 281 | 293 | ||
3505 | 282 | # For Microsoft's IDL there are propget and propput attributes to indicate getter | 294 | # For Microsoft's IDL there are propget and propput attributes to indicate |
3506 | 283 | # and setter methods for a property. Setting this option to YES (the default) | 295 | # getter and setter methods for a property. Setting this option to YES (the |
3507 | 284 | # will make doxygen replace the get and set methods by a property in the | 296 | # default) will make doxygen replace the get and set methods by a property in |
3508 | 285 | # documentation. This will only work if the methods are indeed getting or | 297 | # the documentation. This will only work if the methods are indeed getting or |
3509 | 286 | # setting a simple type. If this is not the case, or you want to show the | 298 | # setting a simple type. If this is not the case, or you want to show the |
3510 | 287 | # methods anyway, you should set this option to NO. | 299 | # methods anyway, you should set this option to NO. |
3511 | 288 | 300 | ||
3512 | @@ -311,11 +323,11 @@ | |||
3513 | 311 | INLINE_GROUPED_CLASSES = NO | 323 | INLINE_GROUPED_CLASSES = NO |
3514 | 312 | 324 | ||
3515 | 313 | # When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and | 325 | # When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and |
3521 | 314 | # unions with only public data fields will be shown inline in the documentation | 326 | # unions with only public data fields or simple typedef fields will be shown |
3522 | 315 | # of the scope in which they are defined (i.e. file, namespace, or group | 327 | # inline in the documentation of the scope in which they are defined (i.e. file, |
3523 | 316 | # documentation), provided this scope is documented. If set to NO (the default), | 328 | # namespace, or group documentation), provided this scope is documented. If set |
3524 | 317 | # structs, classes, and unions are shown on a separate page (for HTML and Man | 329 | # to NO (the default), structs, classes, and unions are shown on a separate |
3525 | 318 | # pages) or section (for LaTeX and RTF). | 330 | # page (for HTML and Man pages) or section (for LaTeX and RTF). |
3526 | 319 | 331 | ||
3527 | 320 | INLINE_SIMPLE_STRUCTS = NO | 332 | INLINE_SIMPLE_STRUCTS = NO |
3528 | 321 | 333 | ||
3529 | @@ -329,30 +341,14 @@ | |||
3530 | 329 | 341 | ||
3531 | 330 | TYPEDEF_HIDES_STRUCT = NO | 342 | TYPEDEF_HIDES_STRUCT = NO |
3532 | 331 | 343 | ||
3557 | 332 | # The SYMBOL_CACHE_SIZE determines the size of the internal cache use to | 344 | # The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This |
3558 | 333 | # determine which symbols to keep in memory and which to flush to disk. | 345 | # cache is used to resolve symbols given their name and scope. Since this can |
3559 | 334 | # When the cache is full, less often used symbols will be written to disk. | 346 | # be an expensive process and often the same symbol appear multiple times in |
3560 | 335 | # For small to medium size projects (<1000 input files) the default value is | 347 | # the code, doxygen keeps a cache of pre-resolved symbols. If the cache is too |
3561 | 336 | # probably good enough. For larger projects a too small cache size can cause | 348 | # small doxygen will become slower. If the cache is too large, memory is wasted. |
3562 | 337 | # doxygen to be busy swapping symbols to and from disk most of the time | 349 | # The cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid |
3563 | 338 | # causing a significant performance penalty. | 350 | # range is 0..9, the default is 0, corresponding to a cache size of 2^16 = 65536 |
3564 | 339 | # If the system has enough physical memory increasing the cache will improve the | 351 | # symbols. |
3541 | 340 | # performance by keeping more symbols in memory. Note that the value works on | ||
3542 | 341 | # a logarithmic scale so increasing the size by one will roughly double the | ||
3543 | 342 | # memory usage. The cache size is given by this formula: | ||
3544 | 343 | # 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, | ||
3545 | 344 | # corresponding to a cache size of 2^16 = 65536 symbols. | ||
3546 | 345 | |||
3547 | 346 | SYMBOL_CACHE_SIZE = 0 | ||
3548 | 347 | |||
3549 | 348 | # Similar to the SYMBOL_CACHE_SIZE the size of the symbol lookup cache can be | ||
3550 | 349 | # set using LOOKUP_CACHE_SIZE. This cache is used to resolve symbols given | ||
3551 | 350 | # their name and scope. Since this can be an expensive process and often the | ||
3552 | 351 | # same symbol appear multiple times in the code, doxygen keeps a cache of | ||
3553 | 352 | # pre-resolved symbols. If the cache is too small doxygen will become slower. | ||
3554 | 353 | # If the cache is too large, memory is wasted. The cache size is given by this | ||
3555 | 354 | # formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range is 0..9, the default is 0, | ||
3556 | 355 | # corresponding to a cache size of 2^16 = 65536 symbols. | ||
3565 | 356 | 352 | ||
3566 | 357 | LOOKUP_CACHE_SIZE = 0 | 353 | LOOKUP_CACHE_SIZE = 0 |
3567 | 358 | 354 | ||
3568 | @@ -363,7 +359,7 @@ | |||
3569 | 363 | # If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in | 359 | # If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in |
3570 | 364 | # documentation are documented, even if no documentation was available. | 360 | # documentation are documented, even if no documentation was available. |
3571 | 365 | # Private class members and static file members will be hidden unless | 361 | # Private class members and static file members will be hidden unless |
3573 | 366 | # the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES | 362 | # the EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES |
3574 | 367 | 363 | ||
3575 | 368 | EXTRACT_ALL = YES | 364 | EXTRACT_ALL = YES |
3576 | 369 | 365 | ||
3577 | @@ -544,7 +540,8 @@ | |||
3578 | 544 | GENERATE_DEPRECATEDLIST= YES | 540 | GENERATE_DEPRECATEDLIST= YES |
3579 | 545 | 541 | ||
3580 | 546 | # The ENABLED_SECTIONS tag can be used to enable conditional | 542 | # The ENABLED_SECTIONS tag can be used to enable conditional |
3582 | 547 | # documentation sections, marked by \if sectionname ... \endif. | 543 | # documentation sections, marked by \if section-label ... \endif |
3583 | 544 | # and \cond section-label ... \endcond blocks. | ||
3584 | 548 | 545 | ||
3585 | 549 | ENABLED_SECTIONS = | 546 | ENABLED_SECTIONS = |
3586 | 550 | 547 | ||
3587 | @@ -571,7 +568,8 @@ | |||
3588 | 571 | SHOW_FILES = YES | 568 | SHOW_FILES = YES |
3589 | 572 | 569 | ||
3590 | 573 | # Set the SHOW_NAMESPACES tag to NO to disable the generation of the | 570 | # Set the SHOW_NAMESPACES tag to NO to disable the generation of the |
3592 | 574 | # Namespaces page. This will remove the Namespaces entry from the Quick Index | 571 | # Namespaces page. |
3593 | 572 | # This will remove the Namespaces entry from the Quick Index | ||
3594 | 575 | # and from the Folder Tree View (if specified). The default is YES. | 573 | # and from the Folder Tree View (if specified). The default is YES. |
3595 | 576 | 574 | ||
3596 | 577 | SHOW_NAMESPACES = YES | 575 | SHOW_NAMESPACES = YES |
3597 | @@ -601,7 +599,8 @@ | |||
3598 | 601 | # requires the bibtex tool to be installed. See also | 599 | # requires the bibtex tool to be installed. See also |
3599 | 602 | # http://en.wikipedia.org/wiki/BibTeX for more info. For LaTeX the style | 600 | # http://en.wikipedia.org/wiki/BibTeX for more info. For LaTeX the style |
3600 | 603 | # of the bibliography can be controlled using LATEX_BIB_STYLE. To use this | 601 | # of the bibliography can be controlled using LATEX_BIB_STYLE. To use this |
3602 | 604 | # feature you need bibtex and perl available in the search path. | 602 | # feature you need bibtex and perl available in the search path. Do not use |
3603 | 603 | # file names with spaces, bibtex cannot handle them. | ||
3604 | 605 | 604 | ||
3605 | 606 | CITE_BIB_FILES = | 605 | CITE_BIB_FILES = |
3606 | 607 | 606 | ||
3607 | @@ -757,7 +756,11 @@ | |||
3608 | 757 | # wildcard * is used, a substring. Examples: ANamespace, AClass, | 756 | # wildcard * is used, a substring. Examples: ANamespace, AClass, |
3609 | 758 | # AClass::ANamespace, ANamespace::*Test | 757 | # AClass::ANamespace, ANamespace::*Test |
3610 | 759 | 758 | ||
3612 | 760 | EXCLUDE_SYMBOLS = android google mfd mgg mp | 759 | EXCLUDE_SYMBOLS = android \ |
3613 | 760 | google \ | ||
3614 | 761 | mfd \ | ||
3615 | 762 | mgg \ | ||
3616 | 763 | mp | ||
3617 | 761 | 764 | ||
3618 | 762 | # The EXAMPLE_PATH tag can be used to specify one or more files or | 765 | # The EXAMPLE_PATH tag can be used to specify one or more files or |
3619 | 763 | # directories that contain example code fragments that are included (see | 766 | # directories that contain example code fragments that are included (see |
3620 | @@ -790,14 +793,19 @@ | |||
3621 | 790 | # by executing (via popen()) the command <filter> <input-file>, where <filter> | 793 | # by executing (via popen()) the command <filter> <input-file>, where <filter> |
3622 | 791 | # is the value of the INPUT_FILTER tag, and <input-file> is the name of an | 794 | # is the value of the INPUT_FILTER tag, and <input-file> is the name of an |
3623 | 792 | # input file. Doxygen will then use the output that the filter program writes | 795 | # input file. Doxygen will then use the output that the filter program writes |
3626 | 793 | # to standard output. If FILTER_PATTERNS is specified, this tag will be | 796 | # to standard output. |
3627 | 794 | # ignored. | 797 | # If FILTER_PATTERNS is specified, this tag will be ignored. |
3628 | 798 | # Note that the filter must not add or remove lines; it is applied before the | ||
3629 | 799 | # code is scanned, but not when the output code is generated. If lines are added | ||
3630 | 800 | # or removed, the anchors will not be placed correctly. | ||
3631 | 795 | 801 | ||
3632 | 796 | INPUT_FILTER = | 802 | INPUT_FILTER = |
3633 | 797 | 803 | ||
3634 | 798 | # The FILTER_PATTERNS tag can be used to specify filters on a per file pattern | 804 | # The FILTER_PATTERNS tag can be used to specify filters on a per file pattern |
3637 | 799 | # basis. Doxygen will compare the file name with each pattern and apply the | 805 | # basis. |
3638 | 800 | # filter if there is a match. The filters are a list of the form: | 806 | # Doxygen will compare the file name with each pattern and apply the |
3639 | 807 | # filter if there is a match. | ||
3640 | 808 | # The filters are a list of the form: | ||
3641 | 801 | # pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further | 809 | # pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further |
3642 | 802 | # info on how filters are used. If FILTER_PATTERNS is empty or if | 810 | # info on how filters are used. If FILTER_PATTERNS is empty or if |
3643 | 803 | # non of the patterns match the file name, INPUT_FILTER is applied. | 811 | # non of the patterns match the file name, INPUT_FILTER is applied. |
3644 | @@ -818,6 +826,13 @@ | |||
3645 | 818 | 826 | ||
3646 | 819 | FILTER_SOURCE_PATTERNS = | 827 | FILTER_SOURCE_PATTERNS = |
3647 | 820 | 828 | ||
3648 | 829 | # If the USE_MD_FILE_AS_MAINPAGE tag refers to the name of a markdown file that | ||
3649 | 830 | # is part of the input, its contents will be placed on the main page | ||
3650 | 831 | # (index.html). This can be useful if you have a project on for instance GitHub | ||
3651 | 832 | # and want reuse the introduction page also for the doxygen output. | ||
3652 | 833 | |||
3653 | 834 | USE_MDFILE_AS_MAINPAGE = | ||
3654 | 835 | |||
3655 | 821 | #--------------------------------------------------------------------------- | 836 | #--------------------------------------------------------------------------- |
3656 | 822 | # configuration options related to source browsing | 837 | # configuration options related to source browsing |
3657 | 823 | #--------------------------------------------------------------------------- | 838 | #--------------------------------------------------------------------------- |
3658 | @@ -855,7 +870,8 @@ | |||
3659 | 855 | # If the REFERENCES_LINK_SOURCE tag is set to YES (the default) | 870 | # If the REFERENCES_LINK_SOURCE tag is set to YES (the default) |
3660 | 856 | # and SOURCE_BROWSER tag is set to YES, then the hyperlinks from | 871 | # and SOURCE_BROWSER tag is set to YES, then the hyperlinks from |
3661 | 857 | # functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will | 872 | # functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will |
3663 | 858 | # link to the source code. Otherwise they will link to the documentation. | 873 | # link to the source code. |
3664 | 874 | # Otherwise they will link to the documentation. | ||
3665 | 859 | 875 | ||
3666 | 860 | REFERENCES_LINK_SOURCE = YES | 876 | REFERENCES_LINK_SOURCE = YES |
3667 | 861 | 877 | ||
3668 | @@ -920,7 +936,7 @@ | |||
3669 | 920 | # The HTML_HEADER tag can be used to specify a personal HTML header for | 936 | # The HTML_HEADER tag can be used to specify a personal HTML header for |
3670 | 921 | # each generated HTML page. If it is left blank doxygen will generate a | 937 | # each generated HTML page. If it is left blank doxygen will generate a |
3671 | 922 | # standard header. Note that when using a custom header you are responsible | 938 | # standard header. Note that when using a custom header you are responsible |
3673 | 923 | # for the proper inclusion of any scripts and style sheets that doxygen | 939 | # for the proper inclusion of any scripts and style sheets that doxygen |
3674 | 924 | # needs, which is dependent on the configuration options used. | 940 | # needs, which is dependent on the configuration options used. |
3675 | 925 | # It is advised to generate a default header using "doxygen -w html | 941 | # It is advised to generate a default header using "doxygen -w html |
3676 | 926 | # header.html footer.html stylesheet.css YourConfigFile" and then modify | 942 | # header.html footer.html stylesheet.css YourConfigFile" and then modify |
3677 | @@ -938,18 +954,27 @@ | |||
3678 | 938 | 954 | ||
3679 | 939 | # The HTML_STYLESHEET tag can be used to specify a user-defined cascading | 955 | # The HTML_STYLESHEET tag can be used to specify a user-defined cascading |
3680 | 940 | # style sheet that is used by each HTML page. It can be used to | 956 | # style sheet that is used by each HTML page. It can be used to |
3685 | 941 | # fine-tune the look of the HTML output. If the tag is left blank doxygen | 957 | # fine-tune the look of the HTML output. If left blank doxygen will |
3686 | 942 | # will generate a default style sheet. Note that doxygen will try to copy | 958 | # generate a default style sheet. Note that it is recommended to use |
3687 | 943 | # the style sheet file to the HTML output directory, so don't put your own | 959 | # HTML_EXTRA_STYLESHEET instead of this one, as it is more robust and this |
3688 | 944 | # style sheet in the HTML output directory as well, or it will be erased! | 960 | # tag will in the future become obsolete. |
3689 | 945 | 961 | ||
3690 | 946 | HTML_STYLESHEET = | 962 | HTML_STYLESHEET = |
3691 | 963 | |||
3692 | 964 | # The HTML_EXTRA_STYLESHEET tag can be used to specify an additional | ||
3693 | 965 | # user-defined cascading style sheet that is included after the standard | ||
3694 | 966 | # style sheets created by doxygen. Using this option one can overrule | ||
3695 | 967 | # certain style aspects. This is preferred over using HTML_STYLESHEET | ||
3696 | 968 | # since it does not replace the standard style sheet and is therefor more | ||
3697 | 969 | # robust against future updates. Doxygen will copy the style sheet file to | ||
3698 | 970 | # the output directory. | ||
3699 | 971 | |||
3700 | 947 | HTML_EXTRA_STYLESHEET = @CMAKE_BINARY_DIR@/doc/extra.css | 972 | HTML_EXTRA_STYLESHEET = @CMAKE_BINARY_DIR@/doc/extra.css |
3701 | 948 | 973 | ||
3702 | 949 | # The HTML_EXTRA_FILES tag can be used to specify one or more extra images or | 974 | # The HTML_EXTRA_FILES tag can be used to specify one or more extra images or |
3703 | 950 | # other source files which should be copied to the HTML output directory. Note | 975 | # other source files which should be copied to the HTML output directory. Note |
3704 | 951 | # that these files will be copied to the base HTML output directory. Use the | 976 | # that these files will be copied to the base HTML output directory. Use the |
3706 | 952 | # $relpath$ marker in the HTML_HEADER and/or HTML_FOOTER files to load these | 977 | # $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these |
3707 | 953 | # files. In the HTML_STYLESHEET file, use the file name only. Also note that | 978 | # files. In the HTML_STYLESHEET file, use the file name only. Also note that |
3708 | 954 | # the files will be copied as-is; there are no commands or markers available. | 979 | # the files will be copied as-is; there are no commands or markers available. |
3709 | 955 | 980 | ||
3710 | @@ -1030,9 +1055,9 @@ | |||
3711 | 1030 | 1055 | ||
3712 | 1031 | DOCSET_BUNDLE_ID = org.doxygen.Project | 1056 | DOCSET_BUNDLE_ID = org.doxygen.Project |
3713 | 1032 | 1057 | ||
3717 | 1033 | # When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely identify | 1058 | # When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely |
3718 | 1034 | # the documentation publisher. This should be a reverse domain-name style | 1059 | # identify the documentation publisher. This should be a reverse domain-name |
3719 | 1035 | # string, e.g. com.mycompany.MyDocSet.documentation. | 1060 | # style string, e.g. com.mycompany.MyDocSet.documentation. |
3720 | 1036 | 1061 | ||
3721 | 1037 | DOCSET_PUBLISHER_ID = org.doxygen.Publisher | 1062 | DOCSET_PUBLISHER_ID = org.doxygen.Publisher |
3722 | 1038 | 1063 | ||
3723 | @@ -1138,7 +1163,7 @@ | |||
3724 | 1138 | QHG_LOCATION = | 1163 | QHG_LOCATION = |
3725 | 1139 | 1164 | ||
3726 | 1140 | # If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files | 1165 | # If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files |
3728 | 1141 | # will be generated, which together with the HTML files, form an Eclipse help | 1166 | # will be generated, which together with the HTML files, form an Eclipse help |
3729 | 1142 | # plugin. To install this plugin and make it available under the help contents | 1167 | # plugin. To install this plugin and make it available under the help contents |
3730 | 1143 | # menu in Eclipse, the contents of the directory containing the HTML and XML | 1168 | # menu in Eclipse, the contents of the directory containing the HTML and XML |
3731 | 1144 | # files needs to be copied into the plugins directory of eclipse. The name of | 1169 | # files needs to be copied into the plugins directory of eclipse. The name of |
3732 | @@ -1217,13 +1242,21 @@ | |||
3733 | 1217 | 1242 | ||
3734 | 1218 | USE_MATHJAX = NO | 1243 | USE_MATHJAX = NO |
3735 | 1219 | 1244 | ||
3736 | 1245 | # When MathJax is enabled you can set the default output format to be used for | ||
3737 | 1246 | # the MathJax output. Supported types are HTML-CSS, NativeMML (i.e. MathML) and | ||
3738 | 1247 | # SVG. The default value is HTML-CSS, which is slower, but has the best | ||
3739 | 1248 | # compatibility. | ||
3740 | 1249 | |||
3741 | 1250 | MATHJAX_FORMAT = HTML-CSS | ||
3742 | 1251 | |||
3743 | 1220 | # When MathJax is enabled you need to specify the location relative to the | 1252 | # When MathJax is enabled you need to specify the location relative to the |
3744 | 1221 | # HTML output directory using the MATHJAX_RELPATH option. The destination | 1253 | # HTML output directory using the MATHJAX_RELPATH option. The destination |
3745 | 1222 | # directory should contain the MathJax.js script. For instance, if the mathjax | 1254 | # directory should contain the MathJax.js script. For instance, if the mathjax |
3746 | 1223 | # directory is located at the same level as the HTML output directory, then | 1255 | # directory is located at the same level as the HTML output directory, then |
3747 | 1224 | # MATHJAX_RELPATH should be ../mathjax. The default value points to | 1256 | # MATHJAX_RELPATH should be ../mathjax. The default value points to |
3748 | 1225 | # the MathJax Content Delivery Network so you can quickly see the result without | 1257 | # the MathJax Content Delivery Network so you can quickly see the result without |
3750 | 1226 | # installing MathJax. However, it is strongly recommended to install a local | 1258 | # installing MathJax. |
3751 | 1259 | # However, it is strongly recommended to install a local | ||
3752 | 1227 | # copy of MathJax from http://www.mathjax.org before deployment. | 1260 | # copy of MathJax from http://www.mathjax.org before deployment. |
3753 | 1228 | 1261 | ||
3754 | 1229 | MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest | 1262 | MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest |
3755 | @@ -1233,6 +1266,11 @@ | |||
3756 | 1233 | 1266 | ||
3757 | 1234 | MATHJAX_EXTENSIONS = | 1267 | MATHJAX_EXTENSIONS = |
3758 | 1235 | 1268 | ||
3759 | 1269 | # The MATHJAX_CODEFILE tag can be used to specify a file with javascript | ||
3760 | 1270 | # pieces of code that will be used on startup of the MathJax code. | ||
3761 | 1271 | |||
3762 | 1272 | MATHJAX_CODEFILE = | ||
3763 | 1273 | |||
3764 | 1236 | # When the SEARCHENGINE tag is enabled doxygen will generate a search box | 1274 | # When the SEARCHENGINE tag is enabled doxygen will generate a search box |
3765 | 1237 | # for the HTML output. The underlying search engine uses javascript | 1275 | # for the HTML output. The underlying search engine uses javascript |
3766 | 1238 | # and DHTML and should work on any modern browser. Note that when using | 1276 | # and DHTML and should work on any modern browser. Note that when using |
3767 | @@ -1244,15 +1282,55 @@ | |||
3768 | 1244 | SEARCHENGINE = YES | 1282 | SEARCHENGINE = YES |
3769 | 1245 | 1283 | ||
3770 | 1246 | # When the SERVER_BASED_SEARCH tag is enabled the search engine will be | 1284 | # When the SERVER_BASED_SEARCH tag is enabled the search engine will be |
3777 | 1247 | # implemented using a PHP enabled web server instead of at the web client | 1285 | # implemented using a web server instead of a web client using Javascript. |
3778 | 1248 | # using Javascript. Doxygen will generate the search PHP script and index | 1286 | # There are two flavours of web server based search depending on the |
3779 | 1249 | # file to put on the web server. The advantage of the server | 1287 | # EXTERNAL_SEARCH setting. When disabled, doxygen will generate a PHP script for |
3780 | 1250 | # based approach is that it scales better to large projects and allows | 1288 | # searching and an index file used by the script. When EXTERNAL_SEARCH is |
3781 | 1251 | # full text search. The disadvantages are that it is more difficult to setup | 1289 | # enabled the indexing and searching needs to be provided by external tools. |
3782 | 1252 | # and does not have live searching capabilities. | 1290 | # See the manual for details. |
3783 | 1253 | 1291 | ||
3784 | 1254 | SERVER_BASED_SEARCH = NO | 1292 | SERVER_BASED_SEARCH = NO |
3785 | 1255 | 1293 | ||
3786 | 1294 | # When EXTERNAL_SEARCH is enabled doxygen will no longer generate the PHP | ||
3787 | 1295 | # script for searching. Instead the search results are written to an XML file | ||
3788 | 1296 | # which needs to be processed by an external indexer. Doxygen will invoke an | ||
3789 | 1297 | # external search engine pointed to by the SEARCHENGINE_URL option to obtain | ||
3790 | 1298 | # the search results. Doxygen ships with an example indexer (doxyindexer) and | ||
3791 | 1299 | # search engine (doxysearch.cgi) which are based on the open source search | ||
3792 | 1300 | # engine library Xapian. See the manual for configuration details. | ||
3793 | 1301 | |||
3794 | 1302 | EXTERNAL_SEARCH = NO | ||
3795 | 1303 | |||
3796 | 1304 | # The SEARCHENGINE_URL should point to a search engine hosted by a web server | ||
3797 | 1305 | # which will returned the search results when EXTERNAL_SEARCH is enabled. | ||
3798 | 1306 | # Doxygen ships with an example search engine (doxysearch) which is based on | ||
3799 | 1307 | # the open source search engine library Xapian. See the manual for configuration | ||
3800 | 1308 | # details. | ||
3801 | 1309 | |||
3802 | 1310 | SEARCHENGINE_URL = | ||
3803 | 1311 | |||
3804 | 1312 | # When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the unindexed | ||
3805 | 1313 | # search data is written to a file for indexing by an external tool. With the | ||
3806 | 1314 | # SEARCHDATA_FILE tag the name of this file can be specified. | ||
3807 | 1315 | |||
3808 | 1316 | SEARCHDATA_FILE = searchdata.xml | ||
3809 | 1317 | |||
3810 | 1318 | # When SERVER_BASED_SEARCH AND EXTERNAL_SEARCH are both enabled the | ||
3811 | 1319 | # EXTERNAL_SEARCH_ID tag can be used as an identifier for the project. This is | ||
3812 | 1320 | # useful in combination with EXTRA_SEARCH_MAPPINGS to search through multiple | ||
3813 | 1321 | # projects and redirect the results back to the right project. | ||
3814 | 1322 | |||
3815 | 1323 | EXTERNAL_SEARCH_ID = | ||
3816 | 1324 | |||
3817 | 1325 | # The EXTRA_SEARCH_MAPPINGS tag can be used to enable searching through doxygen | ||
3818 | 1326 | # projects other than the one defined by this configuration file, but that are | ||
3819 | 1327 | # all added to the same external search index. Each project needs to have a | ||
3820 | 1328 | # unique id set via EXTERNAL_SEARCH_ID. The search mapping then maps the id | ||
3821 | 1329 | # of to a relative location where the documentation can be found. | ||
3822 | 1330 | # The format is: EXTRA_SEARCH_MAPPINGS = id1=loc1 id2=loc2 ... | ||
3823 | 1331 | |||
3824 | 1332 | EXTRA_SEARCH_MAPPINGS = | ||
3825 | 1333 | |||
3826 | 1256 | #--------------------------------------------------------------------------- | 1334 | #--------------------------------------------------------------------------- |
3827 | 1257 | # configuration options related to the LaTeX output | 1335 | # configuration options related to the LaTeX output |
3828 | 1258 | #--------------------------------------------------------------------------- | 1336 | #--------------------------------------------------------------------------- |
3829 | @@ -1290,7 +1368,7 @@ | |||
3830 | 1290 | 1368 | ||
3831 | 1291 | # The PAPER_TYPE tag can be used to set the paper type that is used | 1369 | # The PAPER_TYPE tag can be used to set the paper type that is used |
3832 | 1292 | # by the printer. Possible values are: a4, letter, legal and | 1370 | # by the printer. Possible values are: a4, letter, legal and |
3834 | 1293 | # executive. If left blank a4wide will be used. | 1371 | # executive. If left blank a4 will be used. |
3835 | 1294 | 1372 | ||
3836 | 1295 | PAPER_TYPE = a4 | 1373 | PAPER_TYPE = a4 |
3837 | 1296 | 1374 | ||
3838 | @@ -1313,6 +1391,13 @@ | |||
3839 | 1313 | 1391 | ||
3840 | 1314 | LATEX_FOOTER = | 1392 | LATEX_FOOTER = |
3841 | 1315 | 1393 | ||
3842 | 1394 | # The LATEX_EXTRA_FILES tag can be used to specify one or more extra images | ||
3843 | 1395 | # or other source files which should be copied to the LaTeX output directory. | ||
3844 | 1396 | # Note that the files will be copied as-is; there are no commands or markers | ||
3845 | 1397 | # available. | ||
3846 | 1398 | |||
3847 | 1399 | LATEX_EXTRA_FILES = | ||
3848 | 1400 | |||
3849 | 1316 | # If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated | 1401 | # If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated |
3850 | 1317 | # is prepared for conversion to pdf (using ps2pdf). The pdf file will | 1402 | # is prepared for conversion to pdf (using ps2pdf). The pdf file will |
3851 | 1318 | # contain links (just like the HTML output) instead of page references | 1403 | # contain links (just like the HTML output) instead of page references |
3852 | @@ -1458,6 +1543,21 @@ | |||
3853 | 1458 | XML_PROGRAMLISTING = YES | 1543 | XML_PROGRAMLISTING = YES |
3854 | 1459 | 1544 | ||
3855 | 1460 | #--------------------------------------------------------------------------- | 1545 | #--------------------------------------------------------------------------- |
3856 | 1546 | # configuration options related to the DOCBOOK output | ||
3857 | 1547 | #--------------------------------------------------------------------------- | ||
3858 | 1548 | |||
3859 | 1549 | # If the GENERATE_DOCBOOK tag is set to YES Doxygen will generate DOCBOOK files | ||
3860 | 1550 | # that can be used to generate PDF. | ||
3861 | 1551 | |||
3862 | 1552 | GENERATE_DOCBOOK = NO | ||
3863 | 1553 | |||
3864 | 1554 | # The DOCBOOK_OUTPUT tag is used to specify where the DOCBOOK pages will be put. | ||
3865 | 1555 | # If a relative path is entered the value of OUTPUT_DIRECTORY will be put in | ||
3866 | 1556 | # front of it. If left blank docbook will be used as the default path. | ||
3867 | 1557 | |||
3868 | 1558 | DOCBOOK_OUTPUT = docbook | ||
3869 | 1559 | |||
3870 | 1560 | #--------------------------------------------------------------------------- | ||
3871 | 1461 | # configuration options for the AutoGen Definitions output | 1561 | # configuration options for the AutoGen Definitions output |
3872 | 1462 | #--------------------------------------------------------------------------- | 1562 | #--------------------------------------------------------------------------- |
3873 | 1463 | 1563 | ||
3874 | @@ -1488,8 +1588,10 @@ | |||
3875 | 1488 | PERLMOD_LATEX = NO | 1588 | PERLMOD_LATEX = NO |
3876 | 1489 | 1589 | ||
3877 | 1490 | # If the PERLMOD_PRETTY tag is set to YES the Perl module output will be | 1590 | # If the PERLMOD_PRETTY tag is set to YES the Perl module output will be |
3880 | 1491 | # nicely formatted so it can be parsed by a human reader. This is useful | 1591 | # nicely formatted so it can be parsed by a human reader. |
3881 | 1492 | # if you want to understand what is going on. On the other hand, if this | 1592 | # This is useful |
3882 | 1593 | # if you want to understand what is going on. | ||
3883 | 1594 | # On the other hand, if this | ||
3884 | 1493 | # tag is set to NO the size of the Perl module output will be much smaller | 1595 | # tag is set to NO the size of the Perl module output will be much smaller |
3885 | 1494 | # and Perl will parse it just the same. | 1596 | # and Perl will parse it just the same. |
3886 | 1495 | 1597 | ||
3887 | @@ -1575,9 +1677,11 @@ | |||
3888 | 1575 | # The TAGFILES option can be used to specify one or more tagfiles. For each | 1677 | # The TAGFILES option can be used to specify one or more tagfiles. For each |
3889 | 1576 | # tag file the location of the external documentation should be added. The | 1678 | # tag file the location of the external documentation should be added. The |
3890 | 1577 | # format of a tag file without this location is as follows: | 1679 | # format of a tag file without this location is as follows: |
3892 | 1578 | # TAGFILES = file1 file2 ... | 1680 | # |
3893 | 1681 | # TAGFILES = file1 file2 ... | ||
3894 | 1579 | # Adding location for the tag files is done as follows: | 1682 | # Adding location for the tag files is done as follows: |
3896 | 1580 | # TAGFILES = file1=loc1 "file2 = loc2" ... | 1683 | # |
3897 | 1684 | # TAGFILES = file1=loc1 "file2 = loc2" ... | ||
3898 | 1581 | # where "loc1" and "loc2" can be relative or absolute paths | 1685 | # where "loc1" and "loc2" can be relative or absolute paths |
3899 | 1582 | # or URLs. Note that each tag file must have a unique name (where the name does | 1686 | # or URLs. Note that each tag file must have a unique name (where the name does |
3900 | 1583 | # NOT include the path). If a tag file is not located in the directory in which | 1687 | # NOT include the path). If a tag file is not located in the directory in which |
3901 | @@ -1602,6 +1706,12 @@ | |||
3902 | 1602 | 1706 | ||
3903 | 1603 | EXTERNAL_GROUPS = YES | 1707 | EXTERNAL_GROUPS = YES |
3904 | 1604 | 1708 | ||
3905 | 1709 | # If the EXTERNAL_PAGES tag is set to YES all external pages will be listed | ||
3906 | 1710 | # in the related pages index. If set to NO, only the current project's | ||
3907 | 1711 | # pages will be listed. | ||
3908 | 1712 | |||
3909 | 1713 | EXTERNAL_PAGES = YES | ||
3910 | 1714 | |||
3911 | 1605 | # The PERL_PATH should be the absolute path and name of the perl script | 1715 | # The PERL_PATH should be the absolute path and name of the perl script |
3912 | 1606 | # interpreter (i.e. the result of `which perl'). | 1716 | # interpreter (i.e. the result of `which perl'). |
3913 | 1607 | 1717 | ||
3914 | @@ -1698,7 +1808,7 @@ | |||
3915 | 1698 | # the class node. If there are many fields or methods and many nodes the | 1808 | # the class node. If there are many fields or methods and many nodes the |
3916 | 1699 | # graph may become too big to be useful. The UML_LIMIT_NUM_FIELDS | 1809 | # graph may become too big to be useful. The UML_LIMIT_NUM_FIELDS |
3917 | 1700 | # threshold limits the number of items for each type to make the size more | 1810 | # threshold limits the number of items for each type to make the size more |
3919 | 1701 | # managable. Set this to 0 for no limit. Note that the threshold may be | 1811 | # manageable. Set this to 0 for no limit. Note that the threshold may be |
3920 | 1702 | # exceeded by 50% before the limit is enforced. | 1812 | # exceeded by 50% before the limit is enforced. |
3921 | 1703 | 1813 | ||
3922 | 1704 | UML_LIMIT_NUM_FIELDS = 10 | 1814 | UML_LIMIT_NUM_FIELDS = 10 |
3923 | 1705 | 1815 | ||
3924 | === modified file 'doc/component_reports.md' | |||
3925 | --- doc/component_reports.md 2013-11-06 03:17:35 +0000 | |||
3926 | +++ doc/component_reports.md 2013-11-21 20:19:28 +0000 | |||
3927 | @@ -40,6 +40,7 @@ | |||
3928 | 40 | Report | Handlers | 40 | Report | Handlers |
3929 | 41 | ------------------- | -------- | 41 | ------------------- | -------- |
3930 | 42 | rpc-report | log,lttng | 42 | rpc-report | log,lttng |
3931 | 43 | input-receiver | log | ||
3932 | 43 | 44 | ||
3933 | 44 | For example, to enable the logging RPC report, one should set the | 45 | For example, to enable the logging RPC report, one should set the |
3934 | 45 | `MIR_CLIENT_RPC_REPORT=log` environment variable. | 46 | `MIR_CLIENT_RPC_REPORT=log` environment variable. |
3935 | 46 | 47 | ||
3936 | === modified file 'doc/installing_prebuilt_on_pc.md' | |||
3937 | --- doc/installing_prebuilt_on_pc.md 2013-11-06 03:17:35 +0000 | |||
3938 | +++ doc/installing_prebuilt_on_pc.md 2013-11-21 20:19:28 +0000 | |||
3939 | @@ -4,7 +4,12 @@ | |||
3940 | 4 | Install Ubuntu 13.10 or later if you haven't done so already. Uninstall any | 4 | Install Ubuntu 13.10 or later if you haven't done so already. Uninstall any |
3941 | 5 | proprietary drivers (-nvidia, -fglrx) and reboot on the FOSS drivers. | 5 | proprietary drivers (-nvidia, -fglrx) and reboot on the FOSS drivers. |
3942 | 6 | 6 | ||
3944 | 7 | Install Mir: | 7 | Install Mir in Ubuntu 13.10: |
3945 | 8 | 8 | ||
3946 | 9 | sudo apt-get update | 9 | sudo apt-get update |
3947 | 10 | sudo apt-get install mir-demos unity-system-compositor | 10 | sudo apt-get install mir-demos unity-system-compositor |
3948 | 11 | |||
3949 | 12 | Install Mir in Ubuntu 14.04 or later: | ||
3950 | 13 | |||
3951 | 14 | sudo apt-get update | ||
3952 | 15 | sudo apt-get install mir-demos ubuntu-desktop-mir | ||
3953 | 11 | 16 | ||
3954 | === modified file 'doc/using_mir_on_pc.md' | |||
3955 | --- doc/using_mir_on_pc.md 2013-11-06 03:17:35 +0000 | |||
3956 | +++ doc/using_mir_on_pc.md 2013-11-21 20:19:28 +0000 | |||
3957 | @@ -28,6 +28,7 @@ | |||
3958 | 28 | ------------------------------------- | 28 | ------------------------------------- |
3959 | 29 | 29 | ||
3960 | 30 | Note: for this to work you need to have Mir and all its dependencies (which | 30 | Note: for this to work you need to have Mir and all its dependencies (which |
3961 | 31 | <<<<<<< TREE | ||
3962 | 31 | include lightdm, Mesa and the Xorg drivers). The easiest way is to run Ubuntu | 32 | include lightdm, Mesa and the Xorg drivers). The easiest way is to run Ubuntu |
3963 | 32 | 13.10 or later. | 33 | 13.10 or later. |
3964 | 33 | 34 | ||
3965 | @@ -37,6 +38,19 @@ | |||
3966 | 37 | system compositor, create the file | 38 | system compositor, create the file |
3967 | 38 | /etc/lightdm/lightdm.conf.d/10-unity-system-compositor.conf to look to look like | 39 | /etc/lightdm/lightdm.conf.d/10-unity-system-compositor.conf to look to look like |
3968 | 39 | this: | 40 | this: |
3969 | 41 | ======= | ||
3970 | 42 | include lightdm, Mesa and the Xorg drivers). The easiest way is to run Ubuntu | ||
3971 | 43 | 13.10 or later. | ||
3972 | 44 | |||
3973 | 45 | If you are running Ubuntu 13.10, additionally install unity-system-compositor. | ||
3974 | 46 | If you are running Ubuntu 14.04 or later, instead install ubuntu-desktop-mir. | ||
3975 | 47 | These packages will install dependencies you need and will create a file in | ||
3976 | 48 | /etc/lightdm/lightdm.conf.d/10-unity-system-compositor.conf. | ||
3977 | 49 | |||
3978 | 50 | If you have instead built from source, to set up the system compositor, create | ||
3979 | 51 | /etc/lightdm/lightdm.conf.d/10-unity-system-compositor.conf yourself and make | ||
3980 | 52 | it look like this: | ||
3981 | 53 | >>>>>>> MERGE-SOURCE | ||
3982 | 40 | 54 | ||
3983 | 41 | [SeatDefaults] | 55 | [SeatDefaults] |
3984 | 42 | type=unity | 56 | type=unity |
3985 | 43 | 57 | ||
3986 | === modified file 'examples/CMakeLists.txt' | |||
3987 | --- examples/CMakeLists.txt 2013-09-23 13:37:44 +0000 | |||
3988 | +++ examples/CMakeLists.txt 2013-11-21 20:19:28 +0000 | |||
3989 | @@ -114,6 +114,7 @@ | |||
3990 | 114 | target_link_libraries(mir_demo_standalone_render_surfaces | 114 | target_link_libraries(mir_demo_standalone_render_surfaces |
3991 | 115 | mirserver | 115 | mirserver |
3992 | 116 | mirshell | 116 | mirshell |
3993 | 117 | mirsharedgeometry | ||
3994 | 117 | ${Boost_LIBRARIES} | 118 | ${Boost_LIBRARIES} |
3995 | 118 | ) | 119 | ) |
3996 | 119 | 120 | ||
3997 | 120 | 121 | ||
3998 | === modified file 'examples/buffer_render_target.cpp' | |||
3999 | --- examples/buffer_render_target.cpp 2013-08-28 03:41:48 +0000 | |||
4000 | +++ examples/buffer_render_target.cpp 2013-11-21 20:19:28 +0000 | |||
4001 | @@ -27,7 +27,7 @@ | |||
4002 | 27 | namespace mt = mir::tools; | 27 | namespace mt = mir::tools; |
4003 | 28 | 28 | ||
4004 | 29 | mt::BufferRenderTarget::BufferRenderTarget(mg::Buffer& buffer) | 29 | mt::BufferRenderTarget::BufferRenderTarget(mg::Buffer& buffer) |
4006 | 30 | : buffer(buffer) | 30 | : buffer(buffer), old_fbo(), old_viewport() |
4007 | 31 | { | 31 | { |
4008 | 32 | /* | 32 | /* |
4009 | 33 | * With the new lazy buffer allocation method, we may be executing inside | 33 | * With the new lazy buffer allocation method, we may be executing inside |
4010 | @@ -35,12 +35,14 @@ | |||
4011 | 35 | * we change... | 35 | * we change... |
4012 | 36 | */ | 36 | */ |
4013 | 37 | glGetIntegerv(GL_VIEWPORT, old_viewport); | 37 | glGetIntegerv(GL_VIEWPORT, old_viewport); |
4014 | 38 | glGetIntegerv(GL_FRAMEBUFFER_BINDING, &old_fbo); | ||
4015 | 38 | resources.setup(buffer); | 39 | resources.setup(buffer); |
4016 | 39 | } | 40 | } |
4017 | 40 | 41 | ||
4018 | 41 | mt::BufferRenderTarget::~BufferRenderTarget() | 42 | mt::BufferRenderTarget::~BufferRenderTarget() |
4019 | 42 | { | 43 | { |
4020 | 43 | glFinish(); | 44 | glFinish(); |
4021 | 45 | glBindFramebuffer(GL_FRAMEBUFFER, old_fbo); | ||
4022 | 44 | glViewport(old_viewport[0], old_viewport[1], | 46 | glViewport(old_viewport[0], old_viewport[1], |
4023 | 45 | old_viewport[2], old_viewport[3]); | 47 | old_viewport[2], old_viewport[3]); |
4024 | 46 | } | 48 | } |
4025 | 47 | 49 | ||
4026 | === modified file 'examples/buffer_render_target.h' | |||
4027 | --- examples/buffer_render_target.h 2013-08-28 03:41:48 +0000 | |||
4028 | +++ examples/buffer_render_target.h 2013-11-21 20:19:28 +0000 | |||
4029 | @@ -58,6 +58,7 @@ | |||
4030 | 58 | 58 | ||
4031 | 59 | Resources resources; | 59 | Resources resources; |
4032 | 60 | mir::graphics::Buffer& buffer; | 60 | mir::graphics::Buffer& buffer; |
4033 | 61 | GLint old_fbo; | ||
4034 | 61 | GLint old_viewport[4]; | 62 | GLint old_viewport[4]; |
4035 | 62 | }; | 63 | }; |
4036 | 63 | 64 | ||
4037 | 64 | 65 | ||
4038 | === modified file 'examples/demo-inprocess-surface-client/inprocess_egl_client.cpp' | |||
4039 | --- examples/demo-inprocess-surface-client/inprocess_egl_client.cpp 2013-11-06 03:17:35 +0000 | |||
4040 | +++ examples/demo-inprocess-surface-client/inprocess_egl_client.cpp 2013-11-21 20:19:28 +0000 | |||
4041 | @@ -20,8 +20,13 @@ | |||
4042 | 20 | #include "example_egl_helper.h" | 20 | #include "example_egl_helper.h" |
4043 | 21 | 21 | ||
4044 | 22 | #include "mir/main_loop.h" | 22 | #include "mir/main_loop.h" |
4045 | 23 | <<<<<<< TREE | ||
4046 | 23 | #include "mir/shell/focus_controller.h" | 24 | #include "mir/shell/focus_controller.h" |
4047 | 24 | #include "mir/shell/surface.h" | 25 | #include "mir/shell/surface.h" |
4048 | 26 | ======= | ||
4049 | 27 | #include "mir/shell/focus_controller.h" | ||
4050 | 28 | #include "mir/frontend/surface.h" | ||
4051 | 29 | >>>>>>> MERGE-SOURCE | ||
4052 | 25 | #include "mir/shell/surface_creation_parameters.h" | 30 | #include "mir/shell/surface_creation_parameters.h" |
4053 | 26 | #include "mir/shell/session.h" | 31 | #include "mir/shell/session.h" |
4054 | 27 | #include "mir/frontend/session.h" | 32 | #include "mir/frontend/session.h" |
4055 | @@ -47,7 +52,6 @@ | |||
4056 | 47 | #include <signal.h> | 52 | #include <signal.h> |
4057 | 48 | 53 | ||
4058 | 49 | namespace mf = mir::frontend; | 54 | namespace mf = mir::frontend; |
4059 | 50 | namespace mc = mir::compositor; | ||
4060 | 51 | namespace msh = mir::shell; | 55 | namespace msh = mir::shell; |
4061 | 52 | namespace mg = mir::graphics; | 56 | namespace mg = mir::graphics; |
4062 | 53 | namespace me = mir::examples; | 57 | namespace me = mir::examples; |
4063 | 54 | 58 | ||
4064 | === modified file 'examples/demo-shell/demo_shell.cpp' | |||
4065 | --- examples/demo-shell/demo_shell.cpp 2013-11-06 03:17:35 +0000 | |||
4066 | +++ examples/demo-shell/demo_shell.cpp 2013-11-21 20:19:28 +0000 | |||
4067 | @@ -24,7 +24,10 @@ | |||
4068 | 24 | 24 | ||
4069 | 25 | #include "mir/run_mir.h" | 25 | #include "mir/run_mir.h" |
4070 | 26 | #include "mir/report_exception.h" | 26 | #include "mir/report_exception.h" |
4071 | 27 | <<<<<<< TREE | ||
4072 | 27 | #include "mir/shell/session_container.h" | 28 | #include "mir/shell/session_container.h" |
4073 | 29 | ======= | ||
4074 | 30 | >>>>>>> MERGE-SOURCE | ||
4075 | 28 | #include "mir/graphics/display.h" | 31 | #include "mir/graphics/display.h" |
4076 | 29 | #include "mir/input/composite_event_filter.h" | 32 | #include "mir/input/composite_event_filter.h" |
4077 | 30 | 33 | ||
4078 | 31 | 34 | ||
4079 | === modified file 'examples/demo-shell/window_manager.cpp' | |||
4080 | --- examples/demo-shell/window_manager.cpp 2013-11-06 03:17:35 +0000 | |||
4081 | +++ examples/demo-shell/window_manager.cpp 2013-11-21 20:19:28 +0000 | |||
4082 | @@ -14,6 +14,7 @@ | |||
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: Robert Carr <robert.carr@canonical.com> | 16 | * Authored by: Robert Carr <robert.carr@canonical.com> |
4086 | 17 | * Daniel van Vugt <daniel.van.vugt@canonical.com> | ||
4087 | 17 | */ | 18 | */ |
4088 | 18 | 19 | ||
4089 | 19 | #include "window_manager.h" | 20 | #include "window_manager.h" |
4090 | @@ -29,6 +30,7 @@ | |||
4091 | 29 | 30 | ||
4092 | 30 | #include <cassert> | 31 | #include <cassert> |
4093 | 31 | #include <cstdlib> | 32 | #include <cstdlib> |
4094 | 33 | #include <cmath> | ||
4095 | 32 | 34 | ||
4096 | 33 | namespace me = mir::examples; | 35 | namespace me = mir::examples; |
4097 | 34 | namespace msh = mir::shell; | 36 | namespace msh = mir::shell; |
4098 | @@ -41,7 +43,7 @@ | |||
4099 | 41 | } | 43 | } |
4100 | 42 | 44 | ||
4101 | 43 | me::WindowManager::WindowManager() | 45 | me::WindowManager::WindowManager() |
4103 | 44 | : max_fingers(0) | 46 | : old_pinch_diam(0.0f), max_fingers(0) |
4104 | 45 | { | 47 | { |
4105 | 46 | } | 48 | } |
4106 | 47 | 49 | ||
4107 | @@ -60,6 +62,9 @@ | |||
4108 | 60 | compositor = cptor; | 62 | compositor = cptor; |
4109 | 61 | } | 63 | } |
4110 | 62 | 64 | ||
4111 | 65 | namespace | ||
4112 | 66 | { | ||
4113 | 67 | |||
4114 | 63 | mir::geometry::Point average_pointer(MirMotionEvent const& motion) | 68 | mir::geometry::Point average_pointer(MirMotionEvent const& motion) |
4115 | 64 | { | 69 | { |
4116 | 65 | using namespace mir; | 70 | using namespace mir; |
4117 | @@ -79,6 +84,36 @@ | |||
4118 | 79 | return Point{x, y}; | 84 | return Point{x, y}; |
4119 | 80 | } | 85 | } |
4120 | 81 | 86 | ||
4121 | 87 | float measure_pinch(MirMotionEvent const& motion, | ||
4122 | 88 | mir::geometry::Displacement& dir) | ||
4123 | 89 | { | ||
4124 | 90 | int count = static_cast<int>(motion.pointer_count); | ||
4125 | 91 | int max = 0; | ||
4126 | 92 | |||
4127 | 93 | for (int i = 0; i < count; i++) | ||
4128 | 94 | { | ||
4129 | 95 | for (int j = 0; j < i; j++) | ||
4130 | 96 | { | ||
4131 | 97 | int dx = motion.pointer_coordinates[i].x - | ||
4132 | 98 | motion.pointer_coordinates[j].x; | ||
4133 | 99 | int dy = motion.pointer_coordinates[i].y - | ||
4134 | 100 | motion.pointer_coordinates[j].y; | ||
4135 | 101 | |||
4136 | 102 | int sqr = dx*dx + dy*dy; | ||
4137 | 103 | |||
4138 | 104 | if (sqr > max) | ||
4139 | 105 | { | ||
4140 | 106 | max = sqr; | ||
4141 | 107 | dir = mir::geometry::Displacement{dx, dy}; | ||
4142 | 108 | } | ||
4143 | 109 | } | ||
4144 | 110 | } | ||
4145 | 111 | |||
4146 | 112 | return sqrtf(max); // return pinch diameter | ||
4147 | 113 | } | ||
4148 | 114 | |||
4149 | 115 | } // namespace | ||
4150 | 116 | |||
4151 | 82 | bool me::WindowManager::handle(MirEvent const& event) | 117 | bool me::WindowManager::handle(MirEvent const& event) |
4152 | 83 | { | 118 | { |
4153 | 84 | // TODO: Fix android configuration and remove static hack ~racarr | 119 | // TODO: Fix android configuration and remove static hack ~racarr |
4154 | @@ -87,6 +122,8 @@ | |||
4155 | 87 | assert(display); | 122 | assert(display); |
4156 | 88 | assert(compositor); | 123 | assert(compositor); |
4157 | 89 | 124 | ||
4158 | 125 | bool handled = false; | ||
4159 | 126 | |||
4160 | 90 | if (event.key.type == mir_event_type_key && | 127 | if (event.key.type == mir_event_type_key && |
4161 | 91 | event.key.action == mir_key_action_down) | 128 | event.key.action == mir_key_action_down) |
4162 | 92 | { | 129 | { |
4163 | @@ -148,22 +185,73 @@ | |||
4164 | 148 | (event.motion.modifiers & mir_key_modifier_alt || | 185 | (event.motion.modifiers & mir_key_modifier_alt || |
4165 | 149 | fingers >= 3)) | 186 | fingers >= 3)) |
4166 | 150 | { | 187 | { |
4167 | 188 | geometry::Displacement pinch_dir; | ||
4168 | 189 | auto pinch_diam = | ||
4169 | 190 | measure_pinch(event.motion, pinch_dir); | ||
4170 | 191 | |||
4171 | 151 | // Start of a gesture: When the latest finger/button goes down | 192 | // Start of a gesture: When the latest finger/button goes down |
4172 | 152 | if (action == mir_motion_action_down || | 193 | if (action == mir_motion_action_down || |
4173 | 153 | action == mir_motion_action_pointer_down) | 194 | action == mir_motion_action_pointer_down) |
4174 | 154 | { | 195 | { |
4175 | 155 | relative_click = cursor - surf->top_left(); | ||
4176 | 156 | click = cursor; | 196 | click = cursor; |
4187 | 157 | } | 197 | handled = true; |
4188 | 158 | else if (event.motion.action == mir_motion_action_move) | 198 | } |
4189 | 159 | { // Movement is happening with one or more fingers/button down | 199 | else if (event.motion.action == mir_motion_action_move && |
4190 | 160 | geometry::Point abs = cursor - relative_click; | 200 | max_fingers <= 3) // Avoid accidental movement |
4191 | 161 | if (max_fingers <= 3) // Avoid accidental movement | 201 | { |
4192 | 162 | { | 202 | geometry::Displacement drag = cursor - old_cursor; |
4193 | 163 | surf->move_to(abs); | 203 | |
4194 | 164 | return true; | 204 | if (event.motion.button_state == |
4195 | 165 | } | 205 | mir_motion_button_tertiary) |
4196 | 166 | } | 206 | { // Resize by mouse middle button |
4197 | 207 | int width = old_size.width.as_int() + | ||
4198 | 208 | drag.dx.as_int(); | ||
4199 | 209 | int height = old_size.height.as_int() + | ||
4200 | 210 | drag.dy.as_int(); | ||
4201 | 211 | if (width <= 0) width = 1; | ||
4202 | 212 | if (height <= 0) height = 1; | ||
4203 | 213 | surf->resize({width, height}); | ||
4204 | 214 | } | ||
4205 | 215 | else | ||
4206 | 216 | { // Move surface (by mouse or 3 fingers) | ||
4207 | 217 | surf->move_to(old_pos + drag); | ||
4208 | 218 | } | ||
4209 | 219 | |||
4210 | 220 | if (fingers == 3) | ||
4211 | 221 | { // Resize by pinch/zoom | ||
4212 | 222 | float diam_delta = pinch_diam - old_pinch_diam; | ||
4213 | 223 | /* | ||
4214 | 224 | * Resize vector (dx,dy) has length=diam_delta and | ||
4215 | 225 | * direction=pinch_dir, so solve for (dx,dy)... | ||
4216 | 226 | */ | ||
4217 | 227 | float lenlen = diam_delta * diam_delta; | ||
4218 | 228 | int x = pinch_dir.dx.as_int(); | ||
4219 | 229 | int y = pinch_dir.dy.as_int(); | ||
4220 | 230 | int xx = x * x; | ||
4221 | 231 | int yy = y * y; | ||
4222 | 232 | int xxyy = xx + yy; | ||
4223 | 233 | int dx = sqrtf(lenlen * xx / xxyy); | ||
4224 | 234 | int dy = sqrtf(lenlen * yy / xxyy); | ||
4225 | 235 | if (diam_delta < 0.0f) | ||
4226 | 236 | { | ||
4227 | 237 | dx = -dx; | ||
4228 | 238 | dy = -dy; | ||
4229 | 239 | } | ||
4230 | 240 | |||
4231 | 241 | int width = old_size.width.as_int() + dx; | ||
4232 | 242 | int height = old_size.height.as_int() + dy; | ||
4233 | 243 | if (width <= 0) width = 1; | ||
4234 | 244 | if (height <= 0) height = 1; | ||
4235 | 245 | surf->resize({width, height}); | ||
4236 | 246 | } | ||
4237 | 247 | |||
4238 | 248 | handled = true; | ||
4239 | 249 | } | ||
4240 | 250 | |||
4241 | 251 | old_pos = surf->top_left(); | ||
4242 | 252 | old_size = surf->size(); | ||
4243 | 253 | old_pinch_diam = pinch_diam; | ||
4244 | 254 | old_cursor = cursor; | ||
4245 | 167 | } | 255 | } |
4246 | 168 | } | 256 | } |
4247 | 169 | 257 | ||
4248 | @@ -173,9 +261,9 @@ | |||
4249 | 173 | if (abs(dir.dx.as_int()) >= min_swipe_distance) | 261 | if (abs(dir.dx.as_int()) >= min_swipe_distance) |
4250 | 174 | { | 262 | { |
4251 | 175 | focus_controller->focus_next(); | 263 | focus_controller->focus_next(); |
4253 | 176 | return true; | 264 | handled = true; |
4254 | 177 | } | 265 | } |
4255 | 178 | } | 266 | } |
4256 | 179 | } | 267 | } |
4258 | 180 | return false; | 268 | return handled; |
4259 | 181 | } | 269 | } |
4260 | 182 | 270 | ||
4261 | === modified file 'examples/demo-shell/window_manager.h' | |||
4262 | --- examples/demo-shell/window_manager.h 2013-11-06 03:17:35 +0000 | |||
4263 | +++ examples/demo-shell/window_manager.h 2013-11-21 20:19:28 +0000 | |||
4264 | @@ -21,6 +21,7 @@ | |||
4265 | 21 | 21 | ||
4266 | 22 | #include "mir/input/event_filter.h" | 22 | #include "mir/input/event_filter.h" |
4267 | 23 | #include "mir/geometry/displacement.h" | 23 | #include "mir/geometry/displacement.h" |
4268 | 24 | #include "mir/geometry/size.h" | ||
4269 | 24 | 25 | ||
4270 | 25 | #include <memory> | 26 | #include <memory> |
4271 | 26 | 27 | ||
4272 | @@ -62,8 +63,11 @@ | |||
4273 | 62 | std::shared_ptr<graphics::Display> display; | 63 | std::shared_ptr<graphics::Display> display; |
4274 | 63 | std::shared_ptr<compositor::Compositor> compositor; | 64 | std::shared_ptr<compositor::Compositor> compositor; |
4275 | 64 | 65 | ||
4278 | 65 | geometry::Displacement relative_click; // Click location in window space | 66 | geometry::Point click; |
4279 | 66 | geometry::Point click; // Click location in screen space | 67 | geometry::Point old_pos; |
4280 | 68 | geometry::Point old_cursor; | ||
4281 | 69 | geometry::Size old_size; | ||
4282 | 70 | float old_pinch_diam; | ||
4283 | 67 | int max_fingers; // Maximum number of fingers touched during gesture | 71 | int max_fingers; // Maximum number of fingers touched during gesture |
4284 | 68 | }; | 72 | }; |
4285 | 69 | 73 | ||
4286 | 70 | 74 | ||
4287 | === modified file 'examples/demo_input_filter.cpp' | |||
4288 | --- examples/demo_input_filter.cpp 2013-08-28 03:41:48 +0000 | |||
4289 | +++ examples/demo_input_filter.cpp 2013-11-21 20:19:28 +0000 | |||
4290 | @@ -32,6 +32,21 @@ | |||
4291 | 32 | 32 | ||
4292 | 33 | struct PrintingEventFilter : public mi::EventFilter | 33 | struct PrintingEventFilter : public mi::EventFilter |
4293 | 34 | { | 34 | { |
4294 | 35 | void print_motion_event(MirMotionEvent const& ev) | ||
4295 | 36 | { | ||
4296 | 37 | std::cout << "Motion Event time=" << ev.event_time | ||
4297 | 38 | << " pointer_count=" << ev.pointer_count << std::endl; | ||
4298 | 39 | |||
4299 | 40 | for (size_t i = 0; i < ev.pointer_count; ++i) | ||
4300 | 41 | { | ||
4301 | 42 | std::cout << " " | ||
4302 | 43 | << " id=" << ev.pointer_coordinates[i].id | ||
4303 | 44 | << " pos=(" << ev.pointer_coordinates[i].x << ", " << ev.pointer_coordinates[i].y << ")" | ||
4304 | 45 | << std::endl; | ||
4305 | 46 | } | ||
4306 | 47 | std::cout << "----------------" << std::endl << std::endl; | ||
4307 | 48 | } | ||
4308 | 49 | |||
4309 | 35 | bool handle(MirEvent const& ev) override | 50 | bool handle(MirEvent const& ev) override |
4310 | 36 | { | 51 | { |
4311 | 37 | // TODO: Enhance printing | 52 | // TODO: Enhance printing |
4312 | @@ -42,8 +57,7 @@ | |||
4313 | 42 | } | 57 | } |
4314 | 43 | else if (ev.type == mir_event_type_motion) | 58 | else if (ev.type == mir_event_type_motion) |
4315 | 44 | { | 59 | { |
4318 | 45 | std::cout << "Handling motion event (time, pointer0_x, pointer0_y): " << ev.motion.event_time << " " | 60 | print_motion_event(ev.motion); |
4317 | 46 | << ev.motion.pointer_coordinates[0].x << " " << ev.motion.pointer_coordinates[0].y << std::endl; | ||
4319 | 47 | } | 61 | } |
4320 | 48 | return false; | 62 | return false; |
4321 | 49 | } | 63 | } |
4322 | @@ -56,7 +70,7 @@ | |||
4323 | 56 | event_filter(std::make_shared<PrintingEventFilter>()) | 70 | event_filter(std::make_shared<PrintingEventFilter>()) |
4324 | 57 | { | 71 | { |
4325 | 58 | } | 72 | } |
4327 | 59 | 73 | ||
4328 | 60 | std::shared_ptr<mi::CompositeEventFilter> the_composite_event_filter() override | 74 | std::shared_ptr<mi::CompositeEventFilter> the_composite_event_filter() override |
4329 | 61 | { | 75 | { |
4330 | 62 | auto composite_filter = ServerConfiguration::the_composite_event_filter(); | 76 | auto composite_filter = ServerConfiguration::the_composite_event_filter(); |
4331 | @@ -69,10 +83,18 @@ | |||
4332 | 69 | 83 | ||
4333 | 70 | } | 84 | } |
4334 | 71 | 85 | ||
4335 | 86 | |||
4336 | 87 | #include <std/MirLog.h> | ||
4337 | 88 | void my_write_to_log(int /*prio*/, char const* buffer) | ||
4338 | 89 | { | ||
4339 | 90 | printf("%s\n", buffer); | ||
4340 | 91 | } | ||
4341 | 92 | |||
4342 | 72 | int main(int argc, char const* argv[]) | 93 | int main(int argc, char const* argv[]) |
4343 | 73 | try | 94 | try |
4344 | 74 | { | 95 | { |
4345 | 75 | DemoServerConfiguration config(argc, argv); | 96 | DemoServerConfiguration config(argc, argv); |
4346 | 97 | mir::write_to_log = my_write_to_log; | ||
4347 | 76 | 98 | ||
4348 | 77 | mir::run_mir(config, [](mir::DisplayServer&) {/* empty init */}); | 99 | mir::run_mir(config, [](mir::DisplayServer&) {/* empty init */}); |
4349 | 78 | return 0; | 100 | return 0; |
4350 | 79 | 101 | ||
4351 | === modified file 'examples/eglapp.c' | |||
4352 | --- examples/eglapp.c 2013-10-07 09:21:27 +0000 | |||
4353 | +++ examples/eglapp.c 2013-11-21 20:19:28 +0000 | |||
4354 | @@ -23,6 +23,7 @@ | |||
4355 | 23 | #include <signal.h> | 23 | #include <signal.h> |
4356 | 24 | #include <time.h> | 24 | #include <time.h> |
4357 | 25 | #include <EGL/egl.h> | 25 | #include <EGL/egl.h> |
4358 | 26 | #include <GLES2/gl2.h> | ||
4359 | 26 | 27 | ||
4360 | 27 | #include <xkbcommon/xkbcommon-keysyms.h> | 28 | #include <xkbcommon/xkbcommon-keysyms.h> |
4361 | 28 | 29 | ||
4362 | @@ -75,6 +76,7 @@ | |||
4363 | 75 | time_t now = time(NULL); | 76 | time_t now = time(NULL); |
4364 | 76 | time_t dtime; | 77 | time_t dtime; |
4365 | 77 | int dcount; | 78 | int dcount; |
4366 | 79 | EGLint width, height; | ||
4367 | 78 | 80 | ||
4368 | 79 | if (!running) | 81 | if (!running) |
4369 | 80 | return; | 82 | return; |
4370 | @@ -90,6 +92,14 @@ | |||
4371 | 90 | lasttime = now; | 92 | lasttime = now; |
4372 | 91 | lastcount = count; | 93 | lastcount = count; |
4373 | 92 | } | 94 | } |
4374 | 95 | |||
4375 | 96 | /* This is one way to handle window resizing. But in future it would be | ||
4376 | 97 | better to have resize events coming from the server */ | ||
4377 | 98 | if (eglQuerySurface(egldisplay, eglsurface, EGL_WIDTH, &width) && | ||
4378 | 99 | eglQuerySurface(egldisplay, eglsurface, EGL_HEIGHT, &height)) | ||
4379 | 100 | { | ||
4380 | 101 | glViewport(0, 0, width, height); | ||
4381 | 102 | } | ||
4382 | 93 | } | 103 | } |
4383 | 94 | 104 | ||
4384 | 95 | static void mir_eglapp_handle_input(MirSurface* surface, MirEvent const* ev, void* context) | 105 | static void mir_eglapp_handle_input(MirSurface* surface, MirEvent const* ev, void* context) |
4385 | @@ -300,12 +310,11 @@ | |||
4386 | 300 | 310 | ||
4387 | 301 | const MirDisplayMode *mode = &output->modes[output->current_mode]; | 311 | const MirDisplayMode *mode = &output->modes[output->current_mode]; |
4388 | 302 | 312 | ||
4391 | 303 | const unsigned int max_formats = 10; | 313 | unsigned int format[mir_pixel_formats]; |
4390 | 304 | unsigned int format[max_formats]; | ||
4392 | 305 | unsigned int nformats; | 314 | unsigned int nformats; |
4393 | 306 | 315 | ||
4394 | 307 | mir_connection_get_available_surface_formats(connection, | 316 | mir_connection_get_available_surface_formats(connection, |
4396 | 308 | format, max_formats, &nformats); | 317 | format, mir_pixel_formats, &nformats); |
4397 | 309 | 318 | ||
4398 | 310 | surfaceparm.pixel_format = format[0]; | 319 | surfaceparm.pixel_format = format[0]; |
4399 | 311 | for (unsigned int f = 0; f < nformats; f++) | 320 | for (unsigned int f = 0; f < nformats; f++) |
4400 | @@ -322,18 +331,17 @@ | |||
4401 | 322 | } | 331 | } |
4402 | 323 | } | 332 | } |
4403 | 324 | 333 | ||
4406 | 325 | printf("Connected to display: resolution (%dx%d), position(%dx%d), " | 334 | printf("Current active output is %dx%d %+d%+d\n", |
4405 | 326 | "supports %d pixel formats\n", | ||
4407 | 327 | mode->horizontal_resolution, mode->vertical_resolution, | 335 | mode->horizontal_resolution, mode->vertical_resolution, |
4410 | 328 | output->position_x, output->position_y, | 336 | output->position_x, output->position_y); |
4409 | 329 | output->num_output_formats); | ||
4411 | 330 | 337 | ||
4412 | 331 | surfaceparm.width = *width > 0 ? *width : mode->horizontal_resolution; | 338 | surfaceparm.width = *width > 0 ? *width : mode->horizontal_resolution; |
4413 | 332 | surfaceparm.height = *height > 0 ? *height : mode->vertical_resolution; | 339 | surfaceparm.height = *height > 0 ? *height : mode->vertical_resolution; |
4414 | 333 | 340 | ||
4415 | 334 | mir_display_config_destroy(display_config); | 341 | mir_display_config_destroy(display_config); |
4416 | 335 | 342 | ||
4418 | 336 | printf("Using pixel format #%d\n", surfaceparm.pixel_format); | 343 | printf("Server supports %d of %d surface pixel formats. Using format: %d\n", |
4419 | 344 | nformats, mir_pixel_formats, surfaceparm.pixel_format); | ||
4420 | 337 | unsigned int bpp = get_bpp(surfaceparm.pixel_format); | 345 | unsigned int bpp = get_bpp(surfaceparm.pixel_format); |
4421 | 338 | EGLint attribs[] = | 346 | EGLint attribs[] = |
4422 | 339 | { | 347 | { |
4423 | 340 | 348 | ||
4424 | === modified file 'examples/progressbar.c' | |||
4425 | --- examples/progressbar.c 2013-08-27 08:52:43 +0000 | |||
4426 | +++ examples/progressbar.c 2013-11-21 20:19:28 +0000 | |||
4427 | @@ -33,6 +33,12 @@ | |||
4428 | 33 | uint8_t r, g, b, a; | 33 | uint8_t r, g, b, a; |
4429 | 34 | } Color; | 34 | } Color; |
4430 | 35 | 35 | ||
4431 | 36 | static const Color blue = {0, 0, 255, 255}; | ||
4432 | 37 | static const Color white = {255, 255, 255, 255}; | ||
4433 | 38 | |||
4434 | 39 | static const Color *const foreground = &white; | ||
4435 | 40 | static const Color *const background = &blue; | ||
4436 | 41 | |||
4437 | 36 | static volatile sig_atomic_t running = 1; | 42 | static volatile sig_atomic_t running = 1; |
4438 | 37 | 43 | ||
4439 | 38 | static void shutdown(int signum) | 44 | static void shutdown(int signum) |
4440 | @@ -178,6 +184,7 @@ | |||
4441 | 178 | MirGraphicsRegion backbuffer; | 184 | MirGraphicsRegion backbuffer; |
4442 | 179 | 185 | ||
4443 | 180 | mir_surface_get_graphics_region(surface, &backbuffer); | 186 | mir_surface_get_graphics_region(surface, &backbuffer); |
4444 | 187 | clear_region(&backbuffer, background); | ||
4445 | 181 | copy_region(&backbuffer, canvas); | 188 | copy_region(&backbuffer, canvas); |
4446 | 182 | mir_surface_swap_buffers_sync(surface); | 189 | mir_surface_swap_buffers_sync(surface); |
4447 | 183 | } | 190 | } |
4448 | @@ -264,8 +271,6 @@ | |||
4449 | 264 | 271 | ||
4450 | 265 | while (running) | 272 | while (running) |
4451 | 266 | { | 273 | { |
4452 | 267 | static const Color background = {0, 0, 255, 255}; | ||
4453 | 268 | static const Color foreground = {255, 255, 255, 255}; | ||
4454 | 269 | static const int width = 8; | 274 | static const int width = 8; |
4455 | 270 | static const int space = 1; | 275 | static const int space = 1; |
4456 | 271 | const int grid = width + 2 * space; | 276 | const int grid = width + 2 * space; |
4457 | @@ -275,11 +280,11 @@ | |||
4458 | 275 | const int y = (t / row) * grid + space; | 280 | const int y = (t / row) * grid + space; |
4459 | 276 | 281 | ||
4460 | 277 | if (t % square == 0) | 282 | if (t % square == 0) |
4462 | 278 | clear_region(&canvas, &background); | 283 | clear_region(&canvas, background); |
4463 | 279 | 284 | ||
4464 | 280 | t = (t + 1) % square; | 285 | t = (t + 1) % square; |
4465 | 281 | 286 | ||
4467 | 282 | draw_box(&canvas, x, y, width, &foreground); | 287 | draw_box(&canvas, x, y, width, foreground); |
4468 | 283 | 288 | ||
4469 | 284 | redraw(surf, &canvas); | 289 | redraw(surf, &canvas); |
4470 | 285 | usleep(sleep_usec); | 290 | usleep(sleep_usec); |
4471 | 286 | 291 | ||
4472 | === modified file 'examples/render_surfaces.cpp' | |||
4473 | --- examples/render_surfaces.cpp 2013-11-06 03:17:35 +0000 | |||
4474 | +++ examples/render_surfaces.cpp 2013-11-21 20:19:28 +0000 | |||
4475 | @@ -27,8 +27,8 @@ | |||
4476 | 27 | #include "mir/graphics/cursor.h" | 27 | #include "mir/graphics/cursor.h" |
4477 | 28 | #include "mir/graphics/display.h" | 28 | #include "mir/graphics/display.h" |
4478 | 29 | #include "mir/graphics/display_buffer.h" | 29 | #include "mir/graphics/display_buffer.h" |
4481 | 30 | #include "mir/shell/surface_builder.h" | 30 | #include "mir/shell/surface_factory.h" |
4482 | 31 | #include "mir/surfaces/surface.h" | 31 | #include "mir/shell/surface.h" |
4483 | 32 | #include "mir/run_mir.h" | 32 | #include "mir/run_mir.h" |
4484 | 33 | #include "mir/report_exception.h" | 33 | #include "mir/report_exception.h" |
4485 | 34 | 34 | ||
4486 | @@ -185,13 +185,13 @@ | |||
4487 | 185 | { | 185 | { |
4488 | 186 | public: | 186 | public: |
4489 | 187 | Moveable() {} | 187 | Moveable() {} |
4491 | 188 | Moveable(ms::Surface& s, const geom::Size& display_size, | 188 | Moveable(std::shared_ptr<msh::Surface> const& s, const geom::Size& display_size, |
4492 | 189 | float dx, float dy, const glm::vec3& rotation_axis, float alpha_offset) | 189 | float dx, float dy, const glm::vec3& rotation_axis, float alpha_offset) |
4498 | 190 | : surface(&s), display_size(display_size), | 190 | : surface(s), display_size(display_size), |
4499 | 191 | x{static_cast<float>(s.top_left().x.as_uint32_t())}, | 191 | x{static_cast<float>(s->top_left().x.as_uint32_t())}, |
4500 | 192 | y{static_cast<float>(s.top_left().y.as_uint32_t())}, | 192 | y{static_cast<float>(s->top_left().y.as_uint32_t())}, |
4501 | 193 | w{static_cast<float>(s.size().width.as_uint32_t())}, | 193 | w{static_cast<float>(s->size().width.as_uint32_t())}, |
4502 | 194 | h{static_cast<float>(s.size().height.as_uint32_t())}, | 194 | h{static_cast<float>(s->size().height.as_uint32_t())}, |
4503 | 195 | dx{dx}, | 195 | dx{dx}, |
4504 | 196 | dy{dy}, | 196 | dy{dy}, |
4505 | 197 | rotation_axis{rotation_axis}, | 197 | rotation_axis{rotation_axis}, |
4506 | @@ -233,7 +233,7 @@ | |||
4507 | 233 | } | 233 | } |
4508 | 234 | 234 | ||
4509 | 235 | private: | 235 | private: |
4511 | 236 | ms::Surface* surface; | 236 | std::shared_ptr<msh::Surface> surface; |
4512 | 237 | geom::Size display_size; | 237 | geom::Size display_size; |
4513 | 238 | float x; | 238 | float x; |
4514 | 239 | float y; | 239 | float y; |
4515 | @@ -387,7 +387,7 @@ | |||
4516 | 387 | std::cout << "Rendering " << moveables.size() << " surfaces" << std::endl; | 387 | std::cout << "Rendering " << moveables.size() << " surfaces" << std::endl; |
4517 | 388 | 388 | ||
4518 | 389 | auto const display = the_display(); | 389 | auto const display = the_display(); |
4520 | 390 | auto const surface_builder = the_surface_builder(); | 390 | auto const surface_factory = the_surfaces_surface_factory(); |
4521 | 391 | /* TODO: Get proper configuration */ | 391 | /* TODO: Get proper configuration */ |
4522 | 392 | geom::Rectangles view_area; | 392 | geom::Rectangles view_area; |
4523 | 393 | display->for_each_display_buffer([&view_area](mg::DisplayBuffer const& db) | 393 | display->for_each_display_buffer([&view_area](mg::DisplayBuffer const& db) |
4524 | @@ -406,18 +406,20 @@ | |||
4525 | 406 | int i = 0; | 406 | int i = 0; |
4526 | 407 | for (auto& m : moveables) | 407 | for (auto& m : moveables) |
4527 | 408 | { | 408 | { |
4529 | 409 | std::shared_ptr<ms::Surface> s = surface_builder->create_surface( | 409 | auto const s = surface_factory->create_surface( |
4530 | 410 | nullptr, | 410 | nullptr, |
4531 | 411 | msh::a_surface().of_size(surface_size) | 411 | msh::a_surface().of_size(surface_size) |
4532 | 412 | .of_pixel_format(surface_pf) | 412 | .of_pixel_format(surface_pf) |
4535 | 413 | .of_buffer_usage(mg::BufferUsage::hardware) | 413 | .of_buffer_usage(mg::BufferUsage::hardware), |
4536 | 414 | ).lock(); | 414 | mf::SurfaceId(), {}); |
4537 | 415 | 415 | ||
4538 | 416 | /* | 416 | /* |
4541 | 417 | * Let the system know that the surface is suitable for rendering | 417 | * We call advance_client_buffer() twice so that the surface is |
4542 | 418 | * (i.e., that it contains buffers with valid contents). | 418 | * considers the first buffer to be posted. |
4543 | 419 | * (TODO There must be a better way!) | ||
4544 | 419 | */ | 420 | */ |
4546 | 420 | s->flag_for_render(); | 421 | s->advance_client_buffer(); |
4547 | 422 | s->advance_client_buffer(); | ||
4548 | 421 | 423 | ||
4549 | 422 | /* | 424 | /* |
4550 | 423 | * Place each surface at a different starting location and give it a | 425 | * Place each surface at a different starting location and give it a |
4551 | @@ -427,7 +429,7 @@ | |||
4552 | 427 | uint32_t const y = h * (0.5 + 0.25 * sin(i * angular_step)) - surface_side / 2.0; | 429 | uint32_t const y = h * (0.5 + 0.25 * sin(i * angular_step)) - surface_side / 2.0; |
4553 | 428 | 430 | ||
4554 | 429 | s->move_to({x, y}); | 431 | s->move_to({x, y}); |
4556 | 430 | m = Moveable(*s, display_size, | 432 | m = Moveable(s, display_size, |
4557 | 431 | cos(0.1f + i * M_PI / 6.0f) * w / 3.0f, | 433 | cos(0.1f + i * M_PI / 6.0f) * w / 3.0f, |
4558 | 432 | sin(0.1f + i * M_PI / 6.0f) * h / 3.0f, | 434 | sin(0.1f + i * M_PI / 6.0f) * h / 3.0f, |
4559 | 433 | glm::vec3{(i % 3 == 0) * 1.0f, (i % 3 == 1) * 1.0f, (i % 3 == 2) * 1.0f}, | 435 | glm::vec3{(i % 3 == 0) * 1.0f, (i % 3 == 1) * 1.0f, (i % 3 == 2) * 1.0f}, |
4560 | 434 | 436 | ||
4561 | === modified file 'include/client/mir_toolkit/mir_client_library.h' | |||
4562 | --- include/client/mir_toolkit/mir_client_library.h 2013-08-28 03:41:48 +0000 | |||
4563 | +++ include/client/mir_toolkit/mir_client_library.h 2013-11-21 20:19:28 +0000 | |||
4564 | @@ -207,7 +207,7 @@ | |||
4565 | 207 | /** | 207 | /** |
4566 | 208 | * Set the event handler to be called when events arrive for a surface. | 208 | * Set the event handler to be called when events arrive for a surface. |
4567 | 209 | * \warning event_handler could be called from another thread. You must do | 209 | * \warning event_handler could be called from another thread. You must do |
4569 | 210 | * and locking appropriate to protect your data accessed in the | 210 | * any locking appropriate to protect your data accessed in the |
4570 | 211 | * callback. There is also a chance that different events will be | 211 | * callback. There is also a chance that different events will be |
4571 | 212 | * called back in different threads, for the same surface, | 212 | * called back in different threads, for the same surface, |
4572 | 213 | * simultaneously. | 213 | * simultaneously. |
4573 | 214 | 214 | ||
4574 | === added file 'include/platform/mir/graphics/basic_platform.h' | |||
4575 | --- include/platform/mir/graphics/basic_platform.h 1970-01-01 00:00:00 +0000 | |||
4576 | +++ include/platform/mir/graphics/basic_platform.h 2013-11-21 20:19:28 +0000 | |||
4577 | @@ -0,0 +1,45 @@ | |||
4578 | 1 | /* | ||
4579 | 2 | * Copyright © 2013 Canonical Ltd. | ||
4580 | 3 | * | ||
4581 | 4 | * This program is free software: you can redistribute it and/or modify it | ||
4582 | 5 | * under the terms of the GNU Lesser General Public License version 3, | ||
4583 | 6 | * as published by the Free Software Foundation. | ||
4584 | 7 | * | ||
4585 | 8 | * This program is distributed in the hope that it will be useful, | ||
4586 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
4587 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
4588 | 11 | * GNU Lesser General Public License for more details. | ||
4589 | 12 | * | ||
4590 | 13 | * You should have received a copy of the GNU Lesser General Public License | ||
4591 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
4592 | 15 | * | ||
4593 | 16 | * Authored by: Alexandros Frantzis <alexandros.frantzis@canonical.com> | ||
4594 | 17 | */ | ||
4595 | 18 | |||
4596 | 19 | #ifndef MIR_GRAPHICS_BASIC_PLATFORM_H_ | ||
4597 | 20 | #define MIR_GRAPHICS_BASIC_PLATFORM_H_ | ||
4598 | 21 | |||
4599 | 22 | #include <EGL/egl.h> | ||
4600 | 23 | |||
4601 | 24 | namespace mir | ||
4602 | 25 | { | ||
4603 | 26 | namespace graphics | ||
4604 | 27 | { | ||
4605 | 28 | |||
4606 | 29 | class BasicPlatform | ||
4607 | 30 | { | ||
4608 | 31 | public: | ||
4609 | 32 | virtual ~BasicPlatform() = default; | ||
4610 | 33 | |||
4611 | 34 | virtual EGLNativeDisplayType egl_native_display() const = 0; | ||
4612 | 35 | |||
4613 | 36 | protected: | ||
4614 | 37 | BasicPlatform() = default; | ||
4615 | 38 | BasicPlatform(BasicPlatform const&) = delete; | ||
4616 | 39 | BasicPlatform& operator=(BasicPlatform const&) = delete; | ||
4617 | 40 | }; | ||
4618 | 41 | |||
4619 | 42 | } | ||
4620 | 43 | } | ||
4621 | 44 | |||
4622 | 45 | #endif /* MIR_GRAPHICS_BASIC_PLATFORM_H_ */ | ||
4623 | 0 | 46 | ||
4624 | === modified file 'include/platform/mir/graphics/buffer_ipc_packer.h' | |||
4625 | --- include/platform/mir/graphics/buffer_ipc_packer.h 2013-09-11 05:21:22 +0000 | |||
4626 | +++ include/platform/mir/graphics/buffer_ipc_packer.h 2013-11-21 20:19:28 +0000 | |||
4627 | @@ -20,6 +20,7 @@ | |||
4628 | 20 | #define MIR_GRAPHICS_BUFFER_IPC_PACKER_H_ | 20 | #define MIR_GRAPHICS_BUFFER_IPC_PACKER_H_ |
4629 | 21 | 21 | ||
4630 | 22 | #include "mir/geometry/dimensions.h" | 22 | #include "mir/geometry/dimensions.h" |
4631 | 23 | #include "mir/geometry/size.h" | ||
4632 | 23 | 24 | ||
4633 | 24 | namespace mir | 25 | namespace mir |
4634 | 25 | { | 26 | { |
4635 | @@ -34,6 +35,7 @@ | |||
4636 | 34 | virtual void pack_data(int) = 0; | 35 | virtual void pack_data(int) = 0; |
4637 | 35 | virtual void pack_stride(geometry::Stride) = 0; | 36 | virtual void pack_stride(geometry::Stride) = 0; |
4638 | 36 | virtual void pack_flags(unsigned int) = 0; | 37 | virtual void pack_flags(unsigned int) = 0; |
4639 | 38 | virtual void pack_size(geometry::Size const& size) = 0; | ||
4640 | 37 | 39 | ||
4641 | 38 | protected: | 40 | protected: |
4642 | 39 | BufferIPCPacker() {} | 41 | BufferIPCPacker() {} |
4643 | 40 | 42 | ||
4644 | === modified file 'include/platform/mir/graphics/egl_resources.h' | |||
4645 | --- include/platform/mir/graphics/egl_resources.h 2013-08-28 03:41:48 +0000 | |||
4646 | +++ include/platform/mir/graphics/egl_resources.h 2013-11-21 20:19:28 +0000 | |||
4647 | @@ -30,6 +30,8 @@ | |||
4648 | 30 | { | 30 | { |
4649 | 31 | public: | 31 | public: |
4650 | 32 | EGLContextStore(EGLDisplay egl_display, EGLContext egl_context); | 32 | EGLContextStore(EGLDisplay egl_display, EGLContext egl_context); |
4651 | 33 | EGLContextStore(EGLContextStore&&); | ||
4652 | 34 | |||
4653 | 33 | ~EGLContextStore() noexcept; | 35 | ~EGLContextStore() noexcept; |
4654 | 34 | 36 | ||
4655 | 35 | operator EGLContext() const; | 37 | operator EGLContext() const; |
4656 | @@ -38,14 +40,18 @@ | |||
4657 | 38 | EGLContextStore(EGLContextStore const&) = delete; | 40 | EGLContextStore(EGLContextStore const&) = delete; |
4658 | 39 | EGLContextStore& operator=(EGLContextStore const&) = delete; | 41 | EGLContextStore& operator=(EGLContextStore const&) = delete; |
4659 | 40 | 42 | ||
4662 | 41 | EGLDisplay const egl_display_; | 43 | EGLDisplay egl_display_; |
4663 | 42 | EGLContext const egl_context_; | 44 | EGLContext egl_context_; |
4664 | 43 | }; | 45 | }; |
4665 | 44 | 46 | ||
4666 | 45 | class EGLSurfaceStore | 47 | class EGLSurfaceStore |
4667 | 46 | { | 48 | { |
4668 | 47 | public: | 49 | public: |
4669 | 50 | enum AllowNoSurface { DisallowNoSurface, AllowNoSurface }; | ||
4670 | 51 | EGLSurfaceStore(EGLDisplay egl_display, EGLSurface egl_surface, | ||
4671 | 52 | enum AllowNoSurface allow_no_surface); | ||
4672 | 48 | EGLSurfaceStore(EGLDisplay egl_display, EGLSurface egl_surface); | 53 | EGLSurfaceStore(EGLDisplay egl_display, EGLSurface egl_surface); |
4673 | 54 | EGLSurfaceStore(EGLSurfaceStore&&); | ||
4674 | 49 | 55 | ||
4675 | 50 | ~EGLSurfaceStore() noexcept; | 56 | ~EGLSurfaceStore() noexcept; |
4676 | 51 | 57 | ||
4677 | @@ -55,8 +61,8 @@ | |||
4678 | 55 | EGLSurfaceStore(EGLSurfaceStore const&) = delete; | 61 | EGLSurfaceStore(EGLSurfaceStore const&) = delete; |
4679 | 56 | EGLSurfaceStore& operator=(EGLSurfaceStore const&) = delete; | 62 | EGLSurfaceStore& operator=(EGLSurfaceStore const&) = delete; |
4680 | 57 | 63 | ||
4683 | 58 | EGLDisplay const egl_display_; | 64 | EGLDisplay egl_display_; |
4684 | 59 | EGLSurface const egl_surface_; | 65 | EGLSurface egl_surface_; |
4685 | 60 | }; | 66 | }; |
4686 | 61 | 67 | ||
4687 | 62 | } | 68 | } |
4688 | 63 | 69 | ||
4689 | === modified file 'include/platform/mir/graphics/native_platform.h' | |||
4690 | --- include/platform/mir/graphics/native_platform.h 2013-10-23 09:33:59 +0000 | |||
4691 | +++ include/platform/mir/graphics/native_platform.h 2013-11-21 20:19:28 +0000 | |||
4692 | @@ -52,7 +52,7 @@ | |||
4693 | 52 | 52 | ||
4694 | 53 | virtual std::shared_ptr<InternalClient> create_internal_client() = 0; | 53 | virtual std::shared_ptr<InternalClient> create_internal_client() = 0; |
4695 | 54 | 54 | ||
4697 | 55 | virtual void fill_ipc_package(std::shared_ptr<BufferIPCPacker> const& packer, std::shared_ptr<Buffer> const& buffer) const = 0; | 55 | virtual void fill_ipc_package(BufferIPCPacker* packer, Buffer const* buffer) const = 0; |
4698 | 56 | 56 | ||
4699 | 57 | virtual ~NativePlatform() = default; | 57 | virtual ~NativePlatform() = default; |
4700 | 58 | NativePlatform(NativePlatform const&) = delete; | 58 | NativePlatform(NativePlatform const&) = delete; |
4701 | 59 | 59 | ||
4702 | === modified file 'include/platform/mir/graphics/platform.h' | |||
4703 | --- include/platform/mir/graphics/platform.h 2013-08-28 03:41:48 +0000 | |||
4704 | +++ include/platform/mir/graphics/platform.h 2013-11-21 20:19:28 +0000 | |||
4705 | @@ -20,6 +20,8 @@ | |||
4706 | 20 | #ifndef MIR_GRAPHICS_PLATFORM_H_ | 20 | #ifndef MIR_GRAPHICS_PLATFORM_H_ |
4707 | 21 | #define MIR_GRAPHICS_PLATFORM_H_ | 21 | #define MIR_GRAPHICS_PLATFORM_H_ |
4708 | 22 | 22 | ||
4709 | 23 | #include "basic_platform.h" | ||
4710 | 24 | |||
4711 | 23 | #include <memory> | 25 | #include <memory> |
4712 | 24 | 26 | ||
4713 | 25 | namespace mir | 27 | namespace mir |
4714 | @@ -57,7 +59,7 @@ | |||
4715 | 57 | * Interface to platform specific support for graphics operations. | 59 | * Interface to platform specific support for graphics operations. |
4716 | 58 | * \ingroup platform_enablement | 60 | * \ingroup platform_enablement |
4717 | 59 | */ | 61 | */ |
4719 | 60 | class Platform | 62 | class Platform : public BasicPlatform |
4720 | 61 | { | 63 | { |
4721 | 62 | public: | 64 | public: |
4722 | 63 | Platform() = default; | 65 | Platform() = default; |
4723 | @@ -97,8 +99,7 @@ | |||
4724 | 97 | * \param [in] packer the object providing the packing functionality | 99 | * \param [in] packer the object providing the packing functionality |
4725 | 98 | * \param [in] buffer the buffer to fill the IPC package for | 100 | * \param [in] buffer the buffer to fill the IPC package for |
4726 | 99 | */ | 101 | */ |
4729 | 100 | virtual void fill_ipc_package(std::shared_ptr<BufferIPCPacker> const& packer, | 102 | virtual void fill_ipc_package(BufferIPCPacker* packer, Buffer const* buffer) const = 0; |
4728 | 101 | std::shared_ptr<graphics::Buffer> const& buffer) const = 0; | ||
4730 | 102 | 103 | ||
4731 | 103 | /** | 104 | /** |
4732 | 104 | * Creates the in-process client support object. | 105 | * Creates the in-process client support object. |
4733 | 105 | 106 | ||
4734 | === modified file 'include/server/mir/compositor/buffer_stream.h' | |||
4735 | --- include/server/mir/compositor/buffer_stream.h 2013-11-06 03:17:35 +0000 | |||
4736 | +++ include/server/mir/compositor/buffer_stream.h 2013-11-21 20:19:28 +0000 | |||
4737 | @@ -47,6 +47,7 @@ | |||
4738 | 47 | virtual std::shared_ptr<graphics::Buffer> lock_snapshot_buffer() = 0; | 47 | virtual std::shared_ptr<graphics::Buffer> lock_snapshot_buffer() = 0; |
4739 | 48 | virtual geometry::PixelFormat get_stream_pixel_format() = 0; | 48 | virtual geometry::PixelFormat get_stream_pixel_format() = 0; |
4740 | 49 | virtual geometry::Size stream_size() = 0; | 49 | virtual geometry::Size stream_size() = 0; |
4741 | 50 | virtual void resize(geometry::Size const& size) = 0; | ||
4742 | 50 | virtual void allow_framedropping(bool) = 0; | 51 | virtual void allow_framedropping(bool) = 0; |
4743 | 51 | virtual void force_requests_to_complete() = 0; | 52 | virtual void force_requests_to_complete() = 0; |
4744 | 52 | }; | 53 | }; |
4745 | 53 | 54 | ||
4746 | === modified file 'include/server/mir/compositor/scene.h' | |||
4747 | --- include/server/mir/compositor/scene.h 2013-11-06 03:17:35 +0000 | |||
4748 | +++ include/server/mir/compositor/scene.h 2013-11-21 20:19:28 +0000 | |||
4749 | @@ -75,7 +75,7 @@ | |||
4750 | 75 | * Scene changes. | 75 | * Scene changes. |
4751 | 76 | * | 76 | * |
4752 | 77 | * The supplied callback should not directly or indirectly (e.g., | 77 | * The supplied callback should not directly or indirectly (e.g., |
4754 | 78 | * by changing a property of a Renderable) change the state of | 78 | * by changing a property of a surface) change the state of |
4755 | 79 | * the Scene, otherwise a deadlock may occur. | 79 | * the Scene, otherwise a deadlock may occur. |
4756 | 80 | */ | 80 | */ |
4757 | 81 | virtual void set_change_callback(std::function<void()> const& f) = 0; | 81 | virtual void set_change_callback(std::function<void()> const& f) = 0; |
4758 | 82 | 82 | ||
4759 | === modified file 'include/server/mir/default_configuration_options.h' | |||
4760 | --- include/server/mir/default_configuration_options.h 2013-11-06 03:17:35 +0000 | |||
4761 | +++ include/server/mir/default_configuration_options.h 2013-11-21 20:19:28 +0000 | |||
4762 | @@ -40,7 +40,12 @@ | |||
4763 | 40 | static char const* const host_socket_opt; | 40 | static char const* const host_socket_opt; |
4764 | 41 | static char const* const standalone_opt; | 41 | static char const* const standalone_opt; |
4765 | 42 | static char const* const frontend_threads; | 42 | static char const* const frontend_threads; |
4767 | 43 | static char const* const name_opt; | 43 | <<<<<<< TREE |
4768 | 44 | static char const* const name_opt; | ||
4769 | 45 | ======= | ||
4770 | 46 | static char const* const name_opt; | ||
4771 | 47 | static char const* const offscreen_opt; | ||
4772 | 48 | >>>>>>> MERGE-SOURCE | ||
4773 | 44 | 49 | ||
4774 | 45 | static char const* const glog; | 50 | static char const* const glog; |
4775 | 46 | static char const* const glog_stderrthreshold; | 51 | static char const* const glog_stderrthreshold; |
4776 | 47 | 52 | ||
4777 | === modified file 'include/server/mir/default_server_configuration.h' | |||
4778 | --- include/server/mir/default_server_configuration.h 2013-11-06 03:17:35 +0000 | |||
4779 | +++ include/server/mir/default_server_configuration.h 2013-11-21 20:19:28 +0000 | |||
4780 | @@ -55,32 +55,31 @@ | |||
4781 | 55 | namespace shell | 55 | namespace shell |
4782 | 56 | { | 56 | { |
4783 | 57 | class SurfaceFactory; | 57 | class SurfaceFactory; |
4784 | 58 | class SurfaceBuilder; | ||
4785 | 59 | class SurfaceController; | 58 | class SurfaceController; |
4786 | 60 | class InputTargeter; | 59 | class InputTargeter; |
4787 | 61 | class SessionContainer; | ||
4788 | 62 | class FocusSetter; | 60 | class FocusSetter; |
4789 | 63 | class FocusSequence; | ||
4790 | 64 | class PlacementStrategy; | 61 | class PlacementStrategy; |
4791 | 65 | class SessionListener; | 62 | class SessionListener; |
4792 | 66 | class FocusController; | 63 | class FocusController; |
4793 | 67 | class SessionManager; | ||
4794 | 68 | class PixelBuffer; | ||
4795 | 69 | class SnapshotStrategy; | ||
4796 | 70 | class DisplayLayout; | 64 | class DisplayLayout; |
4797 | 71 | class SurfaceConfigurator; | 65 | class SurfaceConfigurator; |
4798 | 66 | } | ||
4799 | 67 | namespace time | ||
4800 | 68 | { | ||
4801 | 69 | class TimeSource; | ||
4802 | 70 | } | ||
4803 | 71 | namespace surfaces | ||
4804 | 72 | { | ||
4805 | 73 | class BroadcastingSessionEventSink; | ||
4806 | 74 | class BufferStreamFactory; | ||
4807 | 72 | class MediatingDisplayChanger; | 75 | class MediatingDisplayChanger; |
4808 | 76 | class PixelBuffer; | ||
4809 | 77 | class SessionContainer; | ||
4810 | 73 | class SessionEventSink; | 78 | class SessionEventSink; |
4811 | 74 | class SessionEventHandlerRegister; | 79 | class SessionEventHandlerRegister; |
4821 | 75 | class BroadcastingSessionEventSink; | 80 | class SessionManager; |
4822 | 76 | } | 81 | class SnapshotStrategy; |
4823 | 77 | namespace time | 82 | class SurfaceBuilder; |
4815 | 78 | { | ||
4816 | 79 | class TimeSource; | ||
4817 | 80 | } | ||
4818 | 81 | namespace surfaces | ||
4819 | 82 | { | ||
4820 | 83 | class BufferStreamFactory; | ||
4824 | 84 | class SurfaceStackModel; | 83 | class SurfaceStackModel; |
4825 | 85 | class SurfaceStack; | 84 | class SurfaceStack; |
4826 | 86 | class SurfaceController; | 85 | class SurfaceController; |
4827 | @@ -186,15 +185,13 @@ | |||
4828 | 186 | * configurable interfaces for modifying shell | 185 | * configurable interfaces for modifying shell |
4829 | 187 | * @{ */ | 186 | * @{ */ |
4830 | 188 | virtual std::shared_ptr<shell::SurfaceFactory> the_shell_surface_factory(); | 187 | virtual std::shared_ptr<shell::SurfaceFactory> the_shell_surface_factory(); |
4832 | 189 | virtual std::shared_ptr<shell::SessionContainer> the_shell_session_container(); | 188 | virtual std::shared_ptr<shell::SurfaceFactory> the_surfaces_surface_factory(); |
4833 | 190 | virtual std::shared_ptr<shell::FocusSetter> the_shell_focus_setter(); | 189 | virtual std::shared_ptr<shell::FocusSetter> the_shell_focus_setter(); |
4834 | 191 | virtual std::shared_ptr<shell::FocusSequence> the_shell_focus_sequence(); | ||
4835 | 192 | virtual std::shared_ptr<shell::PlacementStrategy> the_shell_placement_strategy(); | 190 | virtual std::shared_ptr<shell::PlacementStrategy> the_shell_placement_strategy(); |
4836 | 193 | virtual std::shared_ptr<shell::SessionListener> the_shell_session_listener(); | 191 | virtual std::shared_ptr<shell::SessionListener> the_shell_session_listener(); |
4837 | 194 | virtual std::shared_ptr<shell::PixelBuffer> the_shell_pixel_buffer(); | ||
4838 | 195 | virtual std::shared_ptr<shell::SnapshotStrategy> the_shell_snapshot_strategy(); | ||
4839 | 196 | virtual std::shared_ptr<shell::DisplayLayout> the_shell_display_layout(); | 192 | virtual std::shared_ptr<shell::DisplayLayout> the_shell_display_layout(); |
4840 | 197 | virtual std::shared_ptr<shell::SurfaceConfigurator> the_shell_surface_configurator(); | 193 | virtual std::shared_ptr<shell::SurfaceConfigurator> the_shell_surface_configurator(); |
4841 | 194 | <<<<<<< TREE | ||
4842 | 198 | virtual std::shared_ptr<shell::SessionEventSink> the_shell_session_event_sink(); | 195 | virtual std::shared_ptr<shell::SessionEventSink> the_shell_session_event_sink(); |
4843 | 199 | virtual std::shared_ptr<shell::SessionEventHandlerRegister> the_shell_session_event_handler_register(); | 196 | virtual std::shared_ptr<shell::SessionEventHandlerRegister> the_shell_session_event_handler_register(); |
4844 | 200 | virtual std::shared_ptr<shell::SurfaceController> the_shell_surface_controller(); | 197 | virtual std::shared_ptr<shell::SurfaceController> the_shell_surface_controller(); |
4845 | @@ -212,6 +209,20 @@ | |||
4846 | 212 | /** @name surfaces configuration - customization | 209 | /** @name surfaces configuration - customization |
4847 | 213 | * configurable interfaces for modifying surfaces | 210 | * configurable interfaces for modifying surfaces |
4848 | 214 | * @{ */ | 211 | * @{ */ |
4849 | 212 | ======= | ||
4850 | 213 | virtual std::shared_ptr<shell::SurfaceController> the_shell_surface_controller(); | ||
4851 | 214 | /** @} */ | ||
4852 | 215 | |||
4853 | 216 | /** @name internal surfaces configuration | ||
4854 | 217 | * builder functions used in the default implementation. | ||
4855 | 218 | * The interfaces returned are not published, so the functions are only useful in tests | ||
4856 | 219 | * @{ */ | ||
4857 | 220 | virtual std::shared_ptr<surfaces::PixelBuffer> the_pixel_buffer(); | ||
4858 | 221 | virtual std::shared_ptr<surfaces::SnapshotStrategy> the_snapshot_strategy(); | ||
4859 | 222 | virtual std::shared_ptr<surfaces::SessionContainer> the_session_container(); | ||
4860 | 223 | virtual std::shared_ptr<surfaces::SessionEventSink> the_session_event_sink(); | ||
4861 | 224 | virtual std::shared_ptr<surfaces::SessionEventHandlerRegister> the_session_event_handler_register(); | ||
4862 | 225 | >>>>>>> MERGE-SOURCE | ||
4863 | 215 | virtual std::shared_ptr<surfaces::SurfaceStackModel> the_surface_stack_model(); | 226 | virtual std::shared_ptr<surfaces::SurfaceStackModel> the_surface_stack_model(); |
4864 | 216 | virtual std::shared_ptr<surfaces::SurfacesReport> the_surfaces_report(); | 227 | virtual std::shared_ptr<surfaces::SurfacesReport> the_surfaces_report(); |
4865 | 217 | /** @} */ | 228 | /** @} */ |
4866 | @@ -220,6 +231,7 @@ | |||
4867 | 220 | * dependencies of surfaces on the rest of the Mir | 231 | * dependencies of surfaces on the rest of the Mir |
4868 | 221 | * @{ */ | 232 | * @{ */ |
4869 | 222 | virtual std::shared_ptr<surfaces::BufferStreamFactory> the_buffer_stream_factory(); | 233 | virtual std::shared_ptr<surfaces::BufferStreamFactory> the_buffer_stream_factory(); |
4870 | 234 | virtual std::shared_ptr<surfaces::SurfacesReport> the_surfaces_report(); | ||
4871 | 223 | /** @} */ | 235 | /** @} */ |
4872 | 224 | 236 | ||
4873 | 225 | 237 | ||
4874 | @@ -241,20 +253,15 @@ | |||
4875 | 241 | 253 | ||
4876 | 242 | virtual std::shared_ptr<time::TimeSource> the_time_source(); | 254 | virtual std::shared_ptr<time::TimeSource> the_time_source(); |
4877 | 243 | 255 | ||
4878 | 244 | virtual std::shared_ptr<shell::SessionManager> the_session_manager(); | ||
4879 | 245 | |||
4880 | 246 | protected: | 256 | protected: |
4881 | 247 | using DefaultConfigurationOptions::the_options; | 257 | using DefaultConfigurationOptions::the_options; |
4882 | 248 | using DefaultConfigurationOptions::add_options; | 258 | using DefaultConfigurationOptions::add_options; |
4883 | 249 | using DefaultConfigurationOptions::parse_options; | 259 | using DefaultConfigurationOptions::parse_options; |
4884 | 250 | 260 | ||
4885 | 251 | virtual std::shared_ptr<input::InputChannelFactory> the_input_channel_factory(); | 261 | virtual std::shared_ptr<input::InputChannelFactory> the_input_channel_factory(); |
4888 | 252 | virtual std::shared_ptr<shell::MediatingDisplayChanger> the_mediating_display_changer(); | 262 | virtual std::shared_ptr<surfaces::MediatingDisplayChanger> the_mediating_display_changer(); |
4887 | 253 | virtual std::shared_ptr<shell::BroadcastingSessionEventSink> the_broadcasting_session_event_sink(); | ||
4889 | 254 | 263 | ||
4890 | 255 | CachedPtr<frontend::Connector> connector; | 264 | CachedPtr<frontend::Connector> connector; |
4891 | 256 | CachedPtr<shell::SessionManager> session_manager; | ||
4892 | 257 | |||
4893 | 258 | 265 | ||
4894 | 259 | CachedPtr<input::InputConfiguration> input_configuration; | 266 | CachedPtr<input::InputConfiguration> input_configuration; |
4895 | 260 | 267 | ||
4896 | @@ -283,13 +290,13 @@ | |||
4897 | 283 | CachedPtr<surfaces::SurfacesReport> surfaces_report; | 290 | CachedPtr<surfaces::SurfacesReport> surfaces_report; |
4898 | 284 | 291 | ||
4899 | 285 | CachedPtr<shell::SurfaceFactory> shell_surface_factory; | 292 | CachedPtr<shell::SurfaceFactory> shell_surface_factory; |
4901 | 286 | CachedPtr<shell::SessionContainer> shell_session_container; | 293 | CachedPtr<shell::SurfaceFactory> surfaces_surface_factory; |
4902 | 294 | CachedPtr<surfaces::SessionContainer> session_container; | ||
4903 | 287 | CachedPtr<shell::FocusSetter> shell_focus_setter; | 295 | CachedPtr<shell::FocusSetter> shell_focus_setter; |
4904 | 288 | CachedPtr<shell::FocusSequence> shell_focus_sequence; | ||
4905 | 289 | CachedPtr<shell::PlacementStrategy> shell_placement_strategy; | 296 | CachedPtr<shell::PlacementStrategy> shell_placement_strategy; |
4906 | 290 | CachedPtr<shell::SessionListener> shell_session_listener; | 297 | CachedPtr<shell::SessionListener> shell_session_listener; |
4909 | 291 | CachedPtr<shell::PixelBuffer> shell_pixel_buffer; | 298 | CachedPtr<surfaces::PixelBuffer> pixel_buffer; |
4910 | 292 | CachedPtr<shell::SnapshotStrategy> shell_snapshot_strategy; | 299 | CachedPtr<surfaces::SnapshotStrategy> snapshot_strategy; |
4911 | 293 | CachedPtr<shell::DisplayLayout> shell_display_layout; | 300 | CachedPtr<shell::DisplayLayout> shell_display_layout; |
4912 | 294 | CachedPtr<shell::SurfaceConfigurator> shell_surface_configurator; | 301 | CachedPtr<shell::SurfaceConfigurator> shell_surface_configurator; |
4913 | 295 | CachedPtr<compositor::DisplayBufferCompositorFactory> display_buffer_compositor_factory; | 302 | CachedPtr<compositor::DisplayBufferCompositorFactory> display_buffer_compositor_factory; |
4914 | @@ -297,26 +304,39 @@ | |||
4915 | 297 | CachedPtr<compositor::Compositor> compositor; | 304 | CachedPtr<compositor::Compositor> compositor; |
4916 | 298 | CachedPtr<logging::Logger> logger; | 305 | CachedPtr<logging::Logger> logger; |
4917 | 299 | CachedPtr<graphics::DisplayReport> display_report; | 306 | CachedPtr<graphics::DisplayReport> display_report; |
4918 | 300 | CachedPtr<surfaces::SurfaceController> surface_controller; | ||
4919 | 301 | CachedPtr<time::TimeSource> time_source; | 307 | CachedPtr<time::TimeSource> time_source; |
4920 | 302 | CachedPtr<MainLoop> main_loop; | 308 | CachedPtr<MainLoop> main_loop; |
4921 | 303 | CachedPtr<ServerStatusListener> server_status_listener; | 309 | CachedPtr<ServerStatusListener> server_status_listener; |
4922 | 304 | CachedPtr<graphics::DisplayConfigurationPolicy> display_configuration_policy; | 310 | CachedPtr<graphics::DisplayConfigurationPolicy> display_configuration_policy; |
4923 | 305 | CachedPtr<graphics::nested::HostConnection> host_connection; | 311 | CachedPtr<graphics::nested::HostConnection> host_connection; |
4927 | 306 | CachedPtr<input::NestedInputRelay> nested_input_relay; | 312 | CachedPtr<surfaces::MediatingDisplayChanger> mediating_display_changer; |
4925 | 307 | CachedPtr<shell::MediatingDisplayChanger> mediating_display_changer; | ||
4926 | 308 | CachedPtr<shell::BroadcastingSessionEventSink> broadcasting_session_event_sink; | ||
4928 | 309 | 313 | ||
4929 | 310 | private: | 314 | private: |
4930 | 311 | std::shared_ptr<input::EventFilter> const default_filter; | 315 | std::shared_ptr<input::EventFilter> const default_filter; |
4931 | 312 | |||
4932 | 313 | // the communications interface to use | 316 | // the communications interface to use |
4933 | 314 | virtual std::shared_ptr<frontend::ProtobufIpcFactory> the_ipc_factory( | 317 | virtual std::shared_ptr<frontend::ProtobufIpcFactory> the_ipc_factory( |
4934 | 315 | std::shared_ptr<frontend::Shell> const& shell, | 318 | std::shared_ptr<frontend::Shell> const& shell, |
4935 | 316 | std::shared_ptr<graphics::GraphicBufferAllocator> const& allocator); | 319 | std::shared_ptr<graphics::GraphicBufferAllocator> const& allocator); |
4936 | 317 | 320 | ||
4937 | 318 | virtual std::string the_socket_file() const; | 321 | virtual std::string the_socket_file() const; |
4938 | 322 | <<<<<<< TREE | ||
4939 | 319 | std::shared_ptr<input::NestedInputRelay> the_nested_input_relay(); | 323 | std::shared_ptr<input::NestedInputRelay> the_nested_input_relay(); |
4940 | 324 | ======= | ||
4941 | 325 | |||
4942 | 326 | // The following caches and factory functions are internal to the | ||
4943 | 327 | // default implementations of corresponding the Mir components | ||
4944 | 328 | CachedPtr<surfaces::BroadcastingSessionEventSink> broadcasting_session_event_sink; | ||
4945 | 329 | CachedPtr<input::NestedInputRelay> nested_input_relay; | ||
4946 | 330 | CachedPtr<surfaces::SurfaceController> surface_controller; | ||
4947 | 331 | CachedPtr<surfaces::SessionManager> session_manager; | ||
4948 | 332 | |||
4949 | 333 | std::shared_ptr<surfaces::BroadcastingSessionEventSink> the_broadcasting_session_event_sink(); | ||
4950 | 334 | std::shared_ptr<input::NestedInputRelay> the_nested_input_relay(); | ||
4951 | 335 | std::shared_ptr<surfaces::SessionManager> the_session_manager(); | ||
4952 | 336 | std::shared_ptr<surfaces::SurfaceBuilder> the_surface_builder(); | ||
4953 | 337 | std::shared_ptr<surfaces::SurfaceController> the_surface_controller(); | ||
4954 | 338 | std::function<void()> force_threads_to_unblock_callback(); | ||
4955 | 339 | >>>>>>> MERGE-SOURCE | ||
4956 | 320 | }; | 340 | }; |
4957 | 321 | } | 341 | } |
4958 | 322 | 342 | ||
4959 | 323 | 343 | ||
4960 | === modified file 'include/server/mir/frontend/shell.h' | |||
4961 | --- include/server/mir/frontend/shell.h 2013-08-28 03:41:48 +0000 | |||
4962 | +++ include/server/mir/frontend/shell.h 2013-11-21 20:19:28 +0000 | |||
4963 | @@ -36,7 +36,7 @@ | |||
4964 | 36 | class Shell | 36 | class Shell |
4965 | 37 | { | 37 | { |
4966 | 38 | public: | 38 | public: |
4968 | 39 | virtual ~Shell() {} | 39 | virtual ~Shell() = default; |
4969 | 40 | 40 | ||
4970 | 41 | virtual std::shared_ptr<Session> open_session( | 41 | virtual std::shared_ptr<Session> open_session( |
4971 | 42 | std::string const& name, std::shared_ptr<EventSink> const& sink) = 0; | 42 | std::string const& name, std::shared_ptr<EventSink> const& sink) = 0; |
4972 | @@ -44,7 +44,7 @@ | |||
4973 | 44 | 44 | ||
4974 | 45 | virtual SurfaceId create_surface_for(std::shared_ptr<Session> const& session, | 45 | virtual SurfaceId create_surface_for(std::shared_ptr<Session> const& session, |
4975 | 46 | shell::SurfaceCreationParameters const& params) = 0; | 46 | shell::SurfaceCreationParameters const& params) = 0; |
4977 | 47 | 47 | ||
4978 | 48 | virtual void handle_surface_created(std::shared_ptr<Session> const& session) = 0; | 48 | virtual void handle_surface_created(std::shared_ptr<Session> const& session) = 0; |
4979 | 49 | 49 | ||
4980 | 50 | protected: | 50 | protected: |
4981 | 51 | 51 | ||
4982 | === modified file 'include/server/mir/frontend/surface.h' | |||
4983 | --- include/server/mir/frontend/surface.h 2013-10-15 08:53:10 +0000 | |||
4984 | +++ include/server/mir/frontend/surface.h 2013-11-21 20:19:28 +0000 | |||
4985 | @@ -25,6 +25,8 @@ | |||
4986 | 25 | #include "mir/geometry/size.h" | 25 | #include "mir/geometry/size.h" |
4987 | 26 | #include "mir_toolkit/common.h" | 26 | #include "mir_toolkit/common.h" |
4988 | 27 | 27 | ||
4989 | 28 | #include <glm/glm.hpp> | ||
4990 | 29 | |||
4991 | 28 | #include <memory> | 30 | #include <memory> |
4992 | 29 | 31 | ||
4993 | 30 | namespace mir | 32 | namespace mir |
4994 | @@ -55,12 +57,7 @@ | |||
4995 | 55 | virtual geometry::Size size() const = 0; | 57 | virtual geometry::Size size() const = 0; |
4996 | 56 | virtual geometry::PixelFormat pixel_format() const = 0; | 58 | virtual geometry::PixelFormat pixel_format() const = 0; |
4997 | 57 | 59 | ||
4998 | 58 | /// Submit the current client buffer, return the next client buffer | ||
4999 | 59 | /// | ||
5000 | 60 | /// \param [out] need_ipc: True if the buffer content must be sent via IPC |
The diff has been truncated for viewing.