summaryrefslogtreecommitdiff
path: root/platform/winrt/mupdfwinrt/Cache.h
diff options
context:
space:
mode:
Diffstat (limited to 'platform/winrt/mupdfwinrt/Cache.h')
-rw-r--r--platform/winrt/mupdfwinrt/Cache.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/platform/winrt/mupdfwinrt/Cache.h b/platform/winrt/mupdfwinrt/Cache.h
new file mode 100644
index 00000000..0763dba4
--- /dev/null
+++ b/platform/winrt/mupdfwinrt/Cache.h
@@ -0,0 +1,34 @@
+#pragma once
+
+#include <mutex>
+extern "C" {
+ #include "mupdf/fitz.h"
+}
+
+#define MAX_DISPLAY_CACHE_SIZE 3
+
+typedef struct cache_entry_s cache_entry_t;
+
+struct cache_entry_s
+{
+ fz_display_list *dlist;
+ cache_entry_t *next;
+ cache_entry_t *prev;
+ int index;
+};
+
+class Cache
+{
+private:
+ int size;
+ cache_entry_t *head;
+ cache_entry_t *tail;
+ std::mutex cache_lock;
+
+public:
+ Cache(void);
+ ~Cache(void);
+ fz_display_list* UseEntry(int value, fz_context *mu_ctx);
+ void AddEntry(int value, fz_display_list *dlist, fz_context *mu_ctx);
+ void Empty(fz_context *mu_ctx);
+};