Bug 2379

Summary: Rounding when calling backend functions
Product: cairo Reporter: Owen Taylor <otaylor>
Component: generalAssignee: Carl Worth <cworth>
Status: RESOLVED FIXED QA Contact: cairo-bugs mailing list <cairo-bugs>
Severity: normal    
Priority: high CC: jwatt
Version: 0.9.3   
Hardware: x86 (IA32)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:

Description Owen Taylor 2005-01-25 11:49:31 UTC
General possible area of bugs in Cairo is double => integer conversion
when calling the backend interfaces, which take integers; e.g., 
_cairo_gstate_show_surface() has:


        status = _cairo_surface_composite (gstate->operator,
                                           surface,
                                           pattern.source,
                                           gstate->surface,
                                           device_x, device_y,
                                           0, 0,
                                           device_x, device_y,
                                           device_width,
                                           device_height);

It needs something like a

 int device_ix = floor (device_x + 0.5);

and similar. (That function also needs checking that the clipped
path gives consistent results... there are fixed point numbers on
that path, so it's not clear on first glance.)

Possible test case:

 - Take primitives, draw them at integer - epsilon integer + epsilon
   test that the result is pixel-the-same.

Hitting every code path is going to be hard, but getting partial
coverage should already help.
Comment 1 Carl Worth 2005-08-22 17:14:33 UTC
Move bugs against "cvs" version to "0.9.3" so we can remove the "cvs" version.
Comment 2 Chris Wilson 2008-10-10 15:12:25 UTC
I no longer think this is a general issue due to the work on carefully managing double->fixed and fixed->double conversions. I've added the suggested review and test case to the TODO.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.