82
社区成员
发帖
与我相关
我的任务
分享Canvas2D: Multiple readback operations using getImageData are faster with the willReadFrequently attribute set to true.
The 2D context creation algorithm, which is passed a target (a canvas element) and options, consists of running these steps:
Let settings be the result of converting options to the dictionary type CanvasRenderingContext2DSettings. (This can throw an exception.).
Let context be a new CanvasRenderingContext2D object.
Initialize context's canvas attribute to point to target.
Set context's output bitmap to the same bitmap as target's bitmap (so that they are shared).
Set bitmap dimensions to the numeric values of target's width and height content attributes.
Set context's alpha to settings["alpha"].
Set context's desynchronized to settings["desynchronized"].
Set context's color space to settings["colorSpace"].
Set context's will read frequently to settings["willReadFrequently"].
Return context.