code: def _draw(self, context, opacity):
          
  
          # if we have been moved around, we should update bounds
          fresh_draw = len(self.__new_instructions or []) > 0
          if fresh_draw: #new stuff!
              self.paths = []
              self.__instruction_cache = self.__new_instructions
              self.__new_instructions = []
          else:
              if not self.__instruction_cache:
                  return
  
          for instruction, args in self.__instruction_cache:
              if fresh_draw:
                  if instruction in ("new_path", "stroke", "fill", "clip"):
                      self.paths.append((instruction, "path", context.copy_path()))
  
                  elif instruction in ("save", "restore", "translate", "scale", "rotate"):
                      self.paths.append((instruction, "transform", args))
  
              if instruction == "set_color":
                  self._set_color(context, args[0], args[1], args[2], args[3] * opacity)
              elif instruction == "show_layout":
                  self._show_layout(context, *args)
              elif opacity < 1 and instruction == "paint":
                  context.paint_with_alpha(opacity)
              else:
                  getattr(context, instruction)(*args)
docs: draw accumulated instructions in context