diff options
author | Robin Watts <robin.watts@artifex.com> | 2012-01-04 18:33:33 +0000 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2012-01-04 19:13:41 +0000 |
commit | 2ae2a7b68381f0fc5940e983ccdec5b4cc08d188 (patch) | |
tree | a0ff2e359868cf6d4bcc6de7fabc06d9ade9774a /android | |
parent | 94439d77f23763d59457b9946ba35bd354ea4841 (diff) | |
download | mupdf-2ae2a7b68381f0fc5940e983ccdec5b4cc08d188.tar.xz |
Bug 692739: Add ability to abort time consuming actions
A new 'cookie' parameter is added to page rendering/interpretation
functions. Supply this as NULL to get existing behaviour.
If you supply a non-NULL cookie, then this is taken as a pointer to
a struct that can be used for simple, non-thread locked communication
between caller and library.
The entire struct should be memset to zero before entry, except for
specific flags (thus coping with future extensions to this struct).
The abort flag should be zero on entry. It will be checked periodically
by the library - if the caller sets it non-zero (via another thread)
then the current operation will be aborted. No guarantees are given as
to how often this will be checked, or how fast it will be responded to.
The progress_max field will be set to an integer (-1 for unknown)
representing the number of 'things' to do. The progress field will
count up from 0 to this number as time goes by. No guarantees are
made as to the accuracy of this information, but it should be
useful for offering some sort of progress bar etc. Note that
progress_max may increase during the job.
In general, callers should be careful to accept out of range or
invalid data in this structure as this is deliberately
accessed 'unlocked'.
Diffstat (limited to 'android')
-rw-r--r-- | android/jni/mupdf.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/android/jni/mupdf.c b/android/jni/mupdf.c index c7f06252..48ffbe87 100644 --- a/android/jni/mupdf.c +++ b/android/jni/mupdf.c @@ -139,7 +139,7 @@ Java_com_artifex_mupdf_MuPDFCore_gotoPageInternal(JNIEnv *env, jobject thiz, int /* Render to list */ currentPageList = fz_new_display_list(ctx); dev = fz_new_list_device(ctx, currentPageList); - pdf_run_page(xref, currentPage, dev, fz_identity); + pdf_run_page(xref, currentPage, dev, fz_identity, NULL); } fz_catch(ctx) { @@ -240,7 +240,7 @@ Java_com_artifex_mupdf_MuPDFCore_drawPage(JNIEnv *env, jobject thiz, jobject bit time = clock(); for (i=0; i<100;i++) { #endif - fz_execute_display_list(currentPageList, dev, ctm, bbox); + fz_execute_display_list(currentPageList, dev, ctm, bbox, NULL); #ifdef TIME_DISPLAY_LIST } time = clock() - time; |