Chrome DevTools Timeline Update Layer Tree Event

↘锁芯ラ 提交于 2019-11-27 17:59:40
Alexander J. Ray

First you have to understand what a Render Layer is. The Render Layer is the browsers representation of how to render that node and how it relates to other nodes with the same coordinate space to deal with things like overlapping content, painting etc. The Update Layer Tree could be happening from a number of different things. For example if you use javascript to set a style on an element the Layer Tree will need to be computed and updated. Or maybe it has to sync the Layer Tree between the compositors thread ( where textures get loaded to the GPU ) and the main thread ( where the javascript runs ).

In your case, I would guess that you are triggering a fundamental layer invalidation that is forcing it to update a layer high up on the tree hierarchy which is then trickling down the tree and causing each of those layers to be updated. Although its hard to say without looking at your code.

Either way if this long Update Layer Tree is consistently happening before the Layout is being recalculated, it's most certainly related to that.

Here are some resources to get you started.

Read This HTML5 Rocks article about the browsers Layers. Accelerated Rendering in Chrome

or this other HTML5 Rocks article about compositing. High Performance Animations

And if you want a deep understanding of how chrome renders a page and utilizes the GPU in that process. There is a great article on the Chromium blog about it. GPU Accelerated Compositing in Chrome

Good luck.

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