<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>234606</bug_id>
          
          <creation_ts>2021-12-22 09:40:34 -0800</creation_ts>
          <short_desc>[Cairo] Add support for premultiplied alpha interpolated color stop gradients in the Cairo backend</short_desc>
          <delta_ts>2021-12-29 09:41:16 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebKit API</component>
          <version>Other</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Sam Weinig">sam</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>aperez</cc>
    
    <cc>fujii</cc>
    
    <cc>rbuis</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>zimmermann</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1826313</commentid>
    <comment_count>0</comment_count>
    <who name="Sam Weinig">sam</who>
    <bug_when>2021-12-22 09:40:34 -0800</bug_when>
    <thetext>With https://bugs.webkit.org/show_bug.cgi?id=234492, we added support for choosing between premultiplied alpha and unpremultiplied alpha color stop interpolation for Gradient, but only for the CoreGraphics backend.

To support CSS gradients, the Cairo needs to add support for both modes as well (the unpremultiplied case is still needed for SVG and Canvas).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1826388</commentid>
    <comment_count>1</comment_count>
    <who name="Adrian Perez">aperez</who>
    <bug_when>2021-12-22 13:47:35 -0800</bug_when>
    <thetext>AFAIU, with Cairo we set the colors for the stops un-premultiplied (because
there is no other option, that&apos;s what the public API allows), then Cairo
pre-multiplies color values while building its internal state, then internally
always does calculations using premultiplied values, meaning that when painting 
a gradient it will interpolate stop colors which are premultiplied — there
is no way of telling Cairo to calculate interpolaton of gradient stops
un-premultiplied. Meaning: with Cairo the way it paints gradiants the output
is correct for CSS, but not SVG/Canvas.

(Take this with some big grains of salt, I am not a graphics expert, what
I *think* know is from looking sometimes inside Cairo in the last months.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1826618</commentid>
    <comment_count>2</comment_count>
    <who name="Fujii Hironori">fujii</who>
    <bug_when>2021-12-23 13:18:02 -0800</bug_when>
    <thetext>(In reply to Adrian Perez from comment #1)
&gt; Meaning: with Cairo the way it paints gradiants the output
&gt; is correct for CSS, but not SVG/Canvas.

Is this right?
fast/gradients/alpha-premultiplied.html is failing for Cairo ports.
This is not a test case for SVG or Canvas.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1827183</commentid>
    <comment_count>3</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2021-12-29 09:41:16 -0800</bug_when>
    <thetext>&lt;rdar://problem/86985929&gt;</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>