diff options
author | Michael Vrhel <michael.vrhel@artifex.com> | 2014-06-10 10:37:02 -0700 |
---|---|---|
committer | Michael Vrhel <michael.vrhel@artifex.com> | 2014-09-09 16:39:38 -0700 |
commit | 349019669bdfd851b12ba554022eaf43aea554b9 (patch) | |
tree | 8a148a386131b12b71877ee337d6c25b4c870b46 /platform/winrt/gsview/MainWindow.xaml.cs | |
parent | 9dc83b9caf2c0e3e1ffb3bb3b521179ee3d1b811 (diff) | |
download | mupdf-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/gsview/MainWindow.xaml.cs')
-rw-r--r-- | platform/winrt/gsview/MainWindow.xaml.cs | 7 |
1 files changed, 5 insertions, 2 deletions
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 |