CoreGraphics is Right After All

A while back I wrote about a potential issue with compositing using Quartz. I’m happy to finally conclude that there in fact is no issue. Yes, Quartz does behave differently than Cairo, but I believe Quartz has the more consistent behavior throughout all its modes. I came to this realization after talking to the engineer who does the compositing work in Quartz.

The main difference is that Quartz will only ever touch pixels within the ‘clip’ of an object, whereas it seems that Cairo will touch pixels outside of it. After thinking about it for a bit this makes much more sense, and seems to be a much simpler thing to implement as well, so I’m not sure why Cairo seems to take the tack they do.

So for example, if you fill a circle in Quartz, only the pixels inside the realm of influence (the circular path itself) will have the Porter-Duff blending applied. This is why things look different in Safari and Firefox when using these modes in a canvas object.

I reported in my prior post that I thought that it should affect pixels outside the circle, but this no longer makes sense to me after talking with that engineer. Now, if you were to blit an image of the circle, the area of influence would be the image rect (intersected with any clip, obviously). Then you’d get results more like what you’d expect. So basically, once you know that fact, you can likely still do most of the things you’d want to do using these blend modes.

So in the end it just seems like limiting the blending to the effective clip area is the better method. It’s far simpler to implement, since much like painting the circle in say, source over, you only affect pixels inside the circle. Ever. And that is a constant through all composition modes. This makes it consistent and predictable.

So in the end, it’s right, as far as I’m concerned (and Apple, of course)!



Limbo

I’ve recently left Yahoo! after 3 years there. I already miss hanging out with everyone, but it was clear to me that the best thing for me was to get out and find my own path.

I got to Yahoo! through the acquisition of Konfabulator (now Yahoo! Widgets). It was an interesting experience to say the least. I think I could write a small book on my time there. That might be the topic of a future post here. Suffice it to say, I don’t think it went as well as it could have.

But this post is about my current state of limbo. Not quite anywhere right now. It was definitely a little risky to just leave my job and take some time off. I’ve never had the opportunity do it before, and I have a few irons in the fire regarding what to do next, so I figured I’d give it a go. This way, I can really be free and clear to refocus myself and know what I really feel about what I want to do next.

So far it’s been a pretty good time off. I’ve mostly been working on my own iPhone application. I won’t say what it is yet. It’s nothing super-special, but it’s turning out pretty sweet. I know I will use it every day, maybe you will too. I have no idea if I’d even charge for it or not. If I did, maybe it’d be a buck or two. But that’s not even really in my head right now. I just want to finish it!

I’ve really been enjoying coding for the iPhone. Yes, even though it’s Objective-C :-) The only annoyances for me have been the bugs I keep running into. I’m a good boy though and I write them up for Apple. Heck, I even sent in a test case for one. Fortunately, most of them to date have been duplicates they know about. Hopefully they’ll get squared away soon.

As far as what to do next, I’ll keep meeting with people over the next few weeks and hopefully we can figure this out. While I am enjoying my time to myself, I certainly can’t keep this up indefinitely! Maybe I should be an Indie developer for iPhone/MacOS. Then I can stay home and survive.

Stay tuned.