【发布时间】:2012-06-04 13:31:56
【问题描述】:
许多博客都表达了通过使用transform: translateZ(0) 来加速动画和过渡,“欺骗”GPU 认为元素是 3D 的性能提升。我想知道以下列方式使用此转换是否有影响:
* {
-webkit-transform: translateZ(0);
-moz-transform: translateZ(0);
-ms-transform: translateZ(0);
-o-transform: translateZ(0);
transform: translateZ(0);
}
【问题讨论】:
-
你能链接到那些博客文章吗?
-
@PineappleUndertheSea 这个:blog.teamtreehouse.com/… 发给我这里。
-
顺便说一句,
-o-transform: translateZ(0)从来都不是一件事。 caniuse.com/#search=translate3d -
@Ahmed Nuaman 是的,这不仅仅是一个把戏。但它在某些应用程序中正式使用。但是,如果您最终使用没有 GPU 的设备(低端)......我不确定它的性能如何。但是,如果处理器可以做什么(2D 图形)被委派给 GPU,只是因为有 3D 命令,尽管它没有最终影响。而且 3D 在其内部使用多个内核并且执行速度更快。这就是这里的意义所在。需要更多调查...
标签: performance css translate-animation