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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/canvas/canvas-imageSmoothingQuality.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
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <body> 3 <body>
4 <script src="../../resources/js-test.js"></script> 4 <script src="../../resources/js-test.js"></script>
5 <canvas id="source"></canvas> 5 <canvas id="source"></canvas>
6 <canvas id="default"></canvas> 6 <canvas id="default"></canvas>
7 <script> 7 <script>
8 8
9 description("Tests for the imageSmoothingQuality attribute."); 9 description("Tests for the imageSmoothingQuality attribute.");
10 10
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 lowContext.imageSmoothingEnabled = false; 78 lowContext.imageSmoothingEnabled = false;
79 var noFilterData = scaleImageData(lowCanvas, lowCanvas.imageSmoothingQuality); 79 var noFilterData = scaleImageData(lowCanvas, lowCanvas.imageSmoothingQuality);
80 80
81 debug(""); 81 debug("");
82 shouldNotBe("lowData", "mediumData"); 82 shouldNotBe("lowData", "mediumData");
83 // Skia uses mipmaps when downscaling, for both high and medium quality 83 // Skia uses mipmaps when downscaling, for both high and medium quality
84 shouldBe("mediumData", "highData"); 84 shouldBe("mediumData", "highData");
85 shouldNotBe("lowData", "highData"); 85 shouldNotBe("lowData", "highData");
86 86
87 debug(""); 87 debug("");
88 shouldBeGreaterThan("sampleAlpha(noFilterData)", "sampleAlpha(lowData)"); 88 shouldBe("sampleAlpha(noFilterData)", "sampleAlpha(lowData)");
89 shouldBeGreaterThan("sampleAlpha(lowData)", "sampleAlpha(mediumData)"); 89 shouldBeGreaterThan("sampleAlpha(lowData)", "sampleAlpha(mediumData)");
90 // Skia uses mipmaps when downscaling, for both high and medium quality 90 // Skia uses mipmaps when downscaling, for both high and medium quality
91 shouldBe("sampleAlpha(mediumData)", "sampleAlpha(highData)"); 91 shouldBe("sampleAlpha(mediumData)", "sampleAlpha(highData)");
92 92
93 93
94 debug("\n\nOn setting, it must be set to the new value."); 94 debug("\n\nOn setting, it must be set to the new value.");
95 evalAndLog("highContext.imageSmoothingQuality = 'medium';"); 95 evalAndLog("highContext.imageSmoothingQuality = 'medium';");
96 shouldBe("highContext.imageSmoothingQuality", "'medium'"); 96 shouldBe("highContext.imageSmoothingQuality", "'medium'");
97 shouldBe("scaleImageData(highCanvas, highCanvas.imageSmoothingQuality);", 97 shouldBe("scaleImageData(highCanvas, highCanvas.imageSmoothingQuality);",
98 "mediumData"); 98 "mediumData");
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 shouldBe("scaleImageData(highCanvas, highCanvas.imageSmoothingQuality);", 135 shouldBe("scaleImageData(highCanvas, highCanvas.imageSmoothingQuality);",
136 "mediumData"); 136 "mediumData");
137 shouldBe("highContext.restore(); highContext.imageSmoothingQuality", "'high'"); 137 shouldBe("highContext.restore(); highContext.imageSmoothingQuality", "'high'");
138 shouldBe("scaleImageData(highCanvas, highCanvas.imageSmoothingQuality);", 138 shouldBe("scaleImageData(highCanvas, highCanvas.imageSmoothingQuality);",
139 "highData"); 139 "highData");
140 140
141 debug(""); 141 debug("");
142 </script> 142 </script>
143 </body> 143 </body>
144 </html> 144 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698