summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/canvas/element/manual/filters/tentative/canvas-filter-object-turbulence.html
blob: b5b494825e7a714be3326cd052078c9b5c780a92 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<head>
    <link rel="match" href="canvas-filter-object-blur-expected.html">
</head>
<body>
</body>
<script>
  const testCases = [
    {baseFrequency: 0.025},
    {baseFrequency: [0.025, 0.1]},
    {baseFrequency: 0.05},
    {baseFrequency: 0.025, seed: 100},
    {baseFrequency: 0.025, numOctaves: 2},
    {},
    {baseFrequency: 0.025, type: "fractalNoise"},
    {baseFrequency: 0.025, stitchTiles: "stitch"},
  ]

  for (tc of testCases) {
    const canvas = document.createElement("canvas");
    document.body.appendChild(canvas);
    const ctx = canvas.getContext("2d");
    const filterOptions = {...{name: "turbulence"}, ...tc};
    ctx.filter = new CanvasFilter(filterOptions);
    ctx.fillRect(0, 0, 1, 1);
  }
</script>