aboutsummaryrefslogtreecommitdiff
path: root/src/client
diff options
context:
space:
mode:
Diffstat (limited to 'src/client')
-rw-r--r--src/client/handshake.rs1
-rw-r--r--src/client/mod.rs12
-rw-r--r--src/client/transport.rs7
3 files changed, 14 insertions, 6 deletions
diff --git a/src/client/handshake.rs b/src/client/handshake.rs
index ef55fe22..69e2f52f 100644
--- a/src/client/handshake.rs
+++ b/src/client/handshake.rs
@@ -183,6 +183,7 @@ pub(super) fn do_handshake(
mouse_capture,
surface_active,
surface_reuse: true,
+ surface_delta: true,
snapshot_codecs: vec![SNAPSHOT_CODEC_V1.into()],
surface_codecs: vec![SURFACE_CODEC_V1.into()],
input_codecs: vec![INPUT_CODEC_V1.into()],
diff --git a/src/client/mod.rs b/src/client/mod.rs
index 13125c2d..9fff9719 100644
--- a/src/client/mod.rs
+++ b/src/client/mod.rs
@@ -539,6 +539,10 @@ async fn run_client_loop(
handshake.endpoint_methods.unwrap_or_default(),
handshake.endpoint_capabilities.unwrap_or_default(),
);
+ let surface_reuse = negotiation.supports_capability(protocol::surface_reuse::CAPABILITY);
+ let surface_delta = negotiation.supports_capability(protocol::surface_delta::CAPABILITY);
+ let surface_decoder = (surface_reuse || surface_delta)
+ .then(|| protocol::surface_reuse::Decoder::new(surface_delta));
let transport = start_endpoint_transport(
stream,
(),
@@ -546,7 +550,7 @@ async fn run_client_loop(
endpoint::ClientEndpointId::Local,
1,
max_frame_size,
- negotiation.supports_capability(protocol::surface_reuse::CAPABILITY),
+ surface_decoder,
)?;
let mut registry = endpoint::EndpointRegistry::new(transport, 1, negotiation);
if state.shell.is_some() {
@@ -1198,6 +1202,8 @@ async fn run_client_loop(
}
let surface_reuse =
negotiation.supports_capability(protocol::surface_reuse::CAPABILITY);
+ let surface_delta =
+ negotiation.supports_capability(protocol::surface_delta::CAPABILITY);
let agent_view_projection_supported = negotiation.supports_capability(
crate::protocol::endpoint::AGENT_VIEW_PROJECTION_CAPABILITY,
);
@@ -1220,6 +1226,8 @@ async fn run_client_loop(
if let Some(frame) = frame {
state.present_frame(frame);
}
+ let surface_decoder = (surface_reuse || surface_delta)
+ .then(|| protocol::surface_reuse::Decoder::new(surface_delta));
let reader_tx = event_tx.clone();
std::thread::spawn(move || {
server_reader_thread(
@@ -1229,7 +1237,7 @@ async fn run_client_loop(
MAX_GRAPHICS_FRAME_SIZE,
endpoint_id,
generation,
- surface_reuse,
+ surface_decoder,
);
});
}
diff --git a/src/client/transport.rs b/src/client/transport.rs
index 4396690a..7f083bcf 100644
--- a/src/client/transport.rs
+++ b/src/client/transport.rs
@@ -7,7 +7,7 @@ pub(super) fn start_endpoint_transport(
endpoint_id: endpoint::ClientEndpointId,
generation: u64,
max_frame_size: usize,
- surface_reuse: bool,
+ surface_decoder: Option<protocol::surface_reuse::Decoder>,
) -> Result<endpoint::NativeEndpointTransport, ClientError> {
let reader = stream.try_clone().map_err(ClientError::ConnectionFailed)?;
let transport = endpoint::NativeEndpointTransport::with_lifetime(stream, lifetime)
@@ -24,7 +24,7 @@ pub(super) fn start_endpoint_transport(
max_frame_size,
endpoint_id,
generation,
- surface_reuse,
+ surface_decoder,
);
})
.map_err(ClientError::ConnectionFailed)?;
@@ -39,7 +39,7 @@ pub(super) fn server_reader_thread(
max_frame_size: usize,
endpoint_id: endpoint::ClientEndpointId,
generation: u64,
- surface_reuse: bool,
+ mut surface_decoder: Option<protocol::surface_reuse::Decoder>,
) {
if stream.set_nonblocking(true).is_err() {
let _ = event_tx.blocking_send(ClientLoopEvent::ServerDisconnected {
@@ -53,7 +53,6 @@ pub(super) fn server_reader_thread(
stream: &mut stream,
stopped: should_quit,
};
- let mut surface_decoder = surface_reuse.then(protocol::surface_reuse::Decoder::default);
loop {
if should_quit.load(Ordering::Acquire) {
break;