diff layer/Colour3DPlotRenderer.h @ 1221:eaab8bab3522

Measure time taken to render per pixel, and use the time last time around to decide whether to be time constrained this time around
author Chris Cannam
date Thu, 26 Jan 2017 11:55:11 +0000
parents 34df6ff25472
children fc40742bb911
line wrap: on
line diff
--- a/layer/Colour3DPlotRenderer.h	Thu Jan 26 10:41:50 2017 +0000
+++ b/layer/Colour3DPlotRenderer.h	Thu Jan 26 11:55:11 2017 +0000
@@ -32,6 +32,7 @@
 class DenseThreeDimensionalModel;
 class Dense3DModelPeakCache;
 class FFTModel;
+class RenderTimer;
 
 enum class BinDisplay {
     AllBins,
@@ -111,7 +112,9 @@
     
     Colour3DPlotRenderer(Sources sources, Parameters parameters) :
         m_sources(sources),
-	m_params(parameters)
+	m_params(parameters),
+        m_secondsPerXPixel(0.0),
+        m_secondsPerXPixelValid(false)
     { }
 
     struct RenderResult {
@@ -263,6 +266,9 @@
     // valid range in the magnitude cache, but not necessarily vice
     // versa (as the image cache is limited to contiguous ranges).
     ScrollableMagRangeCache m_magCache;
+
+    double m_secondsPerXPixel;
+    bool m_secondsPerXPixelValid;
     
     RenderResult render(const LayerGeometryProvider *v,
                         QPainter &paint, QRect rect, bool timeConstrained);
@@ -310,6 +316,8 @@
 
     void getPreferredPeakCache(const LayerGeometryProvider *,
                                int &peakCacheIndex, int &binsPerPeak) const;
+
+    void updateTimings(const RenderTimer &timer, int xPixelCount);
 };
 
 #endif