refact: texture render as an option (#8168)

* refact: texture render as an option

Signed-off-by: fufesou <linlong1266@gmail.com>

* refact: texture render, translation

Signed-off-by: fufesou <linlong1266@gmail.com>

* refact: texture render as option

Signed-off-by: fufesou <linlong1266@gmail.com>

* Update ui_interface.rs

---------

Signed-off-by: fufesou <linlong1266@gmail.com>
Co-authored-by: RustDesk <71636191+rustdesk@users.noreply.github.com>
This commit is contained in:
fufesou
2024-05-28 16:42:30 +08:00
committed by GitHub
parent 010b17509a
commit 72ec86b58d
66 changed files with 481 additions and 282 deletions

View File

@@ -1,6 +1,7 @@
use crate::{
common::{get_supported_keyboard_modes, is_keyboard_mode_supported},
input::{MOUSE_BUTTON_LEFT, MOUSE_TYPE_DOWN, MOUSE_TYPE_UP, MOUSE_TYPE_WHEEL},
ui_interface::use_texture_render,
};
use async_trait::async_trait;
use bytes::Bytes;
@@ -448,7 +449,7 @@ impl<T: InvokeUiSession> Session<T> {
let mark_unsupported = self.lc.read().unwrap().mark_unsupported.clone();
let decoder = scrap::codec::Decoder::supported_decodings(
None,
cfg!(feature = "flutter"),
use_texture_render(),
luid,
&mark_unsupported,
);
@@ -469,6 +470,11 @@ impl<T: InvokeUiSession> Session<T> {
self.send(Data::Message(msg));
}
pub fn use_texture_render_changed(&self) {
self.send(Data::ResetDecoder(None));
self.change_prefer_codec();
}
pub fn restart_remote_device(&self) {
let mut lc = self.lc.write().unwrap();
lc.restarting_remote_device = true;
@@ -732,8 +738,7 @@ impl<T: InvokeUiSession> Session<T> {
msg_out.set_misc(misc);
self.send(Data::Message(msg_out));
#[cfg(not(feature = "flutter_texture_render"))]
{
if !use_texture_render() {
self.capture_displays(vec![], vec![], vec![display]);
}
}