Skip to content

Improve AnnotationViewport and AnnotationDocument repaint speed

Noah Davis requested to merge work/ndavis/faster-annotationviewport into master

Instead of being a QQuickPaintedItem, AnnotationViewport is now a QQuickItem that renders annotations as a separate texture from the base screenshot image texture. Due to the changes, we no longer have the zoom property for scaling the image below 1x scale by scaling down the QImage. We only use scale now, so in order to scale smoothly below 1x, we need to set layer.enabled: true; layer.mipmap: true; layer.smooth: true in ScreenshotView. This also means that it is currently no longer possible to get an unfilter view of the pixels when zoomed in. Hopefully we can fix that someday.

AnnotationDocument now has separate images for the base screenshot image and the annotations image. This allows us to update the annotations without repainting using the base image. The annotation image is also painted lazily. That is, the painting happens when AnnotationDocument has been marked as needing a repaint and an annotation image was requested. When an annotation image is requested and there is no need for a repaint, AnnotationDocument will just return a cached version of the annotation image.

Merge request reports