Does WebKit use OpenGL to render CSS transitions?

断了今生、忘了曾经 提交于 2020-01-01 08:54:08

问题


Does WebKit use OpenGL to render CSS transitions, or does it use software rendering?


回答1:


WebKit is just a frontend. It depends on the backend and the hardware support. Google Chrome uses skia as a back-end and it can use software or hardware. So the answer is it depends on the implementation of the back-end and the hardware it is running on.




回答2:


From what I know the only hardware accelerated property using transitions is the translate3d transform.

Eg:

// Normal
div{
    -webkit-transition: all 0.5s ease-out;
}

// Adding class to animate
div.transformed{
    -webkit-transform: translate3d(100px, 100px, 0);
}

If you use just the translate transform or animate any other property it won't be hardware accelerated.



来源:https://stackoverflow.com/questions/6567926/does-webkit-use-opengl-to-render-css-transitions

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!