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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/canvas/canvas-imageSmoothing-disabled-scaling-down.html

Issue 2157953002: Change filter quality when scaling-down in drawImage (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update test expectation Created 4 years, 5 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/canvas/canvas-imageSmoothingQuality.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE HTML>
2 <script src="../../resources/testharness.js"></script>
3 <script src="../../resources/testharnessreport.js"></script>
4 <script>
5 function getCanvasDataFromDrawImage(source, disableSmoothing)
6 {
7 var canvas = document.createElement("canvas");
8 canvas.width = 100;
9 canvas.height = 100;
10 var ctx = canvas.getContext("2d");
11 ctx.clearRect(0, 0, canvas.width, canvas.height);
12 ctx.scale(0.9, 0.9);
13 ctx.rotate(45 * Math.PI / 180);
14 if (disableSmoothing)
15 ctx.imageSmoothingEnabled = false;
16 ctx.drawImage(source, 0, 0, source.width, source.height, 0, 0, 100, 100);
17 var d = ctx.getImageData(0, 0, 100, 100).data;
18 return d;
19 }
20
21 test(function() {
22 var canvas = document.createElement('canvas');
23 canvas.height = 100;
24 canvas.width = 100;
25 var ctx = canvas.getContext('2d');
26 ctx.fillStyle = '#FF0000';
27 ctx.fillRect(0, 0, canvas.width, canvas.height);
28 var data1 = getCanvasDataFromDrawImage(canvas, false);
29 var data2 = getCanvasDataFromDrawImage(canvas, true);
30 assert_array_equals(data1, data2, "drawImage() should have the same results with imageSmoothingEnabled = true and false when scaling down.");
31 }, 'Test drawImage with imageSmoothingEnabled=false and scaling down the source. ');
32
33 </script>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/canvas/canvas-imageSmoothingQuality.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698