paint.go 903 B

123456789101112131415161718192021222324
  1. // Copyright 2015 The Go Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. // Package paint defines an event for the app being ready to paint.
  5. //
  6. // See the golang.org/x/mobile/app package for details on the event model.
  7. package paint
  8. // Event indicates that the app is ready to paint the next frame of the GUI.
  9. //
  10. // A frame is completed by calling the App's Publish method.
  11. type Event struct {
  12. // External is true for paint events sent by the screen driver.
  13. //
  14. // An external event may be sent at any time in response to an
  15. // operating system event, for example the window opened, was
  16. // resized, or the screen memory was lost.
  17. //
  18. // Programs actively drawing to the screen as fast as vsync allows
  19. // should ignore external paint events to avoid a backlog of paint
  20. // events building up.
  21. External bool
  22. }