summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorKrzysztof Kowalczyk <kkowalczyk@tlapx60ubu.(none)>2007-09-21 07:41:14 -0700
committerKrzysztof Kowalczyk <kkowalczyk@tlapx60ubu.(none)>2007-09-21 07:41:14 -0700
commit634718936f2a95fac2a9d12fcea483b3d0ca8fa6 (patch)
treea54e5256df30e7c40130cf9a3add74d25523b2ed /test
parent617550199762fab42ca2e202e641e047b3efbac0 (diff)
simplify perf-test
Diffstat (limited to 'test')
-rwxr-xr-xtest/perf-test-pdf-engine.h78
-rwxr-xr-xtest/perf-test-preview-win.cc5
-rwxr-xr-xtest/perf-test.cc75
3 files changed, 75 insertions, 83 deletions
diff --git a/test/perf-test-pdf-engine.h b/test/perf-test-pdf-engine.h
deleted file mode 100755
index 7c454aa6..00000000
--- 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 5f3f09b0..173a7a55 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 46a6d6b9..fc309bb4 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;