Core Animation in Practice, Part 1Graphics & MediaiOS
Core Animation in Practice, Part 1 Core Animation is the layer-based animation system that powers the dynamic user experience seen in iPhone OS. See Core Animation in action and learn about its architecture, capabilities, and best practices. Learn how to combine the familiar capabilities of UIKit, Quartz 2D, and OpenGL ES with the power of Core Animation layers and animation. Download: HD | SD    | PDF System Requirements
To watch the streaming version of this video, use the latest version of Safari on a Mac running OS X Lion or later. Alternatively, you can download this video in HD and SD.
Core Animation in Practice, Part 2Graphics & MediaiOS

WWDC 2010 Session 123 – Building Animation Driven Interfaces
WWDC 2010 Session 424 – Core Animation in Practice, Part 1
WWDC 2010 Session 425 – Core Animation in Practice, Part 2


https://developer.apple.com/videos/wwdc/2011/#421

  • Core Animation Essentials
  • Graphics, Media, & Games
  • iOS, OS X



2011년 강의로 기초 공부


[CATransactionAnimation setDuration:2];

만으로도 animation을 실행한다.

CAAction protocol

implicit animation이 싫을 땐,

[CATransactionAnimation setDisableActions:YES];


hitTest screen value를 얻을 땐, presentationLayer를 이용하기


Bitmap cache 얘기 같은 것 듣고 싶었는데, 발표자가 시간이 모자랐는지 그냥 넘어가네..


Replicators라는 것도 있네. 변화를 여러 replicator instances에 조금씩 반영?

Particles는 ios5부터. CAEmitterLayer

이것도 쓸 일은 없겠다.


WWDC 2011 Video: Understanding UIKit rendering
WWDC 2012 Video: iOS App performance: Graphics and Animations


drawRect: layer.contents backing store

CA::Layer::layout_and_display_if_needed(CA::Transaction*)


https://developer.apple.com/videos/wwdc/2014/#419

  • Advanced Graphics and Animations for iOS Apps
  • Tools
  • iOS



Layout --> Display --> Prepare --> Commit

layout: CPU, IO

display= drawRect, string drawing: CPU, memory

prepare= image decoding

commit= package up layers and send to render server


  1. animateWithDuration 
  2. layoutSubviews
  3. Render each frame

Command buffer --> Tiler (vertex processing, tiling) --> Parameter buffer --> Render (pixel shader) --> Render buffer

를 연속적으로 pipelining

16.67ms

gpu context switch때문에 gpu idle time이 생기곤 한다.

shouldRasterize

extra offscreen passes when updating content -->> 정적인 content에 쓰기

cache size는 2.5x of screen size에 한정돼있으니까 overuse하지 말기.

rasterized images는 100ms 이상 동안 안쓰인다면 evicted from cache


Tools

performance issue가 있다면, 생각해 보자

  1. frame rate = 60 frame/sec
  2. CPU or GPU bounds
  3. GPU desirable > CPU
  4. fewer offscreen passes
  5. less blending
  6. Dont use strange image formats
  7. visual effects costs
  8. view hierarchy

Instruments

Core animation instrument, OpenGL ES drivier instrument

color blended layers에 check하면, 얼마나 겹쳐 있는지 알 수 있다.

color hit green and ... red: cache 안돼있을 때 빨갛게 표시

color copied images: 지원 안하는 color format 때문에 시간 걸릴 때

color misaligned image

color offscreen yellow




2012, 2013 년에는 mac os x Cocoa Animation

  • Best Practices for Cocoa Animation
  • Frameworks
  • OS X



https://developer.apple.com/videos/wwdc/2012/

Layer-Backed Views: AppKit + Core Animation Essentials OS X
Layer-Backed Views: AppKit + Core AnimationPlay Learn how to effectively use layer-backed views in AppKit to...



한편, 그리기 video가 너무 없네.


https://developer.apple.com/videos/wwdc/2011/#129

Practical Drawing for iOS DevelopersApp FrameworksiOS







by 언제나19 2015. 4. 9. 23:46
| 1 |