Skip to content

Commit

Permalink
Spec that out-of-range premultipliedAlpha:true values have undefined …
Browse files Browse the repository at this point in the history
…compositing results. (#3698)
  • Loading branch information
kdashg authored Oct 10, 2024
1 parent 450cceb commit 596c48f
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions specs/latest/1.0/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -839,12 +839,29 @@ <h4>Context creation parameters</h4>
</dd>
<dt> <span class=prop-value>premultipliedAlpha</span>
<dd>
<p>
If the value is true the page compositor will assume the drawing buffer contains
colors with premultiplied alpha. If the value is false the page compositor will
assume that colors in the drawing buffer are not premultiplied. This flag is ignored
if the <strong>alpha</strong> flag is
false. See <a href="#PREMULTIPLIED_ALPHA">Premultiplied Alpha</a> for more
if the <strong>alpha</strong> flag is false.
</p>
<p>
With <code>premultipliedAlpha:true</code>, any pixels sent to the page
compositor shall have color values less-than-or-equal-to their alpha value,
otherwise the colors resulting from compositing such out-of-range pixel values
are undefined.
<div class="note">
For example, with <code>premultipliedAlpha:true</code>
<code>vec4(1.0, 0.0, 0.0, 0.5)</code> might display as green
instead of red, possibly due to optimized packed compositing math overflows.
This is left undefined due to the intractible performance impact of requiring
consistent behavior.
</div>
</p>
<p>
See <a href="#PREMULTIPLIED_ALPHA">Premultiplied Alpha</a> for more
information on the effects of the <code>premultipliedAlpha</code> flag.
</p>
</dd>
<dt> <span class=prop-value>preserveDrawingBuffer</span>
<dd>
Expand Down

0 comments on commit 596c48f

Please sign in to comment.