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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/canvas/canvas-composite-repaint-by-all-imagesource.html

Issue 1972273002: Let repaint tests test pixels by default (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 <head> 3 <head>
4 <title>Check repaint region of fillRect() and drawImage() with different com posite modes.</title> 4 <title>Check repaint region of fillRect() and drawImage() with different com posite modes.</title>
5 <style type="text/css"> 5 <style type="text/css">
6 body { margin: 5px; font-family: arial,verdana,helvetica; background: #fff ; } 6 body { margin: 5px; font-family: arial,verdana,helvetica; background: #fff ; }
7 canvas { border: 1px solid #999; } 7 canvas { border: 1px solid #999; }
8 div { margin: 10px; } 8 div { margin: 10px; }
9 #output h1 { font-size: medium; font-weight: normal; } 9 #output h1 { font-size: medium; font-weight: normal; }
10 #output h2 { font-size: small; font-weight: normal; } 10 #output h2 { font-size: small; font-weight: normal; }
(...skipping 18 matching lines...) Expand all
29 rkJggg== 29 rkJggg==
30 "></div> 30 "></div>
31 <div>Test Canvas</div> 31 <div>Test Canvas</div>
32 <div><canvas id = "source-canvas"></canvas></div> 32 <div><canvas id = "source-canvas"></canvas></div>
33 <div>Test Video</div> 33 <div>Test Video</div>
34 <div><video id="video"> 34 <div><video id="video">
35 <source src="resources/canvas_video.mp4" type='video/mp4' /> 35 <source src="resources/canvas_video.mp4" type='video/mp4' />
36 <source src="resources/canvas_video.webm" type='video/webm' /> 36 <source src="resources/canvas_video.webm" type='video/webm' />
37 <source src="resources/canvas_video.ogv" type='video/ogg' /> 37 <source src="resources/canvas_video.ogv" type='video/ogg' />
38 </video></div> 38 </video></div>
39 <script src="../repaint/resources/text-based-repaint.js"></script> 39 <script src="../repaint/resources/repaint.js"></script>
40 <script type="application/x-javascript"> 40 <script type="application/x-javascript">
41 // These map to the rows of the table 41 // These map to the rows of the table
42 var compositeTypes = [ 42 var compositeTypes = [
43 'source-over','source-in','source-out','source-atop', 43 'source-over','source-in','source-out','source-atop',
44 'destination-over','destination-in','destination-out','destination-atop', 44 'destination-over','destination-in','destination-out','destination-atop',
45 'lighter','copy','xor' 45 'lighter','copy','xor'
46 ]; 46 ];
47 47
48 // These map to the columns of the table 48 // These map to the columns of the table
49 var testNames = [ 49 var testNames = [
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 } 120 }
121 121
122 function drawCanvas(context) { 122 function drawCanvas(context) {
123 context.drawImage(document.getElementById('source-canvas'), 10, 10); 123 context.drawImage(document.getElementById('source-canvas'), 10, 10);
124 } 124 }
125 125
126 function drawVideo(context) { 126 function drawVideo(context) {
127 context.drawImage(document.getElementById('video'), 10, 10); 127 context.drawImage(document.getElementById('video'), 10, 10);
128 } 128 }
129 129
130 // callback from text-based-repaint.js 130 // callback from repaint.js
131 function repaintTest() { 131 function repaintTest() {
132 for (var i = 0; i < compositeTypes.length; i++) { 132 for (var i = 0; i < compositeTypes.length; i++) {
133 for (var j = 0; j < testNames.length; j++) { 133 for (var j = 0; j < testNames.length; j++) {
134 var context = getContext(i, j); 134 var context = getContext(i, j);
135 context.globalCompositeOperation = compositeTypes[i]; 135 context.globalCompositeOperation = compositeTypes[i];
136 switch (testNames[j]) { 136 switch (testNames[j]) {
137 case 'solid color': 137 case 'solid color':
138 drawRect(context); 138 drawRect(context);
139 break; 139 break;
140 case 'image': 140 case 'image':
(...skipping 28 matching lines...) Expand all
169 var canvas = document.getElementById('source-canvas'); 169 var canvas = document.getElementById('source-canvas');
170 canvas.width = imageElement.width; 170 canvas.width = imageElement.width;
171 canvas.height = imageElement.height; 171 canvas.height = imageElement.height;
172 var context = canvas.getContext('2d'); 172 var context = canvas.getContext('2d');
173 context.drawImage(imageElement, 0, 0); 173 context.drawImage(imageElement, 0, 0);
174 174
175 window.testIsAsync = true; 175 window.testIsAsync = true;
176 </script> 176 </script>
177 </body> 177 </body>
178 </html> 178 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698