Commit graph

57 commits

Author SHA1 Message Date
hujianwei
5e2d83c0d0 Make test reference data work on systems other than mine
* tests/test_harness.c (struct image_difference_statistics): New
struct.
(compare_single_row_8bpc4, compare_single_row_8bpc4x1)
(compare_single_row): Allow slight differences to compensate for
hardware differences.
(verify_image_data): Adjust accordingly.
2022-11-17 06:06:45 +00:00
hujianwei
ac7b6b5915 Allow running tests with an always garbaged subcompositor
* 12to11-test.xml (test_surface) <set_always_garbage>: New
request.
* compositor.h: Update prototypes.
* subcompositor.c (SubcompositorUpdate): Don't clear garbaged
flag if the subcompositor is always garbaged.
(SubcompositorSetAlwaysGarbaged): New function.
* test.c (SetAlwaysGarbage): New function.
(test_surface_impl): Add function.
* tests/test_harness.c (make_test_surface): Always garbage the
subcompositor if TEST_ALWAYS_GARBAGE is set.
2022-11-17 04:56:55 +00:00
hujianwei
7128095c18 Fix names of reference data
* tests/buffer_scale_2_5_1.dump:
* tests/buffer_scale_2_5_2.dump:
* tests/buffer_scale_3_5_1.dump:
* tests/buffer_scale_3_5_2.dump: Fix reference data names.
2022-11-17 01:56:08 +00:00
hujianwei
7deac88eae Add new scale tests
* tests/scale_test.c (enum test_kind): New test for 2x5 scale.
(test_names): Add new test name.
(LAST_TEST): Set to new test.
(do_verify_window_size): New function.
(test_single_step): Verify window sizes as well.  Implement new
test.

* tests/test_harness.c (verify_window_size): New function.
* tests/test_harness.h: New prototype.
2022-11-17 01:52:55 +00:00
hujianwei
897035e531 Add new buffer scale tests
* tests/buffer_scale_3_5_1.dump:
* tests/buffer_scale_3_5_2.dump: New files.
2022-11-17 01:36:51 +00:00
hujianwei
4772d8cede Fix XDG activation in some edge cases
* 12to11-test.xml (test_manager) <activated>: Add
activator_surface parameter.

* compositor.h (enum _ClientDataType): New XdgActivationData
type.
(struct _RoleFuncs, struct _XdgRoleImplementationFuncs): Pass
activator surface in `activate'.
* seat.c (struct _Seat): New field for the serial of the last
entry event.
(SendKeyboardEnter, XLSeatCheckActivationSerial): Add
workarounds for Firefox.
* surface.c (HandleSurfaceDestroy): Allow client data
free_functions to be NULL.
* test.c (Activate): Accept and send activator surface.

* xdg_activation.c (struct _XdgActivationToken): New fields for
the surface and destroy callback.
(HandleSurfaceDestroyed): New function.
(SetSurface): Really record the activator surface.
(GetIdForSurface): New function.
(Commit): Include activator surface ID.
(HandleResourceDestroy): Destroy activator surface.
(GetSurfaceForId): New function.
(Activate): Pass activator surface whenever specified.

* xdg_surface.c (Activate):
* xdg_toplevel.c (Activate): Adjust accordingly.

* tests/xdg_activation_test.c (check_activation_with_serial):
Check activator surface as well.
(test_single_step): Fix damage rect for dummy buffer.
(handle_test_surface_activated): Record the activator surface.
2022-11-16 07:11:03 +00:00
hujianwei
13b3d3d04b Add new seat tests for key presses
* 12to11-test.xml (test_seat_controller) <dispatch_XI_FocusIn>:
<dispatch_XI_FocusOut>
<dispatch_XI_RawKeyPress>
<dispatch_XI_RawKeyRelease>
<dispatch_XI_KeyPress>
<dispatch_XI_KeyRelease>: New requests.

* seat.c (MakeSeatForDevicePair): Prevent seat->key_pressed from
being NULL as long as keymaps have been initialized.

* test_seat.c (DispatchXIFocusIn, DispatchXIFocusOut)
(GenerateRawEvent, DispatchXIRawKeyRelease, DispatchXIKeyPress)
(DispatchXIKeyRelease): New functions.
(seat_controller_impl): Add new functions.
(XLGetTestSeat): Prevent seat->key_pressed from being NULL.

* tests/seat_test.c (enum test_expect_event_kind): Add keyboard
events.
(struct test_recorded_keyboard_enter_event)
(struct test_recorded_keyboard_key_event)
(struct test_recorded_keyboard_modifiers_event): New structs.
(enum test_kind, test_names): Add new test.
(LAST_TEST): Set to key test.
(run_key_test, test_single_step): Implement new test.
(expect_keyboard_enter_event, expect_keyboard_modifiers_event)
(expect_keyboard_key_event): New function.
(handle_keyboard_keymap, handle_keyboard_enter)
(handle_keyboard_leave, handle_keyboard_key)
(handle_keyboard_repeat_info): New functions.
(keyboard_listener, run_test): Attach new keyboard listener.

* tests/test_harness.c (test_init_seat): Initialize keyboard.
* tests/test_harness.h (struct test_seat): New field `keyboard'.
2022-11-16 02:15:47 +00:00
hujianwei
62a055983c * tests/subsurface_test_39.dump: New file. 2022-11-15 05:01:13 +00:00
hujianwei
ad9d1c3d6a Add new test for role actions
* subcompositor.c (ViewSetSubcompositor):
* subsurface.c (Teardown, XLSubsurfaceParentDestroyed):
* surface.c (HandleSurfaceDestroy): Restore previous code with
more comments.

