summaryrefslogtreecommitdiff
path: root/platform/windows/mupdfwinrt/Cache.h
diff options
context:
space:
mode:
authorMichael Vrhel <michael.vrhel@artifex.com>2014-09-09 16:31:31 -0700
committerMichael Vrhel <michael.vrhel@artifex.com>2014-09-09 16:39:41 -0700
commit7ea99e3a8951e265d1437a77dcfee069de0edf76 (patch)
tree8e113fea67931064e2a9338d67b26aaabab27512 /platform/windows/mupdfwinrt/Cache.h
parent8a9519f2183b64fe220bcb1f6acedbe6acc190cd (diff)
downloadmupdf-7ea99e3a8951e265d1437a77dcfee069de0edf76.tar.xz
Rename of winrt to windows due to presence on gsview in this folder.
The contents of this folder will contain both winrt and gsview projects which are shared in a common visual studio 2013 solution.
Diffstat (limited to 'platform/windows/mupdfwinrt/Cache.h')
-rw-r--r--platform/windows/mupdfwinrt/Cache.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/platform/windows/mupdfwinrt/Cache.h b/platform/windows/mupdfwinrt/Cache.h
new file mode 100644
index 00000000..e8c9801d
--- /dev/null
+++ b/platform/windows/mupdfwinrt/Cache.h
@@ -0,0 +1,38 @@
+#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
+{
+ int number;
+ int width;
+ int height;
+ 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);
+ void GetSize(int *width, int *height);
+ fz_display_list* Use(int value, int *width, int *height, fz_context *mu_ctx);
+ void Add(int value, int width, int height, fz_display_list *dlist, fz_context *mu_ctx);
+ void Empty(fz_context *mu_ctx);
+};