blob: 50fbb51b3ce73f477a36817e608fc86819ee1c82 [file] [log] [blame]
<!DOCTYPE html>
<html>
<script src="./resources/test-runner-paint-worklet.js"></script>
<style>
html, body { margin: 0; padding: 0; }
.container {
width: 100px;
height: 100px;
}
#canvas-geometry {
background-image: paint(geometry);
}
</style>
<body>
<div id="canvas-geometry" class="container"></div>
<script id="code" type="text/worklet">
registerPaint('geometry', class {
paint(ctx, geom) {
ctx.fillStyle = 'green';
// Get the initial scale
if (ctx.getTransform().a != 1)
ctx.fillStyle = 'red';
ctx.setTransform(2, 0, 0, 2, 0, 0);
if (ctx.getTransform().a != 2)
ctx.fillStyle = 'blue';
ctx.resetTransform();
if (ctx.getTransform().a != 1)
ctx.fillStyle = 'yellow';
ctx.fillRect(0, 0, geom.width, geom.height);
}
});
</script>
<script>
document.body.style.zoom = "200%";
importPaintWorkletThenEndTest(document.getElementById('code').textContent);
</script>
</body>
</html>