* tests/subsurface_test.c (test_single_step): Test that surface
actions work with unconfirmed subsurfaces.
2022-11-15 05:00:56 +00:00
hujianwei
dfb8378257 Check in new files for subsurface tests
* tests/subsurface_stack_1.png:
* tests/subsurface_stack_2.png:
* tests/subsurface_test_35.dump:
* tests/subsurface_test_36.dump:
* tests/subsurface_test_37.dump:
* tests/subsurface_test_38.dump: New files.
2022-11-15 04:27:18 +00:00
hujianwei
e8b746e7ec Update subsurface tests to handle reparenting and fix discovered bugs
* 12to11-test.xml (test_manager) <set_buffer_label>: New
request.
* 12to11.man:
* README: Add missing documentation.
* buffer.c (ExtBufferDestroy): Free buffer label.
* compositor.h (struct _ExtBuffer): New field `label'
* linux-dmabuf-unstable-v1.xml: Update from wayland-protocols.
* subcompositor.c (IsSkipped, SetSkipped, ClearSkipped): Delete
macros.
(SubcompositorUpdateBounds, SubcompositorUpdateBoundsForInsert)
(SkipSlug): Adjust accordingly.
(DamageIncludingInferiors): Fix function.
(SubcompositorInsert, SubcompositorInsertBefore)
(SubcompositorInsertAfter, ViewIsVisible, ViewRecomputeChildren)
(ViewInsert, ViewInsertAfter, ViewInsertBefore): Call
DamageIncludingInferiors on child, not view.
(ViewSetSubcompositor, ViewAfterSizeUpdate, ViewMove): Get rid
of "skipped" state.
(ViewUnskip, ViewSkip): delete functions.
(ViewFree, DoCull, SubcompositorLookupView): Get rid of
"skipped" state.
* subsurface.c (struct _Subsurface): New field `pending'.
(AfterParentCommit): Attach views whenever pending.
(Setup): Stop attaching views upon setup.
(Teardown): Only detach views when not pending.
(GetSubsurface): Add comment.
(XLSubsurfaceParentDestroyed): Set subcompositor to NULL when
parent is destroyed.
(XLSubsurfaceHandleParentCommit): New function.
* surface.c (RunCommitCallbacks): Run commit callbacks in the
order in which they were created.
(NotifySubsurfaceDestroyed): Assert that a role is present.
(HandleSurfaceDestroy): Clear subsurfaces before releasing role.
Set subsurfaces to NULL.
* test.c (SetBufferLabel): New function.
(test_manager_impl): Implement.
* tests/subsurface_test.c (enum test_kind): New
SUBSURFACE_REPARENT_KIND.
(test_names): Add names
(LAST_TEST): Set to SUBSURFACE_REPARENT_KIND.
(test_single_step): Implement new test.
* tests/test_harness.c (load_png_image): Set buffer debug label.
2022-11-15 04:26:36 +00:00
hujianwei
2979979633 Implement xdg-activation-v1
* 12to11-test.xml (test_surface): <activated>: New event.
* 12to11.c (XLMain): Initialize XDG activation.
* Imakefile (SRCS, OBJS): Add xdg_activation.c and
xdg_activation.o.
(xdg-activation-v1): New scanner target.
* atoms.c (names, XLInitAtoms): New atom `_NET_ACTIVE_WINDOW'.
Adjust accordingly.
* compositor.h (struct _RoleFuncs): New function `activate'.
(struct _XdgRoleImplementationFuncs): Likewise.
* seat.c (XLSeatCheckActivationSerial): New function.
* test.c (Activate): New function.
(GetTestSurface): Attach new hook.
* tests/Imakefile (OBJS13, SRCS13): Add xdg_activation_test.c/o.
(xdg-activation-v1): New scanner target.
(PROGRAMS): Add xdg_activation_test.
(xdg_activation_test): New program target.
* tests/run_tests.sh (standard_tests): Add xdg_activation_test.
* tests/svnignore.txt: Add xdg_activation_test.
* xdg_surface.c (Activate): New function.
(XLGetXdgSurface): Attach hook.
* xdg_toplevel.c (Activate): New function.
(XLGetXdgToplevel): Attach hook.
2022-11-14 06:05:23 +00:00
hujianwei
556cf6dbcc Check in new files for xdg-activation
* xdg-activation-v1.xml:
* xdg_activation.c:
* tests/xdg_activation_test:
* tests/xdg_activation_test.c: New files.
2022-11-14 05:58:00 +00:00
hujianwei
30f22613b8 Fix some minor problems
* seat.c (DispatchEntryExit): Understand all kinds of entry and
exit events instead of just non-grab ones.
* subcompositor.c (SubcompositorComposite1): Remove redundant
assignment.
* xerror.c (CategorizeClients): Add new assertion.

* tests/select_test.c (verify_sample_text):
(verify_sample_text_multiple): Fix typos.
2022-11-13 13:45:11 +00:00
hujianwei
563422d8cf Improve handling of pointer unlock events
* compositor.h: Update prototypes.
* idle_inhibit.c (DestroyIdleInhibitManager): New function.
(idle_inhibit_manager_impl): Add missing op handler.
* seat.c (struct _Seat): Remove pointer unlock surface.  Add
last_seen_subcompositor.
(ReleaseSeat): Release the last seen subcompositor callback.
(ClearPointerUnlockSurface, SwapUnlockSurface): Delete
functions.
(HandleSubcompositorDestroy): New function.
(EnteredSurface): Stop calling SwapUnlockSurface.
(DispatchEntryExit): Set the last seen subcompositor.
(DispatchMotion, CancelGrab1, CancelGrab): Use the last seen
subcompositor to decide where to unlock instead.
(LockSurfaceFocus, DispatchButton, DispatchGesturePinch)
(DispatchGestureSwipe): Stop calling SwapUnlockSurface.
(FakePointerEdge, ForceEntry): Stop calling SwapUnlockSurface.

* subcompositor.c (struct _SubcompositorDestroyCallback): New
struct.
(struct _Subcompositor): New field `destroy_callbacks'.
(MakeSubcompositor): Initialize new field.
(SubcompositorFree): Run and free destroy callbacks.
(SubcompositorOnDestroy, SubcompositorRemoveDestroyCallback):
New functions.
* tests/run_tests.sh:
* tests/select_test.c (verify_sample_text_multiple): Fix
ommissions and typos.
2022-11-13 11:18:44 +00:00
hujianwei
b54e5a1a01 * tests/select_helper.c: Make atom_names big enough. 2022-11-13 05:46:38 +00:00
hujianwei
b022f0dbd9 Fix handling of MULTIPLE selections and add test
* select.c (SignalConversionPerformed): Improve diagnostic
messages.
(ConvertSelectionMultiple): Use correct atoms.
(HandleSelectionRequest): Allow selection requests with target
MULTIPLE.

* tests/Imakefile (SRCS12, OBJS12): Add select_helper_multiple.c
and .o.
(PROGRAMS): Add select_helper_multiple.
(select_helper_multiple): New program.
* tests/select_helper.c (main): Fix typo.

* tests/select_test.c (verify_sample_text_multiple): New function.
(test_single_step): Call it.
* tests/svnignore.txt: Add select_helper_multiple.
2022-11-12 08:07:43 +00:00
hujianwei
8810afbe2d Check in new file for select tests
* tests/select_helper_multiple.c: New file.
2022-11-12 08:04:52 +00:00
hujianwei
456537aee9 * tests/run_test.sh: Allow running select tests. 2022-11-12 05:23:31 +00:00
hujianwei
0bdc502068 Fix text input bugs with grabbed popups and bugs found by new tests
* 12to11-test.xml (test_manager) <error>: Add
invalid_user_time.
<get_serial, serial> New request and event.
(test_seat_controller) <set_last_user_time>: New request.

* compositor.h (struct _TextInputFuncs): Make `filter_input'
return keycode.
* data_device.c (DestroyReference): Check if reference device is
detached before unlinking reference.
* seat.c (LookupKeysym): Delete function.
(DispatchKey): Use keycodes instead.
(XLSeatExplicitlyGrabSurface): Avoid using owner-events keyboard
grab.

