force waterfall to throttle by client dc paint from appframe idle

- Attempting to improve waterfall jitter between platforms
This commit is contained in:
Charles J. Cliffe 2015-08-13 17:59:56 -04:00
parent c77d2c9408
commit 8000e97a8c
3 changed files with 15 additions and 4 deletions

View File

@ -768,7 +768,11 @@ void AppFrame::OnIdle(wxIdleEvent& event) {
#ifndef _WIN32
usleep(5000);
#endif
if (this->IsVisible()) {
waterfallCanvas->DoPaint();
demodWaterfallCanvas->DoPaint();
}
event.RequestMore();
}

View File

@ -88,7 +88,12 @@ void WaterfallCanvas::processInputQueue() {
}
void WaterfallCanvas::OnPaint(wxPaintEvent& WXUNUSED(event)) {
wxPaintDC dc(this);
// event.Skip();
}
void WaterfallCanvas::DoPaint() {
wxClientDC dc(this);
// wxPaintDC dc(this);
const wxSize ClientSize = GetClientSize();
long double currentZoom = zoom;
@ -354,8 +359,9 @@ void WaterfallCanvas::OnKeyDown(wxKeyEvent& event) {
}
}
void WaterfallCanvas::OnIdle(wxIdleEvent &event) {
Refresh();
event.RequestMore();
// Refresh();
// event.RequestMore();
event.Skip();
}
void WaterfallCanvas::OnMouseMoved(wxMouseEvent& event) {

View File

@ -28,6 +28,7 @@ public:
void attachSpectrumCanvas(SpectrumCanvas *canvas_in);
void processInputQueue();
SpectrumVisualDataQueue *getVisualDataQueue();
void DoPaint();
private:
void OnPaint(wxPaintEvent& event);