Exemple #1
0
def test_Region_init(args):
    assert isinstance(skia.Region(*args), skia.Region)
Exemple #2
0
def region():
    return skia.Region(skia.IRect(100, 100))
Exemple #3
0
def other():
    return skia.Region(skia.IRect(50, 50))
Exemple #4
0
import skia
import pytest


@pytest.mark.parametrize('args', [
    tuple(),
    (skia.Region(), ),
    (skia.IRect(100, 100), ),
])
def test_Region_init(args):
    assert isinstance(skia.Region(*args), skia.Region)


@pytest.fixture
def region():
    return skia.Region(skia.IRect(100, 100))


@pytest.fixture
def other():
    return skia.Region(skia.IRect(50, 50))


def test_Region_eq(region):
    assert region == region


def test_Region_ne(region, other):
    assert region != other

Exemple #5
0
def test_Canvas_drawRegion(canvas):
    canvas.drawRegion(skia.Region(), skia.Paint())
Exemple #6
0
def test_Canvas_clipRRect(canvas, args):
    canvas.clipRRect(*args)


@pytest.mark.parametrize('args', [
    (skia.Path(), skia.ClipOp.kIntersect, True),
    (skia.Path(), skia.ClipOp.kIntersect),
    (skia.Path(), True),
    (skia.Path(), ),
])
def test_Canvas_clipPath(canvas, args):
    canvas.clipPath(*args)


@pytest.mark.parametrize('args', [
    (skia.Region(), ),
    (
        skia.Region(),
        skia.ClipOp.kIntersect,
    ),
])
def test_Canvas_clipRegion(canvas, args):
    canvas.clipRegion(*args)


@pytest.mark.parametrize('args', [
    (skia.Rect(100, 100), ),
    (skia.Path(), ),
])
def test_Canvas_quickReject(canvas, args):
    assert isinstance(canvas.quickReject(*args), bool)
def test_AlphaThresholdFilter_Make():
    assert isinstance(
        skia.AlphaThresholdFilter.Make(
            skia.Region(), 0, 1), skia.ImageFilter)
def test_ImageFilters_AlphaThreshold():
    assert isinstance(skia.ImageFilters.AlphaThreshold(
        skia.Region(), 0, 1), skia.ImageFilter)