summaryrefslogtreecommitdiff
path: root/platform/winrt
diff options
context:
space:
mode:
authorMichael Vrhel <michael.vrhel@artifex.com>2014-06-10 10:37:02 -0700
committerMichael Vrhel <michael.vrhel@artifex.com>2014-09-09 16:39:38 -0700
commit349019669bdfd851b12ba554022eaf43aea554b9 (patch)
tree8a148a386131b12b71877ee337d6c25b4c870b46 /platform/winrt
parent9dc83b9caf2c0e3e1ffb3bb3b521179ee3d1b811 (diff)
downloadmupdf-349019669bdfd851b12ba554022eaf43aea554b9.tar.xz
Add check and state to avoid rendering same page on different threads.
The annotation display support that I added had introduced a bug where the same page may initially get rendered on different threads if you did rapid scrolling.
Diffstat (limited to 'platform/winrt')
-rw-r--r--platform/winrt/gsview/DocPage.cs1
-rw-r--r--platform/winrt/gsview/MainWindow.xaml.cs7
2 files changed, 6 insertions, 2 deletions
diff --git a/platform/winrt/gsview/DocPage.cs b/platform/winrt/gsview/DocPage.cs
index 0114c045..267d99e8 100644
--- a/platform/winrt/gsview/DocPage.cs
+++ b/platform/winrt/gsview/DocPage.cs
@@ -13,6 +13,7 @@ namespace gsview
public enum Annotate_t
{
UNKNOWN,
+ COMPUTING,
NO_ANNOTATE,
HAS_ANNOTATE,
ANNOTATE_VISIBLE,
diff --git a/platform/winrt/gsview/MainWindow.xaml.cs b/platform/winrt/gsview/MainWindow.xaml.cs
index 07e0452a..1fc7642b 100644
--- a/platform/winrt/gsview/MainWindow.xaml.cs
+++ b/platform/winrt/gsview/MainWindow.xaml.cs
@@ -856,7 +856,8 @@ namespace gsview
private void SetPageAnnot(int page_num, Annotate_t render_result)
{
- if (m_docPages[page_num].Annotate == Annotate_t.UNKNOWN)
+ if (m_docPages[page_num].Annotate == Annotate_t.UNKNOWN ||
+ m_docPages[page_num].Annotate == Annotate_t.COMPUTING)
{
if (render_result == Annotate_t.NO_ANNOTATE)
m_docPages[page_num].Annotate = Annotate_t.NO_ANNOTATE;
@@ -1439,7 +1440,9 @@ namespace gsview
* another with scroll changes mark this as being
* full resolution */
m_docPages[k].Content = Page_Content_t.FULL_RESOLUTION;
-
+ /* Avoid launching another thread just because we don't
+ * know the annotation condition for this page */
+ m_docPages[k].Annotate = Annotate_t.COMPUTING;
if (ComputePageSize(k, scale_factor, out ras_size) == status_t.S_ISOK)
{
try