Automatic update from web-platform-tests Re-enable virtual/off-main-thread-css-paint/ tests I suspect that due to paint holding two requestAnimationFrames was not consistently enough time to ensure a drawn frame. However, in other tests we use the starting of a composited animation to know when we have for sure drawn a new main frame. By applying the same technique for paint worklet we can re-enable these tests without the same flakiness. Bug: 355693577 Change-Id: I104f229257dc8fa051f8bf6c3c1e569ff2cbe48a Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7726989 Reviewed-by: Vladimir Levin <vmpstr@chromium.org> Commit-Queue: Robert Flack <flackr@chromium.org> Cr-Commit-Position: refs/heads/main@{#1610775} -- wpt-commits: e2d58307df0b8139854ad974ef2e4908d2a62baa wpt-pr: 59020
41 lines
1.0 KiB
HTML
41 lines
1.0 KiB
HTML
<!DOCTYPE html>
|
|
<html class="reftest-wait">
|
|
<link rel="help" href="https://drafts.css-houdini.org/css-paint-api/">
|
|
<link rel="match" href="paint2d-transform-ref.html">
|
|
<meta name="fuzzy" content="maxDifference=0-128;totalPixels=0-1000">
|
|
<style>
|
|
#output {
|
|
width: 200px;
|
|
height: 200px;
|
|
background-image: paint(transform);
|
|
}
|
|
</style>
|
|
<script src="/common/reftest-wait.js"></script>
|
|
<script src="/common/worklet-reftest.js"></script>
|
|
<body>
|
|
<div id="output"></div>
|
|
|
|
<script id="code" type="text/worklet">
|
|
registerPaint('transform', class {
|
|
paint(ctx, geom) {
|
|
ctx.fillStyle = 'green';
|
|
ctx.transform(1, 0.5, 0, 1, 20, 20);
|
|
ctx.fillRect(0, 0, 50, 50);
|
|
|
|
ctx.resetTransform();
|
|
|
|
ctx.fillStyle = 'blue';
|
|
ctx.translate(150, 60);
|
|
ctx.rotate(60 * Math.PI / 180);
|
|
ctx.scale(1.5, 1);
|
|
ctx.fillRect(0, 0, 50, 50);
|
|
}
|
|
});
|
|
</script>
|
|
|
|
<script>
|
|
importWorkletAndTerminateTestAfterAsyncPaint(CSS.paintWorklet, document.getElementById('code').textContent);
|
|
</script>
|
|
</body>
|
|
</html>
|