class_docstr: BaseCanvasBackend(vispy_canvas, capability, context_type)
  
  Abstract class that provides an interface between backends and Canvas.
  Each backend must implement a subclass of CanvasBackend, and
  implement all its _vispy_xxx methods. Also, a backend must
  make sure to generate the following events: 'initialize', 'resize',
  'draw', 'mouse_press', 'mouse_release', 'mouse_move',
  'mouse_wheel', 'key_press', 'key_release'. When a backend detects
  that the canvas should be closed, the backend should call
  'self._vispy_canvas.close', because the close event is handled within
  the canvas itself.
class_docstr_tok: ["BaseCanvasBackend","(","vispy_canvas",",","capability",",","context_type",")","Abstract","class","that","provides","an","interface","between","backends","and","Canvas",".","Each","backend","must","implement","a","subclass","of","CanvasBackend",",","and","implement","all","its","_vispy_xxx","methods",".","Also",",","a","backend","must","make","sure","to","generate","the","following","events",":","'initialize","'",",","'resize","'",",","'draw","'",",","'mouse_press","'",",","'mouse_release","'",",","'mouse_move","'",",","'mouse_wheel","'",",","'key_press","'",",","'key_release","'",".","When","a","backend","detects","that","the","canvas","should","be","closed",",","the","backend","should","call","'self._vispy_canvas.close","'",",","because","the","close","event","is","handled","within","the","canvas","itself","."]
code: def __init__(self, vispy_canvas):
      # Note: it is the responsibility of the subclass to call
      # the __init__ of the mro - we don't call super().__init__() here.
  
      from .canvas import Canvas  # Avoid circular import
  
      assert isinstance(vispy_canvas, Canvas)
      self._vispy_canvas = vispy_canvas
      self._last_time = 0
  
      # We set the _backend attribute of the vispy_canvas to self,
      # because at the end of the __init__ of the CanvasBackend
      # implementation there might be a call to show or draw. By
      # setting it here, we ensure that the Canvas is "ready to go".
      vispy_canvas._backend = self
  
      # Data used in the construction of new mouse events
      self._vispy_mouse_data = {
          "buttons": [],
          "press_event": None,
          "last_event": None,
          "last_mouse_press": None,
      }
  
imports: from ..util import SimpleBunch
  import time
  from timeit import default_timer
label_desc: Use image node_id 1 to create a new BaseCanvasBackend object from inherited base classes: object with example: obj = BaseCanvasBackend(vispy_canvas)