[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    branches/work/kviewshell-0.7/kviewshell/shell
From:       Wilfried Huss <Wilfried.Huss () gmx ! at>
Date:       2006-01-02 19:19:09
Message-ID: 1136229549.640773.17760.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 493631 by whuss:

Fix regression in single threaded mode.

 M  +24 -0     documentPageCache.cpp  
 M  +10 -8     documentWidget.cpp  


--- branches/work/kviewshell-0.7/kviewshell/shell/documentPageCache.cpp \
#493630:493631 @@ -242,6 +242,29 @@
     {
       if (async && renderer->isMultiThreaded())
       {
+        // Prerender previous page
+        if ((pageNr - 1 > 0) && (!isPageCached(pageNr - 1)))
+        {
+          RenderedDocumentPagePixmap* previousPage = createDocumentPagePixmap();
+          if (previousPage)
+          {
+            previousPage->setPageNumber(pageNr - 1);
+            QueuedDocumentPage* queuedPage = new QueuedDocumentPage(previousPage, \
resolutionInDPI, false); +            renderQueue->addRenderJob(queuedPage);
+          }
+        }
+        // Prerender previous page
+        if ((pageNr + 1 <= renderer->totalPages()) && (!isPageCached(pageNr + 1)))
+        {
+          RenderedDocumentPagePixmap* nextPage = createDocumentPagePixmap();
+          if (nextPage)
+          {
+            nextPage->setPageNumber(pageNr + 1);
+            QueuedDocumentPage* queuedPage = new QueuedDocumentPage(nextPage, \
resolutionInDPI, false); +            renderQueue->addRenderJob(queuedPage);
+          }
+        }
+
         // Add to render queue
         QueuedDocumentPage* queuedPage = new QueuedDocumentPage(page, \
resolutionInDPI, false);  renderQueue->addRenderJob(queuedPage);
@@ -251,6 +274,7 @@
           kdDebug(kvs::shell) << "start rendering thread" << endl;
           renderThread->start();
         }
+        return 0;
       }
       else
       {
--- branches/work/kviewshell-0.7/kviewshell/shell/documentWidget.cpp #493630:493631
@@ -912,15 +912,17 @@
   RenderedDocumentPagePixmap* page = documentCache->getPage(pageNumber);
   pixmapRequested = false;
 
-  /* FIXME: this is needed for single threaded mode, but breaks multithreaded mode.
-  update();
+  // If we have page != 0 at this point we are in single threaded mode.
+  if (page)
+  {
+    update();
 
-  // If more widgets need updateing at the some time, the next line allows them to \
                be
-  // displayed one after another. Widthout it all widgets are updated after all the \
                rendering
-  // is completed. This is especially noticable in overview mode. After the change \
                to a seperate
-  // rendering thread this will probably not be needed anymore.
-  qApp->processEvents();
-  */
+    // If more widgets need updateing at the some time, the next line allows them to \
be +    // displayed one after another. Widthout it all widgets are updated after all \
the rendering +    // is completed. This is especially noticable in overview mode. \
After the change to a seperate +    // rendering thread this will probably not be \
needed anymore. +    qApp->processEvents();
+  }
 }
 
 QSize DocumentWidget::pageSize() const


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic