From 6014dd05a0a3dd887944920bd0a652671207506b Mon Sep 17 00:00:00 2001 From: dignow Date: Tue, 19 Sep 2023 21:32:50 +0800 Subject: [PATCH] fix, texture render widget, blurry image Signed-off-by: dignow --- flutter/lib/desktop/pages/remote_page.dart | 16 +++++++++++----- flutter/lib/models/desktop_render_texture.dart | 2 +- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/flutter/lib/desktop/pages/remote_page.dart b/flutter/lib/desktop/pages/remote_page.dart index 86d4b05bb..f38e7d16c 100644 --- a/flutter/lib/desktop/pages/remote_page.dart +++ b/flutter/lib/desktop/pages/remote_page.dart @@ -409,7 +409,7 @@ class _RemotePageState extends State keyboardEnabled: _keyboardEnabled, remoteCursorMoved: _remoteCursorMoved, textureId: _renderTexture.textureId, - useTextureRender: _renderTexture.useTextureRender, + useTextureRender: RenderTexture.useTextureRender, listenerBuilder: (child) => _buildRawTouchAndPointerRegion(child, enterView, leaveView), ); @@ -539,7 +539,10 @@ class _ImagePaintState extends State { imageWidget = SizedBox( width: imageWidth, height: imageHeight, - child: Obx(() => Texture(textureId: widget.textureId.value)), + child: Obx(() => Texture( + textureId: widget.textureId.value, + filterQuality: FilterQuality.none, + )), ); } else { imageWidget = CustomPaint( @@ -576,11 +579,14 @@ class _ImagePaintState extends State { imageWidget = Stack( children: [ Positioned( - left: c.x.toInt().toDouble(), - top: c.y.toInt().toDouble(), + left: c.x, + top: c.y, width: c.getDisplayWidth() * s, height: c.getDisplayHeight() * s, - child: Texture(textureId: widget.textureId.value), + child: Texture( + textureId: widget.textureId.value, + filterQuality: FilterQuality.none, + ), ) ], ); diff --git a/flutter/lib/models/desktop_render_texture.dart b/flutter/lib/models/desktop_render_texture.dart index f8456e339..b18d97b82 100644 --- a/flutter/lib/models/desktop_render_texture.dart +++ b/flutter/lib/models/desktop_render_texture.dart @@ -8,7 +8,7 @@ class RenderTexture { final RxInt textureId = RxInt(-1); int _textureKey = -1; SessionID? _sessionId; - final useTextureRender = bind.mainUseTextureRender(); + static final useTextureRender = bind.mainUseTextureRender(); final textureRenderer = TextureRgbaRenderer();