* select.c (struct _SelectionOwnerInfo, HandleSelectionRequest):
Allow CurrentTime in selection requests.  Compensate for
wraparound as well.
(OwnSelection, DisownSelection): Use Timestamp instead of Time.
* test.c (GetSerial): New function.
(test_manager_impl): Add new function.
* test_seat.c (SetLastUserTime): New function.
(seat_controller_impl): Add new function.
* tests/Imakefile (LOCAL_LIBRARIES): Remove GBM and DRM.
(SRCS10, OBJS10, SRCS11, OBJS11): New variables.
(dmabuf_test): Only link this program with GBM and DRM.
(PROGRAMS): Add select_test, select_helper.
(select_test, select_helper): New programs.

* tests/README: Document that select_test needs to be run under
vfb.
* tests/run_tests.sh: Add TODO note.
* tests/svnignore.txt: Add select_test and select_helper.
* tests/test_harness.c (handle_test_manager_serial): New
function.
(test_manager_listener): Add new function.
(open_test_display): Clear display->seat.
(test_get_serial): New function.

* tests/test_harness.h (struct test_display): New function
`serial'.

* text_input.c (CreateIC): Improve debugging code.
(CalculateKeycodeForEvent): Move earlier.
(FilterInputCallback): Handle keycodes here as well.
(XLTextInputDispatchCoreEvent): Add more debugging code.

* xdata.c (SelectSelectionInput): Obtain server time here.
(XLOwnDragSelection, NoteLocalSelectionFooter): Convert times to
Timestamp.
2022-11-12 03:51:21 +00:00
hujianwei
be955e3c79 Check in new files for selection tests
* tests/select_helper.c:
* tests/select_test.c: New files.
2022-11-12 03:42:39 +00:00
hujianwei
163dca96bd Add scroll valuator tests
* 12to11-test.xml (test_manager): <error>: New errors.
(test_XIDeviceInfo, test_device_controller): New interfaces.
(test_seat_controller): <get_device_controller>: New request.
<device_id>: New event.

* seat.c (NoticeDeviceDisabled): Ignore test seats.
(XLSeatDispatchCoreKeyEvent): Expand commentary.

* test_seat.c (struct _TestDeviceController)
(struct _TestXIDeviceInfo): New structs.
(DestroyXIValuatorState): New function.
(AddValuatorToTestXIValuatorState): Fix crashes.
(XIValuatorState_impl): Add DestroyXIValuatorState.
(DestroyDeviceInfo, SetDeviceId, SetName, SetUse, SetAttachment)
(SetEnabled, AddXIScrollClassInfo, AddXIValuatorClassInfo): New
functions.
(XIDeviceInfo_impl): New interface implementation.
(HandleXIDeviceInfoDestroy): New function.
(DestroyDeviceController, AddDeviceInfo, GetDeviceInfo): New
functions.
(device_controller_impl): New interface.
(HandleTestDeviceControllerDestroy): New function.
(GetDeviceController): New function.
(seat_controller_impl): Add it.
(XLGetTestSeat): Send new `device_id' event.

