Mir

Merge lp://qastaging/~vanvugt/mir/resize-server-Surfaces into lp://qastaging/mir

Proposed by Daniel van Vugt
Status: Merged
Approved by: Alan Griffiths
Approved revision: no longer in the source branch.
Merged at revision: 1202
Proposed branch: lp://qastaging/~vanvugt/mir/resize-server-Surfaces
Merge into: lp://qastaging/mir
Prerequisite: lp://qastaging/~vanvugt/mir/resize-BufferStream
Diff against target: 211 lines (+108/-0)
10 files modified
include/server/mir/shell/surface.h (+2/-0)
include/server/mir/surfaces/surface.h (+3/-0)
include/test/mir_test_doubles/mock_surface_state.h (+1/-0)
src/server/shell/surface.cpp (+5/-0)
src/server/surfaces/mutable_surface_state.h (+1/-0)
src/server/surfaces/surface.cpp (+18/-0)
src/server/surfaces/surface_data.cpp (+10/-0)
src/server/surfaces/surface_data.h (+1/-0)
tests/unit-tests/surfaces/test_surface.cpp (+49/-0)
tests/unit-tests/surfaces/test_surface_data.cpp (+18/-0)
To merge this branch: bzr merge lp://qastaging/~vanvugt/mir/resize-server-Surfaces
Reviewer Review Type Date Requested Status
Alan Griffiths Approve
Alexandros Frantzis (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+193905@code.qastaging.launchpad.net

Commit message

Implement resize() for the server-side Surface classes.

This is fine for server-owned surfaces, but won't be fully functional with
clients till they get support for resize() too.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Alexandros Frantzis (afrantzis) wrote :

Looks good.

A slight concern:

85 + surface_buffer_stream->resize(size);
86 +
87 + // Now the buffer stream has successfully resized, update the state second;
88 + surface_state->resize(size);

There is an opportunity for inconsistency here, but I am not sure if it has any significant effect:
1. buffer stream gets resized
2. external entity gets surface size which hasn't changed (or has it cached from before, because it hasn't received a notification yet), and makes a decision based on this information
3. external entity gets a new buffer which has size != surface size
4. surface state gets updated

review: Needs Information
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Alexandros,

That inconsistency is something I have planned for right from the beginning.

You cannot solve the inconsistency completely, because that would mean the server has to /wait/ on and rely on the client to fill new buffers quickly. But we don't and shouldn't trust clients.

So what I've done is treat resizes asynchronously. The surface size changes immediately. But its buffers will take a while to catch up (because they're coming from another process that's an unavoidable fact of life). This means there's no blocking and no interruption to what the user sees. Worst case is that you'll be rendering an old buffer size to the new surface size, so might briefly see some scaling happen while the client catches up. I think this is the ideal approach.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Thus, rather than solve the inconsistency which isn't really feasible to solve, we just handle the fact that during rapid resizing the surface size might be different to the buffer size within it. So long as we're aware that's possible and /normal/, it's very easy to handle.

Also, we may choose to clamp instead of scale... as a matter of cosmetics. I'm not sure which looks best, but all existing windowing systems seem to take the clamp approach.

Revision history for this message
Alexandros Frantzis (afrantzis) wrote :

OK.

review: Approve
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

LGTM (well nothing about *Surface* really looks good but...)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches