"CGLayer is no longer recommended"; Is this a general consensus?

I wrote an iOS application in which I successfully use CGLayer. Studying ways to squeeze out a little more performance from this application, I came across this blog post: http://iosptl.com/posts/cglayer-no-longer-recommended/ , in which the author very widely states that he CGLayerwill never be used. Separate mail alone is not a concern, but I also found that people link to this post as something that needs to be followed.

No real features are offered. For example, the author claims that "sometimes it's faster, sometimes slower." This makes me wonder if the problem is that overall programmers will not use this object correctly.

I suppose this question is for experienced Cocoa / Cocoa Touch developers. Is there any merit in this? Is there CGLayersomething that can be avoided, and if so, are there specific, measurable reasons why?

+3
source share
3 answers

To start with my answer, I would like to conclude that this is your own design decision about whether you use it CGLayerin your application or not.

, - , , , iOS. iOS CALayer. CALayer (CG), , , CGLayer. CALayer , . CGLayer.

, , CALayer , shouldRasterize YES . , - , GPU. .

CGLayer CG, , , PDF.

, Apple CGLayer. , , . , , , CGLayer, , .

+1

. "", , CGLayer .

CGLayer . CGLayer ( ). ( ). , CGLayer .

+1

, :

Core Graphics, [CGLayer], iPhone. , , . , . , , CGLayer, . CGLayer . , CG.

, Apple Quartz 2D Programming Guide ( 2014) :

Note. Graphics graphics contexts are sometimes used for display. Before you decide to use the graphics context for this purpose, see Drawing the main graphics layer. CGLayer objects (CGLayerRef) are optimized for off-screen drawing because, whenever possible, Quartz caches layers on the graphics card.

+1
source

All Articles