Hacker News new | past | comments | ask | show | jobs | submit login

There is no guarantee that canvas is hardware accelerated, or how whatever they are optimized, so a low level software rendering library might turn out to execute faster, regardless of the browser.



This is not about Canvas but rather set of primitives that browser uses for rendering web pages.

Like in my Sciter (https://sciter.com) where you can do

    var anyEl = …;
    
    anyEl.paintBackground = function(gfx) {
      gfx.fillColor(rgb(0,0,0))
         .rectangle(0,0,100cm,100cm);
      return true; // to suppress CSS background drawing 
    }
paintBackground/Content/Foreground methods are called while rendering HTML tree and the `gfx` passed to that function is the very same graphics that is used for rendering HTML/CSS tree.

That thing allows to combine immediate mode graphics a la ImGui with retained one to achieve more performant solution at the end.

The same approach can be used with WASM I think.




Applications are open for YC Winter 2020

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: