Does WebKit use OpenGL to render CSS transitions?

后端 未结 2 1464
梦毁少年i
梦毁少年i 2021-02-20 19:01

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

2条回答
  •  执笔经年
    2021-02-20 19:21

    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.

提交回复
热议问题