Commit 8dce227e authored by Aaron Krajeski's avatar Aaron Krajeski Committed by Commit Bot

Add tests to draw on opaque canvases

Bug: 1003114
Change-Id: Icf3be92cf83a8c7bb4ef2d83879208bdd19a5881
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2212421
Commit-Queue: Aaron Krajeski <aaronhk@chromium.org>
Reviewed-by: default avatarYi Xu <yiyix@chromium.org>
Reviewed-by: default avatarJuanmi Huertas <juanmihd@chromium.org>
Reviewed-by: default avatarFernando Serboncini <fserb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#773218}
parent 55fdafdc
<!DOCTYPE html>
<canvas id="c"></canvas>
<script type="text/javascript">
const color = "rgba(120, 45, 200, 0.7)"; // A kind of half purple
const canvas = document.getElementById("c");
const ctx = canvas.getContext("2d");
// Opaque canvases have black backgrounds on pixels that haven't been drawn to
ctx.fillStyle = "black";
ctx.fillRect(0, 0, canvas.width, canvas.height);
ctx.fillStyle = color;
ctx.fillRect(10, 10, 100, 100);
</script>
</html>
\ No newline at end of file
<!DOCTYPE html>
<canvas id="c"></canvas>
<script type="text/javascript">
/*
A test to make sure drawing a canvas with alpha = false works appropriately.
*/
const color = "rgba(120, 45, 200, 0.7)"; // A kind of half purple
const canvas = document.getElementById("c");
const ctx = canvas.getContext("2d", { alpha: false });
ctx.fillStyle = color;
ctx.fillRect(10, 10, 100, 100);
</script>
</html>
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment