mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-10-21 04:32:05 +00:00
graphics: make N a transient usage-hints bitmask
Change the graphics protocol N key from a boolean into a usage-hints bitmask. Define the first bit as a transient hint, allowing the terminal to treat the image data as short-lived and apply optimizations such as skipping disk cache writes. Propagate the transient hint through frame coalescing and composition, so a composed frame is transient if any contributing frame is transient.
This commit is contained in:
parent
cc2d7a1789
commit
89946ebc07
8 changed files with 54 additions and 28 deletions
|
|
@ -756,16 +756,12 @@ func (self *GraphicsCommand) SetFrameToMakeCurrent(c uint64) *GraphicsCommand {
|
|||
return self
|
||||
}
|
||||
|
||||
func (self *GraphicsCommand) NoDiskCache() bool {
|
||||
return self.N != 0
|
||||
func (self *GraphicsCommand) UsageHints() uint64 {
|
||||
return self.N
|
||||
}
|
||||
|
||||
func (self *GraphicsCommand) SetNoDiskCache(noDiskCache bool) *GraphicsCommand {
|
||||
if noDiskCache {
|
||||
self.N = 1
|
||||
} else {
|
||||
self.N = 0
|
||||
}
|
||||
func (self *GraphicsCommand) SetUsageHints(hints uint64) *GraphicsCommand {
|
||||
self.N = hints
|
||||
return self
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue