[cairo] postscript?

Charles Doutriaux doutriaux1 at llnl.gov
Fri Aug 1 11:01:13 PDT 2008


Hello,

I'm going to try to simplify my problem as much possible

basically I'm drawing a LOT of little square with about 20 patterns.

I used to generate the pattern each and every time i would draw the 
square, which is much inefficient

A while ago somebody on the list suggested i only create the pattern 
once and then reuse it.

I finally got around doing this, but I still get the EXACt same 
postscript file. I'm not sure what I'm doing worng.

basically i limited calls to :
      pattern = cairo_pattern_create_for_surface (image);
      cairo_pattern_set_extend (pattern, CAIRO_EXTEND_REPEAT);
by saving pattenr
but i'm still calling:
          cairo_set_source(cr,pattern);
a gazillion times

Any idea why the postscript is still exactly the same?

I'm pasting an excerpt of  an example of the postscript output. i'll try 
to generate a small one next.

C.


300.969 515.359 m 302.926 516.23 l 310.438 517.438 l 317.945 520.445 l
325.453 519.125 l 332.965 518.297 l 340.473 515.547 l 341.824 515.359 l
340.473 515.359 l 302.926 515.359 l 302.926 515.359 l 302.926 515.359 l f
/CairoPattern {
  q
  0 0 4 4 rectclip
Q q
0.55 0.06 0.98 rg
0 4 m 0 1 l 3 1 l f
  Q
Q q
47.617 -571.039 533.145 447.602 re W n
} bind def
<< /PatternType 1
   /PaintType 1
   /TilingType 1
   /XStep 4 /YStep 4
   /BBox [0 0 4 4]
   /PaintProc { CairoPattern }
 >>
[ 1 0 0 1 0 788 ]
makepattern setpattern
359.906 515.359 m 363 515.977 l 364.238 515.359 l 363 515.359 l f
/CairoPattern {
  q
  0 0 4 4 rectclip
Q q
0.55 0.06 0.98 rg
0 4 m 0 1 l 3 1 l f
  Q
Q q
47.617 -571.039 533.145 447.602 re W n
} bind def
<< /PatternType 1
   /PaintType 1
   /TilingType 1
   /XStep 4 /YStep 4
   /BBox [0 0 4 4]
   /PaintProc { CairoPattern }
 >>
[ 1 0 0 1 0 788 ]
makepattern setpattern
392.855 515.359 m 393.035 515.902 l 396.055 515.359 l 393.035 515.359 l f
/CairoPattern {
  q
  0 0 4 4 rectclip
Q q
0.55 0.06 0.98 rg
0 4 m 0 1 l 3 1 l f
  Q
Q q
47.617 -571.039 533.145 447.602 re W n
} bind def
<< /PatternType 1
   /PaintType 1
   /TilingType 1
   /XStep 4 /YStep 4
   /BBox [0 0 4 4]
   /PaintProc { CairoPattern }
 >>
[ 1 0 0 1 0 788 ]
makepattern setpattern
494.078 515.359 m 498.039 525.309 l 498.25 525.309 l 498.574 515.359 l
498.164 515.359 l 498.164 515.359 l 498.164 515.359 l f
/CairoPattern {
  q
  0 0 4 4 rectclip
Q q
0.55 0.06 0.98 rg
0 4 m 0 1 l 3 1 l f
  Q
Q q
47.617 -571.039 533.145 447.602 re W n
} bind def
<< /PatternType 1
   /PaintType 1
   /TilingType 1
   /XStep 4 /YStep 4
   /BBox [0 0 4 4]
   /PaintProc { CairoPattern }
 >>
[ 1 0 0 1 0 788 ]
makepattern setpattern
183.172 525.309 m 190.293 526.02 l 190.488 525.309 l 190.293 525.309 l f
/CairoPattern {
  q
  0 0 4 4 rectclip
Q q
0.55 0.06 0.98 rg
0 4 m 0 1 l 3 1 l f
  Q
Q q
47.617 -571.039 533.145 447.602 re W n
} bind def
<< /PatternType 1
   /PaintType 1
   /TilingType 1
   /XStep 4 /YStep 4
   /BBox [0 0 4 4]
   /PaintProc { CairoPattern }
 >>
[ 1 0 0 1 0 788 ]
makepattern setpattern
498.039 525.309 m 498.164 525.789 l 498.25 525.309 l 498.164 525.309 l f
/CairoPattern {
  q
  0 0 4 4 rectclip
Q q
0.24 0.16 0.98 rg
0 2 2 -2 re f
  Q
Q q
47.617 -571.039 533.145 447.602 re W n
} bind def
<< /PatternType 1
   /PaintType 1
   /TilingType 1
   /XStep 4 /YStep 4
   /BBox [0 0 4 4]
   /PaintProc { CairoPattern }
 >>
[ 1 0 0 1 0 788 ]
makepattern setpattern
520.691 356.215 m 523.164 356.215 l 520.691 355.516 l 519.445 356.215 l f
/CairoPattern {
  q
  0 0 4 4 rectclip
Q q
0.24 0.16 0.98 rg
0 2 2 -2 re f
  Q
Q q
47.617 -571.039 533.145 447.602 re W n
} bind def
<< /PatternType 1
   /PaintType 1
   /TilingType 1
   /XStep 4 /YStep 4
   /BBox [0 0 4 4]
   /PaintProc { CairoPattern }
 >>
[ 1 0 0 1 0 788 ]
makepattern setpattern
205.309 366.16 m 205.551 366.16 l 205.309 365.926 l 205.188 366.16 l f
/CairoPattern {
  q
  0 0 4 4 rectclip
Q q
0.24 0.16 0.98 rg
0 2 2 -2 re f
  Q
Q q
47.617 -571.039 533.145 447.602 re W n
} bind def
<< /PatternType 1
--More--(1%)




More information about the cairo mailing list