[poppler] 4 commits - makefile.vc msvc/poppler test/perf-test.cc test/perf-test-pdf-engine.h test/perf-test-preview-dummy.cc test/perf-test-preview-win.cc

Krzysztof Kowalczyk kjk at kemper.freedesktop.org
Fri Sep 21 22:18:27 PDT 2007


 makefile.vc                     |    2 
 msvc/poppler/poppler-config.h   |  143 +++++++++++++++++++++++++++++
 test/perf-test-pdf-engine.h     |  131 ---------------------------
 test/perf-test-preview-dummy.cc |    3 
 test/perf-test-preview-win.cc   |   83 ++++++++++++++---
 test/perf-test.cc               |  191 +++++++++++++++++-----------------------
 6 files changed, 300 insertions(+), 253 deletions(-)

New commits:
diff-tree 634718936f2a95fac2a9d12fcea483b3d0ca8fa6 (from 617550199762fab42ca2e202e641e047b3efbac0)
Author: Krzysztof Kowalczyk <kkowalczyk at tlapx60ubu.(none)>
Date:   Fri Sep 21 07:41:14 2007 -0700

    simplify perf-test

diff --git a/test/perf-test-pdf-engine.h b/test/perf-test-pdf-engine.h
deleted file mode 100755
index 7c454aa..0000000
--- a/test/perf-test-pdf-engine.h
+++ /dev/null
@@ -1,78 +0,0 @@
-#ifndef PDF_TEST_PDF_ENGINE_H_
-#define PDF_TEST_PDF_ENGINE_H_
-
-#include "ErrorCodes.h"
-#include "GooString.h"
-#include "GooList.h"
-#include "GlobalParams.h"
-#include "SplashBitmap.h"
-#include "Object.h" /* must be included before SplashOutputDev.h because of sloppiness in SplashOutputDev.h */
-#include "SplashOutputDev.h"
-#include "TextOutputDev.h"
-#include "PDFDoc.h"
-#include "SecurityHandler.h"
-#include "Link.h"
-
-#define INVALID_PAGE_NO     -1
-
-#ifdef _MSC_VER
-#define strdup _strdup
-#endif
-
-#define dimof(X)    (sizeof(X)/sizeof((X)[0]))
-
-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();
-    ~PdfEnginePoppler();
-
-    const char *fileName(void) const { return _fileName; };
-
-    void setFileName(const char *fileName) {
-        assert(!_fileName);
-        _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,
-                         BOOL (*abortCheckCbkA)(void *data),
-                         void *abortCheckCbkDataA);
-
-    PDFDoc* pdfDoc() { return _pdfDoc; }
-    SplashOutputDev *   outputDevice();
-private:
-    char *_fileName;
-    int _pageCount;
-
-    PDFDoc *            _pdfDoc;
-    SplashOutputDev *   _outputDev;
-};
-
-
-#endif
diff --git a/test/perf-test-preview-win.cc b/test/perf-test-preview-win.cc
index 5f3f09b..173a7a5 100755
--- a/test/perf-test-preview-win.cc
+++ b/test/perf-test-preview-win.cc
@@ -4,11 +4,10 @@
 /* This is a preview support for perf-test for Windows */
 
 #include <windows.h>
-
-#include "perf-test-pdf-engine.h"
-
 #include <assert.h>
 
+#include "SplashBitmap.h"
+
 #define WIN_CLASS_NAME  "PDFTEST_PDF_WIN"
 #define COL_WINDOW_BG RGB(0xff, 0xff, 0xff)
 
diff --git a/test/perf-test.cc b/test/perf-test.cc
index 46a6d6b..fc309bb 100755
--- a/test/perf-test.cc
+++ b/test/perf-test.cc
@@ -22,8 +22,6 @@
 #include <windows.h>
 #endif
 
-#include "perf-test-pdf-engine.h"
-
 #include <assert.h>
 #include <config.h>
 #include <stdio.h>
@@ -38,10 +36,30 @@
 #include <dirent.h>
 #endif
 
+#include "ErrorCodes.h"
+#include "GooString.h"
+#include "GooList.h"
+#include "GlobalParams.h"
+#include "SplashBitmap.h"
+#include "Object.h" /* must be included before SplashOutputDev.h because of sloppiness in SplashOutputDev.h */
+#include "SplashOutputDev.h"
+#include "TextOutputDev.h"
+#include "PDFDoc.h"
+#include "SecurityHandler.h"
+#include "Link.h"
+
 #ifndef _MSC_VER
 typedef BOOL int;
 #endif
 
