Bug 2379 - Rounding when calling backend functions
Summary: Rounding when calling backend functions
Status: RESOLVED FIXED
Alias: None
Product: cairo
Classification: Unclassified
Component: general (show other bugs)
Version: 0.9.3
Hardware: x86 (IA32) Linux (All)
: high normal
Assignee: Carl Worth
QA Contact: cairo-bugs mailing list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-01-25 11:49 UTC by Owen Taylor
Modified: 2008-10-10 15:12 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

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.