Commit b9811da3 authored by Teresa Kang's avatar Teresa Kang Committed by Commit Bot

Add getImageData-cpu perf test

To show that willReadFrequently solves crbug.com/1013323, getImageData
perf test needs to be run with willReadFrequently set to true. Pinpoint
tests will be run against CL 2238991 with getImageData-cpu.html.

New perf tests are added to benchmarks_to_shard.json to be included in
the benchmark: blink_perf.canvas.

Bug: 1090180
Change-Id: I07cbdc18f9145160a6614afa8b9b35724796a5e8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2271527Reviewed-by: default avatarJuanmi Huertas <juanmihd@chromium.org>
Reviewed-by: default avatarJohn Chen <johnchen@chromium.org>
Reviewed-by: default avatarFernando Serboncini <fserb@chromium.org>
Commit-Queue: Teresa Kang <teresakang@google.com>
Cr-Commit-Position: refs/heads/master@{#784033}
parent 171595f9
<!DOCTYPE html>
<html>
<body>
<script src="../resources/runner.js"></script>
<script>
var canvas2D = document.createElement("canvas");
var ctx2D = canvas2D.getContext("2d", { willReadFrequently: true });
function setSize(width, height) {
canvas2D.width = width;
canvas2D.height = height;
}
function rand(range) {
return Math.floor(Math.random() * range);
}
function fillCanvas(ctx2d, canvas2d) {
ctx2d.fillStyle = "rgba(" + rand(256) + "," + rand(256) + "," + rand(256) +
"," + rand(256) + ")";
ctx2d.fillRect(0, 0, canvas2d.width, canvas2d.height);
}
function getImageDataFromCanvas2D() {
ctx2D.getImageData(0, 0, canvas2D.width, canvas2D.height);
}
setSize(1024, 1024);
fillCanvas(ctx2D, canvas2D);
PerfTestRunner.measureRunsPerSecond({
run: getImageDataFromCanvas2D,
description: "This bench test checks the speed on getting ImageData from " +
"Canvas2D(1024x1024)."
});
</script>
</body>
</html>
...@@ -59,8 +59,13 @@ ...@@ -59,8 +59,13 @@
"drawimage-not-pixelaligned.html", "drawimage-not-pixelaligned.html",
"drawimage.html", "drawimage.html",
"getImageData.html", "getImageData.html",
"getImageData-cpu.html",
"getImageDataColorManaged.html", "getImageDataColorManaged.html",
"putImageData.html", "putImageData.html",
"repeated-draw-cpu.html",
"repeated-draw-gpu.html",
"repeated-getImageData-cpu.html",
"repeated-getImageData-gpu.html",
"toBlob_duration.html", "toBlob_duration.html",
"toBlob_duration_jpeg.html", "toBlob_duration_jpeg.html",
"toBlob-small-canvas-in-worker.html", "toBlob-small-canvas-in-worker.html",
......
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