Bug 42421 - It looks like Clipping of cairo doesn't work correctly.
Summary: It looks like Clipping of cairo doesn't work correctly.
Status: RESOLVED FIXED
Alias: None
Product: cairo
Classification: Unclassified
Component: image backend (show other bugs)
Version: 1.10.3
Hardware: x86 (IA32) Linux (All)
: highest critical
Assignee: Carl Worth
QA Contact: cairo-bugs mailing list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-31 04:52 UTC by Seongwon Cho
Modified: 2012-02-09 14:13 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
test code and result files (1.17 KB, application/x-gzip)
2011-10-31 04:52 UTC, Seongwon Cho
Details

Description Seongwon Cho 2011-10-31 04:52:02 UTC
Created attachment 52943 [details]
test code and result files

Hi,

I make test app which it contains 4 clips and 1 path and call cairo_fill() on cairo 1.11.3 (upstream latest)
Each clips may have different AA option and path has CAIRO_ANTIALIAS_DEFAULT.
In this scenario clipping doesn't work correctly.
If I change the AA of path to CAIRO_ANTIALIAS_NONE clipping works well.

As I analysis of cairo clip_and_composite_boxes() in cairo-spans-compositor.c has problem. 
Even I set clip on application, composite_needs_clip() in composite_boxes() returns FALSE and call scan converter without clip information.

I attached test code with png files.

Thanks.
Comment 1 Chris Wilson 2012-02-09 14:13:54 UTC
commit fb3a193959bbfa71308338182f208e3221ddfa04
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Thu Feb 9 22:06:18 2012 +0000

    clip: Check whether an extents only clip contains the box
    
    If we steal the boxes, we leave behind an extents-only clip, i.e. only
    without a path or boxes, in which case do not return FALSE for the
    is-contained check on a rectangle.
    
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

commit 3023ff86d58f97f3b2d3304c337920647bc8a147
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Thu Feb 9 22:08:08 2012 +0000

    clip: Apply the partial boxes for clip_combine_with_surface
    
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

commit 3443ad903d2ccff7d63a9116df7629d69d87d673
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Thu Feb 9 22:08:41 2012 +0000

    spans: Pass unbounded operations to the spans compositors
    
    Only bail if we need to combine clipping with the spans (either for a
    bounded or unbounded operation).
    
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

commit bb86e332da9a7837b6fd6476efd9be77572dd706
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Thu Feb 9 22:11:24 2012 +0000

    traps: composite_boxes() is not a mask constructor
    
    Since it doesn't combine the clip in a single pass, don't claim to.
    
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>


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.