Example #1
0
    assert isinstance(context.supportsDistanceFieldText(), bool)


def test_GrContext_storeVkPipelineCacheData(context):
    context.storeVkPipelineCacheData()


def test_GrContext_defaultBackendFormat(context):
    assert isinstance(
        context.defaultBackendFormat(skia.ColorType.kRGBA_8888_ColorType,
                                     skia.GrRenderable.kNo),
        skia.GrBackendFormat)


@pytest.mark.parametrize('args', [
    (64, 64, skia.GrBackendFormat(), skia.GrMipMapped.kNo,
     skia.GrRenderable.kNo),
    (64, 64, skia.ColorType.kRGBA_8888_ColorType, skia.GrMipMapped.kNo,
     skia.GrRenderable.kNo),
    pytest.param((skia.SurfaceCharacterization(), ), marks=pytest.mark.skip),
    (64, 64, skia.GrBackendFormat(), 0xFFFFFFFF, skia.GrMipMapped.kNo,
     skia.GrRenderable.kNo),
    (64, 64, skia.ColorType.kRGBA_8888_ColorType, 0xFFFFFFFF,
     skia.GrMipMapped.kNo, skia.GrRenderable.kNo),
    pytest.param(
        (skia.SurfaceCharacterization(), 0xFFFFFFFF), marks=pytest.mark.skip),
])
def test_GrContext_createBackendTexture(context, args, request):
    backend_texture = context.createBackendTexture(*args)
    assert isinstance(backend_texture, skia.GrBackendTexture)
    context.deleteBackendTexture(backend_texture)
Example #2
0
def test_GrBackendFormat_ne(backend_format):
    assert backend_format != skia.GrBackendFormat()
Example #3
0
def backend_format():
    return skia.GrBackendFormat()