diff view/View.h @ 915:f6d9f28f37cb osx-retina

Experiment with querying paint rect separately from view rect
author Chris Cannam
date Wed, 11 Mar 2015 15:35:20 +0000
parents 4a578a360011
children 94e4952a6774
line wrap: on
line diff
--- a/view/View.h	Wed Mar 11 13:54:01 2015 +0000
+++ b/view/View.h	Wed Mar 11 15:35:20 2015 +0000
@@ -315,6 +315,18 @@
     sv_frame_t getModelsStartFrame() const;
     sv_frame_t getModelsEndFrame() const;
 
+    /**
+     * To be called from a layer, to obtain the extent of the surface
+     * that the layer is currently painting to. This may be the extent
+     * of the view (if 1x display scaling is in effect) or of a larger
+     * cached pixmap (if greater display scaling is in effect).
+     */
+    QRect getPaintRect() const;
+
+    QSize getPaintSize() const { return getPaintRect().size(); }
+    int getPaintWidth() const { return getPaintRect().width(); }
+    int getPaintHeight() const { return getPaintRect().height(); }
+
     typedef std::set<Model *> ModelSet;
     ModelSet getModels();
 
@@ -415,6 +427,7 @@
     sv_frame_t          m_playPointerFrame;
     bool                m_lightBackground;
     bool                m_showProgress;
+    int                 m_paintScale;
 
     QPixmap            *m_cache;
     sv_frame_t          m_cacheCentreFrame;