예제 #1
0
def test_Surface_MakeFromBackendTexture_2(context):
    characterization = skia.SurfaceCharacterization()
    texture = skia.GrBackendTexture()
    assert isinstance(
        skia.Surface.MakeFromBackendTexture(context, characterization,
                                            texture),
        (type(None), skia.Surface))
예제 #2
0
def test_Surface_MakeRenderTarget_2(context):
    characterization = skia.SurfaceCharacterization()
    check_surface(skia.Surface.MakeRenderTarget(
        context, characterization, skia.Budgeted.kNo))
예제 #3
0
def test_Surface_characterize(surface):
    characterization = skia.SurfaceCharacterization()
    assert isinstance(surface.characterize(characterization), bool)
예제 #4
0
    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)


def test_GrContext_createBackendTexture_2(context, pixmap):
    backend_texture = context.createBackendTexture([pixmap],
예제 #5
0
    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),
    (skia.SurfaceCharacterization(),),
    (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),
    (skia.SurfaceCharacterization(), 0xFFFFFFFF),
    ('pixmap[]',),
    ('pixmap',),
])
def test_GrContext_createBackendTexture(context, args, request):
    if isinstance(args[0], str):
        pixmap = request.getfixturevalue('pixmap')
        if args[0] == 'pixmap[]':
            assert isinstance(context.createBackendTexture(
                [pixmap], skia.GrRenderable.kNo), skia.GrBackendTexture)
        else: