mirror of
https://github.com/giongto35/cloud-game.git
synced 2026-07-28 20:40:06 +00:00
Don't cache nil frames
This commit is contained in:
parent
8b4b238cf9
commit
beaf862dec
1 changed files with 6 additions and 2 deletions
|
|
@ -60,8 +60,12 @@ func (c *Canvas) Get(w, h int) *Frame {
|
|||
return i
|
||||
}
|
||||
|
||||
func (c *Canvas) Put(i *Frame) { c.pool.Put(i) }
|
||||
func (c *Canvas) Clear() { c.wg = sync.WaitGroup{} }
|
||||
func (c *Canvas) Put(i *Frame) {
|
||||
if i != nil {
|
||||
c.pool.Put(i)
|
||||
}
|
||||
}
|
||||
func (c *Canvas) Clear() { c.wg = sync.WaitGroup{} }
|
||||
|
||||
func (c *Canvas) Draw(encoding uint32, rot *Rotate, w, h, packedW, bpp int, data []byte, th int) *Frame {
|
||||
dst := c.Get(w, h)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue