2014-11-03 03:19:34 +00:00
|
|
|
Skia Update
|
|
|
|
|
2014-11-04 21:24:47 +00:00
|
|
|
Skia : Access
|
|
|
|
- code.google.com/p/skia
|
|
|
|
- sites.google.com/site/skiadocs
|
|
|
|
|
2014-11-03 03:19:34 +00:00
|
|
|
Skia : Overview
|
2014-11-04 21:24:47 +00:00
|
|
|
- portable graphics engine
|
|
|
|
- 2D transformations + perspective
|
|
|
|
- primitives: text, geometry, images
|
|
|
|
- effects: shaders, filters, antialiasing, blending
|
2014-11-03 03:19:34 +00:00
|
|
|
|
|
|
|
Skia : Porting
|
|
|
|
- C++ and some SIMD assembly
|
2014-11-04 06:32:07 +00:00
|
|
|
- Fonts : CoreText, FreeType, GDI, DirectWrite
|
2014-11-03 03:19:34 +00:00
|
|
|
- Threads : wrappers for native apis
|
|
|
|
- Memory : wrappers for [new, malloc, discardable]
|
|
|
|
|
2014-11-04 21:24:47 +00:00
|
|
|
Skia : Backends
|
|
|
|
- Surface
|
|
|
|
-- raster : ARGB, RGB16, A8 in software
|
|
|
|
-- gpu : transcribe to OpenGL
|
|
|
|
- Document
|
|
|
|
-- transcribe to PDF or XPS
|
|
|
|
- Record and Playback
|
|
|
|
-- Picture
|
|
|
|
-- Pipe
|
|
|
|
|
2014-11-04 06:32:07 +00:00
|
|
|
Skia : Clients
|
|
|
|
- Blink : under the GraphicsContext hood
|
|
|
|
- Chrome : ui/gfx and compositor
|
2014-11-04 21:24:47 +00:00
|
|
|
- Android : framework
|
2014-11-04 06:32:07 +00:00
|
|
|
- third parties : e.g. Mozilla
|
2014-11-03 03:19:34 +00:00
|
|
|
|
2014-11-04 06:32:07 +00:00
|
|
|
Skia In Blink
|
2014-11-03 03:19:34 +00:00
|
|
|
|
|
|
|
Skia In Blink : Fonts
|
2014-11-04 06:32:07 +00:00
|
|
|
- SkTypeface and SkFontMgr : platform agnostic
|
2014-11-03 03:19:34 +00:00
|
|
|
- Runtime switch between GDI and DirectWrite
|
2014-11-04 06:32:07 +00:00
|
|
|
- SkTextBlob to encapsulate runs of text
|
2014-11-03 03:19:34 +00:00
|
|
|
- Push LCD decision-making out of Blink
|
|
|
|
|
|
|
|
Skia In Blink : Record-Time-Rasterization
|
2014-11-04 21:24:47 +00:00
|
|
|
- What? : direct rendering during “Paint” pass
|
2014-11-03 03:19:34 +00:00
|
|
|
-- Image scaling, filters
|
|
|
|
-- SVG patterns, masks
|
|
|
|
- Problematic in modern Blink
|
|
|
|
-- CTM not always known/knowable
|
|
|
|
-- Rendering backend not always known (gpu or cpu)
|
|
|
|
-- Rasterization takes (too much) time
|
|
|
|
|
|
|
|
Skia In Blink : RTR response
|
|
|
|
- SkImageFilter w/ CPU and GPU implementations
|
2014-11-04 21:24:47 +00:00
|
|
|
- Bitmap scaling : bilerp, mipmaps, fancy
|
2014-11-03 03:19:34 +00:00
|
|
|
- SkPicture for caching SVG
|
|
|
|
- SkPicture + saveLayer() for masks
|
|
|
|
-- PathOps for resolving complex paths
|
|
|
|
- SkPictureShader for device-independent patterns
|
2014-11-04 06:32:07 +00:00
|
|
|
|
|
|
|
Skia In Blink : Recording
|
2014-11-04 21:24:47 +00:00
|
|
|
- GraphicsContext (now) backed by SkPicture
|
2014-11-04 06:32:07 +00:00
|
|
|
-- draw commands are recorded for later playback
|
|
|
|
-- all parameters must be copied or (safely) ref'd
|
|
|
|
-- may record more than is currently visible
|
|
|
|
- Resulting picture may be replayed multiple times
|
2014-11-04 21:24:47 +00:00
|
|
|
-- from different thread(s)
|
2014-11-04 06:32:07 +00:00
|
|
|
|
|
|
|
Skia In Blink : Recording response
|
|
|
|
- New implementation
|
|
|
|
- Optimized for recording speed
|
|
|
|
-- shallow copies whenever possible
|
|
|
|
-- rearchitect all Skia effects to be immutable
|
|
|
|
- Reentrant-safe for playback in multiple threads
|
|
|
|
-- also affected effect subclasses
|
|
|
|
|
|
|
|
Skia In Blink : Playback
|
|
|
|
- Separate pass for optimizations (optional)
|
|
|
|
-- peep-holes rewrites
|
|
|
|
-- compute bounding-box hierarchy for faster tiling
|
|
|
|
-- can be done outside of Blink thread
|
|
|
|
- GPU optimizations
|
|
|
|
-- layer "hoisting"
|
2014-11-04 21:24:47 +00:00
|
|
|
-- distance fields : fonts and concave paths
|
|
|
|
|
|
|
|
Skia In Blink : multi-picture-draw
|
|
|
|
- mpd(canvas[], picture[], matrix[], paint[])
|
|
|
|
- Requires independent canvas objects
|
|
|
|
-- all other parameters can be shared
|
|
|
|
-- draw order is unspecified
|
|
|
|
- Examples
|
|
|
|
-- 1 picture drawing to multiple tiles (canvases)
|
|
|
|
-- multiple pictures each drawing to its own layer
|
|
|
|
|
|
|
|
Skia In Blink : MPD optimizations*
|
|
|
|
- GPU
|
|
|
|
-- "layer hoisting" to reduce rendertarget switching
|
|
|
|
-- layer atlasing (also applies to imagefilters)
|
|
|
|
-- pre-uploading of textures
|
|
|
|
-- atlas yuv (from jpeg) to convert on gpu
|
|
|
|
- CPU
|
|
|
|
-- parallel execution using thread pool
|
|
|
|
-- pre-decoding of images based on visibility
|
2014-11-04 06:32:07 +00:00
|
|
|
|
|
|
|
Skia : Roadmap
|
|
|
|
|
2014-11-04 21:24:47 +00:00
|
|
|
Skia : Roadmap - performance
|
|
|
|
- GPU
|
2014-11-04 06:32:07 +00:00
|
|
|
-- extended OpenGL features (e.g. geometry shaders)
|
|
|
|
-- reordering for increased batching
|
|
|
|
-- support for new low-level OpenGL APIs
|
2014-11-04 21:24:47 +00:00
|
|
|
- CPU
|
|
|
|
-- SIMD applied to floats
|
|
|
|
-- smarter culling in pictures
|
2014-11-04 06:32:07 +00:00
|
|
|
|
2014-11-04 21:24:47 +00:00
|
|
|
Skia : Roadmap - API
|
|
|
|
- Cross process support
|
2014-11-04 06:32:07 +00:00
|
|
|
- Direct support for sRGB
|
|
|
|
- Robust file format
|
2014-11-04 21:24:47 +00:00
|
|
|
- Support PDF viewing
|
|
|
|
- Stable C ABI
|
|
|
|
-- bindings for JS, Go, Python, Lua
|
2014-11-04 06:32:07 +00:00
|
|
|
|
|
|
|
Demo
|