| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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> |
| OLD | NEW |