[poppler] 2 commits - poppler/SplashOutputDev.cc

Albert Astals Cid aacid at kemper.freedesktop.org
Mon Aug 19 15:41:32 PDT 2013


 poppler/SplashOutputDev.cc |   30 +++++++++++++++++++-----------
 1 file changed, 19 insertions(+), 11 deletions(-)

New commits:
commit 3bb8c2e34039cf473bf72ed9dab55664deab3ab7
Merge: 71c1d16 fc78330
Author: Albert Astals Cid <aacid at kde.org>
Date:   Tue Aug 20 00:41:13 2013 +0200

    Merge remote-tracking branch 'origin/poppler-0.24'

commit fc78330072b9771fa39d21896703adb4836e5398
Author: Albert Astals Cid <aacid at kde.org>
Date:   Tue Aug 20 00:37:56 2013 +0200

    use getRGBLine images if available
    
    Speeds up greatly files from bug #66928
    
    E.g. some file went from 21s to 2s in my computer

diff --git a/poppler/SplashOutputDev.cc b/poppler/SplashOutputDev.cc
index 4d4e945..d9ea990 100644
--- a/poppler/SplashOutputDev.cc
+++ b/poppler/SplashOutputDev.cc
@@ -2862,20 +2862,28 @@ GBool SplashOutputDev::imageSrc(void *data, SplashColorPtr colorLine,
       break;
     case splashModeRGB8:
     case splashModeBGR8:
-      for (x = 0, q = colorLine; x < imgData->width; ++x, p += nComps) {
-	imgData->colorMap->getRGB(p, &rgb);
-	*q++ = colToByte(rgb.r);
-	*q++ = colToByte(rgb.g);
-	*q++ = colToByte(rgb.b);
+      if (imgData->colorMap->useRGBLine()) {
+	imgData->colorMap->getRGBLine(p, (Guchar *) colorLine, imgData->width);
+      } else {
+	for (x = 0, q = colorLine; x < imgData->width; ++x, p += nComps) {
+	  imgData->colorMap->getRGB(p, &rgb);
+	  *q++ = colToByte(rgb.r);
+	  *q++ = colToByte(rgb.g);
+	  *q++ = colToByte(rgb.b);
+	}
       }
       break;
     case splashModeXBGR8:
-      for (x = 0, q = colorLine; x < imgData->width; ++x, p += nComps) {
-	imgData->colorMap->getRGB(p, &rgb);
-	*q++ = colToByte(rgb.r);
-	*q++ = colToByte(rgb.g);
-	*q++ = colToByte(rgb.b);
-	*q++ = 255;
+      if (imgData->colorMap->useRGBLine()) {
+	imgData->colorMap->getRGBXLine(p, (Guchar *) colorLine, imgData->width);
+      } else {
+	for (x = 0, q = colorLine; x < imgData->width; ++x, p += nComps) {
+	  imgData->colorMap->getRGB(p, &rgb);
+	  *q++ = colToByte(rgb.r);
+	  *q++ = colToByte(rgb.g);
+	  *q++ = colToByte(rgb.b);
+	  *q++ = 255;
+	}
       }
       break;
 #if SPLASH_CMYK


More information about the poppler mailing list