Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(108)

Unified Diff: third_party/WebKit/PerformanceTests/Canvas/createImageBitmapFromImageData.html

Issue 1387933002: Adding performance benchmark for creating imagebitmap from imagedata (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Enabling --enable-experimental-canvas-features on blink_perf Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tools/perf/benchmarks/blink_perf.py » ('j') | tools/perf/benchmarks/blink_perf.py » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/PerformanceTests/Canvas/createImageBitmapFromImageData.html
diff --git a/third_party/WebKit/PerformanceTests/Canvas/createImageBitmapFromImageData.html b/third_party/WebKit/PerformanceTests/Canvas/createImageBitmapFromImageData.html
new file mode 100644
index 0000000000000000000000000000000000000000..940ac0a3a3c1ed5b2cc6765974caeed2efeee1dd
--- /dev/null
+++ b/third_party/WebKit/PerformanceTests/Canvas/createImageBitmapFromImageData.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<html>
+<body>
+<script src="../resources/runner.js"></script>
+<script>
+var imgHeight = 1024;
+var imgWidth = 1024;
+var canvas = document.createElement("canvas");
+canvas.width = imgWidth;
+canvas.height = imgHeight;
+var context = canvas.getContext('2d');
+var image = context.createImageData(imgWidth, imgHeight);
+
+function rand(range) {
+ return Math.floor(Math.random() * range);
+}
+
+function initializeImageData() {
+ for(var i = 0; i < image.data.length; i++)
+ image.data[i] = rand(256);
+}
+
+function imageBitmapFromImageData() {
+ /*The return Promise is not retained because this test
+ is meant to only measure the immediate run time of
+ createImageBitmap from an ImageData, which is known
+ to be implemented in a way that does all the work
+ synchronously, even though the API is technically async.*/
+ createImageBitmap(image, 0, 0, imgWidth, imgHeight);
+}
+
+initializeImageData();
+PerfTestRunner.measureRunsPerSecond({run: imageBitmapFromImageData, description: "This bench test checks the speed on creating ImageBitmap from ImageData(1024x1024)."});
+</script>
+</body>
+</html>
« no previous file with comments | « no previous file | tools/perf/benchmarks/blink_perf.py » ('j') | tools/perf/benchmarks/blink_perf.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698