* tests/seat_test.c (enum test_expect_event_kind): Add
POINTER_AXIS_VALUE120_EVENT.
(struct test_recorded_axis_value120_event): New event kind.
(enum test_kind): Add TEST_VALUATOR_KIND.
(test_names): Add test_valuator.
(LAST_TEST): Set to TEST_VALUATOR_KIND.
(run_valuator_test): New function.
(test_single_step): Implement accordingly.
(expect_axis_value120_event, handle_pointer_axis_value120): New
functions.

* tests/test_harness.c (handle_seat_controller_device_id): New
function.
(seat_controller_listener): New listener.
(test_init_seat): Wait for device ID and init device controller.

* tests/test_harness.h (struct test_seat): Add device controller
and device ID fields.
2022-11-10 06:14:51 +00:00
hujianwei
45df6087d6 Update dmabuf and seat tests
* tests/dmabuf_test.c (enum test_kind): Add XBGR888_KIND.
(test_names): Add that test.
(LAST_TEST): Set to XBGR888_KIND.
(verify_single_step, test_single_step, test_next_step):
Implement that test, but keep it disabled for now.
* tests/seat_test.c (struct test_subsurface): New struct.
(enum test_kind): Add TEST_GRAB_KIND.
(test_names): Add that test kind.
(LAST_TEST): Set to TEST_GRAB_KIND.
(make_test_subsurface): New function.
(run_grab_test): New functions.
(test_single_step): Implement new test.
(expect_enter_event): Accept surface arg.
(expect_surface_enter): Adjust accordingly.
(handle_wl_callback_done, wait_frame_callback): New functions.
2022-11-09 02:12:28 +00:00
hujianwei
9e7af2fe4c * tests/seat_child.png: New file. 2022-11-09 02:09:53 +00:00
hujianwei
a8297024f1 Add dma-buf tests
* tests/Imakefile (LOCAL_LIBRARIES): Require libgbm and libdrm.
(OBJS9, SRCS9): Add dmabuf_test.c/.o.
(PROGRAMS): Add dmabuf_test.
(dmabuf_test): New program.
* tests/run_tests.sh: Add dmabuf_test.
* tests/seat_test.c (handle_pointer_enter, handle_pointer_leave)
(handle_pointer_motion): Pacify some GCC warnings.
* tests/svnignore.txt: Add dmabuf_test.
* tests/test_harness.h: Include sys/types.h.
2022-11-08 11:53:25 +00:00
hujianwei
ec30b855b6 Check in new files for dma-buf tests
* tests/argb8888_implicit.dump:
* tests/argb8888_linear.dump:
* tests/dmabuf_test.c: New files.
2022-11-08 11:50:09 +00:00
hujianwei
801eee5464 Check in new subsurface test reference data
* tests/subsurface_1_complex.png:
* tests/subsurface_test_30.dump:
* tests/subsurface_test_31.dump:
* tests/subsurface_test_32.dump:
* tests/subsurface_test_33.dump:
* tests/subsurface_test_34.dump:
* tests/subsurface_transparency_damage.png: New files.
2022-11-07 12:02:30 +00:00
hujianwei
7e9ba17e88 Add subsurface scaling and damage simplification tests
* subcompositor.c (IsDamageComplicated): Consider 10 rects as
complex damage.
* surface.c (ApplyScale): Don't dereference subsurface list data
as role.
* tests/subsurface_test.c (enum test_kind, test_names): Add
complex damage and scaling tests.
(LAST_TEST): Set to SUBSURFACE_SCALE_KIND.
(test_single_step): Implement new tests.
2022-11-07 12:01:52 +00:00
hujianwei
b487cbe320 Add button press and grab test
* tests/seat_test.c (enum test_expect_event_kind): Add leave and
button events.
(struct test_expect_data): Remove structure.
(struct test_recorded_event): New structure.
(struct test_recorded_leave_event)
(struct test_recorded_button_event)
(struct test_recorded_frame_event)
(struct test_recorded_enter_event)
(struct test_recorded_motion_event): New structures.  Replace
old event verification mechanism with a mechanism for recording
events sent from the pointer device. and verifying them later.
(enum test_kind, test_names): Add TEST_CLICK_KIND.
(LAST_TEST): Set to TEST_CLICK_KIND.
(num_listener_data, current_listener_data): Remove variables.
(recording_events, record_tail): New variables.
(run_click_test, test_single_step): Implement new kind of test.
(record_events, expect_button_event, expect_frame_event)
(expect_enter_event, expect_motion_event, expect_leave_event)
(expect_button_event, expect_no_events): New functions for
recording and inspecting input events.
(expect_surface_enter, expect_surface_motion): Reimplement in
terms of those functions.
(get_next_expect_data): Delete function.
(handle_pointer_enter, handle_pointer_leave, handle_pointer_motion)
(handle_pointer_button, handle_pointer_frame): Record events
instead of matching them against a list of verified events.
2022-11-07 10:23:12 +00:00
hujianwei
13a399bd35 * tests/seat_test.c (get_next_expect_data): Remove unused field. 2022-11-07 06:21:46 +00:00
hujianwei
686f71c3b4 Add seat testing mechanism and tests for seats
* 12to11-test.xml (test_manager): <error>: Add `invalid_button',
`value_exists', `bad_seat_version' and `invalid_valuator'.
(test_manager): <get_test_seat>: New request.
(test_XIButtonState, test_XIModifierState, test_XIValuatorState)
(test_seat_controller): New interfaces.
* Imakefile: (seat.o): Depend on test_seat.c.
* compositor.h: Update prototypes.
* run.c (XLRunCompositor): Get rid of stdbool constant.
* seat.c (HandleBind1): Move binding logic to this new function.
(HandleBind): Call HandleBind1.
(InitSeatCommon): Add list initialization to this function.
(MakeSeatForDevicePair): Call InitSeatCommon instead.
(HandleRawKey, UpdateModifiersForSeats, DispatchFocusIn)
(DispatchMotion, DispatchBarrierHit, DispatchGesturePinch)
(DispatchGestureSwipe): Do not update user time from send_event
events.  Include test_seat.c.
* test.c (GetTestSeat): New function.
(test_manager_impl): Add new proc function.
(XLLookUpTestSurface): New function.
* tests/Imakefile (OBJS8, SRCS8): New program.
(PROGRAMS): Add seat_test.
(seat_test): New function.
* tests/run_tests.sh (standard_tests): Add seat_test.
* tests/svnignore.txt: Add seat_test.
* tests/test_harness.c (report_test_internal_error,
test_init_seat): New functions.
* tests/test_harness.h (struct test_seat): New struct.
(struct test_display): New field `seat'.
2022-11-07 06:21:07 +00:00
hujianwei
ef456e4d24 Check in new files for seat tests
* test_seat.c:
* tests/seat_test.c:
* tests/seat_test.png: New files.
2022-11-07 06:05:08 +00:00
hujianwei
0042259e28 Check in new test dumps
* tests/subsurface_test_28.dump:
* tests/subsurface_test_29.dump: New files.
2022-11-06 05:10:28 +00:00
hujianwei
3dcceb506b Fix subsurface commit behavior
* subsurface.c (EarlyCommit): Clear pending_commit after merging
cached state.
* tests/subsurface_test.c (test_single_step): Add test that
found this problem.
2022-11-06 05:09:57 +00:00
hujianwei
3ed01b13b7 Check in new subsurface test reference data
* tests/subsurface_test_20.dump:
* tests/subsurface_test_21.dump:
* tests/subsurface_test_22.dump:
* tests/subsurface_test_23.dump:
* tests/subsurface_test_24.dump:
* tests/subsurface_test_25.dump:
* tests/subsurface_test_26.dump:
* tests/subsurface_test_27.dump: New files.
2022-11-06 03:22:18 +00:00
hujianwei
e73914d7dd Correctly implement nested subsurface sync or desync
* compositor.h (struct _RoleFuncs): Get rid of note_desync_child
and co.
* frame_clock.c (StartFrame): Fix typo.
* subsurface.c (struct _Subsurface): New field
`should_be_desync'.
(NoteDesyncChild, NoteChildSynced): Delete functions.
(IsParentSynchronous): New function.
(SetSync1, NoteSubsurfaceDesynchronous, NoteSubsurfaceTeardown):
New functions.
(SetSync): Make all children synchronous when required.
(SetDesync): Desynchronize all children if possible; otherwise,
keep the surface synchronous but set the `should_be_desync'
flag.
(EarlyCommit): Merge pending state if required.
(Setup): Call SetSync1 to make children synchronous.
(Teardown): Call NoteSubsurfaceTeardown to make children
desynchronous as required.
(GetSubsurface): Stop setting
note_child_synced/note_desync_child.

