mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-04 13:42:33 +02: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:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user