Re: create_surface_for_cg_context behavior in Cairo 1.9 vs. 1.12

cu <[email protected]>
Newsgroups gmane.comp.lib.cairo
Message-ID <[email protected]>
Andrea,

Please take a careful look at sample code.  Source surface is an *image
surface* created previously (not shown in the sample) with
cairo_surface_create. CGContext surface is the *destination*. 
Note that source pattern "qpat" is created from "source_surf".
Note that destination context "qcr" is created from "qsurf" which is the
CGContext surface.


Andrea Canciani wrote:
> On Sat, Jun 2, 2012 at 2:01 PM, cu <[email protected]> wrote:
>   
>> The test case is quite simple:
>>
>> // .. set up source_surf as an image surface of the same size as the
>> UIView, draw into it...
>>
>> CGContextRef cgref = UIGraphicsGetCurrentContext();
>> qsurf = cairo_quartz_surface_create_for_cg_context(cgref,
>> source_surf_width, source_surf_height);
>> qpat = cairo_pattern_create_for_surface(source_surf);
>> qcr = cairo_create(qsurf);
>> cairo_set_source(qcr, qpat);
>> cairo_paint(qcr);
>>     

> It looks like you're using a surface created with
> cairo_quartz_surface_create_for_cg_context() as source.
> That is quite a bad idea (see the "bad things" I warned you about).
>
> Would it be possible to draw on a surface created with
> cairo_quartz_surface_create(), instead?
> (I guess it might involve performing an additional blit)
>   

--
cairo mailing list
[email protected]
http://lists.cairographics.org/mailman/listinfo/cairo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.