Bug 587320: Use proper paint counts on D2D due to dual pass rendering. r=joedrew

This commit is contained in:
Bas Schouten 2010-08-16 09:15:03 +02:00
parent b4cb1a06e5
commit 3cbce0cdb6

View File

@ -80,15 +80,32 @@ function show() {
}
function invalidate() {
is(clipped.getPaintCount(), 1, "partially clipped plugin painted once");
var paintCount = 1;
try {
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
if (Components.classes["@mozilla.org/gfx/info;1"].getService(Components.interfaces.nsIGfxInfo).D2DEnabled) {
paintCount = 2;
}
} catch(e) {}
is(clipped.getPaintCount(), paintCount, "partially clipped plugin painted once");
clipped.setColor("FF00FF00"); // plugin invalidates
waitForPaint(done);
}
function done() {
is(clipped.getPaintCount(), 2, "painted after invalidate");
var paintCount = 2;
try {
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
if (Components.classes["@mozilla.org/gfx/info;1"].getService(Components.interfaces.nsIGfxInfo).D2DEnabled) {
paintCount = 4;
}
} catch(e) {}
// With D2D we paint windowless plugin with 2 passes, 4 paints are expected.
is(clipped.getPaintCount(), paintCount, "painted after invalidate");
SimpleTest.finish();
}