예제 #1
0
def test_Data_writable_data(data):
    copy = skia.Data(data, True)
    view = copy.writable_data()
    assert isinstance(view, memoryview)
    assert not view.readonly
    view.cast('B')[0] = 0  # cast needed due to pybind11 issue #2223
    assert not data.equals(copy)
예제 #2
0
def test_Canvas_drawAnnotation(canvas):
    canvas.drawAnnotation(skia.Rect(10, 10), 'key',
                          skia.Data(b'\x00\x00\x00\x00'))
예제 #3
0
def data(png_data):
    return skia.Data(png_data, True)
예제 #4
0
def test_Data_init(args):
    assert isinstance(skia.Data(*args), skia.Data)
예제 #5
0
def test_MemoryStream_Make():
    buf = skia.Data(b'\x00\x00')
    assert isinstance(skia.MemoryStream.MakeDirect(buf), skia.MemoryStream)