summaryrefslogtreecommitdiff
path: root/pdf
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2013-03-19 20:19:06 +0000
committerRobin Watts <robin.watts@artifex.com>2013-03-20 11:29:00 +0000
commit6f1a3ce9dd2821042b146fb928c215b2d0549a3e (patch)
treeb7bba8fcc16e4dffa7c4184e8373f8491802c75c /pdf
parent9e937ba0965bcf11948a9b3ea5eb6d700df65bc9 (diff)
downloadmupdf-6f1a3ce9dd2821042b146fb928c215b2d0549a3e.tar.xz
Add caching of rendered tiles.
This requires a slight change to the device interface. Callers that use fz_begin_tile will see no change (and no caching will be done). We add a new fz_begin_tile_id function that takes an extra 'id' parameter, and returns 0 or 1. If the id is 0 then the function behaves exactly as fz_being_tile does, and always returns 0. The PDF and XPS code continues to call the old (uncached) version. The display list code however generates a unique id for every BEGIN_TILE node, and passes this in. If the id is non zero, then it is taken to be a unique identifier for this tile; the implementer of the fz_begin_tile_id entry point can choose to use this to implement caching. If it chooses to ignore the id (and do no caching), it returns 0. If the device implements caching, then it can check on entry for a previously rendered tile with the appropriate matrix and a matching id. If it finds one, then it returns 1. It is the callers responsibility to then skip over all the device calls that would usually happen to render the tiles (i.e. to skip forward to the matching 'END_TILE' operation).
Diffstat (limited to 'pdf')
-rw-r--r--pdf/pdf_device.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/pdf/pdf_device.c b/pdf/pdf_device.c
index 48963fcd..277a0618 100644
--- a/pdf/pdf_device.c
+++ b/pdf/pdf_device.c
@@ -1130,13 +1130,14 @@ pdf_dev_end_group(fz_device *dev)
pdf_drop_obj(form_ref);
}
-static void
-pdf_dev_begin_tile(fz_device *dev, const fz_rect *area, const fz_rect *view, float xstep, float ystep, const fz_matrix *ctm)
+static int
+pdf_dev_begin_tile(fz_device *dev, const fz_rect *area, const fz_rect *view, float xstep, float ystep, const fz_matrix *ctm, int id)
{
pdf_device *pdev = (pdf_device *)dev->user;
/* FIXME */
pdf_dev_end_text(pdev);
+ return 0;
}
static void