* surface.c (InternalCommit1): New function.
(InternalCommit): Move state merging logic to InternalCommit1.
(XLSurfaceMergeCachedState): New function.

* xdg_surface.c (struct _XdgRole): Remove `n_desync_children'.
(UpdateFrameRefreshPrediction): Resort to counting the number of
children on each frame instead.
(Setup, NoteFrame, NoteChildSynced, NoteDesyncChild, HandleFreeze)
(XLGetXdgSurface): Stop counting sync/desync children.

* tests/subsurface_test.c (enum test_kind, test_names): Add
SUBSURFACE_DESYNC_KIND.
(LAST_TEST): Set to SUBSURFACE_DESYNC_KIND.
(test_single_step): Implement SUBSURFACE_DESYNC_KIND.
2022-11-06 03:21:27 +00:00
hujianwei
736aef224c Fix problems with test Imakefile
* tests/Imakefile (GENFILES): New variable.
(ScannerTarget): Append to GENFILES.
(depend): Only depend on COMMONSRCS.
(clean): Clean generated files.
2022-11-05 12:13:10 +00:00
hujianwei
c26d1c4939 Enable map/unmap optimizations for subsurfaces
* subcompositor.c (ViewMap, ViewUnmap): Union view inferior
bounds whenever possible, instead of garbaging the
subcompositor.
* tests/subsurface_test.c (enum test_kind): New test
`SUBSURFACE_STACKING_1_KIND'.
(test_names): Add new name.
(LAST_TEST): Set to SUBSURFACE_STACKING_1_KIND.
(test_single_step): Implement SUBSURFACE_STACKING_1_KIND.
2022-11-05 10:45:39 +00:00
hujianwei
e712b6b57a Check in new subsurface test dumps
* tests/subsurface_test_18.dump:
* tests/subsurface_test_19.dump: New files.
2022-11-05 10:44:11 +00:00
hujianwei
21aa7494cd Add new buffer scale tests
* 12to11-test.xml (test_manager): <error>: New errors
`scale_lock_exists' and `invalid_scale'.
(test_manager): <get_test_surface>: Reword documentation.
(test_manager): <get_scale_lock>: New request.
(test_scale_lock): New interface.

* compositor.h: Update prototypes.
* output.c (HandleScaleSettingChange): New function.  Ignore
scale changes while scale is locked.
(XLInitRROutputs): Initialize real output scale.
* test.c (DestroyScaleLock, SetScale, GetScaleLock): New
functions.
(test_manager_impl): Add new implementation.
* tests/Imakefile (SYSTEM_LIBRARIES): Add MathLibrary.
(SRCS7, OBJS7): Add scale_test.c/.o.
(PROGRAMS): Add scale_test.
(scale_test): New program target.
* tests/run_tests.sh (standard_tests): Add scale_test.
* tests/svnignore.txt: Add scale_test.
* tests/test_harness.c (exit_with_code): New function.
(open_test_display): Initialize scale.
(report_test_failure): Call it instead of just exit.
(test_set_scale): New function.
(test_complete): Call exit_with_code.
* tests/test_harness.h (struct test_display): New field
`scale_lock'.
2022-11-05 08:18:18 +00:00
hujianwei
fa29286c98 Check in files for buffer scale tests
* tests/buffer_scale_1_1.dump:
* tests/buffer_scale_1_2.dump:
* tests/buffer_scale_1_2_1.dump:
* tests/buffer_scale_1_2_2.dump:
* tests/buffer_scale_2_1.dump:
* tests/buffer_scale_2_2.dump:
* tests/buffer_scale_2_2_1.dump:
* tests/buffer_scale_2_2_2.dump:
* tests/scale.png:
* tests/scale_damage.png:
* tests/scale_test.c: New files.
2022-11-05 08:12:29 +00:00
hujianwei
cde0e6d701 Add viewporter tests with transforms
* tests/viewporter_test.c (enum test_kind, test_names): Add new
test VIEWPORT_SRC_250_50_200_200_DEST_50_75_90CW_KIND.
(LAST_TEST): Set to
VIEWPORT_SRC_250_50_200_200_DEST_50_75_90CW_KIND.
(test_single_step): Implement
VIEWPORT_SRC_250_50_200_200_DEST_50_75_90CW_KIND.
2022-11-05 06:25:41 +00:00
hujianwei
38f398d7dd Check in files for new test
* tests/viewport_src_250_50_200_200_dest_50_75_90cw_1.dump:
* tests/viewport_src_250_50_200_200_dest_50_75_90cw_2.dump: New
files.
2022-11-05 06:24:22 +00:00
hujianwei
ca4d00c38f Update subsurface tests and fix discovered bugs
* subcompositor.c (DoCull): Fix leak of temp region upon
encountering opaque view.
* tests/subsurface_test.c (enum test_kind, test_names): New test
SUBSURFACE_GROW_SHRINK_KIND.
(LAST_TEST): Make it the last test.
(test_single_step): Implement SUBSURFACE_GROW_SHRINK_KIND.
2022-11-05 05:59:05 +00:00
hujianwei
88ac22aa27 Check in files for new subsurface grow/shrink tests
* tests/big.png:
* tests/small.png:
* tests/subsurface_test_15.dump:
* tests/subsurface_test_16.dump:
* tests/subsurface_test_17.dump: New files.
2022-11-05 05:57:25 +00:00
hujianwei
47a650cfd6 Add tests for subsurfaces and fix bug found by them
* subcompositor.c (ViewInsert, ViewInsertAfter)
(ViewInsertBefore): Update bounds for child, not parent view.
* tests/Imakefile (SRCS1, OBJS1): Build imgview first.
(SRCS6, OBJS6): Add subcompositor tests.
(PROGRAMS): Add subsurface_test.
(subsurface_test): New program target.
* tests/run_tests.sh (standard_tests): Add subsurface_test.
* tests/svnignore.txt: Add subsurface_test.
* tests/test_harness.c (swizzle_png_row_premultiply): New
function.
(load_png_image): Premultiply images w/ alpha channel.
* tests/test_harness.h: Include more headers.
2022-11-05 03:44:48 +00:00
hujianwei
b8143cf32b * tests/tiny.png: New file. 2022-11-05 03:41:20 +00:00
hujianwei
f2a504e6eb Check in files for subsurface tests
* tests/cow_transparent.png:
* tests/gradient.png:
* tests/subsurface_1.png:
* tests/subsurface_1_damaged.png:
* tests/subsurface_base.png:
* tests/subsurface_damage.png:
* tests/subsurface_test.c:
* tests/subsurface_test_1.dump:
* tests/subsurface_test_10.dump:
* tests/subsurface_test_11.dump:
* tests/subsurface_test_12.dump:
* tests/subsurface_test_13.dump:
* tests/subsurface_test_14.dump:
* tests/subsurface_test_2.dump:
* tests/subsurface_test_3.dump:
* tests/subsurface_test_4.dump:
* tests/subsurface_test_5.dump:
* tests/subsurface_test_6.dump:
* tests/subsurface_test_7.dump:
* tests/subsurface_test_8.dump:
* tests/subsurface_test_9.dump:
* tests/subsurface_transparency.png: New files.
2022-11-05 03:40:54 +00:00
hujianwei
9faad05a8d Add viewporter shrinking test
* tests/run_tests.sh: Add missed shebang.
* tests/viewporter_test.c (enum test_kind): Add
VIEWPORT_SRC_50_50_200_200_DEST_50_75_KIND.
(test_names): Add name for new test.
(LAST_TEST): Make VIEWPORT_SRC_50_50_200_200_DEST_50_75_KIND.
(test_single_step): Handle
VIEWPORT_SRC_50_50_200_200_DEST_50_75_KIND.
2022-11-04 12:47:38 +00:00
hujianwei
df8f5c7763 Add files for viewporter shrink test
* tests/viewport_src_50_50_200_200_dest_50_75_1.dump:
* tests/viewport_src_50_50_200_200_dest_50_75_2.dump: New files.
2022-11-04 12:46:45 +00:00