about summary refs log tree commit diff stats
Commit message (Collapse)AuthorAgeFilesLines
* Refactor img/*bptato2024-09-1515-274/+264
| | | | | I've moved most image logic to adapter, so it doesn't really make sense to have this subdir anymore.
* Update to Unicode 16.0.0bptato2024-09-145-12883/+13155
|
* loader: improve map interfacebptato2024-09-143-22/+25
| | | | directly accessing map was a bit too error prone
* loader: refactor, misc optimizations & fixesbptato2024-09-149-266/+334
| | | | | | | | * factor out input/output handle tables; use a seq instead * add possibility to directly open cached items onto stdin (mainly an optimization for reading images, which are always cached) * close used handles on local CGI execution * make clone during load work again
* sandbox: stricter fcntl policybptato2024-09-141-4/+17
| | | | fcntl has some cursed commands that we really don't want to allow
* renderdocument: fix image background coloringbptato2024-09-131-13/+16
| | | | special case it in paintBackground so that it doesn't look so ugly
* term: improve damage tracking, special case yaftbptato2024-09-132-15/+42
| | | | | | | It still sucks, but at least now it flashes a bit less. (I should really redo it properly some time) Also, special case yaft so that we always output sixels for it.
* Update docsbptato2024-09-132-23/+64
|
* sixel: do not reserve palette entry for transparencybptato2024-09-122-12/+15
| | | | | | | | | Turns out this isn't actually needed. Which makes sense, as transparency doesn't have a color register at all - it's just the default state of pixels. Also, skip octree-based quantization with palette <= 2; unsurprisingly, monochrome gives much better results.
* sixel: factor out root node, fix a bugbptato2024-09-121-30/+31
|
* sixel: small optimizationsbptato2024-09-111-31/+48
| | | | | | | | * Reduce unnecessary branch allocation even more * Use linked lists to represent sixel bands Also inlined octree-based getColor for clarity, although the compiler was already doing that.
* sixel: faster quantizationbptato2024-09-111-80/+92
| | | | | | | | | | | Reduce eager allocation of whole branches for leaves; now it's done only after the first conflict (or repeated color). This makes quantization ~2x faster for images without large runs of the same color and ~2x slower for images with a lot of those. No noticeable loss in quality. I also disabled refc for the octree and turned the nodes into tagged unions, which again resulted in a ~2x speedup.
* config: add display.sixel-colorsbptato2024-09-104-0/+15
|
* config: fix broken references to commandsbptato2024-09-102-156/+166
|
* pager: fix saveSourcebptato2024-09-103-6/+10
| | | | | | Welp. The fence was needed after all. The keybinding was broken anyway; fix that too.
* pager: fix rewrite-url weirdnessbptato2024-09-102-8/+4
| | | | | | | | | saveSource's URL overriding mechanism conflicted with rewrite-url, since the latter wouldn't change the overriding URL (which was not optional either). Remove the former since a) it's just cosmetic and b) not really visible to the user at all.
* dom: fix crash on wrong CSS content typebptato2024-09-101-3/+1
|
* sixel: misc optimizationsbptato2024-09-091-42/+43
|
* pager, term: fix kitty display, add a sixel bounds checkbptato2024-09-092-4/+5
|
* twtuni: correct behavior on failed bounds checkbptato2024-09-081-11/+11
| | | | Make sure U+FFFD is returned when a bounds check fails.
* sixel: small optimizationbptato2024-09-081-29/+27
| | | | | | For large palettes, looping over the entire chunk list is quite slow. Store the list of active chunks in a separate sequence so we can skip the unused ones.
* utils: add twtunibptato2024-09-0819-433/+483
| | | | | | | | | | | | | | | | | | | std/unicode has the following issues: * Rune is an int32, which implies overflow checking. Also, it is distinct, so you have to convert it manually to do arithmetic. * QJS libunicode and Chagashi work with uint32, interfacing with these required pointless type conversions. * fastRuneAt is a template, meaning it's pasted into every call site. Also, it decodes to UCS-4, so it generates two branches that aren't even used. Overall this lead to quite some code bloat. * fastRuneAt and lastRune have frustratingly different interfaces. Writing code to handle both cases is error prone. * On older Nim versions which we still support, std/unicode takes strings, not openArray[char]'s. Replace it with "twtuni", which includes some improved versions of the few procedures from std/unicode that we actually use.
* Fix 1.6.14 compilationbptato2024-09-072-2/+30
| | | | | Wait, why does std fastRuneAt try to decode UCS-32? Hmm...
* md2html: code, pre, inline fixesbptato2024-09-075-124/+198
|
* term: support SyncTERMbptato2024-09-061-55/+69
| | | | Now it mostly works, provided you set a compatible encoding.
* Update chagashibptato2024-09-062-1/+1
|
* sandbox: allow futex in network/buffer sandboxbptato2024-09-061-1/+2
| | | | | WSL needs it. It was already allowed on Android, so this just makes the sandboxes converge a little.
* twtstr: type erase binarySearch instantiationbptato2024-09-063-38/+52
| | | | | | | | Do it like parseEnumNoCase0, so we no longer instantiate a gazillion different binary searches for the same type. While we're at it, make matchNameProduction's searchInMap use uint32 too.
* term: sixel sizing & output fixesbptato2024-09-053-20/+29
| | | | | | | | | | | | * round down to number divisible by 6 for height * make pager's dispw match term's dispw even after width clamping * make *BE procs actually emit/consume big-endian (lol) * fix borked sixel set raster attributes & control string I mixed up SRA with the device control string's parameters, so instead of toggling transparency in the DCS, I was setting the second SRA parameter to 0. Which, by the way, defines the aspect ratio's denominator, and has nothing to do with transparency. Whoops.
* term: add outputSixelImage bounds checksbptato2024-09-041-3/+12
| | | | Makes it so we don't crash the entire browser upon encoding failure.
* sixel, stbi, sandbox: fix fstat sandbox violationbptato2024-09-045-54/+72
| | | | | | | Until recently, glibc used to implement it as fstatat. So don't trap for fstatat (and for consistency, fstat), but return EPERM. Just to be sure, rewrite sixel & stbi to never call fread.
* bindings: remove zlibbptato2024-09-041-79/+0
| | | | unused
* loader, client, buffer: use selectInto (not select)bptato2024-09-033-9/+13
| | | | select allocates. (makes sense, but I never realized...)
* loader: fix crashes with kqueue backendbptato2024-09-032-4/+23
| | | | | | | pain... (also, fix an fd leak, plus a more general bug where we registered empty output handles.)
* cascade: add missing nil checkbptato2024-09-021-1/+1
|
* loader: fix some fd leaksbptato2024-09-024-11/+37
| | | | + be a bit more paranoid about double closes
* doc: update manpagesbptato2024-09-0214-30/+387
|
* md2html: misc inline fixesbptato2024-09-011-114/+160
| | | | | * fix whitespace-surrounded asterisk turning into emphasis * slightly refactor parseInline (it's still quite ugly...)
* Update chagashibptato2024-09-012-1/+1
|
* pager: fix missing gotoLine return valuebptato2024-09-011-0/+1
|
* sixel: special case search for few color registersbptato2024-09-011-17/+58
| | | | | | See comment for details. (Also, set the palette size based on quality for toBlob.)
* canvas: make sure we don't link to QJSbptato2024-09-0111-192/+167
|
* url: reduce idna sizebptato2024-09-013-2155/+1181
| | | | | Instead of storing pointers to cstrings, put all of them in a single huge string and store indices of that.
* path: fix swap bug, refactor linesbptato2024-09-013-19/+21
|
* canvas: move to separate CGI scriptbptato2024-09-0123-364/+571
| | | | | | | | | | * stream: and passFd is now client-based, and accessible for buffers * Bitmap's width & height is now int, not uint64 * no more non-network Bitmap special case in the pager for canvas I just shoehorned it into the static image model, so it still doesn't render changes after page load. But at least now it doesn't crash the browser.
* git.cgi: add git blamebptato2024-09-011-11/+63
|
* layout: fix table height constraint typebptato2024-08-303-1/+35
| | | | | it's really min-height, not height; consistency is not CSS's strong suit...
* sixel: fix oobbptato2024-08-301-3/+2
| | | | whoops
* term, sixel: misc image fixes, sixel optimizationbptato2024-08-302-70/+121
| | | | | | | | * expand allowed color range somewhat * update maximum sixel size on window resize * fix kitty image cropping * use faster algorithm for sixel compression (also produces less wasteful output)
* md2html: support blockquotebptato2024-08-304-13/+30
| | | | + update todo, readme