diff options
| author | Ben Harris <bjh21@bjh21.me.uk> | 2023-07-29 16:06:19 +0100 |
|---|---|---|
| committer | Ben Harris <bjh21@bjh21.me.uk> | 2023-07-30 11:50:25 +0100 |
| commit | 76da6ec140cbbdac6136469ce50aab40e218f398 (patch) | |
| tree | 90e92a04e2ea6196c93e21efd2f3d2ef716144a6 /malloc.c | |
| parent | 3e7a6adce5887db04d26438da64fdc4de308f4da (diff) | |
| download | puzzles-76da6ec140cbbdac6136469ce50aab40e218f398.zip puzzles-76da6ec140cbbdac6136469ce50aab40e218f398.tar.gz puzzles-76da6ec140cbbdac6136469ce50aab40e218f398.tar.bz2 puzzles-76da6ec140cbbdac6136469ce50aab40e218f398.tar.xz | |
js: keep colour strings in JavaScript rather than in C
The drawing routines in JavaScript used to take pointers to a C string
containing a CSS colour name. That meant that JavaScript had to create
a new JavaScript string on ever call to a drawing function, which seemed
ugly.
So now we instead pass colour numbers all the way down into JavaScript
and keep an array of JavaScript strings there that can be re-used. The
conversion from RGB triples to strings is still done in C, though.
This doesn't seem to have fixed either of the bugs I hoped it would, but
it does measurably improve drawing performance so I think it's worth
doing.
Diffstat (limited to 'malloc.c')
0 files changed, 0 insertions, 0 deletions