opengl: Remove unneeded glViewport calls

This commit is contained in:
Hajime Hoshi 2016-06-22 02:13:23 +09:00
parent e9de66aca2
commit 56c4e71859

View File

@ -52,9 +52,8 @@ func (c *Context) bindFramebuffer(f Framebuffer) error {
} }
func (c *Context) SetViewport(f Framebuffer, width, height int) error { func (c *Context) SetViewport(f Framebuffer, width, height int) error {
lf := c.lastFramebuffer
c.bindFramebuffer(f) c.bindFramebuffer(f)
if lf != f || c.lastViewportWidth != width || c.lastViewportHeight != height { if c.lastViewportWidth != width || c.lastViewportHeight != height {
if err := c.setViewportImpl(width, height); err != nil { if err := c.setViewportImpl(width, height); err != nil {
return nil return nil
} }