Bug 1117304 - Make sure the tile filter doesn't call CopyRect on surfaces with different formats. r=Bas

This commit is contained in:
Markus Stange 2015-01-05 18:40:27 +01:00
parent df12076373
commit 9995deb9d0

View File

@ -1547,7 +1547,16 @@ FilterNodeTileSoftware::Render(const IntRect& aRect)
return nullptr;
}
}
MOZ_ASSERT(input->GetFormat() == target->GetFormat(), "different surface formats from the same input?");
if (input->GetFormat() != target->GetFormat()) {
// Different rectangles of the input can have different formats. If
// that happens, just convert everything to B8G8R8A8.
target = FilterProcessing::ConvertToB8G8R8A8(target);
input = FilterProcessing::ConvertToB8G8R8A8(input);
if (MOZ2D_WARN_IF(!target) || MOZ2D_WARN_IF(!input)) {
return nullptr;
}
}
CopyRect(input, target, srcRect - srcRect.TopLeft(), destRect.TopLeft() - aRect.TopLeft());
}