| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
* reduce copies & allocations
* simplify SGR generation
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* refactor parseHeader
* optimize response blob()
* add direct "to cache" mode for loader requests which sets stdout to a
file, and use it for image processing
* move image resizing into a separate process
* mmap cache files in between processing steps when possible
At last, resize is no longer a part of image decoding. Also, it feels
much nicer to keep encoded image data in the same cache as everything
else.
The mmap operations *should* be more efficient than copying the whole
RGBA data through a pipe. In practice, it only makes a difference for
loading (well, now just mmapping) the encoded image into the pager,
where it singlehandedly speeds up image display by 10x on my test image.
For the other steps, the unfortunate fact that "tocache" must delay the
next fork/exec in the pipeline until the entire image is processed seems
to equal out any wins we might have gotten from skipping a single raw
RGBA copy.
I have tried moving the delay before the exec (it's possible with yet
another pipe), but it didn't help much and made the code much
uglier. (Not that tocache didn't, but I can live with this...)
|
|
|
|
|
|
|
|
|
|
|
| |
* align status truncating behavior with w3m (not exactly, clipping
is still different, but this should be fine for now)
* add "su" for "show last alert"
- w3m's solution here is to scroll one char at a time with
"u", but that's extremely annoying to use. We already have a
line editor that can navigate lines, so reuse that instead.
* fix peekCursor showing empty text
* update todo
|
| |
|
|
|
|
|
| |
This was a bad idea that, despite my best efforts, never worked
properly.
|
|
|
|
|
|
| |
* simplify uint parser
* use uint parser for signed ints too (to simplify overflow handling)
* use openArray[char] where possible
|
| |
|
|
|
|
| |
I meant to fix this enum bug in the previous patch but then I forgot...
|
|
|
|
|
|
|
|
|
|
|
|
| |
* add document.forms
* add form.elements
* remove redundant jshasprop functions
* use mpairs for attribute iteration (mpairs use pointers, but pairs
copies)
* fix remove() crash
* fix remove() collection invalidation for children (if parent is not
in the collection)
* update monoucha
|
|
|
|
| |
looks like it's also necessary for musl
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
I thought this would work fine, but then images weren't loading. Upon
closer inspection I realized we don't necessarily let the image decoder
finish reading the entire file on pass 1 (header parsing), which means
pass 2 (decoding) can end up reading a partially downloaded cache file.
To fix this, we now fall back to streaming mode when an open handle to
the cached item still exists.
(An alternative would be to wait for the cached item to finish loading,
but that's harder to implement and might be slower anyway - the current
implementation allows for the decoder to run while an image is still
being loaded, but we couldn't do that with the second approach.)
|
|
|
|
| |
it was already being treated as such
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Module boundaries didn't make much sense here either. Specifically:
* loader/cgi was originally just one of the many "real" protocols
supported by loader, so it was in a separate module (like the other
ones). Now it's mostly an "internal" protocol, and it was getting
cumbersome to pass all required loader state to loadCGI.
* The loader interface has grown quite large, but there is no need for
(or advantage in) putting it in the same module as the implementation.
Now CGI is handled by loader, and the interface is in the new module
"loaderiface".
|
|
|
|
|
| |
I've moved most image logic to adapter, so it doesn't really make
sense to have this subdir anymore.
|
| |
|
|
|
|
| |
directly accessing map was a bit too error prone
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
| |
fcntl has some cursed commands that we really don't want to allow
|
|
|
|
| |
special case it in paintBackground so that it doesn't look so ugly
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
|
|
| |
Welp. The fence was needed after all.
The keybinding was broken anyway; fix that too.
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
|
|
|
| |
Make sure U+FFFD is returned when a bounds check fails.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
Wait, why does std fastRuneAt try to decode UCS-32?
Hmm...
|
| |
|
|
|
|
| |
Now it mostly works, provided you set a compatible encoding.
|
| |
|
|
|
|
|
| |
WSL needs it. It was already allowed on Android, so this just makes the
sandboxes converge a little.
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
| |
Makes it so we don't crash the entire browser upon encoding failure.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
unused
|
|
|
|
| |
select allocates. (makes sense, but I never realized...)
|
|
|
|
|
|
|
| |
pain...
(also, fix an fd leak, plus a more general bug where we registered
empty output handles.)
|
| |
|
|
|
|
| |
+ be a bit more paranoid about double closes
|
| |
|