Improve comments.

This commit is contained in:
Jürg Lehni 2013-06-18 11:19:56 -07:00
parent c48ab03050
commit deebd15f05

View file

@ -215,10 +215,9 @@ var BlendMode = new function() {
} }
}; };
// Build a lookup table for natively supported blend-modes (on browsers) // Build a lookup table for natively supported CSS blend-modes. Just seeing
// where the CSS blend-modes are supported. Just check for // if globalCompositeOperation is actually sticky is not enough, as Chome 27
// globalCompositeOperation to actually be sticky is not enough, since // pretends for blend-modes to work, but does not actually apply them.
// Chome 27 pretends for them to work, but does not apply the modes.
var ctx = CanvasProvider.getContext(1, 1); var ctx = CanvasProvider.getContext(1, 1);
// Multiply #300 (51) and #a00 (170) and see if we get #200 (34) // Multiply #300 (51) and #a00 (170) and see if we get #200 (34)
ctx.fillStyle = '#300'; ctx.fillStyle = '#300';
@ -227,7 +226,7 @@ var BlendMode = new function() {
ctx.fillStyle = '#a00'; ctx.fillStyle = '#a00';
ctx.fillRect(0, 0, 1, 1); ctx.fillRect(0, 0, 1, 1);
var data = ctx.getImageData(0, 0, 1, 1).data; var data = ctx.getImageData(0, 0, 1, 1).data;
// If data[0] is 34, the mode has worked. Now feature detect all modes that // If data[0] is 34, the mode has worked. Now feature-detect all modes that
// the browser claims to support. // the browser claims to support.
this.nativeModes = data[0] === 34 && Base.each(modes, function(func, mode) { this.nativeModes = data[0] === 34 && Base.each(modes, function(func, mode) {
ctx.globalCompositeOperation = mode; ctx.globalCompositeOperation = mode;