Module image_cache

Source

StructsΒ§

AllPendingLoads πŸ”’
CompletedLoad πŸ”’
Represents an image that has completed loading. Images that fail to load (due to network or decode failure) are still stored here, so that they aren’t fetched again.
DecoderMsg πŸ”’
Message that the decoder worker threads send to the image cache.
ImageCacheImpl
ImageCacheStore πŸ”’
Image cache implementation.
KeyCache πŸ”’
As getting new keys takes a round trip over the constellation, we keep a small cache of them. Additionally, this cache will store image resources that do not have a key yet because those are needed to complete the load.
LoadKeyGenerator πŸ”’
PendingLoad πŸ”’
Represents an image that is either being loaded by the resource thread, or decoded by a worker thread.
RasterizationTask πŸ”’
VectorImageData πŸ”’

EnumsΒ§

CacheResult πŸ”’
Result of accessing a cache.
DecodedImage πŸ”’
ImageBytes πŸ”’
KeyCacheState πŸ”’
The state of the `WebRenderImageKey`` cache
LoadResult πŸ”’
PendingKey πŸ”’
Used for storing images that do not have a WebRenderImageKey yet.

ConstantsΒ§

FALLBACK_RIPPY πŸ”’
MAX_SVG_PIXMAP_DIMENSION πŸ”’
The current SVG stack relies on resvg to provide the natural dimensions of the SVG, which it automatically infers from the width/height/viewBox properties of the SVG. Since these can be arbitrarily large, this can cause us to allocate a pixmap with very large dimensions leading to the process being killed due to memory exhaustion. For example, the /css/css-transforms/perspective-svg-001.html test uses very large values for viewBox. Hence, we just clamp the maximum width/height of the pixmap allocated for rasterization.

FunctionsΒ§

decode_bytes_sync πŸ”’
get_placeholder_image πŸ”’
This will block on getting an ImageKey but that is ok because it is done once upon start-up of a script-thread.
parse_svg_document_in_memory πŸ”’
set_webrender_image_key πŸ”’

Type AliasesΒ§

ImageKey πŸ”’
https://html.spec.whatwg.org/multipage/#list-of-available-images
LoadKey πŸ”’