Bug 55706 - pattern_create_linear with pattern_add_color_stop_rgba with offset 0.5 failed
Summary: pattern_create_linear with pattern_add_color_stop_rgba with offset 0.5 failed
Status: RESOLVED FIXED
Alias: None
Product: cairo
Classification: Unclassified
Component: pdf backend (show other bugs)
Version: 1.10.2
Hardware: Other All
: medium normal
Assignee: Adrian Johnson
QA Contact: cairo-bugs mailing list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-06 22:04 UTC by Volker
Modified: 2012-10-07 11:38 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
pattern bug example (1.33 KB, text/plain)
2012-10-06 22:04 UTC, Volker
Details
working example of pattern (1.41 KB, text/plain)
2012-10-06 22:04 UTC, Volker
Details
working view (38.43 KB, image/png)
2012-10-06 22:06 UTC, Volker
Details
bugged view adobe (88.38 KB, image/png)
2012-10-06 22:07 UTC, Volker
Details
bug view evince (33.91 KB, image/png)
2012-10-06 22:07 UTC, Volker
Details

Description Volker 2012-10-06 22:04:10 UTC
Created attachment 68176 [details]
pattern bug example

There is a bug by creating a line with 

cairo_pattern_create_linear() and cairo_pattern_add_color_stop_rgba().

If the offset of cairo_pattern_add_color_stop_rgba() in the first call is 0.0 and in the other 1.0 it works fine with Adobe Acrobat Reader and Evince document viewer on ubuntu 12.04.

If I set the offset to 0.5 on both function calls in Adobe Acrobat Reader  and in Evince document viewer the line disappears also on Ubuntu 12.04.

I also attached the example as source code and views from document viewers.

This bug has no effect on png outputs.
Comment 1 Volker 2012-10-06 22:04:53 UTC
Created attachment 68177 [details]
working example of pattern
Comment 2 Volker 2012-10-06 22:06:37 UTC
Created attachment 68178 [details]
working view
Comment 3 Volker 2012-10-06 22:07:03 UTC
Created attachment 68179 [details]
bugged view adobe
Comment 4 Volker 2012-10-06 22:07:58 UTC
Created attachment 68180 [details]
bug view evince
Comment 5 Uli Schlachter 2012-10-07 11:38:09 UTC
Can't reproduce with git/master, bug was already fixed.

Git bisect finds (which is commit 1.10.0-231-g3cbe82f aka 1.11.2~98, so anything 1.11.2 or newer should be fine):

commit 3cbe82fe586f64dd11a0b2bc9f58619968965369
Author: Andrea Canciani <ranma42@gmail.com>
Date:   Sun Dec 12 22:29:56 2010 +0000

    ps,pdf: Deal with empty domain gradients.
    
    If all the stops of the gradient have the same offset and the
    pattern's extend mode is EXTEND_PAD, then we cannot use the stops'
    domain as the interpolation parameter range because this would produce
    a gradient with the same start and end objects.  Such ranges tickle
    bad behaviour in rasterisers.
    
    We replace the color function with an appropriate step function
    defined on [0 1].
    
    Fixes radial-gradient-one-stop for pdf and ps3.
    
    Reviewed-by: M Joonas Pihlaja <jpihlaja@cc.helsinki.fi>


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.