• Igor Demin's avatar
    Draw into picture, refactor SkiaLayer · f970ae3d
    Igor Demin authored
    1. Split onRender into performUpdate and performDraw.
    performUpdate will be called from the Swing thread in upcoming commits (to avoid race conditions)
    
    2. Remove canvas.scale by default
    
    Motivation: automatic scaling is harmful.
    Example:
    - skiko returns us 100x100 canvas size.
    - We load image from disk and reduce its size to 100x100.
    - We draw this image onto canvas, and it is scaled 2x with artifacts.
    If skiko returns us 200x200 then we reduce image to 200x200 and draw it onto canvas without scaling.
    
    3. Cache contentScale
    It is expensive operation on Linux to do it in every frame (we read database)
    
    4. Remove onInit, onReshape, onDispose removed from SkiaRenderer.
    It is hard to implement it in the right thread (on macOs we have AppKit and AWT thread). Besides we don't use them in Compose.
    If they will be needed then we can implement them later.
    f970ae3d
Name
Last commit
Last update
..
main/kotlin/SkijaInjectSample Loading commit data...
test/kotlin/SkijaInjectSample Loading commit data...