StructsΒ§
- AllPending
Loads π - Completed
Load π - 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.
- Decoder
Msg π - Message that the decoder worker threads send to the image cache.
- Image
Cache Impl - Image
Cache πStore - 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.
- Load
KeyGenerator π - Pending
Load π - Represents an image that is either being loaded by the resource thread, or decoded by a worker thread.
- Rasterization
Task π - Vector
Image πData
EnumsΒ§
- Cache
Result π - Result of accessing a cache.
- Decoded
Image π - Image
Bytes π - KeyCache
State π - The state of the `WebRenderImageKey`` cache
- Load
Result π - Pending
Key π - 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