def test_PictureRecorder_init(): assert isinstance(skia.PictureRecorder(), skia.PictureRecorder)
def beginPage(self, width, height): assert self._currentRecorder is None self.pageWidth = width self.pageHeight = height self._currentRecorder = skia.PictureRecorder() return self._currentRecorder.beginRecording(width, height)
def recorder(): return skia.PictureRecorder()
def picture(): recorder = skia.PictureRecorder() canvas = recorder.beginRecording(skia.Rect(100, 100)) canvas.clear(0xFFFFFFFF) canvas.drawLine(0, 0, 100, 100, skia.Paint()) return recorder.finishRecordingAsPicture()