-
Notifications
You must be signed in to change notification settings - Fork 103
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
frontend/wayland: wp_viewporter
support
#3445
frontend/wayland: wp_viewporter
support
#3445
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall makes sense, but some initial comments about error handling
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some nits
src/gl/tessellation_helpers.cpp
Outdated
coords.top = sample_rect.top().as_value() / buffer_size.height.as_uint32_t(); | ||
coords.bottom = sample_rect.bottom().as_value() / buffer_size.height.as_uint32_t(); | ||
coords.left = sample_rect.left().as_value() / buffer_size.width.as_uint32_t(); | ||
coords.right = sample_rect.right().as_value() / buffer_size.width.as_uint32_t(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm. All this .as_value()
... .as_uint32_t()
makes me wonder if there's an operator missing in our geometry. This would look safer:
coords.top = sample_rect.top() / buffer_size;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've ended up with sample_rect.top() / buffer_size.width
(as sample_rect.top() / buffer_size
is ambiguous).
src/gl/tessellation_helpers.cpp
Outdated
@@ -14,32 +14,58 @@ | |||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
*/ | |||
#include "mir/gl/tessellation_helpers.h" | |||
#include "mir/geometry/forward.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems odd that we'd want forward.h
in an implementation file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, we don't, but clangd
always wants to pull it in. I missed this one!
/** | ||
* Have the source or destination values changed since the last call to dirty()? | ||
*/ | ||
auto dirty() -> bool; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure "dirty" is the best name here. Obvious interpretations are "is dirty" and "make dirty", but this is neither. And the actual meaning won't be obvious reading the code that calls it. Even the comment isn't clear about what the first call does.
Maybe unchanged_since_last_call()
?
Or, unreported_changes()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've gone for changed_since_last_resolve()
, and updated the implementation slightly to make that true.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks to be a good implementation to me! I will let Alan get it over the line
"This branch has conflicts that must be resolved" |
We can provide an interface to the rest of the frontend to calculate the details `WlSurface` needs and keep all the protocol error generation code in with the `wp_viewporter` rather than spread across multiple files.
We now have a requirement for both the actual value of `scale` and for its reciprocal. Rather than storing the reciprocal and calculating the original value when needed, store the original value and calculate the reciprocal when needed.
Co-authored-by: Alan Griffiths <[email protected]>
…types. It's fine to implicitly convert `Size` -> `SizeD` or `SizeF` -> `SizeD`; these conversions lose no information. Use this to simplify some `RectangleD` constructions in the code
We change this to `changed_since_last_resolve()`.
054fda9
to
3c948ff
Compare
@@ -18,6 +18,7 @@ | |||
#define MIR_GL_TESSELLATION_HELPERS_H_ | |||
#include "mir/gl/primitive.h" | |||
#include "mir/geometry/displacement.h" | |||
#include "mir/geometry/rectangle.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks spurious
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK now
This closes #2599 i think |
Accidentally all squashed together into a single mega-commit, here's
wp_viewporter
.You can test with the
weston-scaler
client in... weston, and also with canonical/wlcs#340