1
1
mirror of https://github.com/wez/wezterm.git synced 2024-12-24 13:52:55 +03:00

fixup setting background layer(s) to solid colors

This is a regression caused by recent work such as 27fbff4ae1

This config wouldn't set the background color to red because we'd never
consider the frame to be loaded:

```lua
local wezterm = require 'wezterm'

local config = wezterm.config_builder()

config.background = {
  { source = { Color = '#FF0000' }, width = '100%', height = '100%' },
}

return config
```
This commit is contained in:
Wez Furlong 2023-05-10 06:29:45 -07:00
parent 61470c9912
commit 6d8e266698
No known key found for this signature in database
GPG Key ID: 7A7F66A31EC9B387

View File

@ -489,14 +489,6 @@ impl DecodedImage {
}
}
fn load_state(&self) -> LoadState {
let frames = self.frames.borrow();
match frames.as_ref() {
Some(state) => state.load_state,
None => LoadState::Loading,
}
}
fn start_frame_decoder(lease: BlobLease, image_data: &Arc<ImageData>) -> Self {
match FrameDecoder::start(lease.clone()) {
Ok(rx) => Self {
@ -879,12 +871,12 @@ impl GlyphCache {
match &*handle.h {
ImageDataType::Rgba8 { hash, .. } => {
if let Some(sprite) = frame_cache.get(hash) {
return Ok((sprite.clone(), None, decoded.load_state()));
return Ok((sprite.clone(), None, LoadState::Loaded));
}
let sprite = atlas.allocate_with_padding(&handle, padding)?;
frame_cache.insert(*hash, sprite.clone());
return Ok((sprite, None, decoded.load_state()));
return Ok((sprite, None, LoadState::Loaded));
}
ImageDataType::AnimRgba8 {
hashes,
@ -932,7 +924,7 @@ impl GlyphCache {
let hash = hashes[*decoded_current_frame];
if let Some(sprite) = frame_cache.get(&hash) {
return Ok((sprite.clone(), next, decoded.load_state()));
return Ok((sprite.clone(), next, LoadState::Loaded));
}
let sprite = atlas.allocate_with_padding(&handle, padding)?;
@ -945,7 +937,7 @@ impl GlyphCache {
*decoded_frame_start
+ durations[*decoded_current_frame].max(min_frame_duration),
),
decoded.load_state(),
LoadState::Loaded,
));
}
ImageDataType::EncodedLease(_) | ImageDataType::EncodedFile(_) => {