OLD | NEW |
(Empty) | |
| 1 Skia Update |
| 2 |
| 3 Skia : Overview |
| 4 - portable 2D graphics engine |
| 5 - src: geometry, images, text |
| 6 - dst : raster, gpu, pdf, displaylist, *user-defined |
| 7 - attr: shaders, filters, antialiasing, blending, *user-defined |
| 8 |
| 9 Skia : Clients |
| 10 - Blink : direct and via GraphicsContext |
| 11 - Chrome : ui/gfx and compositor |
| 12 - Android framework |
| 13 - third parties : e.g. Mozilla |
| 14 - code.google.com/p/skia |
| 15 |
| 16 Skia : Porting |
| 17 - C++ and some SIMD assembly |
| 18 - Fonts : CoreText, FreeType, GDI, DirectWrite, *user-define |
| 19 - Threads : wrappers for native apis |
| 20 - Memory : wrappers for [new, malloc, discardable] |
| 21 |
| 22 Skia : API |
| 23 - SkCanvas |
| 24 -- save, saveLayer, restore |
| 25 -- translate, scale, rotate, concat |
| 26 -- clipRect, clipPath |
| 27 - SkPaint |
| 28 -- color, stroking, antialiasing, filtering |
| 29 -- typeface, textSize, text-flags |
| 30 -- effects: shader, color-filter, image-filter, mask-filter, xfermode |
| 31 |
| 32 <blockstyle = code> |
| 33 void onDraw(SkCanvas* canvas) { |
| 34 SkPaint paint; |
| 35 paint.setFoo(...); |
| 36 canvas->drawRect(..., paint); |
| 37 paint.setBar(...); |
| 38 canvas->drawOval(..., paint); |
| 39 } |
| 40 |
| 41 <blockstyle = code> |
| 42 void onDraw(SkCanvas* canvas) { |
| 43 canvas->drawRect(..., fPaint0); |
| 44 canvas->drawOval(..., fPaint1); |
| 45 } |
| 46 |
| 47 Skia In Blink : GraphicsContext |
| 48 - Similar |
| 49 -- rects, paths, images, text |
| 50 -- matrices, clips |
| 51 - Different |
| 52 -- save/restore affect matrix+clip PLUS all paint settings |
| 53 -- both fill and stroke settings are specified |
| 54 -- hence: fillRect(), strokeRect(), drawRect() |
| 55 |
| 56 <blockstyle = code> |
| 57 void onDraw(GraphicsContext* gc) { |
| 58 gc->save(); |
| 59 gc->setFoo(...); |
| 60 gc->fillRect(...); |
| 61 gc->setBar(...); |
| 62 gc->fillOval(...); |
| 63 gc->restore(); |
| 64 } |
| 65 |
| 66 Skia In Blink : more than GraphicsContext |
| 67 - Simple wrappers |
| 68 -- FloatRect -- SkRect |
| 69 -- Path -- SkPath |
| 70 - Font.h + 21 others |
| 71 -- SkTypeface + flags |
| 72 - Image.h + 25 others |
| 73 -- SkBitmap, SkImage |
| 74 |
| 75 Skia In Blink : Fonts |
| 76 - Assist with code-sharing between platforms |
| 77 - Runtime switch between GDI and DirectWrite |
| 78 - Add SkFontMgr for selection |
| 79 - Push LCD decision-making out of Blink |
| 80 |
| 81 Skia In Blink : Record-Time-Rasterization |
| 82 - Direct rendering during “Paint” pass |
| 83 -- Image scaling, filters |
| 84 -- SVG patterns, masks |
| 85 - Problematic in modern Blink |
| 86 -- CTM not always known/knowable |
| 87 -- Rendering backend not always known (gpu or cpu) |
| 88 -- Rasterization takes (too much) time |
| 89 |
| 90 Skia In Blink : RTR response |
| 91 - SkImageFilter w/ CPU and GPU implementations |
| 92 - SkPaint::FilterLevel : none, low, medium (mipmaps), high |
| 93 - SkPicture for caching SVG |
| 94 - SkPicture + saveLayer() for masks |
| 95 -- PathOps for resolving complex paths |
| 96 - SkPictureShader for device-independent patterns |
OLD | NEW |