ios - CALayer's shouldRasterize vs UIView's drawRect? -


even though 2 apis @ different levels of stack, both calayer's shouldrasterize , uiview's drawrect: achieve same goal - render bitmap , cache future reuse. in both cases, cached versions invalidated if view/layer needs redrawn. difference perceive how bitmap drawn. drawrect: done using cpu, , calayer's shouldrasterize done whatever core animation chooses use, gpu.

can people comment on additional difference between 2 apis?

shouldrasterize caches drawn layer and of sublayers single bitmap context. drawrect provides bitmap content individual layer.

note setting shouldrasterize on layer not affect how layer drawn; affects happens after pixels drawn. can use these options independently or together; provide different functionality.


Comments

Popular posts from this blog

How to mention the localhost in android -

php - Calling a template part from a post -

c# - String.format() DateTime With Arabic culture -