[cairo] how to draw on OSX

Vladimir Vukicevic vladimir at pobox.com
Mon Apr 9 13:11:56 PDT 2007


Travis Griggs wrote:
> I've asked a question kind of like this before, but this time, I've made 
> sure I have a newer version (1.4.2). I'm doing the following sequence 
> (in pseudocode):
> 
> nsGC = [NSGraphicsContext graphicsContextWithWindow: anNSWindow];
> cgRef = [nsGC graphicsPort];
> surface = cairo_quartz_surface_create_for_cg_context(cgRef, 300, 300);
> cr = cairo_create(surface);
> cairo_set_source_rgb(cr, 0.0, 0.0, 1.0);
> cairo_paint(cr);
> 
> Is this the sequence other's use for drawing on quartz windows? Because 
> it doesn't update. If I drag the window, it seems to flush the GC. Do I 
> have to follow every cairo paint() call with some sort of sync to the 
> quartz APIs? Or is there a flag I can set that will make it happen right 
> away?

That's basically what we do -- does this work if you just call 
CGContextFillRect directly, and skip cairo?

    - Vlad


More information about the cairo mailing list