Skip to content

A canvas2d api implementation using webgl and javascript

Notifications You must be signed in to change notification settings

karellodewijk/canvas-webgl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

canvas-webgl

A canvas2d api implementation using webgl and javascript

Currently it supports most features, but many of them have bugs.

Canvas2D api examples:

http:https://karellodewijk.github.io/canvas-webgl/test/canvas_tests1.html

http:https://karellodewijk.github.io/canvas-webgl/test/canvas_tests2.html

http:https://karellodewijk.github.io/canvas-webgl/test/canvas_tests3.html

Test suites:

http:https://karellodewijk.github.io/canvas-webgl/CanvasMark/

http:https://karellodewijk.github.io/canvas-webgl/test_suite/tests/index.html

http:https://karellodewijk.github.io/canvas-webgl/perftest/

Caveats:

  • Text rendering basically uses Canvas2D to render and then copies the result over to the webgl context, which is mostly an excercice in futility. But truly implementing text rendering in webgl would be a huge undertaking.
  • Webgl can not put images with width or height larger than max texture size (typically 4096px) directly into a texture, so I use canvas2D to carve them up at a big performance hit.

Missing features:

  • Hit regions except isPointInPath/isPointInStroke
  • drawFocusIfNeeded, scrollPathIntoView
  • Ellipse support in arcTo
  • There is only 1 winding mode, which is whatever earcut does.

Used libraries:

Major ones are:

There are some smaller bits, attribuited in the source code

About

A canvas2d api implementation using webgl and javascript

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages