mirror of
https://github.com/rustdesk/rustdesk.git
synced 2025-05-11 10:26:19 +02:00
fix nextRgba not called when switching to texture render (#8792)
Because rgba buffer render doesn't support multi display, when switch to multi display, it is possible that rgba.valid has been set to valid but nextRgab is not called, when switching back to single display, rgba.valid is still true. Fix by rgba buffer, rgba texture and gpu texture using different messages. Signed-off-by: 21pages <sunboeasy@gmail.com>
This commit is contained in:
parent
8a4a2b5732
commit
57d1b1ecc4
3 changed files with 21 additions and 23 deletions
|
@ -2547,32 +2547,30 @@ class FFI {
|
|||
}
|
||||
} else if (message is EventToUI_Rgba) {
|
||||
final display = message.field0;
|
||||
if (imageModel.useTextureRender || ffiModel.pi.forceTextureRender) {
|
||||
//debugPrint("EventToUI_Rgba display:$display");
|
||||
textureModel.setTextureType(display: display, gpuTexture: false);
|
||||
// Fetch the image buffer from rust codes.
|
||||
final sz = platformFFI.getRgbaSize(sessionId, display);
|
||||
if (sz == 0) {
|
||||
platformFFI.nextRgba(sessionId, display);
|
||||
return;
|
||||
}
|
||||
final rgba = platformFFI.getRgba(sessionId, display, sz);
|
||||
if (rgba != null) {
|
||||
onEvent2UIRgba();
|
||||
imageModel.onRgba(display, rgba);
|
||||
} else {
|
||||
// Fetch the image buffer from rust codes.
|
||||
final sz = platformFFI.getRgbaSize(sessionId, display);
|
||||
if (sz == 0) {
|
||||
platformFFI.nextRgba(sessionId, display);
|
||||
return;
|
||||
}
|
||||
final rgba = platformFFI.getRgba(sessionId, display, sz);
|
||||
if (rgba != null) {
|
||||
onEvent2UIRgba();
|
||||
imageModel.onRgba(display, rgba);
|
||||
} else {
|
||||
platformFFI.nextRgba(sessionId, display);
|
||||
}
|
||||
platformFFI.nextRgba(sessionId, display);
|
||||
}
|
||||
} else if (message is EventToUI_Texture) {
|
||||
final display = message.field0;
|
||||
debugPrint("EventToUI_Texture display:$display");
|
||||
if (hasGpuTextureRender) {
|
||||
textureModel.setTextureType(display: display, gpuTexture: true);
|
||||
onEvent2UIRgba();
|
||||
final gpuTexture = message.field1;
|
||||
debugPrint(
|
||||
"EventToUI_Texture display:$display, gpuTexture:$gpuTexture");
|
||||
if (gpuTexture && !hasGpuTextureRender) {
|
||||
debugPrint('the gpuTexture is not supported.');
|
||||
return;
|
||||
}
|
||||
textureModel.setTextureType(display: display, gpuTexture: gpuTexture);
|
||||
onEvent2UIRgba();
|
||||
}
|
||||
}();
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue