Performing fully customizable animations with Core Animation - performance

Article

https://www.objc.io/issues/12-animations/animating-custom-layer-properties/

talks about using fully custom animations with Core Animation:

Suppose that instead of embedding our watch face using separate layers, we wanted to draw a watch using Core Graphics. (In general, this will have poor performance , but it can be assumed that there are complex drawing operations that we could implement that are difficult to replicate using the properties and transformations of a regular layer.) How would we do this?

In other words, we draw each frame of the CA manually using CG, because our animation is too complicated to perform with the built-in CALayer functionality only.

Question about lower performance .

  • Since CG runs on the processor, does this risk not block the main thread?
  • Could this be the reason for using SpriteKit instead of CA (since SpriteKit works on the GPU and will not block the main thread)?
+2
source share
1 answer
  • . . Core Graphics (Quartz CG) .... , , , . 1 .

PDF . Core Graphics , . - , PostScript, , , , , .

  1. SpriteKit CA - , SpriteKit/CA vs CG

, , , .

CA CG , , , . , - -.

CG = Core Graphics

CA = Core Animation

Core Animation - , : . . , , , . UIKit, .

Core Animations, , . . , Core Animation, Core Graphics. , .

Core Animation :

CAShapeLayer . CATextLayer NSAttributedString, .

Core Animation, Flash QuickTime, , API , .

  • CALayers Core Graphics. SpriteKit.

  • Core Animation ( ) , , , Sprite Kit, , SpriteKit.

CALayers - . . , , - , .

, SpriteKit:

  • : SK, CA -.
  • : SK , ,
  • : UIKit , .
  • :
  • Visual Scene: , .
  • Visual Particle: . .
  • SKActions: CA / , / CAKeyFrameAnimation

SpriteKit:

  • UIKit ,
  • , (-)
  • , Q & A
  • Apple, - .
  • , /
  • ,
  • ,
  • , , Xcode
  • NSAttributedString

guff, , :

...

PostScript Mac Desktop Publishing, Mac , . Apple , IBM/Intel/Microsoft , . Apple iPhone, , , . *

, :

, . ( ) / Apple, , Apple, . , "" Apple "", iPod, iPhone iPad.

- iPhone. , : SpriteKit . Apple , , , , Apple. iPhone.

Apple , , . , , , Apple, , . Apple , , . Apple , .

. , .

Apple SpriteKit, , .

, cocos2D-X , Apple SpriteKit , . , , , , SpriteKit, , .

, Apple, "" "". , , , , , Apple , .

, , iOS , , . , , Sprite Kit SceneKit.

+7

Source: https://habr.com/ru/post/1666720/


All Articles