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

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

Issue 2576223002: NEON-ize RGBA to RGB code (Closed)
Patch Set: Copyright, fix Windows build. Created 4 years 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
Index: third_party/WebKit/PerformanceTests/Canvas/toBlob_duration_jpeg.html
diff --git a/third_party/WebKit/PerformanceTests/Canvas/toBlob_duration_jpeg.html b/third_party/WebKit/PerformanceTests/Canvas/toBlob_duration_jpeg.html
new file mode 100644
index 0000000000000000000000000000000000000000..92fdc75985c1aaca6e92b31c4aef1caf46f9ecee
--- /dev/null
+++ b/third_party/WebKit/PerformanceTests/Canvas/toBlob_duration_jpeg.html
@@ -0,0 +1,54 @@
+<!DOCTYPE html>
+<html>
+<body>
+<script src = "../resources/runner.js"></script>
+<script>
+var canvas_idle = null;
+var isDone = false;
+
+function createCanvas4k(canvas_id) {
+ var myCanvas = document.createElement("canvas");
+ myCanvas.id = canvas_id;
+ myCanvas.width = 4000;
+ myCanvas.height = 4000;
+ myCanvas.getContext("2d").fillStyle = "rgba(0, 255, 0, 0.5)";
+ myCanvas.getContext("2d").fillRect(0, 0, myCanvas.width, myCanvas.height);
+ return myCanvas;
+}
+
+function invokeToBlobJpg(myCanvas) {
+ var startTime = PerfTestRunner.now();
+ myCanvas.toBlob(function(blob){
+ PerfTestRunner.measureValueAsync(PerfTestRunner.now() - startTime);
+ if (!isDone) {
+ PerfTestRunner.gc();
+ runTest(myCanvas);
+ }
+ }, "image/jpeg");
+}
+
+function draw() {
+ if (!isDone)
+ requestAnimationFrame(draw);
+}
+
+function runTest(myCanvas) {
+ draw(); //repeatedly draw the frame to keep main thread busy
+ invokeToBlobJpg(myCanvas);
+}
+
+window.onload = function () {
+ canvas_idle = createCanvas4k("canvas_idle");
+ PerfTestRunner.prepareToMeasureValuesAsync({
+ unit: 'ms',
+ done: function () {
+ isDone = true;
+ },
+ description: "Measures performance of canvas."
+ });
+ runTest(canvas_idle);
+};
+</script>
+</body>
+</html>
+

Powered by Google App Engine
This is Rietveld 408576698