Permalink
Browse files

Use default OpenGL format for hardware acceleration

  • Loading branch information...
1 parent cb48050 commit e1f32ef428622543bdfcbe358f78e6ee1b384cb6 @nikola-kocic committed Jan 29, 2012
Showing with 6 additions and 12 deletions.
  1. +2 −2 picture_loader.cpp
  2. +1 −7 pictureitem.cpp
  3. +1 −1 pictureitem.h
  4. +2 −2 pictureitem_gl.cpp
View
@@ -16,7 +16,7 @@
QImage PictureLoader::getImage(const FileInfo &info)
{
#ifdef DEBUG_PICTURE_LOADER
- qDebug() << QDateTime::currentDateTime().toString(Qt::ISODate) << "PictureLoader::getImage" << info.getFilePath();
+ qDebug() << QDateTime::currentDateTime().toString(Qt::ISODate) << "PictureLoader::getImage" << info.getPath();
#endif
if (!info.fileExists())
{
@@ -36,7 +36,7 @@ QImage PictureLoader::getImage(const FileInfo &info)
QImage PictureLoader::getThumbnail(const ThumbnailInfo &thumb_info)
{
#ifdef DEBUG_PICTURE_LOADER
- qDebug() << QDateTime::currentDateTime().toString(Qt::ISODate) << "PictureLoader::getThumbnail" << thumb_info.getFileInfo().getFilePath() << thumb_info.getThumbSize();
+ qDebug() << QDateTime::currentDateTime().toString(Qt::ISODate) << "PictureLoader::getThumbnail" << thumb_info.getFileInfo().getPath() << thumb_info.getThumbSize();
#endif
if (!thumb_info.getFileInfo().fileExists())
{
View
@@ -50,13 +50,7 @@ void PictureItem::initPictureItem()
{
if (m_opengl)
{
- QGLFormat glFmt;
- glFmt.setSwapInterval(1); // 1= vsync on
- glFmt.setAlpha(false); // default
- glFmt.setOverlay(false); // default
- glFmt.setSampleBuffers(false); // default
-
- m_imageDisplay_gl = new PictureItemGL(glFmt, this);
+ m_imageDisplay_gl = new PictureItemGL(this);
m_imageDisplay_raster = 0;
this->layout()->addWidget(m_imageDisplay_gl);
}
View
@@ -65,7 +65,7 @@ class PictureItem : public QWidget
{
public:
- explicit PictureItemGL(const QGLFormat& format, PictureItem* parent, const QGLWidget* shareWidget = 0, Qt::WindowFlags f=0);
+ explicit PictureItemGL(PictureItem* parent, const QGLWidget* shareWidget = 0, Qt::WindowFlags f=0);
~PictureItemGL();
void setRotation(const qreal current, const qreal previous);
void updateClearColor();
View
@@ -8,8 +8,8 @@
#include <QDebug>
#include <QDateTime>
#endif
-PictureItem::PictureItemGL::PictureItemGL(const QGLFormat& format, PictureItem *parent, const QGLWidget* shareWidget, Qt::WindowFlags f)
- : QGLWidget(format, parent, shareWidget, f)
+PictureItem::PictureItemGL::PictureItemGL(PictureItem *parent, const QGLWidget *shareWidget, Qt::WindowFlags f)
+ : QGLWidget(parent, shareWidget, f)
, m_picItem(parent)
, m_scaleX(0)
, m_scaleY(0)

0 comments on commit e1f32ef

Please sign in to comment.