Bug 20095

Summary: The cairo_set_tolerance() function behavior is inconsistency with the spec
Product: cairo Reporter: Truc Truong <tructv>
Component: generalAssignee: Carl Worth <cworth>
Status: RESOLVED FIXED QA Contact: cairo-bugs mailing list <cairo-bugs>
Severity: normal    
Priority: medium    
Version: 1.8.6   
Hardware: All   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: The C test program to demonstrate this issue

Description Truc Truong 2009-02-12 23:57:55 UTC
Created attachment 22887 [details]
The C test program to demonstrate this issue

In developing the test for the cairo function cairo_set_tolerance(), we have encountered the following inconsistency with the spec:

- On cairo-1.6.4 or earlier, if we use cairo_set_tolerance() to set tolerance to a value  < 0.0002 and then call cairo_get_tolerance() to retrieve the value of tolerance, the value returned is always equal to 0.0002.

- Additionally, on the latest cairo-1.8.6, if we set a value < 0.003906, then the retrieved value is always equal to 0.003906.

The standard (spec) did not mention anything about this special value 0.0002 or 0.003906.

Is this a deficiency of the documentation or an implementation feature?

Included with this report is the C test program to demonstrate this issue.

Please, give us your ruling/decision.

Thank you very much for your time.
Comment 1 Chris Wilson 2009-02-13 02:12:20 UTC
Thank you for the report. I've pushed

commit de7270cb1e9510cb230e80045c812fa68fcfa585
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Fri Feb 13 10:03:22 2009 +0000

    [cairo] Describe the restrictions upon cairo_set_tolerance()
    
which adds this sentence to the documentation:
    The accuracy of paths within Cairo is limited by the precision of its
    internal arithmetic, and the prescribed @tolerance is restricted to the
    smallest representable internal value.

Is this sufficient detail for you with us exposing the implementation details?
Comment 2 Truc Truong 2009-02-15 19:42:23 UTC
Thank you for your prompt response. It is reasonable to me.

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.