From 1bca04c7568b026d900badc12c2c061413a90429 Mon Sep 17 00:00:00 2001 From: Mark Watkins Date: Sat, 19 Jan 2013 08:10:42 +1000 Subject: [PATCH] Windows needed renderPixmap. Typical. Mac & Linux still don't need it --- Graphs/gGraphView.cpp | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/Graphs/gGraphView.cpp b/Graphs/gGraphView.cpp index 6dcc2859..e1678ca7 100644 --- a/Graphs/gGraphView.cpp +++ b/Graphs/gGraphView.cpp @@ -2073,21 +2073,24 @@ QPixmap gGraph::renderPixmap(int w, int h, bool printing) sg->setScaleY(1.0); - // pm=QPixmap::fromImage(sg->fboRenderPixmap(w,h)); sg->makeCurrent(); // has to be current for fbo creation - -#ifndef Q_OS_MAC - // This doesn't work on Rich's Radeon boxen either - // I'm suspiscious of this function on Radeon hardware. - // pm=sg->renderPixmap(w,h,false); -#endif +#ifdef Q_OS_WIN + if (pm.isNull()){ + pm=sg->renderPixmap(w,h,false); + } + if (pm.isNull()) { // Works, but gives shader warnings + pm=QPixmap::fromImage(sg->pbRenderPixmap(w,h)); + } + if (pm.isNull()){ // crashes on mine, not sure what to do about it + pm=QPixmap::fromImage(sg->fboRenderPixmap(w,h)); + } +#else pm=QPixmap::fromImage(sg->fboRenderPixmap(w,h)); - if (pm.isNull()) { // not sure if this will work with printing qDebug() << "Had to use PixelBuffer for snapshots\n"; pm=QPixmap::fromImage(sg->pbRenderPixmap(w,h)); } - +#endif //sg->doneCurrent(); sg->trashGraphs(); m_graphview=tgv;