+#ifdef _MSC_VER
+#define strdup _strdup
+#endif
+
+#define dimof(X)    (sizeof(X)/sizeof((X)[0]))
+
+#define INVALID_PAGE_NO     -1
+
 /* Those must be implemented in order to provide preview during execution.
    They can be no-ops. An implementation for windows is in
    perf-test-preview-win.cc
@@ -50,6 +68,59 @@ 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();
+    ~PdfEnginePoppler();
+
+    const char *fileName(void) const { return _fileName; };
+
+    void setFileName(const char *fileName) {
+        assert(!_fileName);
+        _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,
+                         BOOL (*abortCheckCbkA)(void *data),
+                         void *abortCheckCbkDataA);
+
+    PDFDoc* pdfDoc() { return _pdfDoc; }
+    SplashOutputDev *   outputDevice();
+private:
+    char *_fileName;
+    int _pageCount;
+
+    PDFDoc *            _pdfDoc;
+    SplashOutputDev *   _outputDev;
+};
+
 typedef struct StrList {
     struct StrList *next;
     char *          str;
diff-tree 617550199762fab42ca2e202e641e047b3efbac0 (from fb5bf808b88992c1772a10e4ed9fe788fb618417)
Author: Krzysztof Kowalczyk <kkowalczyk at tlapx60ubu.(none)>
Date:   Fri Sep 21 05:20:16 2007 -0700

    simplify perf-test code

diff --git a/test/perf-test-pdf-engine.h b/test/perf-test-pdf-engine.h
old mode 100644
new mode 100755
index d000226..7c454aa
--- a/test/perf-test-pdf-engine.h
+++ b/test/perf-test-pdf-engine.h
@@ -37,55 +37,16 @@ private:
     double m_dy;
 };
 
-/* Abstract class representing cached bitmap. Allows different implementations
-   on different platforms. */
-class RenderedBitmap {
+class PdfEnginePoppler {
 public:
-    virtual ~RenderedBitmap() {};
-    virtual int dx() = 0;
-    virtual int dy() = 0;
-    virtual int rowSize() = 0;
-    virtual unsigned char *data() = 0;
-
-#ifdef WIN32
-    // TODO: this is for WINDOWS only
-    virtual HBITMAP createDIBitmap(HDC) = 0;
-    virtual void stretchDIBits(HDC, int, int, int, int) = 0;
-#endif
-};
-
-class RenderedBitmapSplash : public RenderedBitmap {
-public:
-    RenderedBitmapSplash(SplashBitmap *);
-    virtual ~RenderedBitmapSplash();
-
-    virtual int dx();
-    virtual int dy();
-    virtual int rowSize();
-    virtual unsigned char *data();
-
-#ifdef WIN32
-    virtual HBITMAP createDIBitmap(HDC);
-    virtual void stretchDIBits(HDC, int, int, int, int);
-#endif
-protected:
-    SplashBitmap *_bitmap;
-};
-
-class PdfEngine {
-public:
-    PdfEngine() : 
-        _fileName(0)
-        , _pageCount(INVALID_PAGE_NO) 
-    { }
-
-    virtual ~PdfEngine() { free((void*)_fileName); }
+    PdfEnginePoppler();
+    ~PdfEnginePoppler();
 
     const char *fileName(void) const { return _fileName; };
 
     void setFileName(const char *fileName) {
         assert(!_fileName);
-        _fileName = (const char*)strdup(fileName);
+        _fileName = (char*)strdup(fileName);
     }
 
     bool validPageNo(int pageNo) const {
@@ -96,32 +57,18 @@ public:
 
     int pageCount(void) const { return _pageCount; }
 
-    virtual bool load(const char *fileName) = 0;
-    virtual int pageRotation(int pageNo) = 0;
-    virtual SizeD pageSize(int pageNo) = 0;
-    virtual RenderedBitmap *renderBitmap(int pageNo, double zoomReal, int rotation,
-                         BOOL (*abortCheckCbkA)(void *data),
-                         void *abortCheckCbkDataA) = 0;
-
-protected:
-    const char *_fileName;
-    int _pageCount;
-};
-
-class PdfEnginePoppler : public PdfEngine {
-public:
-    PdfEnginePoppler();
-    virtual ~PdfEnginePoppler();
     virtual bool load(const char *fileName);
     virtual int pageRotation(int pageNo);
     virtual SizeD pageSize(int pageNo);
-    virtual RenderedBitmap *renderBitmap(int pageNo, double zoomReal, int rotation,
+    virtual SplashBitmap *renderBitmap(int pageNo, double zoomReal, int rotation,
                          BOOL (*abortCheckCbkA)(void *data),
                          void *abortCheckCbkDataA);
 
     PDFDoc* pdfDoc() { return _pdfDoc; }
     SplashOutputDev *   outputDevice();
 private:
+    char *_fileName;
+    int _pageCount;
 
     PDFDoc *            _pdfDoc;
     SplashOutputDev *   _outputDev;
diff --git a/test/perf-test-preview-dummy.cc b/test/perf-test-preview-dummy.cc
old mode 100644
new mode 100755
index 6360486..10c5518
--- a/test/perf-test-preview-dummy.cc
+++ b/test/perf-test-preview-dummy.cc
@@ -6,9 +6,8 @@ Using this perf-test still works for per
 get any visual feedback during testing.
 */
 
-#include "perf-test-pdf-engine.h"
 
-void PreviewBitmapSplash(RenderedBitmap *bmpSplash)
+void PreviewBitmapSplash(SplashBitmap *bmpSplash)
 {
 }
 
diff --git a/test/perf-test-preview-win.cc b/test/perf-test-preview-win.cc
old mode 100644
new mode 100755
index fdb11bd..5f3f09b
--- a/test/perf-test-preview-win.cc
+++ b/test/perf-test-preview-win.cc
@@ -3,6 +3,8 @@
 
 /* This is a preview support for perf-test for Windows */
 
+#include <windows.h>
+
 #include "perf-test-pdf-engine.h"
 
 #include <assert.h>
@@ -13,7 +15,7 @@
 static HWND             gHwndSplash;
 static HBRUSH           gBrushBg;
 
-static RenderedBitmap *gBmpSplash;
+static SplashBitmap *gBmpSplash;
 
 int rect_dx(RECT *r)
 {
@@ -29,6 +31,60 @@ int rect_dy(RECT *r)
     return dy;
 }
 
+static HBITMAP createDIBitmapCommon(SplashBitmap *bmp, HDC hdc)
+{
+    int bmpDx = bmp->getWidth();
+    int bmpDy = bmp->getHeight();
+    int bmpRowSize = bmp->getRowSize();
+
+    BITMAPINFOHEADER bmih;
+    bmih.biSize = sizeof(bmih);
+    bmih.biHeight = -bmpDy;
+    bmih.biWidth = bmpDx;
+    bmih.biPlanes = 1;
+    bmih.biBitCount = 24;
+    bmih.biCompression = BI_RGB;
+    bmih.biSizeImage = bmpDy * bmpRowSize;;
+    bmih.biXPelsPerMeter = bmih.biYPelsPerMeter = 0;
+    bmih.biClrUsed = bmih.biClrImportant = 0;
+
+    unsigned char* bmpData = bmp->getDataPtr();
+    HBITMAP hbmp = ::CreateDIBitmap(hdc, &bmih, CBM_INIT, bmpData, (BITMAPINFO *)&bmih , DIB_RGB_COLORS);
+    return hbmp;
+}
+
+static void stretchDIBitsCommon(SplashBitmap *bmp, HDC hdc, int leftMargin, int topMargin, int pageDx, int pageDy)
+{
+    int bmpDx = bmp->getWidth();
+    int bmpDy = bmp->getHeight();
+    int bmpRowSize = bmp->getRowSize();
+
+    BITMAPINFOHEADER bmih;
+    bmih.biSize = sizeof(bmih);
+    bmih.biHeight = -bmpDy;
+    bmih.biWidth = bmpDx;
+    bmih.biPlanes = 1;
+    // we could create this dibsection in monochrome
+    // if the printer is monochrome, to reduce memory consumption
+    // but splash is currently setup to return a full colour bitmap
+    bmih.biBitCount = 24;
+    bmih.biCompression = BI_RGB;
+    bmih.biSizeImage = bmpDy * bmpRowSize;;
+    bmih.biXPelsPerMeter = bmih.biYPelsPerMeter = 0;
+    bmih.biClrUsed = bmih.biClrImportant = 0;
+    SplashColorPtr bmpData = bmp->getDataPtr();
+
+    ::StretchDIBits(hdc,
+        // destination rectangle
+        -leftMargin, -topMargin, pageDx, pageDy,
+        // source rectangle
+        0, 0, bmpDx, bmpDy,
+        bmpData,
+        (BITMAPINFO *)&bmih ,
+        DIB_RGB_COLORS,
+        SRCCOPY);
+}
+
 /* Set the client area size of the window 'hwnd' to 'dx'/'dy'. */
 static void resizeClientArea(HWND hwnd, int x, int dx, int dy, int *dx_out)
 {
@@ -46,14 +102,14 @@ static void resizeClientArea(HWND hwnd, 
         *dx_out = win_dx;
 }
 
-static void resizeClientAreaToRenderedBitmap(HWND hwnd, RenderedBitmap *bmp, int x, int *dxOut)
+static void resizeClientAreaToRenderedBitmap(HWND hwnd, SplashBitmap *bmp, int x, int *dxOut)
 {
-    int dx = bmp->dx();
-    int dy = bmp->dy();
+    int dx = bmp->getWidth();
+    int dy = bmp->getHeight();
     resizeClientArea(hwnd, x, dx, dy, dxOut);
 }
 
-static void drawBitmap(HWND hwnd, RenderedBitmap *bmp)
+static void drawBitmap(HWND hwnd, SplashBitmap *bmp)
 {
     PAINTSTRUCT     ps;
 
@@ -61,15 +117,15 @@ static void drawBitmap(HWND hwnd, Render
     SetBkMode(hdc, TRANSPARENT);
     FillRect(hdc, &ps.rcPaint, gBrushBg);
 
-    HBITMAP hbmp = bmp->createDIBitmap(hdc);
+    HBITMAP hbmp = createDIBitmapCommon(bmp, hdc);
     if (hbmp) {
         HDC bmpDC = CreateCompatibleDC(hdc);
         if (bmpDC) {
             SelectObject(bmpDC, hbmp);
             int xSrc = 0, ySrc = 0;
             int xDest = 0, yDest = 0;
-            int bmpDx = bmp->dx();
-            int bmpDy = bmp->dy();
+            int bmpDx = bmp->getWidth();
+            int bmpDy = bmp->getHeight();
             BitBlt(hdc, xDest, yDest, bmpDx, bmpDy, bmpDC, xSrc, ySrc, SRCCOPY);
             DeleteDC(bmpDC);
             bmpDC = NULL;
@@ -82,9 +138,11 @@ static void drawBitmap(HWND hwnd, Render
 
 static void onPaint(HWND hwnd)
 {
-    if (hwnd == gHwndSplash)
-        if (gBmpSplash)
+    if (hwnd == gHwndSplash) {
+        if (gBmpSplash) {
             drawBitmap(hwnd, gBmpSplash);
+        }
+    }
 }
 
 static LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
@@ -209,7 +267,7 @@ static void UpdateWindows(void)
     pumpMessages();
 }
 
-void PreviewBitmapSplash(RenderedBitmap *bmpSplash)
+void PreviewBitmapSplash(SplashBitmap *bmpSplash)
 {
     if (!initWinIfNecessary())
         return;
diff --git a/test/perf-test.cc b/test/perf-test.cc
old mode 100644
new mode 100755
index 1f0991a..46a6d6b
--- a/test/perf-test.cc
+++ b/test/perf-test.cc
@@ -48,7 +48,7 @@ typedef BOOL int;
 */
 extern void PreviewBitmapInit(void);
 extern void PreviewBitmapDestroy(void);
-extern void PreviewBitmapSplash(RenderedBitmap *bmpSplash);
+extern void PreviewBitmapSplash(SplashBitmap *bmpSplash);
 
 typedef struct StrList {
     struct StrList *next;
@@ -401,103 +401,9 @@ void SplashColorsInit(void)
     splashColorSet(SPLASH_COL_WHITE_PTR, 0xff, 0xff, 0xff, 0);
 }
 
-RenderedBitmapSplash::RenderedBitmapSplash(SplashBitmap *bitmap)
-{
-    _bitmap = bitmap;
-}
-
-RenderedBitmapSplash::~RenderedBitmapSplash() {
-    delete _bitmap;
-}
-
-int RenderedBitmapSplash::dx()
-{ 
-    return _bitmap->getWidth();
-}
-
-int RenderedBitmapSplash::dy()
-{ 
-    return _bitmap->getHeight();
-}
-
-int RenderedBitmapSplash::rowSize() 
-{ 
-    return _bitmap->getRowSize(); 
-}
-    
-unsigned char *RenderedBitmapSplash::data()
-{
-    return _bitmap->getDataPtr();
-}
-
-#ifdef WIN32
-static HBITMAP createDIBitmapCommon(RenderedBitmap *bmp, HDC hdc)
-{
-    int bmpDx = bmp->dx();
-    int bmpDy = bmp->dy();
-    int bmpRowSize = bmp->rowSize();
-
-    BITMAPINFOHEADER bmih;
-    bmih.biSize = sizeof(bmih);
-    bmih.biHeight = -bmpDy;
-    bmih.biWidth = bmpDx;
-    bmih.biPlanes = 1;
-    bmih.biBitCount = 24;
-    bmih.biCompression = BI_RGB;
-    bmih.biSizeImage = bmpDy * bmpRowSize;;
-    bmih.biXPelsPerMeter = bmih.biYPelsPerMeter = 0;
-    bmih.biClrUsed = bmih.biClrImportant = 0;
-
-    unsigned char* bmpData = bmp->data();
-    HBITMAP hbmp = ::CreateDIBitmap(hdc, &bmih, CBM_INIT, bmpData, (BITMAPINFO *)&bmih , DIB_RGB_COLORS);
-    return hbmp;
-}
-
-static void stretchDIBitsCommon(RenderedBitmap *bmp, HDC hdc, int leftMargin, int topMargin, int pageDx, int pageDy)
-{
-    int bmpDx = bmp->dx();
-    int bmpDy = bmp->dy();
-    int bmpRowSize = bmp->rowSize();
-
-    BITMAPINFOHEADER bmih;
-    bmih.biSize = sizeof(bmih);
-    bmih.biHeight = -bmpDy;
-    bmih.biWidth = bmpDx;
-    bmih.biPlanes = 1;
-    // we could create this dibsection in monochrome
-    // if the printer is monochrome, to reduce memory consumption
-    // but splash is currently setup to return a full colour bitmap
-    bmih.biBitCount = 24;
-    bmih.biCompression = BI_RGB;
-    bmih.biSizeImage = bmpDy * bmpRowSize;;
-    bmih.biXPelsPerMeter = bmih.biYPelsPerMeter = 0;
-    bmih.biClrUsed = bmih.biClrImportant = 0;
-    SplashColorPtr bmpData = bmp->data();
-
-    ::StretchDIBits(hdc,
-        // destination rectangle
-        -leftMargin, -topMargin, pageDx, pageDy,
-        // source rectangle
-        0, 0, bmpDx, bmpDy,
-        bmpData,
-        (BITMAPINFO *)&bmih ,
-        DIB_RGB_COLORS,
-        SRCCOPY);
-}
-
-HBITMAP RenderedBitmapSplash::createDIBitmap(HDC hdc)
-{
-    return createDIBitmapCommon(this, hdc);
-}
-
-void RenderedBitmapSplash::stretchDIBits(HDC hdc, int leftMargin, int topMargin, int pageDx, int pageDy)
-{
-    stretchDIBitsCommon(this, hdc, leftMargin, topMargin, pageDx, pageDy);
-}
-#endif
-
 PdfEnginePoppler::PdfEnginePoppler() : 
-    PdfEngine()
+   _fileName(0)
+   , _pageCount(INVALID_PAGE_NO) 
    , _pdfDoc(NULL)
    , _outputDev(NULL)
 {
@@ -505,6 +411,7 @@ PdfEnginePoppler::PdfEnginePoppler() : 
 
 PdfEnginePoppler::~PdfEnginePoppler()
 {
+    free(_fileName);
     delete _outputDev;
     delete _pdfDoc;
 }
@@ -547,7 +454,7 @@ SplashOutputDev * PdfEnginePoppler::outp
     return _outputDev;
 }
 
-RenderedBitmap *PdfEnginePoppler::renderBitmap(
+SplashBitmap *PdfEnginePoppler::renderBitmap(
                            int pageNo, double zoomReal, int rotation,
                            BOOL (*abortCheckCbkA)(void *data),
                            void *abortCheckCbkDataA)
@@ -564,10 +471,7 @@ RenderedBitmap *PdfEnginePoppler::render
         abortCheckCbkA, abortCheckCbkDataA);
 
     SplashBitmap* bmp = _outputDev->takeBitmap();
-    if (bmp)
-        return new RenderedBitmapSplash(bmp);
-
-    return NULL;
+    return bmp;
 }
 
 struct FindFileState {
@@ -1015,7 +919,7 @@ Exit:
 static void RenderPdf(const char *fileName)
 {
     const char *fileNameSplash = NULL;
-    PdfEngine * engineSplash = NULL;
+    PdfEnginePoppler * engineSplash = NULL;
 
     // TODO: fails if file already exists and has read-only attribute
     CopyFile(fileName, POPPLER_TMP_NAME, FALSE);
@@ -1041,7 +945,7 @@ static void RenderPdf(const char *fileNa
         if ((gPageNo != PAGE_NO_NOT_GIVEN) && (gPageNo != curPage))
             continue;
 
-        RenderedBitmap *bmpSplash = NULL;
+        SplashBitmap *bmpSplash = NULL;
 
         MsTimer msTimer;
         bmpSplash = engineSplash->renderBitmap(curPage, 100.0, 0, NULL, NULL);
@@ -1051,7 +955,7 @@ static void RenderPdf(const char *fileNa
             if (!bmpSplash)
                 LogInfo("page splash %d: failed to render\n", curPage);
             else
-                LogInfo("page splash %d (%dx%d): %.2f ms\n", curPage, bmpSplash->dx(), bmpSplash->dy(), timeInMs);
+                LogInfo("page splash %d (%dx%d): %.2f ms\n", curPage, bmpSplash->getWidth(), bmpSplash->getHeight(), timeInMs);
 
         if (ShowPreview()) {
             PreviewBitmapSplash(bmpSplash);
diff-tree fb5bf808b88992c1772a10e4ed9fe788fb618417 (from 60829b08a7440f36014f68ec54bee7a742412738)
Author: Krzysztof Kowalczyk <kkowalczyk at tlapx60ubu.(none)>
Date:   Fri Sep 21 03:03:26 2007 -0700

    more msvc build fixes

diff --git a/makefile.vc b/makefile.vc
index 4bbd0ce..d657cbf 100644
--- a/makefile.vc
+++ b/makefile.vc
@@ -54,7 +54,7 @@ CFLAGS = $(CFLAGS) /Zi
 # /FAscu - generate assembly listings
 CFLAGS = $(CFLAGS) /FAscu
 
-CFLAGS = $(CFLAGS) /Imsvc /I. /Igoo /Ipoppler /Isplash /Ifofi /Itest
+CFLAGS = $(CFLAGS) /Imsvc /Imsvc/poppler /I. /Igoo /Ipoppler /Isplash /Ifofi /Itest
 
 CFLAGS = $(CFLAGS) /I$(ZLIB_DIR) /I$(JPEG_DIR) /I$(FREETYPE_DIR)\include
 
diff --git a/test/perf-test.cc b/test/perf-test.cc
index d122fb7..1f0991a 100644
--- a/test/perf-test.cc
+++ b/test/perf-test.cc
@@ -18,6 +18,10 @@
 #pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'\"")
 #endif
 
+#ifdef WIN32
+#include <windows.h>
+#endif
+
 #include "perf-test-pdf-engine.h"
 
 #include <assert.h>
diff-tree 60829b08a7440f36014f68ec54bee7a742412738 (from 853c22a174bae81139edc9aeded7f26ae2655cef)
Author: Krzysztof Kowalczyk <kkowalczyk at tlapx60ubu.(none)>
Date:   Fri Sep 21 03:02:34 2007 -0700

    msvc build fixes

diff --git a/msvc/poppler/poppler-config.h b/msvc/poppler/poppler-config.h
new file mode 100755
index 0000000..ed51b52
--- /dev/null
+++ b/msvc/poppler/poppler-config.h
@@ -0,0 +1,143 @@
+//================================================= -*- mode: c++ -*- ====
+//
+// poppler-config.h
+//
+// Copyright 1996-2004 Glyph & Cog, LLC
+//
+//========================================================================
+
+#ifndef POPPLER_CONFIG_H
+#define POPPLER_CONFIG_H
+
+// We duplicate some of the config.h #define's here since they are
+// used in some of the header files we install.  The #ifndef/#endif
+// around #undef look odd, but it's to silence warnings about
+// redefining those symbols.
+
+/* Full path for the system-wide xpdfrc file. */
+#ifndef SYSTEM_XPDFRC
+/* #undef SYSTEM_XPDFRC */
+#endif
+
+/* Include support for OPI comments. */
+#ifndef OPI_SUPPORT
+#define OPI_SUPPORT 1
+#endif
+
+/* Enable word list support. */
+#ifndef TEXTOUT_WORD_LIST
+#define TEXTOUT_WORD_LIST 1
+#endif
+
+// Also, there's a couple of preprocessor symbols in the header files
+// that are used but never defined: DISABLE_OUTLINE, DEBUG_MEM and
+
+//------------------------------------------------------------------------
+// version
+//------------------------------------------------------------------------
+
+// xpdf version
+#define xpdfVersion         "3.00"
+#define xpdfVersionNum      3.00
+#define xpdfMajorVersion    3
+#define xpdfMinorVersion    0
+#define xpdfMajorVersionStr "3"
+#define xpdfMinorVersionStr "0"
+
+// supported PDF version
+#define supportedPDFVersionStr "1.5"
+#define supportedPDFVersionNum 1.5
+
+// copyright notice
+#define xpdfCopyright "Copyright 1996-2004 Glyph & Cog, LLC"
+
+// Windows resource file stuff
+#define winxpdfVersion "WinXpdf 3.00"
+#define xpdfCopyrightAmp "Copyright 1996-2004 Glyph && Cog, LLC"
+
+//------------------------------------------------------------------------
+// paper size
+//------------------------------------------------------------------------
+
+// default paper size (in points) for PostScript output
+#ifdef A4_PAPER
+#define defPaperWidth  595    // ISO A4 (210x297 mm)
+#define defPaperHeight 842
+#else
+#define defPaperWidth  612    // American letter (8.5x11")
+#define defPaperHeight 792
+#endif
+
+//------------------------------------------------------------------------
+// config file (xpdfrc) path
+//------------------------------------------------------------------------
+
+// user config file name, relative to the user's home directory
+#if defined(VMS) || (defined(WIN32) && !defined(__CYGWIN32__))
+#define xpdfUserConfigFile "xpdfrc"
+#else
+#define xpdfUserConfigFile ".xpdfrc"
+#endif
+
+// system config file name (set via the configure script)
+#ifdef SYSTEM_XPDFRC
+#define xpdfSysConfigFile SYSTEM_XPDFRC
+#else
+// under Windows, we get the directory with the executable and then
+// append this file name
+#define xpdfSysConfigFile "xpdfrc"
+#endif
+
+//------------------------------------------------------------------------
+// X-related constants
+//------------------------------------------------------------------------
+
+// default maximum size of color cube to allocate
+#define defaultRGBCube 5
+
+// number of fonts (combined t1lib, FreeType, X server) to cache
+#define xOutFontCacheSize 64
+
+// number of Type 3 fonts to cache
+#define xOutT3FontCacheSize 8
+
+//------------------------------------------------------------------------
+// popen
+//------------------------------------------------------------------------
+
+#if defined(_MSC_VER) || defined(__BORLANDC__)
+#define popen _popen
+#define pclose _pclose
+#endif
+
+#if defined(VMS) || defined(VMCMS) || defined(DOS) || defined(OS2) || defined(__EMX__) || defined(WIN32) || defined(__DJGPP__) || defined(MACOS)
+#define POPEN_READ_MODE "rb"
+#else
+#define POPEN_READ_MODE "r"
+#endif
+
+//------------------------------------------------------------------------
+// Win32 stuff
+//------------------------------------------------------------------------
+
+#if defined(_MSC_VER) || defined(__BORLANDC__)
+#ifndef CDECL
+#define CDECL __cdecl
+#endif
+#else
+#define CDECL
+#endif
+
+//------------------------------------------------------------------------
+// Compiler
+//------------------------------------------------------------------------
+
+#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4)
+#define GCC_PRINTF_FORMAT(fmt_index, va_index) \
+	__attribute__((__format__(__printf__, fmt_index, va_index)))
+#else
+#define GCC_PRINTF_FORMAT(fmt_index, va_index)
+#endif
+
+
+#endif /* POPPLER_CONFIG_H */


More information about the poppler mailing list