Skip to content

Pan and Pinch gestures bad performance in Forms UWP #274

Closed

Description

@mgierlasinski

Hi!
I tested Pich and Pan gestures from sample project in Forms/UWP app and it's slow. When dragging image from BitmapScale sample it doesn't move smoothly, especially when drag distance is large. In OpenGL backed gestures don't work at all. Tested on Lumia 950 (not XL), SkiaSharp 1.56-2 (latest from nuget, I had to downgrade from 1.57 used in sample project).

Regards,
Marcin

Activity

  1. bugadani commented on Apr 10, 2017

    @bugadani

    I've run into this today.

    My setup is a charting control that draws in PaintSurface handler. I implemented panning and pinch to zoom that update actual drawing parameters in PaintSurface handler. My first resuts yielded normal-ish performance for panning, and variable, slow performance while zooming (slow framerates, only refreshed while slowly pinching). Turns out, calling Debug.WriteLine in PinchUpdated handler is a bad idea - the handler should be as short as possible because it takes priority over PaintSurface.

    @mgierlasinski you may have better results if you separate bitmap drawing out of the gesture event handlers.

  2. mattleibow commented on Aug 29, 2017

    @mattleibow
    Contributor

    I had a look at this, and the reason is that the OpenGL for UWP is not quite perfect yet when it comes to the view.

    I need to go back and investigate the correct (or better) way to get the scaling correct. Currently, to preserve the quality of high density screens, I am rendering the large framebuffer. However, there is some disconnect with the framebuffer and the view, so I am having to scale the view down using a ScaleTransform:

    https://github.com/mono/SkiaSharp/blob/master/source/SkiaSharp.Views/SkiaSharp.Views.UWP/SKSwapChainPanel.cs#L46-L50

    As a result of the scaling, the actual view is (on my Lumia 950 XL) only a third of the total visible view. Thus, it gives the impression that the gestures aren't working at all, but in fact they do work, but only in the top left third of the screen.

  3. jross100 commented on Jan 9, 2018

    @jross100

    Hi @mattleibow

    I've run into this bug too with touch events and the SKGLView.

    I think this could be solved by setting the scale when creating the surface. See here for info:

    microsoft/angle#29 (comment)

    It looks like the information that Dmitry wrote might be relevant as well:

    https://developernote.com/2015/11/combining-opengl-and-xaml-together-in-a-windows-store-app-uwp/

  4. mattleibow commented on Oct 30, 2024

    @mattleibow
    Contributor

    This way of rendering should now be fixed. And, we are not really supporting UWP anymore, WinUI is the way to go. That has a totally new implementation, so I am going to close this for now.

    For any similar issues, please open a new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions