fix, texture render widget, blurry image

Signed-off-by: dignow <linlong1265@gmail.com>
This commit is contained in:
dignow 2023-09-19 21:32:50 +08:00
parent 5f222c4df2
commit 6014dd05a0
2 changed files with 12 additions and 6 deletions

View File

@ -409,7 +409,7 @@ class _RemotePageState extends State<RemotePage>
keyboardEnabled: _keyboardEnabled, keyboardEnabled: _keyboardEnabled,
remoteCursorMoved: _remoteCursorMoved, remoteCursorMoved: _remoteCursorMoved,
textureId: _renderTexture.textureId, textureId: _renderTexture.textureId,
useTextureRender: _renderTexture.useTextureRender, useTextureRender: RenderTexture.useTextureRender,
listenerBuilder: (child) => listenerBuilder: (child) =>
_buildRawTouchAndPointerRegion(child, enterView, leaveView), _buildRawTouchAndPointerRegion(child, enterView, leaveView),
); );
@ -539,7 +539,10 @@ class _ImagePaintState extends State<ImagePaint> {
imageWidget = SizedBox( imageWidget = SizedBox(
width: imageWidth, width: imageWidth,
height: imageHeight, height: imageHeight,
child: Obx(() => Texture(textureId: widget.textureId.value)), child: Obx(() => Texture(
textureId: widget.textureId.value,
filterQuality: FilterQuality.none,
)),
); );
} else { } else {
imageWidget = CustomPaint( imageWidget = CustomPaint(
@ -576,11 +579,14 @@ class _ImagePaintState extends State<ImagePaint> {
imageWidget = Stack( imageWidget = Stack(
children: [ children: [
Positioned( Positioned(
left: c.x.toInt().toDouble(), left: c.x,
top: c.y.toInt().toDouble(), top: c.y,
width: c.getDisplayWidth() * s, width: c.getDisplayWidth() * s,
height: c.getDisplayHeight() * s, height: c.getDisplayHeight() * s,
child: Texture(textureId: widget.textureId.value), child: Texture(
textureId: widget.textureId.value,
filterQuality: FilterQuality.none,
),
) )
], ],
); );

View File

@ -8,7 +8,7 @@ class RenderTexture {
final RxInt textureId = RxInt(-1); final RxInt textureId = RxInt(-1);
int _textureKey = -1; int _textureKey = -1;
SessionID? _sessionId; SessionID? _sessionId;
final useTextureRender = bind.mainUseTextureRender(); static final useTextureRender = bind.mainUseTextureRender();
final textureRenderer = TextureRgbaRenderer(); final textureRenderer = TextureRgbaRenderer();