From b579bd7fd0993746f63bbb1e5e2fc19246a93018 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Sun, 7 Apr 2019 10:08:08 +0900 Subject: [PATCH] graphics: Remove GraphicsContext.Invalidated --- graphicscontext.go | 10 ---------- internal/ui/ui.go | 1 - 2 files changed, 11 deletions(-) diff --git a/graphicscontext.go b/graphicscontext.go index 7aebec8fb..f2d703ab5 100644 --- a/graphicscontext.go +++ b/graphicscontext.go @@ -45,19 +45,10 @@ type graphicsContext struct { screenHeight int screenScale float64 initialized bool - invalidated bool // browser only offsetX float64 offsetY float64 } -func (c *graphicsContext) Invalidate() { - // Note that this is called only on browsers so far. - // TODO: On mobiles, this function is not called and instead IsTexture is called - // to detect if the context is lost. This is simple but might not work on some platforms. - // Should Invalidate be called explicitly? - c.invalidated = true -} - func (c *graphicsContext) SetSize(screenWidth, screenHeight int, screenScale float64) { c.screenScale = screenScale @@ -180,6 +171,5 @@ func (c *graphicsContext) restoreIfNeeded() error { if err := shareable.Restore(); err != nil { return err } - c.invalidated = false return nil } diff --git a/internal/ui/ui.go b/internal/ui/ui.go index 558b2609e..8c6549aa7 100644 --- a/internal/ui/ui.go +++ b/internal/ui/ui.go @@ -21,7 +21,6 @@ import ( type GraphicsContext interface { SetSize(width, height int, scale float64) Update(afterFrameUpdate func()) error - Invalidate() } // RegularTermination represents a regular termination.