class_docstr: EGL backend for Canvas abstract class.
code: def __init__(self, vispy_canvas, **kwargs):
      BaseCanvasBackend.__init__(self, vispy_canvas)
      p = self._process_backend_kwargs(kwargs)
      self._initialized = False
  
      # Deal with context
      p.context.shared.add_ref("egl", self)
      if p.context.shared.ref is self:
          # Store context information
          attribs = [
              egl.EGL_RED_SIZE,
              8,
              egl.EGL_BLUE_SIZE,
              8,
              egl.EGL_GREEN_SIZE,
              8,
              egl.EGL_ALPHA_SIZE,
              8,
              egl.EGL_COLOR_BUFFER_TYPE,
              egl.EGL_RGB_BUFFER,
              egl.EGL_SURFACE_TYPE,
              egl.EGL_PBUFFER_BIT,
          ]
          api = None
          if "es" in config["gl_backend"]:
              attribs.extend(
                  [egl.EGL_RENDERABLE_TYPE, egl.EGL_OPENGL_ES2_BIT]
              )
              api = egl.EGL_OPENGL_ES_API
          else:
              attribs.extend(
                  [egl.EGL_RENDERABLE_TYPE, egl.EGL_OPENGL_BIT]
              )
              api = egl.EGL_OPENGL_API
  
          self._native_config = egl.eglChooseConfig(
              _EGL_DISPLAY, attribs
          )[0]
          egl.eglBindAPI(api)
          self._native_context = egl.eglCreateContext(
              _EGL_DISPLAY, self._native_config, None
          )
      else:
          # Reuse information from other context
          self._native_config = p.context.shared.ref._native_config
          self._native_context = p.context.shared.ref._native_context
  
      self._surface = None
      self._vispy_set_size(*p.size)
      _VP_EGL_ALL_WINDOWS.append(self)
  
      # Init
      self._initialized = True
      self._vispy_canvas.set_current()
      self._vispy_canvas.events.initialize()
  
imports: from __future__ import division
  import atexit
  from time import sleep
  from ..base import BaseApplicationBackend, BaseCanvasBackend, BaseTimerBackend
  from ...util.ptime import time
  from ...None import config
label_desc: Use image node_id 1 to create a new CanvasBackend object from inherited base classes: BaseCanvasBackend with example: obj = CanvasBackend(vispy_canvas)