[poppler] Branch 'xpdf303merge' - poppler/GfxState.cc

Albert Astals Cid aacid at kemper.freedesktop.org
Tue Aug 30 12:00:19 PDT 2011


 poppler/GfxState.cc |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

New commits:
commit 12e0acd9d393df76e297bb3fde323092c428be21
Author: Albert Astals Cid <aacid at kde.org>
Date:   Tue Aug 30 21:03:05 2011 +0200

    xpdf303: GfxXXXpath different growing strategy

diff --git a/poppler/GfxState.cc b/poppler/GfxState.cc
index 4812996..be73fd8 100644
--- a/poppler/GfxState.cc
+++ b/poppler/GfxState.cc
@@ -5175,7 +5175,7 @@ GfxSubpath::GfxSubpath(GfxSubpath *subpath) {
 
 void GfxSubpath::lineTo(double x1, double y1) {
   if (n >= size) {
-    size += 16;
+    size *= 2;
     x = (double *)greallocn(x, size, sizeof(double));
     y = (double *)greallocn(y, size, sizeof(double));
     curve = (GBool *)greallocn(curve, size, sizeof(GBool));
@@ -5189,7 +5189,7 @@ void GfxSubpath::lineTo(double x1, double y1) {
 void GfxSubpath::curveTo(double x1, double y1, double x2, double y2,
 			 double x3, double y3) {
   if (n+3 > size) {
-    size += 16;
+    size *= 2;
     x = (double *)greallocn(x, size, sizeof(double));
     y = (double *)greallocn(y, size, sizeof(double));
     curve = (GBool *)greallocn(curve, size, sizeof(GBool));
@@ -5261,7 +5261,7 @@ void GfxPath::moveTo(double x, double y) {
 void GfxPath::lineTo(double x, double y) {
   if (justMoved) {
     if (n >= size) {
-      size += 16;
+      size *= 2;
       subpaths = (GfxSubpath **)
 	           greallocn(subpaths, size, sizeof(GfxSubpath *));
     }
@@ -5276,7 +5276,7 @@ void GfxPath::curveTo(double x1, double y1, double x2, double y2,
 	     double x3, double y3) {
   if (justMoved) {
     if (n >= size) {
-      size += 16;
+      size *= 2;
       subpaths = (GfxSubpath **) 
  	         greallocn(subpaths, size, sizeof(GfxSubpath *));
     }
@@ -5292,7 +5292,7 @@ void GfxPath::close() {
   // moveto/closepath/clip, which defines an empty clipping region
   if (justMoved) {
     if (n >= size) {
-      size += 16;
+      size *= 2;
       subpaths = (GfxSubpath **)
 	greallocn(subpaths, size, sizeof(GfxSubpath *));
     }


More information about the poppler mailing list