graphics: Use power-of-2 size for the default framebuffer

This commit is contained in:
Hajime Hoshi 2017-12-05 02:32:53 +09:00
parent 6bbf6c53ce
commit f74c1e67ea

View File

@ -409,6 +409,8 @@ func (c *newScreenFramebufferImageCommand) Exec(indexOffsetInBytes int) error {
if c.height < 1 {
return errors.New("graphics: height must be equal or more than 1.")
}
c.result.framebuffer = newScreenFramebuffer(c.width, c.height, c.offsetX, c.offsetY)
w := emath.NextPowerOf2Int(c.width)
h := emath.NextPowerOf2Int(c.height)
c.result.framebuffer = newScreenFramebuffer(w, h, c.offsetX, c.offsetY)
return nil
}