Summary: |
Do cairo_mask on a rgba source produces wrong result |
Product: |
cairo
|
Reporter: |
david_wu |
Component: |
image backend | Assignee: |
Carl Worth <cworth> |
Status: |
RESOLVED
FIXED
|
QA Contact: |
cairo-bugs mailing list <cairo-bugs> |
Severity: |
normal
|
|
|
Priority: |
medium
|
|
|
Version: |
1.6.0 | |
|
Hardware: |
x86 (IA32) | |
|
OS: |
Linux (All) | |
|
Whiteboard: |
|
i915 platform:
|
|
i915 features:
|
|
Attachments: |
testing sample code
|
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.
Created attachment 18451 [details] testing sample code The following sequence produces wrong masked color: cairo_t* cr = cairo_create(target); cairo_set_source_surface(cr, source, 0, 0); cairo_paint_with_alpha(cr, alpha); cairo_set_source_rgba(cr, 1.0, 1.0, 1.0, alpha); cairo_mask_surface(cr, mask, 0, 0); where target, source, and mask are image surfaces, and alpha is an arbitrary value other than 1.0. For example, when data is as follows: uchar sourceWhite[] = { 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff }; uchar maskA8[] = { 0x00,0xff,0x00,0x00 }; double alpha = 0.5; we will get this result in target surface: 80808080404040C0 while the expected should be: 80808080C0C0C0C0. Please see the attached for a sample code. (compile command was: g++ -Wall -ffast-math -g `pkg-config --cflags --libs cairo` cairo_mask.cpp g++ version: g++ (GCC) 4.2.3 (Ubuntu 4.2.3-2ubuntu7))