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

Side by Side Diff: PerformanceTests/Canvas/upload-video-to-sub-texture.html

Issue 219023009: Fix timing out of perf test: Canvas/upload-canvas-2d-to-texture.html (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 8 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 unified diff | Download patch
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <body> 3 <body>
4 <video id="video" autoplay="true" loop> 4 <video id="video" loop></video>
5 <source type="video/mp4">
6 </video>
7 <script src="../resources/runner.js"></script> 5 <script src="../resources/runner.js"></script>
8 <script src="resources/canvas_runner.js"></script> 6 <script src="resources/canvas_runner.js"></script>
9 <script> 7 <script>
10 var videoElement = document.getElementById("video"); 8 var videoElement = document.getElementById("video");
11 var canvas3D = document.createElement('canvas'); 9 var canvas3D = document.createElement('canvas');
12 var gl = canvas3D.getContext('experimental-webgl'); 10 var gl = canvas3D.getContext('experimental-webgl');
13 if(!gl) 11 if(!gl)
14 CanvasRunner.logFatalError("\nWebGL is not supported or enabled on this plat form!\n"); 12 CanvasRunner.logFatalError("\nWebGL is not supported or enabled on this plat form!\n");
15 13
16 function setSize(width, height) { 14 function setSize(width, height) {
17 canvas3D.width = width; 15 canvas3D.width = width;
18 canvas3D.height = height; 16 canvas3D.height = height;
19 } 17 }
20 18
21 function addPlayCallback(videoElement) { 19 function addPlayCallback(videoElement) {
22 // This logic makes sure this perf test starts after playing the video. 20 // This logic makes sure this perf test starts after playing the video.
23 videoElement.addEventListener("canplaythrough", startVideo, true); 21 videoElement.addEventListener("canplaythrough", startVideo, true);
24 videoElement.addEventListener("play", startPerfTest, true); 22 videoElement.addEventListener("play", startPerfTest, true);
25 videoElement.src = "../resources/720x576i-anamorphic.mov"; 23 videoElement.addEventListener('error', function(ev) {
24 CanvasRunner.logFatalError("\nmp4 codec is not supported on this platfor m. Received error event:" + ev.target.error.code + "\n");
25 }, false);
26 videoElement.src = "../resources/bear-1280x720.mp4";
26 } 27 }
27 28
28 function startVideo() { 29 function startVideo() {
29 // loop can emit this event again. 30 // loop can emit this event again.
30 videoElement.removeEventListener("canplaythrough", startVideo, true); 31 videoElement.removeEventListener("canplaythrough", startVideo, true);
31 videoElement.play(); 32 videoElement.play();
32 } 33 }
33 34
34 35
35 function startPerfTest() { 36 function startPerfTest() {
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 } 73 }
73 74
74 window.onload = function () { 75 window.onload = function () {
75 setSize(1, 1); 76 setSize(1, 1);
76 addPlayCallback(videoElement); 77 addPlayCallback(videoElement);
77 } 78 }
78 79
79 </script> 80 </script>
80 </body> 81 </body>
81 </html> 82 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698