Skip to content

Commit

Permalink
+ when creating picture check whether pbuffer is supported
Browse files Browse the repository at this point in the history
  • Loading branch information
wwmayer committed Dec 9, 2014
1 parent 5da5be2 commit d4a5249
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/Gui/Thumbnail.cpp
Expand Up @@ -30,6 +30,7 @@
# include <QDateTime>
# include <QImage>
# include <QGLFramebufferObject>
# include <QGLPixelBuffer>
#endif

#include "Thumbnail.h"
Expand Down Expand Up @@ -86,8 +87,9 @@ void Thumbnail::SaveDocFile (Base::Writer &writer) const
if (!this->viewer)
return;
QImage img;
bool pbuffer = QGLPixelBuffer::hasOpenGLPbuffers();
if (App::GetApplication().GetParameterGroupByPath
("User parameter:BaseApp/Preferences/Document")->GetBool("DisablePBuffers",false)) {
("User parameter:BaseApp/Preferences/Document")->GetBool("DisablePBuffers",!pbuffer)) {
this->createThumbnailFromFramebuffer(img);
}
else {
Expand Down
4 changes: 3 additions & 1 deletion src/Gui/View3DInventor.cpp
Expand Up @@ -35,6 +35,7 @@
# include <QFileDialog>
# include <QGLFormat>
# include <QGLWidget>
# include <QGLPixelBuffer>
# include <QPainter>
# include <QPrinter>
# include <QPrintDialog>
Expand Down Expand Up @@ -532,8 +533,9 @@ void View3DInventor::print(QPrinter* printer)
QPainter p(printer);
QRect rect = printer->pageRect();

bool pbuffer = QGLPixelBuffer::hasOpenGLPbuffers();
if (App::GetApplication().GetParameterGroupByPath
("User parameter:BaseApp/Preferences/Document")->GetBool("DisablePBuffers",false)) {
("User parameter:BaseApp/Preferences/Document")->GetBool("DisablePBuffers",!pbuffer)) {
previewFromFramebuffer(rect, img);
}
else {
Expand Down
4 changes: 3 additions & 1 deletion src/Gui/View3DPy.cpp
Expand Up @@ -29,6 +29,7 @@
# include <QColor>
# include <QImage>
# include <QGLFramebufferObject>
# include <QGLPixelBuffer>
# include <Inventor/SbViewVolume.h>
# include <Inventor/nodes/SoCamera.h>
#endif
Expand Down Expand Up @@ -696,8 +697,9 @@ Py::Object View3DInventorPy::saveImage(const Py::Tuple& args)
bg.setNamedColor(colname);

QImage img;
bool pbuffer = QGLPixelBuffer::hasOpenGLPbuffers();
if (App::GetApplication().GetParameterGroupByPath
("User parameter:BaseApp/Preferences/Document")->GetBool("DisablePBuffers",false)) {
("User parameter:BaseApp/Preferences/Document")->GetBool("DisablePBuffers",!pbuffer)) {
createImageFromFramebuffer(w, h, bg, img);
}
else {
Expand Down

0 comments on commit d4a5249

Please sign in to comment.