Canvas2D: Multiple readback operations using getImageData are faster with the willReadFrequently ...

还是大剑师兰特
优质创作者: 数据科学与机器学习技术领域
2023-06-03 10:41:39

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:

  1. Let settings be the result of converting options to the dictionary type CanvasRenderingContext2DSettings. (This can throw an exception.).

  2. Let context be a new CanvasRenderingContext2D object.

  3. Initialize context's canvas attribute to point to target.

  4. Set context's output bitmap to the same bitmap as target's bitmap (so that they are shared).

  5. Set bitmap dimensions to the numeric values of target's width and height content attributes.

  6. Set context's alpha to settings["alpha"].

  7. Set context's desynchronized to settings["desynchronized"].

  8. Set context's color space to settings["colorSpace"].

  9. Set context's will read frequently to settings["willReadFrequently"].

  10. Return context.

...全文
14031 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

82

社区成员

发帖
与我相关
我的任务
社区描述
本社区主要讨论GIS前端开发的相关问题,恭迎小伙伴们加入本社区.
javascripthtml5css3 技术论坛(原bbs)
社区管理员
  • 还是大剑师兰特
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