summaryrefslogtreecommitdiff
path: root/android/jni/mupdf.c
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2011-11-14 18:22:13 +0000
committerRobin Watts <robin.watts@artifex.com>2011-11-15 15:20:54 +0000
commit9c0a49060475b2dea1e4c2668bebd1d566113a7b (patch)
tree49e45a691cf105f4266d5c6b7242a4a3256c1200 /android/jni/mupdf.c
parent60c0544742931da63db623ad7a79ba3758704cc1 (diff)
parentfd6def85f22b598d4c278e76138ab7dccbb84c36 (diff)
downloadmupdf-9c0a49060475b2dea1e4c2668bebd1d566113a7b.tar.xz
Merge branch 'master' into context
Mostly redoing the xps_context to xps_document change and adding contexts to newly written code. Conflicts: apps/pdfapp.c apps/pdfapp.h apps/x11_main.c apps/xpsdraw.c draw/draw_device.c draw/draw_scale.c fitz/base_object.c fitz/fitz.h pdf/mupdf.h pdf/pdf_interpret.c pdf/pdf_outline.c pdf/pdf_page.c xps/muxps.h xps/xps_doc.c xps/xps_xml.c
Diffstat (limited to 'android/jni/mupdf.c')
-rw-r--r--android/jni/mupdf.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/android/jni/mupdf.c b/android/jni/mupdf.c
index 463899af..a3d45d8d 100644
--- a/android/jni/mupdf.c
+++ b/android/jni/mupdf.c
@@ -17,6 +17,9 @@
/* Set to 1 to enable debug log traces. */
#define DEBUG 0
+/* Enable to log rendering times (render each frame 100 times and time) */
+#undef TIME_DISPLAY_LIST
+
/* Globals */
fz_colorspace *colorspace;
fz_glyph_cache *glyphcache;
@@ -190,7 +193,22 @@ Java_com_artifex_mupdf_MuPDFCore_drawPage(JNIEnv *env, jobject thiz, jobject bit
ctm = fz_concat(ctm, fz_scale(xscale, yscale));
bbox = fz_round_rect(fz_transform_rect(ctm,currentMediabox));
dev = fz_new_draw_device(glyphcache, pix);
+#ifdef TIME_DISPLAY_LIST
+ {
+ clock_t time;
+ int i;
+
+ LOGE("Executing display list");
+ time = clock();
+ for (i=0; i<100;i++) {
+#endif
fz_execute_display_list(currentPageList, dev, ctm, bbox);
+#ifdef TIME_DISPLAY_LIST
+ }
+ time = clock() - time;
+ LOGE("100 renders in %d (%d per sec)", time, CLOCKS_PER_SEC);
+ }
+#endif
fz_free_device(dev);
fz_drop_pixmap(pix);
LOGE("Rendered");