[gs-cvs] rev 8842 - trunk/gs/lib

alexcher at ghostscript.com alexcher at ghostscript.com
Tue Jul 15 06:27:31 PDT 2008


Author: alexcher
Date: 2008-07-15 06:27:29 -0700 (Tue, 15 Jul 2008)
New Revision: 8842

Modified:
   trunk/gs/lib/pdf_ops.ps
Log:
Cache the pattern instance in the PDF pattern object to prevent reprated
pattern instantiation and improve performance. Bug 689896, customer 531.

DIFFERENCES:
None


Modified: trunk/gs/lib/pdf_ops.ps
===================================================================
--- trunk/gs/lib/pdf_ops.ps	2008-07-14 22:08:12 UTC (rev 8841)
+++ trunk/gs/lib/pdf_ops.ps	2008-07-15 13:27:29 UTC (rev 8842)
@@ -327,8 +327,17 @@
        } ifelse
      } if
 
-     dup /Matrix knownoget not { matrix } if
-     gsave DefaultQstate setqstate makepattern grestore setcolor
+     % Associate pattern instance with the default qstate for the context. 
+     % A single pattren object can be reused in several contexts.
+     dup DefaultQstate .knownget {
+       exch pop
+     } {
+       dup dup /Matrix knownoget not { { 1 0 0 1 0 0 } } if
+       gsave DefaultQstate setqstate makepattern grestore
+       dup 3 1 roll
+       DefaultQstate exch put
+     } ifelse
+     setcolor
    } bdef
 end def
 /setgcolor	% (null | <color...>) <colorspace> setgcolor -



More information about the gs-cvs mailing list