[cairo] 1.4.14 issues on OSX

Travis Griggs tgriggs at cincom.com
Fri Mar 14 14:06:24 PDT 2008


I put together a little snippet to try and make "gentle random  
backgrounds". All I do is draw a randomized set of overlapping  
gradients.

I've noticed two things that I'm having issues with. I'm curious if  
these are surprising to others?

If I set the scale to anything other 1.0 of my cr, I get a "bad  
status". I've come to know that "bad status: out of memory" error  
probably means no such thing, but is the grand catch all for who knows  
what osx or win32 error. Also, if I use an extend style of either pad  
or none, all is cool, but if I try to use reflect or repeat, it breaks.

I put the snippet below the sig. It's in Smalltalk, so may or may not  
be decipherable. I use the macports install. If someone was willing to  
meet me on the irc channel and walk me through getting an xcode  
project setup to compile my own, I'd be willing to put my own debug  
statements in the C code to see what's going on.

--
Travis Griggs
Objologist
"I think that we should be men first, and subjects afterward." - Henry  
David Thoreau



window := ApplicationWindow new.
random := Random new.
vb := VisualBlock block:
		[:gc :box |
		gc newCairoContextWhile:
				[:cr |
				" cr scale: 1.1d."
				100 timesRepeat:
						[| source |
						random next < 1.5 ifTrue:
								[source := LinearGradient from: random next @ random next *  
window bounds extent to: random next @ random next * window bounds  
extent.
								source addStopAt: 0
									red: random next
									green: random next
									blue: random next
									alpha: random next squared * 0.5.
								source addStopAt: 1
									red: random next
									green: random next
									blue: random next
									alpha: random next squared * 0.5]
							ifFalse:
								[source := RadialGradient from: random next @ random next *  
window bounds extent
									radius: random next * window bounds extent r
									to: random next @ random next * window bounds extent
									radius: random next * window bounds extent r.
								source addStopAt: 0
									red: random next
									green: random next
									blue: random next
									alpha: random next squared * 0.5.
								source addStopAt: 1
									red: random next
									green: random next
									blue: random next
									alpha: random next squared * 0.5].
						source extend: ExtendStyle repeat.
						cr
							source: source;
							paint]]].
window component: vb.
window openWithExtent: 400 @ 400



More information about the cairo mailing list