reed | de330ff | 2014-11-02 19:19:34 -0800 | [diff] [blame] | 1 | Skia Update |
| 2 | |
reed | 7b86466 | 2014-11-04 13:24:47 -0800 | [diff] [blame^] | 3 | Skia : Access |
| 4 | - code.google.com/p/skia |
| 5 | - sites.google.com/site/skiadocs |
| 6 | |
reed | de330ff | 2014-11-02 19:19:34 -0800 | [diff] [blame] | 7 | Skia : Overview |
reed | 7b86466 | 2014-11-04 13:24:47 -0800 | [diff] [blame^] | 8 | - portable graphics engine |
| 9 | - 2D transformations + perspective |
| 10 | - primitives: text, geometry, images |
| 11 | - effects: shaders, filters, antialiasing, blending |
reed | de330ff | 2014-11-02 19:19:34 -0800 | [diff] [blame] | 12 | |
| 13 | Skia : Porting |
| 14 | - C++ and some SIMD assembly |
reed | bb8a0ab | 2014-11-03 22:32:07 -0800 | [diff] [blame] | 15 | - Fonts : CoreText, FreeType, GDI, DirectWrite |
reed | de330ff | 2014-11-02 19:19:34 -0800 | [diff] [blame] | 16 | - Threads : wrappers for native apis |
| 17 | - Memory : wrappers for [new, malloc, discardable] |
| 18 | |
reed | 7b86466 | 2014-11-04 13:24:47 -0800 | [diff] [blame^] | 19 | Skia : Backends |
| 20 | - Surface |
| 21 | -- raster : ARGB, RGB16, A8 in software |
| 22 | -- gpu : transcribe to OpenGL |
| 23 | - Document |
| 24 | -- transcribe to PDF or XPS |
| 25 | - Record and Playback |
| 26 | -- Picture |
| 27 | -- Pipe |
| 28 | |
reed | bb8a0ab | 2014-11-03 22:32:07 -0800 | [diff] [blame] | 29 | Skia : Clients |
| 30 | - Blink : under the GraphicsContext hood |
| 31 | - Chrome : ui/gfx and compositor |
reed | 7b86466 | 2014-11-04 13:24:47 -0800 | [diff] [blame^] | 32 | - Android : framework |
reed | bb8a0ab | 2014-11-03 22:32:07 -0800 | [diff] [blame] | 33 | - third parties : e.g. Mozilla |
reed | de330ff | 2014-11-02 19:19:34 -0800 | [diff] [blame] | 34 | |
reed | bb8a0ab | 2014-11-03 22:32:07 -0800 | [diff] [blame] | 35 | Skia In Blink |
reed | de330ff | 2014-11-02 19:19:34 -0800 | [diff] [blame] | 36 | |
| 37 | Skia In Blink : Fonts |
reed | bb8a0ab | 2014-11-03 22:32:07 -0800 | [diff] [blame] | 38 | - SkTypeface and SkFontMgr : platform agnostic |
reed | de330ff | 2014-11-02 19:19:34 -0800 | [diff] [blame] | 39 | - Runtime switch between GDI and DirectWrite |
reed | bb8a0ab | 2014-11-03 22:32:07 -0800 | [diff] [blame] | 40 | - SkTextBlob to encapsulate runs of text |
reed | de330ff | 2014-11-02 19:19:34 -0800 | [diff] [blame] | 41 | - Push LCD decision-making out of Blink |
| 42 | |
| 43 | Skia In Blink : Record-Time-Rasterization |
reed | 7b86466 | 2014-11-04 13:24:47 -0800 | [diff] [blame^] | 44 | - What? : direct rendering during “Paint” pass |
reed | de330ff | 2014-11-02 19:19:34 -0800 | [diff] [blame] | 45 | -- Image scaling, filters |
| 46 | -- SVG patterns, masks |
| 47 | - Problematic in modern Blink |
| 48 | -- CTM not always known/knowable |
| 49 | -- Rendering backend not always known (gpu or cpu) |
| 50 | -- Rasterization takes (too much) time |
| 51 | |
| 52 | Skia In Blink : RTR response |
| 53 | - SkImageFilter w/ CPU and GPU implementations |
reed | 7b86466 | 2014-11-04 13:24:47 -0800 | [diff] [blame^] | 54 | - Bitmap scaling : bilerp, mipmaps, fancy |
reed | de330ff | 2014-11-02 19:19:34 -0800 | [diff] [blame] | 55 | - SkPicture for caching SVG |
| 56 | - SkPicture + saveLayer() for masks |
| 57 | -- PathOps for resolving complex paths |
| 58 | - SkPictureShader for device-independent patterns |
reed | bb8a0ab | 2014-11-03 22:32:07 -0800 | [diff] [blame] | 59 | |
| 60 | Skia In Blink : Recording |
reed | 7b86466 | 2014-11-04 13:24:47 -0800 | [diff] [blame^] | 61 | - GraphicsContext (now) backed by SkPicture |
reed | bb8a0ab | 2014-11-03 22:32:07 -0800 | [diff] [blame] | 62 | -- draw commands are recorded for later playback |
| 63 | -- all parameters must be copied or (safely) ref'd |
| 64 | -- may record more than is currently visible |
| 65 | - Resulting picture may be replayed multiple times |
reed | 7b86466 | 2014-11-04 13:24:47 -0800 | [diff] [blame^] | 66 | -- from different thread(s) |
reed | bb8a0ab | 2014-11-03 22:32:07 -0800 | [diff] [blame] | 67 | |
| 68 | Skia In Blink : Recording response |
| 69 | - New implementation |
| 70 | - Optimized for recording speed |
| 71 | -- shallow copies whenever possible |
| 72 | -- rearchitect all Skia effects to be immutable |
| 73 | - Reentrant-safe for playback in multiple threads |
| 74 | -- also affected effect subclasses |
| 75 | |
| 76 | Skia In Blink : Playback |
| 77 | - Separate pass for optimizations (optional) |
| 78 | -- peep-holes rewrites |
| 79 | -- compute bounding-box hierarchy for faster tiling |
| 80 | -- can be done outside of Blink thread |
| 81 | - GPU optimizations |
| 82 | -- layer "hoisting" |
reed | 7b86466 | 2014-11-04 13:24:47 -0800 | [diff] [blame^] | 83 | -- distance fields : fonts and concave paths |
| 84 | |
| 85 | Skia In Blink : multi-picture-draw |
| 86 | - mpd(canvas[], picture[], matrix[], paint[]) |
| 87 | - Requires independent canvas objects |
| 88 | -- all other parameters can be shared |
| 89 | -- draw order is unspecified |
| 90 | - Examples |
| 91 | -- 1 picture drawing to multiple tiles (canvases) |
| 92 | -- multiple pictures each drawing to its own layer |
| 93 | |
| 94 | Skia In Blink : MPD optimizations* |
| 95 | - GPU |
| 96 | -- "layer hoisting" to reduce rendertarget switching |
| 97 | -- layer atlasing (also applies to imagefilters) |
| 98 | -- pre-uploading of textures |
| 99 | -- atlas yuv (from jpeg) to convert on gpu |
| 100 | - CPU |
| 101 | -- parallel execution using thread pool |
| 102 | -- pre-decoding of images based on visibility |
reed | bb8a0ab | 2014-11-03 22:32:07 -0800 | [diff] [blame] | 103 | |
| 104 | Skia : Roadmap |
| 105 | |
reed | 7b86466 | 2014-11-04 13:24:47 -0800 | [diff] [blame^] | 106 | Skia : Roadmap - performance |
| 107 | - GPU |
reed | bb8a0ab | 2014-11-03 22:32:07 -0800 | [diff] [blame] | 108 | -- extended OpenGL features (e.g. geometry shaders) |
| 109 | -- reordering for increased batching |
| 110 | -- support for new low-level OpenGL APIs |
reed | 7b86466 | 2014-11-04 13:24:47 -0800 | [diff] [blame^] | 111 | - CPU |
| 112 | -- SIMD applied to floats |
| 113 | -- smarter culling in pictures |
reed | bb8a0ab | 2014-11-03 22:32:07 -0800 | [diff] [blame] | 114 | |
reed | 7b86466 | 2014-11-04 13:24:47 -0800 | [diff] [blame^] | 115 | Skia : Roadmap - API |
| 116 | - Cross process support |
reed | bb8a0ab | 2014-11-03 22:32:07 -0800 | [diff] [blame] | 117 | - Direct support for sRGB |
reed | bb8a0ab | 2014-11-03 22:32:07 -0800 | [diff] [blame] | 118 | - Robust file format |
reed | 7b86466 | 2014-11-04 13:24:47 -0800 | [diff] [blame^] | 119 | - Support PDF viewing |
| 120 | - Stable C ABI |
| 121 | -- bindings for JS, Go, Python, Lua |
reed | bb8a0ab | 2014-11-03 22:32:07 -0800 | [diff] [blame] | 122 | |
| 123 | Demo |