[poppler] 2 commits - makefile.vc test/perf-test.cc

Krzysztof Kowalczyk kjk at kemper.freedesktop.org
Fri Sep 21 22:46:39 PDT 2007


 makefile.vc       |    2 -
 test/perf-test.cc |   60 ++++++++----------------------------------------------
 2 files changed, 10 insertions(+), 52 deletions(-)

New commits:
diff-tree 6c69473f2f4a49757614ddd249e65bb7a13c63c1 (from e7e386e7ce8cb8eb8a7037ebdaa601524d332ae7)
Author: Krzysztof Kowalczyk <kkowalczyk at tlapx60ubu.(none)>
Date:   Fri Sep 21 08:09:53 2007 -0700

    undo accidental mode change

diff --git a/makefile.vc b/makefile.vc
old mode 100755
new mode 100644
diff-tree e7e386e7ce8cb8eb8a7037ebdaa601524d332ae7 (from 3e10604637ec193269a3155985476d3b83dc7d62)
Author: Krzysztof Kowalczyk <kkowalczyk at tlapx60ubu.(none)>
Date:   Fri Sep 21 08:08:53 2007 -0700

    more simplification by removing unneded code

diff --git a/makefile.vc b/makefile.vc
old mode 100644
new mode 100755
index d657cbf..0b0f0ee
--- a/makefile.vc
+++ b/makefile.vc
@@ -60,7 +60,7 @@ CFLAGS = $(CFLAGS) /I$(ZLIB_DIR) /I$(JPE
 
 LIBS = $(LIBS) kernel32.lib advapi32.lib user32.lib gdi32.lib
 
-LDFLAGS = $(LDFLAGS) /nologo /DEBUG
+LDFLAGS = $(LDFLAGS) /nologo /DEBUG /NODEFAULTLIB:libcmt
 
 #CFLAGS = $(CFLAGS) /D "USE_FIXEDPOINT"
 
diff --git a/test/perf-test.cc b/test/perf-test.cc
index cde1852..02dfd52 100755
--- a/test/perf-test.cc
+++ b/test/perf-test.cc
@@ -64,22 +64,6 @@ extern void PreviewBitmapInit(void);
 extern void PreviewBitmapDestroy(void);
 extern void PreviewBitmapSplash(SplashBitmap *bmpSplash);
 
-class SizeD {
-public:
-    SizeD(double dx, double dy) { m_dx = dx; m_dy = dy; }
-    SizeD(int dx, int dy) { m_dx = (double)dx; m_dy = (double)dy; }
-    SizeD() { m_dx = 0; m_dy = 0; }
-    int dxI() { return (int)m_dx; }
-    int dyI() { return (int)m_dy; }
-    double dx() { return m_dx; }
-    double dy() { return m_dy; }
-    void setDx(double dx) { m_dx = dx; }
-    void setDy(double dy) { m_dy = dy; }
-private:
-    double m_dx;
-    double m_dy;
-};
-
 class PdfEnginePoppler {
 public:
     PdfEnginePoppler();
@@ -92,26 +76,15 @@ public:
         _fileName = (char*)strdup(fileName);
     }
 
-    bool validPageNo(int pageNo) const {
-        if ((pageNo >= 1) && (pageNo <= pageCount()))
-            return true;
-        return false;
-    }
-
     int pageCount(void) const { return _pageCount; }
 
-    virtual bool load(const char *fileName);
-    virtual int pageRotation(int pageNo);
-    virtual SizeD pageSize(int pageNo);
-    virtual SplashBitmap *renderBitmap(int pageNo, double zoomReal, int rotation,
-                         GBool (*abortCheckCbkA)(void *data),
-                         void *abortCheckCbkDataA);
+    bool load(const char *fileName);
+    SplashBitmap *renderBitmap(int pageNo, double zoomReal, int rotation);
 
-    PDFDoc* pdfDoc() { return _pdfDoc; }
     SplashOutputDev *   outputDevice();
 private:
-    char *_fileName;
-    int _pageCount;
+    char *              _fileName;
+    int                 _pageCount;
 
     PDFDoc *            _pdfDoc;
     SplashOutputDev *   _outputDev;
@@ -498,19 +471,6 @@ bool PdfEnginePoppler::load(const char *
     return true;
 }
 
-int PdfEnginePoppler::pageRotation(int pageNo)
-{
-    assert(validPageNo(pageNo));
-    return pdfDoc()->getPageRotate(pageNo);
-}
-
-SizeD PdfEnginePoppler::pageSize(int pageNo)
-{
-    double dx = pdfDoc()->getPageCropWidth(pageNo);
-    double dy = pdfDoc()->getPageCropHeight(pageNo);
-    return SizeD(dx, dy);
-}
-
 SplashOutputDev * PdfEnginePoppler::outputDevice() {
     if (!_outputDev) {
         GBool bitmapTopDown = gTrue;
@@ -521,10 +481,7 @@ SplashOutputDev * PdfEnginePoppler::outp
     return _outputDev;
 }
 
-SplashBitmap *PdfEnginePoppler::renderBitmap(
-                           int pageNo, double zoomReal, int rotation,
-                           GBool (*abortCheckCbkA)(void *data),
-                           void *abortCheckCbkDataA)
+SplashBitmap *PdfEnginePoppler::renderBitmap(int pageNo, double zoomReal, int rotation)
 {
     assert(outputDevice());
     if (!outputDevice()) return NULL;
@@ -534,8 +491,8 @@ SplashBitmap *PdfEnginePoppler::renderBi
     GBool  useMediaBox = gFalse;
     GBool  crop        = gTrue;
     GBool  doLinks     = gTrue;
-    _pdfDoc->displayPage(_outputDev, pageNo, hDPI, vDPI, rotation, useMediaBox, crop, doLinks,
-        abortCheckCbkA, abortCheckCbkDataA);
+    _pdfDoc->displayPage(_outputDev, pageNo, hDPI, vDPI, rotation, useMediaBox, 
+        crop, doLinks, NULL, NULL);
 
     SplashBitmap* bmp = _outputDev->takeBitmap();
     return bmp;
@@ -1015,7 +972,7 @@ static void RenderPdf(const char *fileNa
         SplashBitmap *bmpSplash = NULL;
 
         MsTimer msTimer;
-        bmpSplash = engineSplash->renderBitmap(curPage, 100.0, 0, NULL, NULL);
+        bmpSplash = engineSplash->renderBitmap(curPage, 100.0, 0);
         msTimer.stop();
         double timeInMs = msTimer.timeInMs();
         if (gfTimings)
@@ -1398,6 +1355,7 @@ int main(int argc, char **argv)
     PreviewBitmapDestroy();
     StrList_Destroy(&gArgsListRoot);
     delete globalParams;
+    free(gOutFileName);
     return 0;
 }
 


More information about the poppler mailing list