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:
Matsumoto Kotaro
2026-06-19 13:18:41 +09:00
parent cc2d7a1789
commit 89946ebc07
8 changed files with 54 additions and 28 deletions

View File

@@ -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
}