Made work the (inactive) case !defined XPDFRENDERER_CACHE_ZOOM_IMAGE.

preferencesAboutTextFull
John Papale 4 years ago
parent 9448d193c9
commit c860e0b0b7
  1. 13
      src/pdf/XPDFRenderer.cpp
  2. 9
      src/pdf/XPDFRenderer.h

@ -38,21 +38,28 @@
#include "core/memcheck.h" #include "core/memcheck.h"
#ifdef XPDFRENDERER_CACHE_ZOOM_IMAGE
#ifdef XPDFRENDERER_CACHE_ZOOM_WITH_LOSS #ifdef XPDFRENDERER_CACHE_ZOOM_WITH_LOSS
double const XPDFRenderer::sRatioZoomRendering[] = { 3.0 }; double const XPDFRenderer::sRatioZoomRendering[] = { 3.0 };
#else //XPDFRENDERER_CACHE_ZOOM_WITH_LOSS #else //XPDFRENDERER_CACHE_ZOOM_WITH_LOSS
double const XPDFRenderer::sRatioZoomRendering[] = { 2.5, 5, 10.0 }; double const XPDFRenderer::sRatioZoomRendering[] = { 2.5, 5, 10.0 };
#endif //XPDFRENDERER_CACHE_ZOOM_WITH_LOSS #endif //XPDFRENDERER_CACHE_ZOOM_WITH_LOSS
#endif //XPDFRENDERER_CACHE_ZOOM_IMAGE
QAtomicInt XPDFRenderer::sInstancesCount = 0; QAtomicInt XPDFRenderer::sInstancesCount = 0;
XPDFRenderer::XPDFRenderer(const QString &filename, bool importingFile) XPDFRenderer::XPDFRenderer(const QString &filename, bool importingFile) :
: mDocument(0) #ifndef XPDFRENDERER_CACHE_ZOOM_IMAGE
mSplash(nullptr),
#endif //XPDFRENDERER_CACHE_ZOOM_IMAGE
mDocument(0)
{ {
#ifdef XPDFRENDERER_CACHE_ZOOM_IMAGE
for (int i = 0; i < NbrZoomCache; i++) for (int i = 0; i < NbrZoomCache; i++)
{ {
m_cache.push_back(TypeCacheData(sRatioZoomRendering[i])); m_cache.push_back(TypeCacheData(sRatioZoomRendering[i]));
} }
#endif //XPDFRENDERER_CACHE_ZOOM_IMAGE
Q_UNUSED(importingFile); Q_UNUSED(importingFile);
if (!globalParams) if (!globalParams)
@ -76,6 +83,7 @@ XPDFRenderer::XPDFRenderer(const QString &filename, bool importingFile)
XPDFRenderer::~XPDFRenderer() XPDFRenderer::~XPDFRenderer()
{ {
#ifdef XPDFRENDERER_CACHE_ZOOM_IMAGE
for(int i = 0; i < m_cache.size(); i++) for(int i = 0; i < m_cache.size(); i++)
{ {
TypeCacheData &cacheData = m_cache[i]; TypeCacheData &cacheData = m_cache[i];
@ -85,6 +93,7 @@ XPDFRenderer::~XPDFRenderer()
cacheData.splash = nullptr; cacheData.splash = nullptr;
} }
} }
#endif //XPDFRENDERER_CACHE_ZOOM_IMAGE
if (mDocument) if (mDocument)
{ {

@ -99,19 +99,22 @@ class XPDFRenderer : public PDFRenderer
}; };
QImage &createPDFImage(int pageNumber, TypeCacheData &cacheData); QImage &createPDFImage(int pageNumber, TypeCacheData &cacheData);
static const double sRatioZoomRendering[NbrZoomCache];
QVector<TypeCacheData> m_cache;
#else #else
QImage* createPDFImage(int pageNumber, qreal xscale = 0.5, qreal yscale = 0.5, const QRectF &bounds = QRectF()); QImage* createPDFImage(int pageNumber, qreal xscale = 0.5, qreal yscale = 0.5, const QRectF &bounds = QRectF());
SplashBitmap* mpSplashBitmap;
SplashOutputDev* mSplash;
#endif #endif
PDFDoc *mDocument; PDFDoc *mDocument;
static QAtomicInt sInstancesCount; static QAtomicInt sInstancesCount;
//! The image is rendered with a quality above normal, so we can use that same //! The image is rendered with a quality above normal, so we can use that same
//! image while zooming. //! image while zooming.
static const double sRatioZoomRendering[NbrZoomCache];
qreal mSliceX; qreal mSliceX;
qreal mSliceY; qreal mSliceY;
QVector<TypeCacheData> m_cache;
}; };
#endif // XPDFRENDERER_H #endif // XPDFRENDERER_H

Loading…
Cancel
Save