Skip to content

Annotate code with coordinate system information #313

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 30, 2022

Conversation

vially
Copy link
Contributor

@vially vially commented Dec 29, 2022

Warning

There are still parts of the code-base which are missing these annotations and would benefit from them. Therefore, this pull-request should be seen more like a starting point for this work.

This pull-request should contain no functional changes. It is only meant to annotate various methods and attributes with explicit information about whether logical or physical pixels are being used.

The current usage patterns have been used to determine whether to mark existing code as dealing with physical or logical coordinates.

This is part of a larger set of changes that are meant to add HighDPI support for Wayland.

Naming conventions

The _px and _dip suffixes are sometimes used for variables depending on whether their data represents physical or logical pixels respectively. Obviously, this is not strictly necessary but it does make it easier to differentiate between the two when writing code that deals with both coordinate systems.

In Wayland terms, buffer coordinates correspond to physical pixels and surface coordinates correspond to logical pixels. Usually the relationship between the two is: buffer_size = surface_size x output_scale.

Note: I agree to delegate all rights related to this PR to Sony.

Signed-off-by: Valentin Hăloiu <valentin.haloiu@gmail.com>
Copy link
Contributor

@HidenoriMatsubayashi HidenoriMatsubayashi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice improvements. Thanks a lot.

@HidenoriMatsubayashi HidenoriMatsubayashi merged commit 5316c72 into sony:master Dec 30, 2022
@vially vially deleted the add-coords-hints branch December 30, 2022 07:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactoring wayland Topics of Wayland
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants