Repository navigation
test: Characterize scene coordinate conversion - #1647
Merged
Merged
Conversation
The absolute and relative conversion is the next piece after bounds placement. pos and size, the half-pixel nudge, and the canvas scale move into obs-scene-coords.c.h. The scene still reads the canvas. It still decides whether to nudge, and whether a group or nested scene keeps its scale. No behavior change. The new symbols are hidden.
test_scene_coords compiles obs-scene-coords.c.h on its own and pins the current C, including the half-pixel nudge. No display.
6 of 7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #1645
What and why
The absolute and relative conversion in
obs-scene.c.hmoves out before the Rust port. Position, size, the half-pixel nudge, and the canvas scale go intoobs-scene-coords.c.h. The scene still reads the canvas withget_scene_dimensions. It still decides whether to nudge, and whether a group or a nested scene keeps its scale.calculate_bounds_datais unchanged. It still callssize_to_absolutewhen the bounds are relative.The new file is its own unity group,
libobs.scene-coords, onLIBOBS_SOURCES. It stays C. The port, later, moves the include into a ported group.The new symbols are not exported.
test_scene_coordscompilesobs-scene-coords.c.hand pins the current C. No display. It characterizes that C source, so a later Rust swap stays invisible until the symbols are reachable from the test.Characterized, not endorsed (comments in the test):
floor(v * 2 + 0.5) / 2. A value already on a half stays. 0.25 goes to 0.5 and 0.75 goes to 1. -0.25 goes to 0 and -0.75 goes to -0.5, so a negative tie does not mirror the positive one.pos_from_absoluteandsize_from_absolutedo not nudge. A nudged pixel value does not come back to the relative value that produced it.RED → GREEN
6e6338361libobs: Move scene coordinate conversion outeacf1b7f1test: Characterize scene coordinate conversion.test_scene_coords8/8, compiled-Wall -Wextra -Werrorand run under UBSan.libobs.core-source) and the new group both compile with the macOS libobs flags (-Werror,-fvisibility=hidden).nm -mshows the nine new symbols as private external. The scene TU references eight of them and does not define them.obs_scene_nudge_absis only called from inside the new file.ci/test_build_groups.py,ci/test_ported_sources.py,ci/test_naming.py,ci/test_platform_ifdef_ratchet.pyandci/test_cmocka_sanitize.pypassed (50 tests). clang-format 22.1.3 and gersemi 0.25.0 are clean on the changed files../lintwas not run. On this Mac it stops in pre-existing host tests (readelf,-Wl,-soname,/varversus/private/var). No stamp. Docker Tier 2 was not run here. PR CI runs it.Checklist
master(or the description starts with a Stacked: note)docs/features.mdis added or updated (not applicable: no user-visible change)-W..., ratchets): built with scripting ON (PR CI builds no OBS app: rungh workflow run ci.yml --ref <branch>for the full builds) and cross-checked with clang and MSVC (not applicable: no flag change)