Skip to content

binouz/node-skia

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

node-skia

This node module allows you to draw with skia on a native EGL window.

Build

Linux

# make

API

  • Spawn a native EGL window to draw on
var skia = require("skia");
var Window = skia.Window;

var win = new Window(1280, 720);
win.start();
win.stop();
win.release();
  • Draw at each frame directly on canvas :
var skia = require("skia");
var Window = skia.Window;

var win = new Window(1280, 720);
win.setDrawHandler(function(canvas) {
    canvas.drawColor(0xFFFFFFFF);
    canvas.drawText(0xFF000000, 100, 100, "Hello World !");
});
win.start();
win.stop();
win.release();
  • Use asynchronous view system :
var skia = require("skia");
var Window = skia.Window;
var View = skia.View;

var View = new View(0xFFFFFFFF);
var win = new Window(1280, 720);
win.setView(view);
win.start();
view.update({
    style : {
        color : 0xFF000000,
        x: 100,
        y: 100,
        fontSize : 30
    },
    children : [],
    content: "Hello World !"
});
win.stop();
win.release();

TODO

We have a basic POC today, but to have a complete library we need to :

  • be fully CSS 3 compliant
  • implement a real layout engine
  • implement transforms
  • implement transitions
  • add support for media element : audio, video, MSE

Other ideas :

  • DRM support through EME
  • Develop a framework with more complex elements

About

Skia based renderer for nodejs with EGL

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published