I started writing some test programs with the HTML canvas
element. This is great, as you can actually write games in
Javascript - efficiently - in principle.
My previous attempts have all used the DOM API which is not very
convenient, and not very efficient.
I had assumed the canvas 2d drawing context was basically a
software-renderer - it's not extremely efficient, but provided
the canvas doesn't have too many pixels, you can still do a lot
of work per frame on a modern machine.
Which is fine.
Suppose you have a canvas which is 640x320 pixels, you can then
get it upscaled into whatever resolution is in the browser
window, making the game appear the same size for everyone.
Great.
Except, the upscaling in web browsers sucks performance. I tried
Firefox 3.6 and Chrome 9. Both of them use loads of CPU scaling
the canvas on to the screen.
If we use a canvas …
Recently, a bug that caused excessive memory usage and slowness (specially in large models) in Workbench has been fixed in its canvas. From the testing I’ve done, the speed for displaying diagrams seems to scale much better and dragging around tables in large models is doable in an acceptable speed. This fix is in the upcoming releases of the 5.0 and 5.1 alpha versions of Workbench.
Apart from that, we’ve been doing some work on reintroducing OpenGL support to the Workbench canvas. Unlike the initial implementation, this time OpenGL is used directly instead of going through Cairo’s experimental (and not quite reliable) support through the Glitz layer. This means that in machines with a recent graphics card, hardware acceleration will be used and working with large diagrams will be a lot smoother and faster. Of course, software rendering backends (GDI+, Quartz and Xlib) will still be supported and used in case OpenGL is not the best …
[Read more]Some people might have noticed that Workbench runs very slowly and flickers a lot in their machines. Other people will be able to work without noticing any significant sluggishness with the diagram graphics. The difference is because Workbench’s custom canvas may use hardware accelerated OpenGL graphics or non-accelerated software rendering, depending on the system (ie, whether or not a 3D accelerated graphics card is available or not). We were expecting that the most reasonably recent machines (maybe 5 years old or less) would have at least some basic graphics acceleration, but for some reason, that seems to not always be the case. Apparently, some people that have decent systems with ATI or Intel cards seem to get the fallback software rendered canvas, which will result in sluggish graphics.
We are still not sure why Cairo/Glitz (the underlying graphics library used by our drawing …
[Read more]