gpt4 book ai didi

performance - CSS不透明过滤器比不透明属性更快?

转载 作者:行者123 更新时间:2023-12-04 12:32:09 25 4
gpt4 key购买 nike

this html5rocks文章中,它指出

In general the CSS ‘opacity’ property isn’t hardware accelerated, but some browsers that implement filters using hardware acceleration will accelerate the filter version of opacity for much better performance.



这似乎暗示着,在性能密集型应用程序中,应该使用不透明度过滤器而不是不透明度属性。例如,我要在不透明度为0.5的图像下渲染 Canvas 。我应该改用过滤器吗?使用此过滤器属性时,如何衡量性能提升?在哪些平台上会有明显的改善?

最佳答案

首先,CSS3滤镜效果是still a draft standardtheir browser support varies。因此,请三思而后,是否真的需要它们(例如CSS Filters in the Real World article(04.2013)报告渲染工件)。
Hardware acceleration in WebkitGPU Accelerated Compositing in Chrome概述了它们的实现,并且都暗示对CSS2或CSS3没有歧视(如果有的话,我会感到惊讶)。

其次,a review in PC magazine(01.2013)显示了IE和Firefox团队的一些在线基准测试结果。有 Canvas ,粒子和CSS(旋转)基准。在此处测试的Maxthon(使用WebKit)和Opera版本不支持加速,因此它们暗示了性能提升。关于透明性:与重采样相比,计算量要少几个数量级,因此您不会注意到此特定操作的任何区别。

关于performance - CSS不透明过滤器比不透明属性更快?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22051391/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com