2D canvas with {alpha: false} does not strictly force alpha to be 255 |
||||
Issue descriptionThe current implementation of the alpha:false context creation parameter forces canvas contents to be composited as if it were fully opaque, but it does not actually force the alpha values of the image buffer to be 255 all the time. Forcing the alpha values to 255 is what is mandated by the spec. Failure to do so has several side-effects. As illustrated by the following test case, the non-255 values are observable via getImageData: https://jsfiddle.net/kpkov098/ Also, setting the context's global compositeOperation to an op that depends on the destinationAlpha will result in artifacts.
,
Aug 22 2017
putImageData() over-writes alpha values.
,
Aug 29 2017
To implement an efficient solution for this, we'd need skia's support. We'd need to be able to set up an SkSurface with an RGB buffer, or an option that disable writing to the alpha channel. For the GPU-accelerated path, this could be as simple as calling glColorMask
,
Jun 29 2018
,
Jul 25
|
||||
►
Sign in to add a comment |
||||
Comment 1 by nathan.f...@oculus.com
, Apr 13 2017