Commit 6ff83474 authored by Albert Astals Cid's avatar Albert Astals Cid

* qt/poppler-page.cc:

      * qt/poppler-private.h: Don't create a SplashOutputDev for every
        renderToPixmap.
parent 6942646d
2006-01-01 Albert Astals Cid <aacid@kde.org>
* qt/poppler-page.cc:
* qt/poppler-private.h: Don't create a SplashOutputDev for every
renderToPixmap.
Sun Jan 1 15:32:08 2006 Jonathan Blandford <jrb@redhat.com>
* glib/reference/*: More gtk-doc work. Not enabled for building
......
......@@ -61,13 +61,8 @@ void Page::renderToPixmap(QPixmap **q, int x, int y, int w, int h, double xres,
{
SplashOutputDev *output_dev;
SplashBitmap *bitmap;
SplashColor white;
white[0] = 255;
white[1] = 255;
white[2] = 255;
SplashColorPtr color_ptr;
output_dev = new SplashOutputDev(splashModeRGB8, 4, gFalse, white);
output_dev->startDoc(data->doc->data->doc.getXRef ());
output_dev = data->doc->data->getOutputDev();
data->doc->data->doc.displayPageSlice(output_dev, data->index + 1, xres, yres,
0, false, false, false, -1, -1, -1, -1);
......@@ -89,7 +84,6 @@ void Page::renderToPixmap(QPixmap **q, int x, int y, int w, int h, double xres,
*q = new QPixmap( *img );
delete img;
delete output_dev;
}
QString Page::getText(const Rectangle &r) const
......
......@@ -23,10 +23,32 @@ namespace Poppler {
class DocumentData {
public:
DocumentData(GooString *filePath, GooString *password) : doc(filePath,password) {}
DocumentData(GooString *filePath, GooString *password) : doc(filePath,password), m_outputDev(0) {}
~DocumentData()
{
delete m_outputDev;
delete m_fontInfoScanner;
}
SplashOutputDev *getOutputDev()
{
if (!m_outputDev)
{
SplashColor white;
white[0] = 255;
white[1] = 255;
white[2] = 255;
m_outputDev = new SplashOutputDev(splashModeRGB8, 4, gFalse, white);
m_outputDev->startDoc(doc.getXRef());
}
return m_outputDev;
}
class PDFDoc doc;
bool locked;
FontInfoScanner *m_fontInfoScanner;
SplashOutputDev *m_outputDev;
};
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment