Bug 764125; changes to tests; r=jrmuizel

This commit is contained in:
Nicholas Cameron 2012-07-24 22:18:39 +12:00
parent f6ab349a9a
commit 6c848e9e58

View File

@ -18,6 +18,10 @@ function IsD2DEnabled() {
return enabled;
}
function IsLinux() {
return navigator.platform.indexOf("Linux") == 0;
}
function IsMacOSX10_5orOlder() {
var is105orOlder = false;
@ -58,6 +62,18 @@ function IsAzureSkia() {
return enabled;
}
function IsAzureCairo() {
var enabled = false;
try {
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var backend = Components.classes["@mozilla.org/gfx/info;1"].getService(Components.interfaces.nsIGfxInfo).getInfo().AzureBackend;
enabled = (backend == "cairo");
} catch (e) { }
return enabled;
}
</script>
<!-- Includes all the tests in the content/canvas/tests except for test_bug397524.html -->
@ -11295,10 +11311,24 @@ isPixel(ctx, 50,25, 0,255,0,255, 0);
isPixel(ctx, 1,1, 0,255,0,255, 0);
isPixel(ctx, 98,1, 0,255,0,255, 0);
isPixel(ctx, 1,48, 0,255,0,255, 0);
isPixel(ctx, 20,48, 0,255,0,255, 0);
// Fails on Linux with Azure/Cairo only
// The arc is drawn badly due to Cairo limitations, the error only becomes
// apparent on Linux because of anti-aliasing, probably due to X.
// The limitation is that Cairo draws arcs by stroking perpendicular to the arc,
// and at very large stroke thicknesses, this becomes a fan. Where exactly the
// 'blades' of the fan appear seems to depend on exactly how the arc is defined
// and the platform. So if the blades of the fan are where pixels are tested it
// passes the test, if the testing pixels fall in between the blades, then we fail.
// With Thebes/Cairo, we were rendering wrong, but got lucky with the test, now
// we are not so lucky.
// Bug 764125
if (IsAzureCairo() && IsLinux()) {
todo_isPixel(ctx, 20,48, 0,255,0,255, 0);
} else {
isPixel(ctx, 20,48, 0,255,0,255, 0);
}
isPixel(ctx, 98,48, 0,255,0,255, 0);
}
</script>
@ -14657,9 +14687,14 @@ isPixel(ctx, 0,25, 0,255,0,255, 0);
isPixel(ctx, 50,25, 0,255,0,255, 0);
isPixel(ctx, 99,25, 0,255,0,255, 0);
isPixel(ctx, 0,49, 0,255,0,255, 0);
isPixel(ctx, 50,49, 0,255,0,255, 0);
isPixel(ctx, 99,49, 0,255,0,255, 0);
if (IsAzureEnabled() && IsAzureCairo()) {
// Bug 764108
todo_isPixel(ctx, 50,49, 0,255,0,255, 0);
todo_isPixel(ctx, 99,49, 0,255,0,255, 0);
} else {
isPixel(ctx, 50,49, 0,255,0,255, 0);
isPixel(ctx, 99,49, 0,255,0,255, 0);
}
}
</script>