def create_rcontext(self, size, frame):
if self.format == '<STR_LIT>':<EOL><INDENT>surface = cairo.PDFSurface(self._output_file(frame), *size)<EOL><DEDENT>elif self.format in ('<STR_LIT>', '<STR_LIT>'):<EOL><INDENT>surface = cairo.PSSurface(self._output_file(frame), *size)<EOL><DEDENT>elif self.format == '<STR_LIT>':<EOL><INDENT>surface = cairo.SVGSurface(self._output_file(frame), *size)<EOL><DEDENT>elif self.format == '<STR_LIT>':<EOL><INDENT>surface = self.target<EOL><DEDENT>else:<EOL><INDENT>surface = cairo.ImageSurface(cairo.FORMAT_ARGB32, *size)<EOL><DEDENT>return cairo.Context(surface)<EOL>
Called when CairoCanvas needs a cairo context to draw on