Interview Summary - offscreen rendering

How to detect off-screen rendering?

1, the simulator debug- selected color Offscreen - Layer Renderd bright yellow to off-screen rendering performance issues may be
2, select the real machine Instrument- Core Animation- check Color Offscreen-Rendered Yellow

Off-screen rendering of the trigger

  • Fillet (maskToBounds and triggering only)
  • Layer Mask
  • shadow
  • Rasterization
Why should avoid off-screen rendering?

Off-screen rendering is generated on the GPU, multi-channel trigger openGL rendering pipeline, resulting in additional overhead. May cause can not be completed within a computing cpu + gpu> 16.7ms, cause the screen Caton or dropped frames.
offscreen rendering will open up a new buffer zone will be switched context, increasing the GPU rendering time, it may cause the screen Caton.

Off-screen rendering consumption performance reasons

You need to create a new buffer
the whole process off-screen rendering, requiring multiple switching context, first switch from the current screen (On-Screen) to off-screen (Off-Screen); wait until the end of the off-screen rendering, the off-screen buffer the results of the rendering area to the screen, you need to be away from the screen to switch context to the current screen

Published 207 original articles · won praise 19 · views 90000 +

Guess you like

Origin blog.csdn.net/songzhuo1991/article/details/104883764