blob: 4d181c96d4c24f952c4bf6c2e7512da2de12336e [file] [log] [blame]
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script type="text/javascript" src="canvas-blending-helpers.js"></script>
<script>
function drawElement(context, i) {
if (i >= blendModes.length)
return;
context.clearRect(0, 0, 10, 10);
context.save();
drawBackdropColorImageInContext(context,
function() {
context.globalCompositeOperation = blendModes[i];
drawSourceColorGradientInContext(context);
checkBlendModeResult(i, context, 5);
context.restore();
drawElement(context, ++i);
});
}
test(function(t) {
var canvas = document.createElement('canvas');
var sigma = 5;
canvas.width = 10;
canvas.height = 10;
context = canvas.getContext('2d');
drawElement(context, 0);
}, 'Series of tests to ensure correct results on applying different blend modes when drawing a gradient on top of an image.');
</script>